From 0dd53da7226fc396949b54dcd8a7d41035bcd6e9 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 21 Oct 2023 17:44:41 -0400 Subject: [PATCH 01/67] deps: add simdjson PR-URL: https://github.com/nodejs/node/pull/50322 Reviewed-By: Jacob Smith Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell Reviewed-By: Geoffrey Booth --- .github/workflows/tools.yml | 9 + LICENSE | 205 + deps/simdjson/LICENSE | 201 + deps/simdjson/simdjson.cpp | 43469 ++++++++ deps/simdjson/simdjson.gyp | 20 + deps/simdjson/simdjson.h | 88489 ++++++++++++++++ .../maintaining/maintaining-dependencies.md | 7 + node.gyp | 2 + src/node_metadata.cc | 2 + src/node_metadata.h | 1 + test/parallel/test-process-versions.js | 1 + tools/dep_updaters/update-simdjson.sh | 52 + tools/license-builder.sh | 2 + 13 files changed, 132460 insertions(+) create mode 100644 deps/simdjson/LICENSE create mode 100644 deps/simdjson/simdjson.cpp create mode 100644 deps/simdjson/simdjson.gyp create mode 100644 deps/simdjson/simdjson.h create mode 100755 tools/dep_updaters/update-simdjson.sh diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 3ff354d55362c6..d29a0f9be67c97 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -36,6 +36,7 @@ on: - ngtcp2 - postject - root-certificates + - simdjson - simdutf - undici - uvwasi @@ -252,6 +253,14 @@ jobs: label: crypto, notable-change run: | node ./tools/dep_updaters/update-root-certs.mjs -v -f "$GITHUB_ENV" + - id: simdjson + subsystem: deps + label: dependencies + run: | + ./tools/dep_updaters/update-simdjson.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: simdutf subsystem: deps label: dependencies diff --git a/LICENSE b/LICENSE index 9cee50463b0ca2..0dbfa8fb849796 100644 --- a/LICENSE +++ b/LICENSE @@ -1309,6 +1309,211 @@ The externally maintained libraries used by Node.js are: jloup@gzip.org madler@alumni.caltech.edu """ +- simdjson, located at deps/simdjson, is licensed as follows: + """ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 The simdjson authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + """ + - simdutf, located at deps/simdutf, is licensed as follows: """ Copyright 2021 The simdutf authors diff --git a/deps/simdjson/LICENSE b/deps/simdjson/LICENSE new file mode 100644 index 00000000000000..71f65b598d907f --- /dev/null +++ b/deps/simdjson/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 The simdjson authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/deps/simdjson/simdjson.cpp b/deps/simdjson/simdjson.cpp new file mode 100644 index 00000000000000..11742711a0e712 --- /dev/null +++ b/deps/simdjson/simdjson.cpp @@ -0,0 +1,43469 @@ +/* auto-generated on 2023-10-30 12:51:02 -0400. Do not edit! */ +/* including simdjson.cpp: */ +/* begin file simdjson.cpp */ +#define SIMDJSON_SRC_SIMDJSON_CPP + +/* including base.h: #include */ +/* begin file base.h */ +#ifndef SIMDJSON_SRC_BASE_H +#define SIMDJSON_SRC_BASE_H + +/* including simdjson/base.h: #include */ +/* begin file simdjson/base.h */ +/** + * @file Base declarations for all simdjson headers + * @private + */ +#ifndef SIMDJSON_BASE_H +#define SIMDJSON_BASE_H + +/* including simdjson/common_defs.h: #include "simdjson/common_defs.h" */ +/* begin file simdjson/common_defs.h */ +#ifndef SIMDJSON_COMMON_DEFS_H +#define SIMDJSON_COMMON_DEFS_H + +#include +/* including simdjson/compiler_check.h: #include "simdjson/compiler_check.h" */ +/* begin file simdjson/compiler_check.h */ +#ifndef SIMDJSON_COMPILER_CHECK_H +#define SIMDJSON_COMPILER_CHECK_H + +#ifndef __cplusplus +#error simdjson requires a C++ compiler +#endif + +#ifndef SIMDJSON_CPLUSPLUS +#if defined(_MSVC_LANG) && !defined(__clang__) +#define SIMDJSON_CPLUSPLUS (_MSC_VER == 1900 ? 201103L : _MSVC_LANG) +#else +#define SIMDJSON_CPLUSPLUS __cplusplus +#endif +#endif + +// C++ 17 +#if !defined(SIMDJSON_CPLUSPLUS17) && (SIMDJSON_CPLUSPLUS >= 201703L) +#define SIMDJSON_CPLUSPLUS17 1 +#endif + +// C++ 14 +#if !defined(SIMDJSON_CPLUSPLUS14) && (SIMDJSON_CPLUSPLUS >= 201402L) +#define SIMDJSON_CPLUSPLUS14 1 +#endif + +// C++ 11 +#if !defined(SIMDJSON_CPLUSPLUS11) && (SIMDJSON_CPLUSPLUS >= 201103L) +#define SIMDJSON_CPLUSPLUS11 1 +#endif + +#ifndef SIMDJSON_CPLUSPLUS11 +#error simdjson requires a compiler compliant with the C++11 standard +#endif + +#ifndef SIMDJSON_IF_CONSTEXPR +#if SIMDJSON_CPLUSPLUS17 +#define SIMDJSON_IF_CONSTEXPR if constexpr +#else +#define SIMDJSON_IF_CONSTEXPR if +#endif +#endif + +#endif // SIMDJSON_COMPILER_CHECK_H +/* end file simdjson/compiler_check.h */ +/* including simdjson/portability.h: #include "simdjson/portability.h" */ +/* begin file simdjson/portability.h */ +#ifndef SIMDJSON_PORTABILITY_H +#define SIMDJSON_PORTABILITY_H + +#include +#include +#include +#include +#include +#ifndef _WIN32 +// strcasecmp, strncasecmp +#include +#endif + +#ifdef _MSC_VER +#define SIMDJSON_VISUAL_STUDIO 1 +/** + * We want to differentiate carefully between + * clang under visual studio and regular visual + * studio. + * + * Under clang for Windows, we enable: + * * target pragmas so that part and only part of the + * code gets compiled for advanced instructions. + * + */ +#ifdef __clang__ +// clang under visual studio +#define SIMDJSON_CLANG_VISUAL_STUDIO 1 +#else +// just regular visual studio (best guess) +#define SIMDJSON_REGULAR_VISUAL_STUDIO 1 +#endif // __clang__ +#endif // _MSC_VER + +#if defined(__x86_64__) || defined(_M_AMD64) +#define SIMDJSON_IS_X86_64 1 +#elif defined(__aarch64__) || defined(_M_ARM64) +#define SIMDJSON_IS_ARM64 1 +#elif defined(__PPC64__) || defined(_M_PPC64) +#if defined(__ALTIVEC__) +#define SIMDJSON_IS_PPC64_VMX 1 +#endif // defined(__ALTIVEC__) +#else +#define SIMDJSON_IS_32BITS 1 + +#if defined(_M_IX86) || defined(__i386__) +#define SIMDJSON_IS_X86_32BITS 1 +#elif defined(__arm__) || defined(_M_ARM) +#define SIMDJSON_IS_ARM_32BITS 1 +#elif defined(__PPC__) || defined(_M_PPC) +#define SIMDJSON_IS_PPC_32BITS 1 +#endif + +#endif // defined(__x86_64__) || defined(_M_AMD64) +#ifndef SIMDJSON_IS_32BITS +#define SIMDJSON_IS_32BITS 0 +#endif + +#if SIMDJSON_IS_32BITS +#ifndef SIMDJSON_NO_PORTABILITY_WARNING +// In the future, we should allow programmers +// to get warning. +#endif // SIMDJSON_NO_PORTABILITY_WARNING +#endif // SIMDJSON_IS_32BITS + +#define SIMDJSON_CAT_IMPLEMENTATION_(a,...) a ## __VA_ARGS__ +#define SIMDJSON_CAT(a,...) SIMDJSON_CAT_IMPLEMENTATION_(a, __VA_ARGS__) + +#define SIMDJSON_STRINGIFY_IMPLEMENTATION_(a,...) #a SIMDJSON_STRINGIFY(__VA_ARGS__) +#define SIMDJSON_STRINGIFY(a,...) SIMDJSON_CAT_IMPLEMENTATION_(a, __VA_ARGS__) + +// this is almost standard? +#undef SIMDJSON_STRINGIFY_IMPLEMENTATION_ +#undef SIMDJSON_STRINGIFY +#define SIMDJSON_STRINGIFY_IMPLEMENTATION_(a) #a +#define SIMDJSON_STRINGIFY(a) SIMDJSON_STRINGIFY_IMPLEMENTATION_(a) + +// Our fast kernels require 64-bit systems. +// +// On 32-bit x86, we lack 64-bit popcnt, lzcnt, blsr instructions. +// Furthermore, the number of SIMD registers is reduced. +// +// On 32-bit ARM, we would have smaller registers. +// +// The simdjson users should still have the fallback kernel. It is +// slower, but it should run everywhere. + +// +// Enable valid runtime implementations, and select SIMDJSON_BUILTIN_IMPLEMENTATION +// + +// We are going to use runtime dispatch. +#if SIMDJSON_IS_X86_64 +#ifdef __clang__ +// clang does not have GCC push pop +// warning: clang attribute push can't be used within a namespace in clang up +// til 8.0 so SIMDJSON_TARGET_REGION and SIMDJSON_UNTARGET_REGION must be *outside* of a +// namespace. +#define SIMDJSON_TARGET_REGION(T) \ + _Pragma(SIMDJSON_STRINGIFY( \ + clang attribute push(__attribute__((target(T))), apply_to = function))) +#define SIMDJSON_UNTARGET_REGION _Pragma("clang attribute pop") +#elif defined(__GNUC__) +// GCC is easier +#define SIMDJSON_TARGET_REGION(T) \ + _Pragma("GCC push_options") _Pragma(SIMDJSON_STRINGIFY(GCC target(T))) +#define SIMDJSON_UNTARGET_REGION _Pragma("GCC pop_options") +#endif // clang then gcc + +#endif // x86 + +// Default target region macros don't do anything. +#ifndef SIMDJSON_TARGET_REGION +#define SIMDJSON_TARGET_REGION(T) +#define SIMDJSON_UNTARGET_REGION +#endif + +// Is threading enabled? +#if defined(_REENTRANT) || defined(_MT) +#ifndef SIMDJSON_THREADS_ENABLED +#define SIMDJSON_THREADS_ENABLED +#endif +#endif + +// workaround for large stack sizes under -O0. +// https://github.com/simdjson/simdjson/issues/691 +#ifdef __APPLE__ +#ifndef __OPTIMIZE__ +// Apple systems have small stack sizes in secondary threads. +// Lack of compiler optimization may generate high stack usage. +// Users may want to disable threads for safety, but only when +// in debug mode which we detect by the fact that the __OPTIMIZE__ +// macro is not defined. +#undef SIMDJSON_THREADS_ENABLED +#endif +#endif + + +#if defined(__clang__) +#define SIMDJSON_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined"))) +#elif defined(__GNUC__) +#define SIMDJSON_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined)) +#else +#define SIMDJSON_NO_SANITIZE_UNDEFINED +#endif + + +#if defined(__clang__) || defined(__GNUC__) +#if defined(__has_feature) +# if __has_feature(memory_sanitizer) +#define SIMDJSON_NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory"))) +# endif // if __has_feature(memory_sanitizer) +#endif // defined(__has_feature) +#endif +// make sure it is defined as 'nothing' if it is unapplicable. +#ifndef SIMDJSON_NO_SANITIZE_MEMORY +#define SIMDJSON_NO_SANITIZE_MEMORY +#endif + +#if SIMDJSON_VISUAL_STUDIO +// This is one case where we do not distinguish between +// regular visual studio and clang under visual studio. +// clang under Windows has _stricmp (like visual studio) but not strcasecmp (as clang normally has) +#define simdjson_strcasecmp _stricmp +#define simdjson_strncasecmp _strnicmp +#else +// The strcasecmp, strncasecmp, and strcasestr functions do not work with multibyte strings (e.g. UTF-8). +// So they are only useful for ASCII in our context. +// https://www.gnu.org/software/libunistring/manual/libunistring.html#char-_002a-strings +#define simdjson_strcasecmp strcasecmp +#define simdjson_strncasecmp strncasecmp +#endif + +#if defined(NDEBUG) || defined(__OPTIMIZE__) || (defined(_MSC_VER) && !defined(_DEBUG)) +// If NDEBUG is set, or __OPTIMIZE__ is set, or we are under MSVC in release mode, +// then do away with asserts and use __assume. +#if SIMDJSON_VISUAL_STUDIO +#define SIMDJSON_UNREACHABLE() __assume(0) +#define SIMDJSON_ASSUME(COND) __assume(COND) +#else +#define SIMDJSON_UNREACHABLE() __builtin_unreachable(); +#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0) +#endif + +#else // defined(NDEBUG) || defined(__OPTIMIZE__) || (defined(_MSC_VER) && !defined(_DEBUG)) +// This should only ever be enabled in debug mode. +#define SIMDJSON_UNREACHABLE() assert(0); +#define SIMDJSON_ASSUME(COND) assert(COND) + +#endif + +#endif // SIMDJSON_PORTABILITY_H +/* end file simdjson/portability.h */ + +namespace simdjson { +namespace internal { +/** + * @private + * Our own implementation of the C++17 to_chars function. + * Defined in src/to_chars + */ +char *to_chars(char *first, const char *last, double value); +/** + * @private + * A number parsing routine. + * Defined in src/from_chars + */ +double from_chars(const char *first) noexcept; +double from_chars(const char *first, const char* end) noexcept; +} + +#ifndef SIMDJSON_EXCEPTIONS +#if __cpp_exceptions +#define SIMDJSON_EXCEPTIONS 1 +#else +#define SIMDJSON_EXCEPTIONS 0 +#endif +#endif + +} // namespace simdjson + +#if defined(__GNUC__) + // Marks a block with a name so that MCA analysis can see it. + #define SIMDJSON_BEGIN_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-BEGIN " #name); + #define SIMDJSON_END_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-END " #name); + #define SIMDJSON_DEBUG_BLOCK(name, block) BEGIN_DEBUG_BLOCK(name); block; END_DEBUG_BLOCK(name); +#else + #define SIMDJSON_BEGIN_DEBUG_BLOCK(name) + #define SIMDJSON_END_DEBUG_BLOCK(name) + #define SIMDJSON_DEBUG_BLOCK(name, block) +#endif + +// Align to N-byte boundary +#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1)) +#define SIMDJSON_ROUNDDOWN_N(a, n) ((a) & ~((n)-1)) + +#define SIMDJSON_ISALIGNED_N(ptr, n) (((uintptr_t)(ptr) & ((n)-1)) == 0) + +#if SIMDJSON_REGULAR_VISUAL_STUDIO + + #define simdjson_really_inline __forceinline + #define simdjson_never_inline __declspec(noinline) + + #define simdjson_unused + #define simdjson_warn_unused + + #ifndef simdjson_likely + #define simdjson_likely(x) x + #endif + #ifndef simdjson_unlikely + #define simdjson_unlikely(x) x + #endif + + #define SIMDJSON_PUSH_DISABLE_WARNINGS __pragma(warning( push )) + #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS __pragma(warning( push, 0 )) + #define SIMDJSON_DISABLE_VS_WARNING(WARNING_NUMBER) __pragma(warning( disable : WARNING_NUMBER )) + // Get rid of Intellisense-only warnings (Code Analysis) + // Though __has_include is C++17, it is supported in Visual Studio 2017 or better (_MSC_VER>=1910). + #ifdef __has_include + #if __has_include() + #include + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS) + #endif + #endif + + #ifndef SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #endif + + #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_VS_WARNING(4996) + #define SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING + #define SIMDJSON_POP_DISABLE_WARNINGS __pragma(warning( pop )) + + #define SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS + #define SIMDJSON_POP_DISABLE_UNUSED_WARNINGS + +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + + #define simdjson_really_inline inline __attribute__((always_inline)) + #define simdjson_never_inline inline __attribute__((noinline)) + + #define simdjson_unused __attribute__((unused)) + #define simdjson_warn_unused __attribute__((warn_unused_result)) + + #ifndef simdjson_likely + #define simdjson_likely(x) __builtin_expect(!!(x), 1) + #endif + #ifndef simdjson_unlikely + #define simdjson_unlikely(x) __builtin_expect(!!(x), 0) + #endif + + #define SIMDJSON_PUSH_DISABLE_WARNINGS _Pragma("GCC diagnostic push") + // gcc doesn't seem to disable all warnings with all and extra, add warnings here as necessary + // We do it separately for clang since it has different warnings. + #ifdef __clang__ + // clang is missing -Wmaybe-uninitialized. + #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS SIMDJSON_PUSH_DISABLE_WARNINGS \ + SIMDJSON_DISABLE_GCC_WARNING(-Weffc++) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wall) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wconversion) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wextra) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wattributes) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wimplicit-fallthrough) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wnon-virtual-dtor) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wreturn-type) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wshadow) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-parameter) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable) + #else // __clang__ + #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS SIMDJSON_PUSH_DISABLE_WARNINGS \ + SIMDJSON_DISABLE_GCC_WARNING(-Weffc++) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wall) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wconversion) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wextra) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wattributes) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wimplicit-fallthrough) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wnon-virtual-dtor) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wreturn-type) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wshadow) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-parameter) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wmaybe-uninitialized) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wformat-security) + #endif // __clang__ + + #define SIMDJSON_PRAGMA(P) _Pragma(#P) + #define SIMDJSON_DISABLE_GCC_WARNING(WARNING) SIMDJSON_PRAGMA(GCC diagnostic ignored #WARNING) + #if SIMDJSON_CLANG_VISUAL_STUDIO + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) + #else + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #endif + #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wdeprecated-declarations) + #define SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wstrict-overflow) + #define SIMDJSON_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop") + + #define SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS SIMDJSON_PUSH_DISABLE_WARNINGS \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused) + #define SIMDJSON_POP_DISABLE_UNUSED_WARNINGS SIMDJSON_POP_DISABLE_WARNINGS + + + +#endif // MSC_VER + +#if defined(simdjson_inline) + // Prefer the user's definition of simdjson_inline; don't define it ourselves. +#elif defined(__GNUC__) && !defined(__OPTIMIZE__) + // If optimizations are disabled, forcing inlining can lead to significant + // code bloat and high compile times. Don't use simdjson_really_inline for + // unoptimized builds. + #define simdjson_inline inline +#else + // Force inlining for most simdjson functions. + #define simdjson_inline simdjson_really_inline +#endif + +#if SIMDJSON_VISUAL_STUDIO + /** + * Windows users need to do some extra work when building + * or using a dynamic library (DLL). When building, we need + * to set SIMDJSON_DLLIMPORTEXPORT to __declspec(dllexport). + * When *using* the DLL, the user needs to set + * SIMDJSON_DLLIMPORTEXPORT __declspec(dllimport). + * + * Static libraries not need require such work. + * + * It does not matter here whether you are using + * the regular visual studio or clang under visual + * studio, you still need to handle these issues. + * + * Non-Windows systems do not have this complexity. + */ + #if SIMDJSON_BUILDING_WINDOWS_DYNAMIC_LIBRARY + // We set SIMDJSON_BUILDING_WINDOWS_DYNAMIC_LIBRARY when we build a DLL under Windows. + // It should never happen that both SIMDJSON_BUILDING_WINDOWS_DYNAMIC_LIBRARY and + // SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY are set. + #define SIMDJSON_DLLIMPORTEXPORT __declspec(dllexport) + #elif SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY + // Windows user who call a dynamic library should set SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY to 1. + #define SIMDJSON_DLLIMPORTEXPORT __declspec(dllimport) + #else + // We assume by default static linkage + #define SIMDJSON_DLLIMPORTEXPORT + #endif + +/** + * Workaround for the vcpkg package manager. Only vcpkg should + * ever touch the next line. The SIMDJSON_USING_LIBRARY macro is otherwise unused. + */ +#if SIMDJSON_USING_LIBRARY +#define SIMDJSON_DLLIMPORTEXPORT __declspec(dllimport) +#endif +/** + * End of workaround for the vcpkg package manager. + */ +#else + #define SIMDJSON_DLLIMPORTEXPORT +#endif + +// C++17 requires string_view. +#if SIMDJSON_CPLUSPLUS17 +#define SIMDJSON_HAS_STRING_VIEW +#include // by the standard, this has to be safe. +#endif + +// This macro (__cpp_lib_string_view) has to be defined +// for C++17 and better, but if it is otherwise defined, +// we are going to assume that string_view is available +// even if we do not have C++17 support. +#ifdef __cpp_lib_string_view +#define SIMDJSON_HAS_STRING_VIEW +#endif + +// Some systems have string_view even if we do not have C++17 support, +// and even if __cpp_lib_string_view is undefined, it is the case +// with Apple clang version 11. +// We must handle it. *This is important.* +#ifndef SIMDJSON_HAS_STRING_VIEW +#if defined __has_include +// do not combine the next #if with the previous one (unsafe) +#if __has_include () +// now it is safe to trigger the include +#include // though the file is there, it does not follow that we got the implementation +#if defined(_LIBCPP_STRING_VIEW) +// Ah! So we under libc++ which under its Library Fundamentals Technical Specification, which preceded C++17, +// included string_view. +// This means that we have string_view *even though* we may not have C++17. +#define SIMDJSON_HAS_STRING_VIEW +#endif // _LIBCPP_STRING_VIEW +#endif // __has_include () +#endif // defined __has_include +#endif // def SIMDJSON_HAS_STRING_VIEW +// end of complicated but important routine to try to detect string_view. + +// +// Backfill std::string_view using nonstd::string_view on systems where +// we expect that string_view is missing. Important: if we get this wrong, +// we will end up with two string_view definitions and potential trouble. +// That is why we work so hard above to avoid it. +// +#ifndef SIMDJSON_HAS_STRING_VIEW +SIMDJSON_PUSH_DISABLE_ALL_WARNINGS +/* including simdjson/nonstd/string_view.hpp: #include "simdjson/nonstd/string_view.hpp" */ +/* begin file simdjson/nonstd/string_view.hpp */ +// Copyright 2017-2020 by Martin Moene +// +// string-view lite, a C++17-like string_view for C++98 and later. +// For more information see https://github.com/martinmoene/string-view-lite +// +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#pragma once + +#ifndef NONSTD_SV_LITE_H_INCLUDED +#define NONSTD_SV_LITE_H_INCLUDED + +#define string_view_lite_MAJOR 1 +#define string_view_lite_MINOR 7 +#define string_view_lite_PATCH 0 + +#define string_view_lite_VERSION nssv_STRINGIFY(string_view_lite_MAJOR) "." nssv_STRINGIFY(string_view_lite_MINOR) "." nssv_STRINGIFY(string_view_lite_PATCH) + +#define nssv_STRINGIFY( x ) nssv_STRINGIFY_( x ) +#define nssv_STRINGIFY_( x ) #x + +// string-view lite configuration: + +#define nssv_STRING_VIEW_DEFAULT 0 +#define nssv_STRING_VIEW_NONSTD 1 +#define nssv_STRING_VIEW_STD 2 + +// tweak header support: + +#ifdef __has_include +# if __has_include() +# include +# endif +#define nssv_HAVE_TWEAK_HEADER 1 +#else +#define nssv_HAVE_TWEAK_HEADER 0 +//# pragma message("string_view.hpp: Note: Tweak header not supported.") +#endif + +// string_view selection and configuration: + +#if !defined( nssv_CONFIG_SELECT_STRING_VIEW ) +# define nssv_CONFIG_SELECT_STRING_VIEW ( nssv_HAVE_STD_STRING_VIEW ? nssv_STRING_VIEW_STD : nssv_STRING_VIEW_NONSTD ) +#endif + +#ifndef nssv_CONFIG_STD_SV_OPERATOR +# define nssv_CONFIG_STD_SV_OPERATOR 0 +#endif + +#ifndef nssv_CONFIG_USR_SV_OPERATOR +# define nssv_CONFIG_USR_SV_OPERATOR 1 +#endif + +#ifdef nssv_CONFIG_CONVERSION_STD_STRING +# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS nssv_CONFIG_CONVERSION_STD_STRING +# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS nssv_CONFIG_CONVERSION_STD_STRING +#endif + +#ifndef nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS +# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS 1 +#endif + +#ifndef nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS +# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS 1 +#endif + +#ifndef nssv_CONFIG_NO_STREAM_INSERTION +# define nssv_CONFIG_NO_STREAM_INSERTION 0 +#endif + +// Control presence of exception handling (try and auto discover): + +#ifndef nssv_CONFIG_NO_EXCEPTIONS +# if defined(_MSC_VER) +# include // for _HAS_EXCEPTIONS +# endif +# if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || (_HAS_EXCEPTIONS) +# define nssv_CONFIG_NO_EXCEPTIONS 0 +# else +# define nssv_CONFIG_NO_EXCEPTIONS 1 +# endif +#endif + +// C++ language version detection (C++23 is speculative): +// Note: VC14.0/1900 (VS2015) lacks too much from C++14. + +#ifndef nssv_CPLUSPLUS +# if defined(_MSVC_LANG ) && !defined(__clang__) +# define nssv_CPLUSPLUS (_MSC_VER == 1900 ? 201103L : _MSVC_LANG ) +# else +# define nssv_CPLUSPLUS __cplusplus +# endif +#endif + +#define nssv_CPP98_OR_GREATER ( nssv_CPLUSPLUS >= 199711L ) +#define nssv_CPP11_OR_GREATER ( nssv_CPLUSPLUS >= 201103L ) +#define nssv_CPP11_OR_GREATER_ ( nssv_CPLUSPLUS >= 201103L ) +#define nssv_CPP14_OR_GREATER ( nssv_CPLUSPLUS >= 201402L ) +#define nssv_CPP17_OR_GREATER ( nssv_CPLUSPLUS >= 201703L ) +#define nssv_CPP20_OR_GREATER ( nssv_CPLUSPLUS >= 202002L ) +#define nssv_CPP23_OR_GREATER ( nssv_CPLUSPLUS >= 202300L ) + +// use C++17 std::string_view if available and requested: + +#if nssv_CPP17_OR_GREATER && defined(__has_include ) +# if __has_include( ) +# define nssv_HAVE_STD_STRING_VIEW 1 +# else +# define nssv_HAVE_STD_STRING_VIEW 0 +# endif +#else +# define nssv_HAVE_STD_STRING_VIEW 0 +#endif + +#define nssv_USES_STD_STRING_VIEW ( (nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_STD) || ((nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_DEFAULT) && nssv_HAVE_STD_STRING_VIEW) ) + +#define nssv_HAVE_STARTS_WITH ( nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW ) +#define nssv_HAVE_ENDS_WITH nssv_HAVE_STARTS_WITH + +// +// Use C++17 std::string_view: +// + +#if nssv_USES_STD_STRING_VIEW + +#include + +// Extensions for std::string: + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { + +template< class CharT, class Traits, class Allocator = std::allocator > +std::basic_string +to_string( std::basic_string_view v, Allocator const & a = Allocator() ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +template< class CharT, class Traits, class Allocator > +std::basic_string_view +to_string_view( std::basic_string const & s ) +{ + return std::basic_string_view( s.data(), s.size() ); +} + +// Literal operators sv and _sv: + +#if nssv_CONFIG_STD_SV_OPERATOR + +using namespace std::literals::string_view_literals; + +#endif + +#if nssv_CONFIG_USR_SV_OPERATOR + +inline namespace literals { +inline namespace string_view_literals { + + +constexpr std::string_view operator "" _sv( const char* str, size_t len ) noexcept // (1) +{ + return std::string_view{ str, len }; +} + +constexpr std::u16string_view operator "" _sv( const char16_t* str, size_t len ) noexcept // (2) +{ + return std::u16string_view{ str, len }; +} + +constexpr std::u32string_view operator "" _sv( const char32_t* str, size_t len ) noexcept // (3) +{ + return std::u32string_view{ str, len }; +} + +constexpr std::wstring_view operator "" _sv( const wchar_t* str, size_t len ) noexcept // (4) +{ + return std::wstring_view{ str, len }; +} + +}} // namespace literals::string_view_literals + +#endif // nssv_CONFIG_USR_SV_OPERATOR + +} // namespace nonstd + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { + +using std::string_view; +using std::wstring_view; +using std::u16string_view; +using std::u32string_view; +using std::basic_string_view; + +// literal "sv" and "_sv", see above + +using std::operator==; +using std::operator!=; +using std::operator<; +using std::operator<=; +using std::operator>; +using std::operator>=; + +using std::operator<<; + +} // namespace nonstd + +#else // nssv_HAVE_STD_STRING_VIEW + +// +// Before C++17: use string_view lite: +// + +// Compiler versions: +// +// MSVC++ 6.0 _MSC_VER == 1200 nssv_COMPILER_MSVC_VERSION == 60 (Visual Studio 6.0) +// MSVC++ 7.0 _MSC_VER == 1300 nssv_COMPILER_MSVC_VERSION == 70 (Visual Studio .NET 2002) +// MSVC++ 7.1 _MSC_VER == 1310 nssv_COMPILER_MSVC_VERSION == 71 (Visual Studio .NET 2003) +// MSVC++ 8.0 _MSC_VER == 1400 nssv_COMPILER_MSVC_VERSION == 80 (Visual Studio 2005) +// MSVC++ 9.0 _MSC_VER == 1500 nssv_COMPILER_MSVC_VERSION == 90 (Visual Studio 2008) +// MSVC++ 10.0 _MSC_VER == 1600 nssv_COMPILER_MSVC_VERSION == 100 (Visual Studio 2010) +// MSVC++ 11.0 _MSC_VER == 1700 nssv_COMPILER_MSVC_VERSION == 110 (Visual Studio 2012) +// MSVC++ 12.0 _MSC_VER == 1800 nssv_COMPILER_MSVC_VERSION == 120 (Visual Studio 2013) +// MSVC++ 14.0 _MSC_VER == 1900 nssv_COMPILER_MSVC_VERSION == 140 (Visual Studio 2015) +// MSVC++ 14.1 _MSC_VER >= 1910 nssv_COMPILER_MSVC_VERSION == 141 (Visual Studio 2017) +// MSVC++ 14.2 _MSC_VER >= 1920 nssv_COMPILER_MSVC_VERSION == 142 (Visual Studio 2019) + +#if defined(_MSC_VER ) && !defined(__clang__) +# define nssv_COMPILER_MSVC_VER (_MSC_VER ) +# define nssv_COMPILER_MSVC_VERSION (_MSC_VER / 10 - 10 * ( 5 + (_MSC_VER < 1900 ) ) ) +#else +# define nssv_COMPILER_MSVC_VER 0 +# define nssv_COMPILER_MSVC_VERSION 0 +#endif + +#define nssv_COMPILER_VERSION( major, minor, patch ) ( 10 * ( 10 * (major) + (minor) ) + (patch) ) + +#if defined( __apple_build_version__ ) +# define nssv_COMPILER_APPLECLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) +# define nssv_COMPILER_CLANG_VERSION 0 +#elif defined( __clang__ ) +# define nssv_COMPILER_APPLECLANG_VERSION 0 +# define nssv_COMPILER_CLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) +#else +# define nssv_COMPILER_APPLECLANG_VERSION 0 +# define nssv_COMPILER_CLANG_VERSION 0 +#endif + +#if defined(__GNUC__) && !defined(__clang__) +# define nssv_COMPILER_GNUC_VERSION nssv_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#else +# define nssv_COMPILER_GNUC_VERSION 0 +#endif + +// half-open range [lo..hi): +#define nssv_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) ) + +// Presence of language and library features: + +#ifdef _HAS_CPP0X +# define nssv_HAS_CPP0X _HAS_CPP0X +#else +# define nssv_HAS_CPP0X 0 +#endif + +// Unless defined otherwise below, consider VC14 as C++11 for variant-lite: + +#if nssv_COMPILER_MSVC_VER >= 1900 +# undef nssv_CPP11_OR_GREATER +# define nssv_CPP11_OR_GREATER 1 +#endif + +#define nssv_CPP11_90 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500) +#define nssv_CPP11_100 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600) +#define nssv_CPP11_110 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700) +#define nssv_CPP11_120 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800) +#define nssv_CPP11_140 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900) +#define nssv_CPP11_141 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910) + +#define nssv_CPP14_000 (nssv_CPP14_OR_GREATER) +#define nssv_CPP17_000 (nssv_CPP17_OR_GREATER) + +// Presence of C++11 language features: + +#define nssv_HAVE_CONSTEXPR_11 nssv_CPP11_140 +#define nssv_HAVE_EXPLICIT_CONVERSION nssv_CPP11_140 +#define nssv_HAVE_INLINE_NAMESPACE nssv_CPP11_140 +#define nssv_HAVE_IS_DEFAULT nssv_CPP11_140 +#define nssv_HAVE_IS_DELETE nssv_CPP11_140 +#define nssv_HAVE_NOEXCEPT nssv_CPP11_140 +#define nssv_HAVE_NULLPTR nssv_CPP11_100 +#define nssv_HAVE_REF_QUALIFIER nssv_CPP11_140 +#define nssv_HAVE_UNICODE_LITERALS nssv_CPP11_140 +#define nssv_HAVE_USER_DEFINED_LITERALS nssv_CPP11_140 +#define nssv_HAVE_WCHAR16_T nssv_CPP11_100 +#define nssv_HAVE_WCHAR32_T nssv_CPP11_100 + +#if ! ( ( nssv_CPP11_OR_GREATER && nssv_COMPILER_CLANG_VERSION ) || nssv_BETWEEN( nssv_COMPILER_CLANG_VERSION, 300, 400 ) ) +# define nssv_HAVE_STD_DEFINED_LITERALS nssv_CPP11_140 +#else +# define nssv_HAVE_STD_DEFINED_LITERALS 0 +#endif + +// Presence of C++14 language features: + +#define nssv_HAVE_CONSTEXPR_14 nssv_CPP14_000 + +// Presence of C++17 language features: + +#define nssv_HAVE_NODISCARD nssv_CPP17_000 + +// Presence of C++ library features: + +#define nssv_HAVE_STD_HASH nssv_CPP11_120 + +// Presence of compiler intrinsics: + +// Providing char-type specializations for compare() and length() that +// use compiler intrinsics can improve compile- and run-time performance. +// +// The challenge is in using the right combinations of builtin availability +// and its constexpr-ness. +// +// | compiler | __builtin_memcmp (constexpr) | memcmp (constexpr) | +// |----------|------------------------------|---------------------| +// | clang | 4.0 (>= 4.0 ) | any (? ) | +// | clang-a | 9.0 (>= 9.0 ) | any (? ) | +// | gcc | any (constexpr) | any (? ) | +// | msvc | >= 14.2 C++17 (>= 14.2 ) | any (? ) | + +#define nssv_HAVE_BUILTIN_VER ( (nssv_CPP17_000 && nssv_COMPILER_MSVC_VERSION >= 142) || nssv_COMPILER_GNUC_VERSION > 0 || nssv_COMPILER_CLANG_VERSION >= 400 || nssv_COMPILER_APPLECLANG_VERSION >= 900 ) +#define nssv_HAVE_BUILTIN_CE ( nssv_HAVE_BUILTIN_VER ) + +#define nssv_HAVE_BUILTIN_MEMCMP ( (nssv_HAVE_CONSTEXPR_14 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_14 ) +#define nssv_HAVE_BUILTIN_STRLEN ( (nssv_HAVE_CONSTEXPR_11 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_11 ) + +#ifdef __has_builtin +# define nssv_HAVE_BUILTIN( x ) __has_builtin( x ) +#else +# define nssv_HAVE_BUILTIN( x ) 0 +#endif + +#if nssv_HAVE_BUILTIN(__builtin_memcmp) || nssv_HAVE_BUILTIN_VER +# define nssv_BUILTIN_MEMCMP __builtin_memcmp +#else +# define nssv_BUILTIN_MEMCMP memcmp +#endif + +#if nssv_HAVE_BUILTIN(__builtin_strlen) || nssv_HAVE_BUILTIN_VER +# define nssv_BUILTIN_STRLEN __builtin_strlen +#else +# define nssv_BUILTIN_STRLEN strlen +#endif + +// C++ feature usage: + +#if nssv_HAVE_CONSTEXPR_11 +# define nssv_constexpr constexpr +#else +# define nssv_constexpr /*constexpr*/ +#endif + +#if nssv_HAVE_CONSTEXPR_14 +# define nssv_constexpr14 constexpr +#else +# define nssv_constexpr14 /*constexpr*/ +#endif + +#if nssv_HAVE_EXPLICIT_CONVERSION +# define nssv_explicit explicit +#else +# define nssv_explicit /*explicit*/ +#endif + +#if nssv_HAVE_INLINE_NAMESPACE +# define nssv_inline_ns inline +#else +# define nssv_inline_ns /*inline*/ +#endif + +#if nssv_HAVE_NOEXCEPT +# define nssv_noexcept noexcept +#else +# define nssv_noexcept /*noexcept*/ +#endif + +//#if nssv_HAVE_REF_QUALIFIER +//# define nssv_ref_qual & +//# define nssv_refref_qual && +//#else +//# define nssv_ref_qual /*&*/ +//# define nssv_refref_qual /*&&*/ +//#endif + +#if nssv_HAVE_NULLPTR +# define nssv_nullptr nullptr +#else +# define nssv_nullptr NULL +#endif + +#if nssv_HAVE_NODISCARD +# define nssv_nodiscard [[nodiscard]] +#else +# define nssv_nodiscard /*[[nodiscard]]*/ +#endif + +// Additional includes: + +#include +#include +#include +#include +#include // std::char_traits<> + +#if ! nssv_CONFIG_NO_STREAM_INSERTION +# include +#endif + +#if ! nssv_CONFIG_NO_EXCEPTIONS +# include +#endif + +#if nssv_CPP11_OR_GREATER +# include +#endif + +// Clang, GNUC, MSVC warning suppression macros: + +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wreserved-user-defined-literal" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wuser-defined-literals" +#elif defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wliteral-suffix" +#endif // __clang__ + +#if nssv_COMPILER_MSVC_VERSION >= 140 +# define nssv_SUPPRESS_MSGSL_WARNING(expr) [[gsl::suppress(expr)]] +# define nssv_SUPPRESS_MSVC_WARNING(code, descr) __pragma(warning(suppress: code) ) +# define nssv_DISABLE_MSVC_WARNINGS(codes) __pragma(warning(push)) __pragma(warning(disable: codes)) +#else +# define nssv_SUPPRESS_MSGSL_WARNING(expr) +# define nssv_SUPPRESS_MSVC_WARNING(code, descr) +# define nssv_DISABLE_MSVC_WARNINGS(codes) +#endif + +#if defined(__clang__) +# define nssv_RESTORE_WARNINGS() _Pragma("clang diagnostic pop") +#elif defined(__GNUC__) +# define nssv_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop") +#elif nssv_COMPILER_MSVC_VERSION >= 140 +# define nssv_RESTORE_WARNINGS() __pragma(warning(pop )) +#else +# define nssv_RESTORE_WARNINGS() +#endif + +// Suppress the following MSVC (GSL) warnings: +// - C4455, non-gsl : 'operator ""sv': literal suffix identifiers that do not +// start with an underscore are reserved +// - C26472, gsl::t.1 : don't use a static_cast for arithmetic conversions; +// use brace initialization, gsl::narrow_cast or gsl::narow +// - C26481: gsl::b.1 : don't use pointer arithmetic. Use span instead + +nssv_DISABLE_MSVC_WARNINGS( 4455 26481 26472 ) +//nssv_DISABLE_CLANG_WARNINGS( "-Wuser-defined-literals" ) +//nssv_DISABLE_GNUC_WARNINGS( -Wliteral-suffix ) + +namespace nonstd { namespace sv_lite { + +// +// basic_string_view declaration: +// + +template +< + class CharT, + class Traits = std::char_traits +> +class basic_string_view; + +namespace detail { + +// support constexpr comparison in C++14; +// for C++17 and later, use provided traits: + +template< typename CharT > +inline nssv_constexpr14 int compare( CharT const * s1, CharT const * s2, std::size_t count ) +{ + while ( count-- != 0 ) + { + if ( *s1 < *s2 ) return -1; + if ( *s1 > *s2 ) return +1; + ++s1; ++s2; + } + return 0; +} + +#if nssv_HAVE_BUILTIN_MEMCMP + +// specialization of compare() for char, see also generic compare() above: + +inline nssv_constexpr14 int compare( char const * s1, char const * s2, std::size_t count ) +{ + return nssv_BUILTIN_MEMCMP( s1, s2, count ); +} + +#endif + +#if nssv_HAVE_BUILTIN_STRLEN + +// specialization of length() for char, see also generic length() further below: + +inline nssv_constexpr std::size_t length( char const * s ) +{ + return nssv_BUILTIN_STRLEN( s ); +} + +#endif + +#if defined(__OPTIMIZE__) + +// gcc, clang provide __OPTIMIZE__ +// Expect tail call optimization to make length() non-recursive: + +template< typename CharT > +inline nssv_constexpr std::size_t length( CharT * s, std::size_t result = 0 ) +{ + return *s == '\0' ? result : length( s + 1, result + 1 ); +} + +#else // OPTIMIZE + +// non-recursive: + +template< typename CharT > +inline nssv_constexpr14 std::size_t length( CharT * s ) +{ + std::size_t result = 0; + while ( *s++ != '\0' ) + { + ++result; + } + return result; +} + +#endif // OPTIMIZE + +#if nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER +#if defined(__OPTIMIZE__) + +// gcc, clang provide __OPTIMIZE__ +// Expect tail call optimization to make search() non-recursive: + +template< class CharT, class Traits = std::char_traits > +constexpr const CharT* search( basic_string_view haystack, basic_string_view needle ) +{ + return haystack.starts_with( needle ) ? haystack.begin() : + haystack.empty() ? haystack.end() : search( haystack.substr(1), needle ); +} + +#else // OPTIMIZE + +// non-recursive: + +template< class CharT, class Traits = std::char_traits > +constexpr const CharT* search( basic_string_view haystack, basic_string_view needle ) +{ + return std::search( haystack.begin(), haystack.end(), needle.begin(), needle.end() ); +} + +#endif // OPTIMIZE +#endif // nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER + +} // namespace detail + +// +// basic_string_view: +// + +template +< + class CharT, + class Traits /* = std::char_traits */ +> +class basic_string_view +{ +public: + // Member types: + + typedef Traits traits_type; + typedef CharT value_type; + + typedef CharT * pointer; + typedef CharT const * const_pointer; + typedef CharT & reference; + typedef CharT const & const_reference; + + typedef const_pointer iterator; + typedef const_pointer const_iterator; + typedef std::reverse_iterator< const_iterator > reverse_iterator; + typedef std::reverse_iterator< const_iterator > const_reverse_iterator; + + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + // 24.4.2.1 Construction and assignment: + + nssv_constexpr basic_string_view() nssv_noexcept + : data_( nssv_nullptr ) + , size_( 0 ) + {} + +#if nssv_CPP11_OR_GREATER + nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept = default; +#else + nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept + : data_( other.data_) + , size_( other.size_) + {} +#endif + + nssv_constexpr basic_string_view( CharT const * s, size_type count ) nssv_noexcept // non-standard noexcept + : data_( s ) + , size_( count ) + {} + + nssv_constexpr basic_string_view( CharT const * s) nssv_noexcept // non-standard noexcept + : data_( s ) +#if nssv_CPP17_OR_GREATER + , size_( Traits::length(s) ) +#elif nssv_CPP11_OR_GREATER + , size_( detail::length(s) ) +#else + , size_( Traits::length(s) ) +#endif + {} + +#if nssv_HAVE_NULLPTR +# if nssv_HAVE_IS_DELETE + nssv_constexpr basic_string_view( std::nullptr_t ) nssv_noexcept = delete; +# else + private: nssv_constexpr basic_string_view( std::nullptr_t ) nssv_noexcept; public: +# endif +#endif + + // Assignment: + +#if nssv_CPP11_OR_GREATER + nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept = default; +#else + nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept + { + data_ = other.data_; + size_ = other.size_; + return *this; + } +#endif + + // 24.4.2.2 Iterator support: + + nssv_constexpr const_iterator begin() const nssv_noexcept { return data_; } + nssv_constexpr const_iterator end() const nssv_noexcept { return data_ + size_; } + + nssv_constexpr const_iterator cbegin() const nssv_noexcept { return begin(); } + nssv_constexpr const_iterator cend() const nssv_noexcept { return end(); } + + nssv_constexpr const_reverse_iterator rbegin() const nssv_noexcept { return const_reverse_iterator( end() ); } + nssv_constexpr const_reverse_iterator rend() const nssv_noexcept { return const_reverse_iterator( begin() ); } + + nssv_constexpr const_reverse_iterator crbegin() const nssv_noexcept { return rbegin(); } + nssv_constexpr const_reverse_iterator crend() const nssv_noexcept { return rend(); } + + // 24.4.2.3 Capacity: + + nssv_constexpr size_type size() const nssv_noexcept { return size_; } + nssv_constexpr size_type length() const nssv_noexcept { return size_; } + nssv_constexpr size_type max_size() const nssv_noexcept { return (std::numeric_limits< size_type >::max)(); } + + // since C++20 + nssv_nodiscard nssv_constexpr bool empty() const nssv_noexcept + { + return 0 == size_; + } + + // 24.4.2.4 Element access: + + nssv_constexpr const_reference operator[]( size_type pos ) const + { + return data_at( pos ); + } + + nssv_constexpr14 const_reference at( size_type pos ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos < size() ); +#else + if ( pos >= size() ) + { + throw std::out_of_range("nonstd::string_view::at()"); + } +#endif + return data_at( pos ); + } + + nssv_constexpr const_reference front() const { return data_at( 0 ); } + nssv_constexpr const_reference back() const { return data_at( size() - 1 ); } + + nssv_constexpr const_pointer data() const nssv_noexcept { return data_; } + + // 24.4.2.5 Modifiers: + + nssv_constexpr14 void remove_prefix( size_type n ) + { + assert( n <= size() ); + data_ += n; + size_ -= n; + } + + nssv_constexpr14 void remove_suffix( size_type n ) + { + assert( n <= size() ); + size_ -= n; + } + + nssv_constexpr14 void swap( basic_string_view & other ) nssv_noexcept + { + const basic_string_view tmp(other); + other = *this; + *this = tmp; + } + + // 24.4.2.6 String operations: + + size_type copy( CharT * dest, size_type n, size_type pos = 0 ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos <= size() ); +#else + if ( pos > size() ) + { + throw std::out_of_range("nonstd::string_view::copy()"); + } +#endif + const size_type rlen = (std::min)( n, size() - pos ); + + (void) Traits::copy( dest, data() + pos, rlen ); + + return rlen; + } + + nssv_constexpr14 basic_string_view substr( size_type pos = 0, size_type n = npos ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos <= size() ); +#else + if ( pos > size() ) + { + throw std::out_of_range("nonstd::string_view::substr()"); + } +#endif + return basic_string_view( data() + pos, (std::min)( n, size() - pos ) ); + } + + // compare(), 6x: + + nssv_constexpr14 int compare( basic_string_view other ) const nssv_noexcept // (1) + { +#if nssv_CPP17_OR_GREATER + if ( const int result = Traits::compare( data(), other.data(), (std::min)( size(), other.size() ) ) ) +#else + if ( const int result = detail::compare( data(), other.data(), (std::min)( size(), other.size() ) ) ) +#endif + { + return result; + } + + return size() == other.size() ? 0 : size() < other.size() ? -1 : 1; + } + + nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other ) const // (2) + { + return substr( pos1, n1 ).compare( other ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other, size_type pos2, size_type n2 ) const // (3) + { + return substr( pos1, n1 ).compare( other.substr( pos2, n2 ) ); + } + + nssv_constexpr int compare( CharT const * s ) const // (4) + { + return compare( basic_string_view( s ) ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s ) const // (5) + { + return substr( pos1, n1 ).compare( basic_string_view( s ) ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s, size_type n2 ) const // (6) + { + return substr( pos1, n1 ).compare( basic_string_view( s, n2 ) ); + } + + // 24.4.2.7 Searching: + + // starts_with(), 3x, since C++20: + + nssv_constexpr bool starts_with( basic_string_view v ) const nssv_noexcept // (1) + { + return size() >= v.size() && compare( 0, v.size(), v ) == 0; + } + + nssv_constexpr bool starts_with( CharT c ) const nssv_noexcept // (2) + { + return starts_with( basic_string_view( &c, 1 ) ); + } + + nssv_constexpr bool starts_with( CharT const * s ) const // (3) + { + return starts_with( basic_string_view( s ) ); + } + + // ends_with(), 3x, since C++20: + + nssv_constexpr bool ends_with( basic_string_view v ) const nssv_noexcept // (1) + { + return size() >= v.size() && compare( size() - v.size(), npos, v ) == 0; + } + + nssv_constexpr bool ends_with( CharT c ) const nssv_noexcept // (2) + { + return ends_with( basic_string_view( &c, 1 ) ); + } + + nssv_constexpr bool ends_with( CharT const * s ) const // (3) + { + return ends_with( basic_string_view( s ) ); + } + + // find(), 4x: + + nssv_constexpr size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return assert( v.size() == 0 || v.data() != nssv_nullptr ) + , pos >= size() + ? npos : to_pos( +#if nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER + detail::search( substr(pos), v ) +#else + std::search( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) +#endif + ); + } + + nssv_constexpr size_type find( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find( CharT const * s, size_type pos, size_type n ) const // (3) + { + return find( basic_string_view( s, n ), pos ); + } + + nssv_constexpr size_type find( CharT const * s, size_type pos = 0 ) const // (4) + { + return find( basic_string_view( s ), pos ); + } + + // rfind(), 4x: + + nssv_constexpr14 size_type rfind( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + if ( size() < v.size() ) + { + return npos; + } + + if ( v.empty() ) + { + return (std::min)( size(), pos ); + } + + const_iterator last = cbegin() + (std::min)( size() - v.size(), pos ) + v.size(); + const_iterator result = std::find_end( cbegin(), last, v.cbegin(), v.cend(), Traits::eq ); + + return result != last ? size_type( result - cbegin() ) : npos; + } + + nssv_constexpr14 size_type rfind( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return rfind( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr14 size_type rfind( CharT const * s, size_type pos, size_type n ) const // (3) + { + return rfind( basic_string_view( s, n ), pos ); + } + + nssv_constexpr14 size_type rfind( CharT const * s, size_type pos = npos ) const // (4) + { + return rfind( basic_string_view( s ), pos ); + } + + // find_first_of(), 4x: + + nssv_constexpr size_type find_first_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return pos >= size() + ? npos + : to_pos( std::find_first_of( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) ); + } + + nssv_constexpr size_type find_first_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find_first_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_first_of( CharT const * s, size_type pos, size_type n ) const // (3) + { + return find_first_of( basic_string_view( s, n ), pos ); + } + + nssv_constexpr size_type find_first_of( CharT const * s, size_type pos = 0 ) const // (4) + { + return find_first_of( basic_string_view( s ), pos ); + } + + // find_last_of(), 4x: + + nssv_constexpr size_type find_last_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + return empty() + ? npos + : pos >= size() + ? find_last_of( v, size() - 1 ) + : to_pos( std::find_first_of( const_reverse_iterator( cbegin() + pos + 1 ), crend(), v.cbegin(), v.cend(), Traits::eq ) ); + } + + nssv_constexpr size_type find_last_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return find_last_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_last_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_last_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_last_of( CharT const * s, size_type pos = npos ) const // (4) + { + return find_last_of( basic_string_view( s ), pos ); + } + + // find_first_not_of(), 4x: + + nssv_constexpr size_type find_first_not_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return pos >= size() + ? npos + : to_pos( std::find_if( cbegin() + pos, cend(), not_in_view( v ) ) ); + } + + nssv_constexpr size_type find_first_not_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find_first_not_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_first_not_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos = 0 ) const // (4) + { + return find_first_not_of( basic_string_view( s ), pos ); + } + + // find_last_not_of(), 4x: + + nssv_constexpr size_type find_last_not_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + return empty() + ? npos + : pos >= size() + ? find_last_not_of( v, size() - 1 ) + : to_pos( std::find_if( const_reverse_iterator( cbegin() + pos + 1 ), crend(), not_in_view( v ) ) ); + } + + nssv_constexpr size_type find_last_not_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return find_last_not_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_last_not_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos = npos ) const // (4) + { + return find_last_not_of( basic_string_view( s ), pos ); + } + + // Constants: + +#if nssv_CPP17_OR_GREATER + static nssv_constexpr size_type npos = size_type(-1); +#elif nssv_CPP11_OR_GREATER + enum : size_type { npos = size_type(-1) }; +#else + enum { npos = size_type(-1) }; +#endif + +private: + struct not_in_view + { + const basic_string_view v; + + nssv_constexpr explicit not_in_view( basic_string_view v_ ) : v( v_ ) {} + + nssv_constexpr bool operator()( CharT c ) const + { + return npos == v.find_first_of( c ); + } + }; + + nssv_constexpr size_type to_pos( const_iterator it ) const + { + return it == cend() ? npos : size_type( it - cbegin() ); + } + + nssv_constexpr size_type to_pos( const_reverse_iterator it ) const + { + return it == crend() ? npos : size_type( crend() - it - 1 ); + } + + nssv_constexpr const_reference data_at( size_type pos ) const + { +#if nssv_BETWEEN( nssv_COMPILER_GNUC_VERSION, 1, 500 ) + return data_[pos]; +#else + return assert( pos < size() ), data_[pos]; +#endif + } + +private: + const_pointer data_; + size_type size_; + +public: +#if nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS + + template< class Allocator > + basic_string_view( std::basic_string const & s ) nssv_noexcept + : data_( s.data() ) + , size_( s.size() ) + {} + +#if nssv_HAVE_EXPLICIT_CONVERSION + + template< class Allocator > + explicit operator std::basic_string() const + { + return to_string( Allocator() ); + } + +#endif // nssv_HAVE_EXPLICIT_CONVERSION + +#if nssv_CPP11_OR_GREATER + + template< class Allocator = std::allocator > + std::basic_string + to_string( Allocator const & a = Allocator() ) const + { + return std::basic_string( begin(), end(), a ); + } + +#else + + std::basic_string + to_string() const + { + return std::basic_string( begin(), end() ); + } + + template< class Allocator > + std::basic_string + to_string( Allocator const & a ) const + { + return std::basic_string( begin(), end(), a ); + } + +#endif // nssv_CPP11_OR_GREATER + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS +}; + +// +// Non-member functions: +// + +// 24.4.3 Non-member comparison functions: +// lexicographically compare two string views (function template): + +template< class CharT, class Traits > +nssv_constexpr bool operator== ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator!= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits > +nssv_constexpr bool operator< ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator<= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator> ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator>= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +// Let S be basic_string_view, and sv be an instance of S. +// Implementations shall provide sufficient additional overloads marked +// constexpr and noexcept so that an object t with an implicit conversion +// to S can be compared according to Table 67. + +#if ! nssv_CPP11_OR_GREATER || nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 100, 141 ) + +// accommodate for older compilers: + +// == + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.size() == detail::length( rhs ) && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return detail::length( lhs ) == rhs.size() && rhs.compare( lhs ) == 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +// != + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +// < + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) > 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) > 0; } + +// <= + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) >= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) >= 0; } + +// > + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) < 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) < 0; } + +// >= + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) <= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) <= 0; } + +#else // newer compilers: + +#define nssv_BASIC_STRING_VIEW_I(T,U) typename std::decay< basic_string_view >::type + +#if defined(_MSC_VER) // issue 40 +# define nssv_MSVC_ORDER(x) , int=x +#else +# define nssv_MSVC_ORDER(x) /*, int=x*/ +#endif + +// == + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator==( + basic_string_view lhs, + nssv_BASIC_STRING_VIEW_I(CharT, Traits) rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator==( + nssv_BASIC_STRING_VIEW_I(CharT, Traits) lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +// != + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator!= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator!= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +// < + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator< ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator< ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +// <= + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator<= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator<= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +// > + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator> ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator> ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +// >= + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator>= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator>= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +#undef nssv_MSVC_ORDER +#undef nssv_BASIC_STRING_VIEW_I + +#endif // compiler-dependent approach to comparisons + +// 24.4.4 Inserters and extractors: + +#if ! nssv_CONFIG_NO_STREAM_INSERTION + +namespace detail { + +template< class Stream > +void write_padding( Stream & os, std::streamsize n ) +{ + for ( std::streamsize i = 0; i < n; ++i ) + os.rdbuf()->sputc( os.fill() ); +} + +template< class Stream, class View > +Stream & write_to_stream( Stream & os, View const & sv ) +{ + typename Stream::sentry sentry( os ); + + if ( !sentry ) + return os; + + const std::streamsize length = static_cast( sv.length() ); + + // Whether, and how, to pad: + const bool pad = ( length < os.width() ); + const bool left_pad = pad && ( os.flags() & std::ios_base::adjustfield ) == std::ios_base::right; + + if ( left_pad ) + write_padding( os, os.width() - length ); + + // Write span characters: + os.rdbuf()->sputn( sv.begin(), length ); + + if ( pad && !left_pad ) + write_padding( os, os.width() - length ); + + // Reset output stream width: + os.width( 0 ); + + return os; +} + +} // namespace detail + +template< class CharT, class Traits > +std::basic_ostream & +operator<<( + std::basic_ostream& os, + basic_string_view sv ) +{ + return detail::write_to_stream( os, sv ); +} + +#endif // nssv_CONFIG_NO_STREAM_INSERTION + +// Several typedefs for common character types are provided: + +typedef basic_string_view string_view; +typedef basic_string_view wstring_view; +#if nssv_HAVE_WCHAR16_T +typedef basic_string_view u16string_view; +typedef basic_string_view u32string_view; +#endif + +}} // namespace nonstd::sv_lite + +// +// 24.4.6 Suffix for basic_string_view literals: +// + +#if nssv_HAVE_USER_DEFINED_LITERALS + +namespace nonstd { +nssv_inline_ns namespace literals { +nssv_inline_ns namespace string_view_literals { + +#if nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS + +nssv_constexpr nonstd::sv_lite::string_view operator "" sv( const char* str, size_t len ) nssv_noexcept // (1) +{ + return nonstd::sv_lite::string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u16string_view operator "" sv( const char16_t* str, size_t len ) nssv_noexcept // (2) +{ + return nonstd::sv_lite::u16string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u32string_view operator "" sv( const char32_t* str, size_t len ) nssv_noexcept // (3) +{ + return nonstd::sv_lite::u32string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::wstring_view operator "" sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) +{ + return nonstd::sv_lite::wstring_view{ str, len }; +} + +#endif // nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS + +#if nssv_CONFIG_USR_SV_OPERATOR + +nssv_constexpr nonstd::sv_lite::string_view operator "" _sv( const char* str, size_t len ) nssv_noexcept // (1) +{ + return nonstd::sv_lite::string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u16string_view operator "" _sv( const char16_t* str, size_t len ) nssv_noexcept // (2) +{ + return nonstd::sv_lite::u16string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u32string_view operator "" _sv( const char32_t* str, size_t len ) nssv_noexcept // (3) +{ + return nonstd::sv_lite::u32string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::wstring_view operator "" _sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) +{ + return nonstd::sv_lite::wstring_view{ str, len }; +} + +#endif // nssv_CONFIG_USR_SV_OPERATOR + +}}} // namespace nonstd::literals::string_view_literals + +#endif + +// +// Extensions for std::string: +// + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { +namespace sv_lite { + +// Exclude MSVC 14 (19.00): it yields ambiguous to_string(): + +#if nssv_CPP11_OR_GREATER && nssv_COMPILER_MSVC_VERSION != 140 + +template< class CharT, class Traits, class Allocator = std::allocator > +std::basic_string +to_string( basic_string_view v, Allocator const & a = Allocator() ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +#else + +template< class CharT, class Traits > +std::basic_string +to_string( basic_string_view v ) +{ + return std::basic_string( v.begin(), v.end() ); +} + +template< class CharT, class Traits, class Allocator > +std::basic_string +to_string( basic_string_view v, Allocator const & a ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +#endif // nssv_CPP11_OR_GREATER + +template< class CharT, class Traits, class Allocator > +basic_string_view +to_string_view( std::basic_string const & s ) +{ + return basic_string_view( s.data(), s.size() ); +} + +}} // namespace nonstd::sv_lite + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +// +// make types and algorithms available in namespace nonstd: +// + +namespace nonstd { + +using sv_lite::basic_string_view; +using sv_lite::string_view; +using sv_lite::wstring_view; + +#if nssv_HAVE_WCHAR16_T +using sv_lite::u16string_view; +#endif +#if nssv_HAVE_WCHAR32_T +using sv_lite::u32string_view; +#endif + +// literal "sv" + +using sv_lite::operator==; +using sv_lite::operator!=; +using sv_lite::operator<; +using sv_lite::operator<=; +using sv_lite::operator>; +using sv_lite::operator>=; + +#if ! nssv_CONFIG_NO_STREAM_INSERTION +using sv_lite::operator<<; +#endif + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS +using sv_lite::to_string; +using sv_lite::to_string_view; +#endif + +} // namespace nonstd + +// 24.4.5 Hash support (C++11): + +// Note: The hash value of a string view object is equal to the hash value of +// the corresponding string object. + +#if nssv_HAVE_STD_HASH + +#include + +namespace std { + +template<> +struct hash< nonstd::string_view > +{ +public: + std::size_t operator()( nonstd::string_view v ) const nssv_noexcept + { + return std::hash()( std::string( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::wstring_view > +{ +public: + std::size_t operator()( nonstd::wstring_view v ) const nssv_noexcept + { + return std::hash()( std::wstring( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::u16string_view > +{ +public: + std::size_t operator()( nonstd::u16string_view v ) const nssv_noexcept + { + return std::hash()( std::u16string( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::u32string_view > +{ +public: + std::size_t operator()( nonstd::u32string_view v ) const nssv_noexcept + { + return std::hash()( std::u32string( v.data(), v.size() ) ); + } +}; + +} // namespace std + +#endif // nssv_HAVE_STD_HASH + +nssv_RESTORE_WARNINGS() + +#endif // nssv_HAVE_STD_STRING_VIEW +#endif // NONSTD_SV_LITE_H_INCLUDED +/* end file simdjson/nonstd/string_view.hpp */ +SIMDJSON_POP_DISABLE_WARNINGS + +namespace std { + using string_view = nonstd::string_view; +} +#endif // SIMDJSON_HAS_STRING_VIEW +#undef SIMDJSON_HAS_STRING_VIEW // We are not going to need this macro anymore. + +/// If EXPR is an error, returns it. +#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } } + +// Unless the programmer has already set SIMDJSON_DEVELOPMENT_CHECKS, +// we want to set it under debug builds. We detect a debug build +// under Visual Studio when the _DEBUG macro is set. Under the other +// compilers, we use the fact that they define __OPTIMIZE__ whenever +// they allow optimizations. +// It is possible that this could miss some cases where SIMDJSON_DEVELOPMENT_CHECKS +// is helpful, but the programmer can set the macro SIMDJSON_DEVELOPMENT_CHECKS. +// It could also wrongly set SIMDJSON_DEVELOPMENT_CHECKS (e.g., if the programmer +// sets _DEBUG in a release build under Visual Studio, or if some compiler fails to +// set the __OPTIMIZE__ macro). +#ifndef SIMDJSON_DEVELOPMENT_CHECKS +#ifdef _MSC_VER +// Visual Studio seems to set _DEBUG for debug builds. +#ifdef _DEBUG +#define SIMDJSON_DEVELOPMENT_CHECKS 1 +#endif // _DEBUG +#else // _MSC_VER +// All other compilers appear to set __OPTIMIZE__ to a positive integer +// when the compiler is optimizing. +#ifndef __OPTIMIZE__ +#define SIMDJSON_DEVELOPMENT_CHECKS 1 +#endif // __OPTIMIZE__ +#endif // _MSC_VER +#endif // SIMDJSON_DEVELOPMENT_CHECKS + +// The SIMDJSON_CHECK_EOF macro is a feature flag for the "don't require padding" +// feature. + +#if SIMDJSON_CPLUSPLUS17 +// if we have C++, then fallthrough is a default attribute +# define simdjson_fallthrough [[fallthrough]] +// check if we have __attribute__ support +#elif defined(__has_attribute) +// check if we have the __fallthrough__ attribute +#if __has_attribute(__fallthrough__) +// we are good to go: +# define simdjson_fallthrough __attribute__((__fallthrough__)) +#endif // __has_attribute(__fallthrough__) +#endif // SIMDJSON_CPLUSPLUS17 +// on some systems, we simply do not have support for fallthrough, so use a default: +#ifndef simdjson_fallthrough +# define simdjson_fallthrough do {} while (0) /* fallthrough */ +#endif // simdjson_fallthrough + +#if SIMDJSON_DEVELOPMENT_CHECKS +#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { assert ((expr)); } while (0) +#else +#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0) +#endif + +#ifndef SIMDJSON_UTF8VALIDATION +#define SIMDJSON_UTF8VALIDATION 1 +#endif + +#ifdef __has_include +// How do we detect that a compiler supports vbmi2? +// For sure if the following header is found, we are ok? +#if __has_include() +#define SIMDJSON_COMPILER_SUPPORTS_VBMI2 1 +#endif +#endif + +#ifdef _MSC_VER +#if _MSC_VER >= 1920 +// Visual Studio 2019 and up support VBMI2 under x64 even if the header +// avx512vbmi2intrin.h is not found. +#define SIMDJSON_COMPILER_SUPPORTS_VBMI2 1 +#endif +#endif + +// By default, we allow AVX512. +#ifndef SIMDJSON_AVX512_ALLOWED +#define SIMDJSON_AVX512_ALLOWED 1 +#endif + +#endif // SIMDJSON_COMMON_DEFS_H +/* end file simdjson/common_defs.h */ +/* skipped duplicate #include "simdjson/compiler_check.h" */ +/* including simdjson/error.h: #include "simdjson/error.h" */ +/* begin file simdjson/error.h */ +#ifndef SIMDJSON_ERROR_H +#define SIMDJSON_ERROR_H + +/* skipped duplicate #include "simdjson/base.h" */ + +#include +#include + +namespace simdjson { + +/** + * All possible errors returned by simdjson. These error codes are subject to change + * and not all simdjson kernel returns the same error code given the same input: it is not + * well defined which error a given input should produce. + * + * Only SUCCESS evaluates to false as a Boolean. All other error codes will evaluate + * to true as a Boolean. + */ +enum error_code { + SUCCESS = 0, ///< No error + CAPACITY, ///< This parser can't support a document that big + MEMALLOC, ///< Error allocating memory, most likely out of memory + TAPE_ERROR, ///< Something went wrong, this is a generic error + DEPTH_ERROR, ///< Your document exceeds the user-specified depth limitation + STRING_ERROR, ///< Problem while parsing a string + T_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 't' + F_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 'f' + N_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 'n' + NUMBER_ERROR, ///< Problem while parsing a number + UTF8_ERROR, ///< the input is not valid UTF-8 + UNINITIALIZED, ///< unknown error, or uninitialized document + EMPTY, ///< no structural element found + UNESCAPED_CHARS, ///< found unescaped characters in a string. + UNCLOSED_STRING, ///< missing quote at the end + UNSUPPORTED_ARCHITECTURE, ///< unsupported architecture + INCORRECT_TYPE, ///< JSON element has a different type than user expected + NUMBER_OUT_OF_RANGE, ///< JSON number does not fit in 64 bits + INDEX_OUT_OF_BOUNDS, ///< JSON array index too large + NO_SUCH_FIELD, ///< JSON field not found in object + IO_ERROR, ///< Error reading a file + INVALID_JSON_POINTER, ///< Invalid JSON pointer reference + INVALID_URI_FRAGMENT, ///< Invalid URI fragment + UNEXPECTED_ERROR, ///< indicative of a bug in simdjson + PARSER_IN_USE, ///< parser is already in use. + OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order + INSUFFICIENT_PADDING, ///< The JSON doesn't have enough padding for simdjson to safely parse it. + INCOMPLETE_ARRAY_OR_OBJECT, ///< The document ends early. + SCALAR_DOCUMENT_AS_VALUE, ///< A scalar document is treated as a value. + OUT_OF_BOUNDS, ///< Attempted to access location outside of document. + TRAILING_CONTENT, ///< Unexpected trailing content in the JSON input + NUM_ERROR_CODES +}; + +/** + * Get the error message for the given error code. + * + * dom::parser parser; + * dom::element doc; + * auto error = parser.parse("foo",3).get(doc); + * if (error) { printf("Error: %s\n", error_message(error)); } + * + * @return The error message. + */ +inline const char *error_message(error_code error) noexcept; + +/** + * Write the error message to the output stream + */ +inline std::ostream& operator<<(std::ostream& out, error_code error) noexcept; + +/** + * Exception thrown when an exception-supporting simdjson method is called + */ +struct simdjson_error : public std::exception { + /** + * Create an exception from a simdjson error code. + * @param error The error code + */ + simdjson_error(error_code error) noexcept : _error{error} { } + /** The error message */ + const char *what() const noexcept { return error_message(error()); } + /** The error code */ + error_code error() const noexcept { return _error; } +private: + /** The error code that was used */ + error_code _error; +}; + +namespace internal { + +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::simdjson_result_base { + * simdjson_result() noexcept : internal::simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct simdjson_result_base : protected std::pair { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline simdjson_result_base() noexcept; + + /** + * Create a new error result. + */ + simdjson_inline simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; + +}; // struct simdjson_result_base + +} // namespace internal + +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + */ +template +struct simdjson_result : public internal::simdjson_result_base { + /** + * @private Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline simdjson_result() noexcept; + /** + * @private Create a new error result. + */ + simdjson_inline simdjson_result(T &&value) noexcept; + /** + * @private Create a new successful result. + */ + simdjson_inline simdjson_result(error_code error_code) noexcept; + /** + * @private Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline simdjson_result(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_warn_unused simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; + +}; // struct simdjson_result + +#if SIMDJSON_EXCEPTIONS + +template +inline std::ostream& operator<<(std::ostream& out, simdjson_result value) { return out << value.value(); } +#endif // SIMDJSON_EXCEPTIONS + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +/** + * @deprecated This is an alias and will be removed, use error_code instead + */ +using ErrorValues [[deprecated("This is an alias and will be removed, use error_code instead")]] = error_code; + +/** + * @deprecated Error codes should be stored and returned as `error_code`, use `error_message()` instead. + */ +[[deprecated("Error codes should be stored and returned as `error_code`, use `error_message()` instead.")]] +inline const std::string error_message(int error) noexcept; +#endif // SIMDJSON_DISABLE_DEPRECATED_API +} // namespace simdjson + +#endif // SIMDJSON_ERROR_H +/* end file simdjson/error.h */ +/* skipped duplicate #include "simdjson/portability.h" */ + +/** + * @brief The top level simdjson namespace, containing everything the library provides. + */ +namespace simdjson { + +SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS + +/** The maximum document size supported by simdjson. */ +constexpr size_t SIMDJSON_MAXSIZE_BYTES = 0xFFFFFFFF; + +/** + * The amount of padding needed in a buffer to parse JSON. + * + * The input buf should be readable up to buf + SIMDJSON_PADDING + * this is a stopgap; there should be a better description of the + * main loop and its behavior that abstracts over this + * See https://github.com/simdjson/simdjson/issues/174 + */ +constexpr size_t SIMDJSON_PADDING = 64; + +/** + * By default, simdjson supports this many nested objects and arrays. + * + * This is the default for parser::max_depth(). + */ +constexpr size_t DEFAULT_MAX_DEPTH = 1024; + +SIMDJSON_POP_DISABLE_UNUSED_WARNINGS + +class implementation; +struct padded_string; +class padded_string_view; +enum class stage1_mode; + +namespace internal { + +template +class atomic_ptr; +class dom_parser_implementation; +class escape_json_string; +class tape_ref; +struct value128; +enum class tape_type; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_BASE_H +/* end file simdjson/base.h */ + +#endif // SIMDJSON_SRC_BASE_H +/* end file base.h */ + +SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS + +/* including to_chars.cpp: #include */ +/* begin file to_chars.cpp */ +#ifndef SIMDJSON_SRC_TO_CHARS_CPP +#define SIMDJSON_SRC_TO_CHARS_CPP + +/* skipped duplicate #include */ + +#include +#include +#include +#include + +namespace simdjson { +namespace internal { +/*! +implements the Grisu2 algorithm for binary to decimal floating-point +conversion. +Adapted from JSON for Modern C++ + +This implementation is a slightly modified version of the reference +implementation which may be obtained from +http://florian.loitsch.com/publications (bench.tar.gz). +The code is distributed under the MIT license, Copyright (c) 2009 Florian +Loitsch. For a detailed description of the algorithm see: [1] Loitsch, "Printing +Floating-Point Numbers Quickly and Accurately with Integers", Proceedings of the +ACM SIGPLAN 2010 Conference on Programming Language Design and Implementation, +PLDI 2010 [2] Burger, Dybvig, "Printing Floating-Point Numbers Quickly and +Accurately", Proceedings of the ACM SIGPLAN 1996 Conference on Programming +Language Design and Implementation, PLDI 1996 +*/ +namespace dtoa_impl { + +template +Target reinterpret_bits(const Source source) { + static_assert(sizeof(Target) == sizeof(Source), "size mismatch"); + + Target target; + std::memcpy(&target, &source, sizeof(Source)); + return target; +} + +struct diyfp // f * 2^e +{ + static constexpr int kPrecision = 64; // = q + + std::uint64_t f = 0; + int e = 0; + + constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_) {} + + /*! + @brief returns x - y + @pre x.e == y.e and x.f >= y.f + */ + static diyfp sub(const diyfp &x, const diyfp &y) noexcept { + + return {x.f - y.f, x.e}; + } + + /*! + @brief returns x * y + @note The result is rounded. (Only the upper q bits are returned.) + */ + static diyfp mul(const diyfp &x, const diyfp &y) noexcept { + static_assert(kPrecision == 64, "internal error"); + + // Computes: + // f = round((x.f * y.f) / 2^q) + // e = x.e + y.e + q + + // Emulate the 64-bit * 64-bit multiplication: + // + // p = u * v + // = (u_lo + 2^32 u_hi) (v_lo + 2^32 v_hi) + // = (u_lo v_lo ) + 2^32 ((u_lo v_hi ) + (u_hi v_lo )) + + // 2^64 (u_hi v_hi ) = (p0 ) + 2^32 ((p1 ) + (p2 )) + // + 2^64 (p3 ) = (p0_lo + 2^32 p0_hi) + 2^32 ((p1_lo + + // 2^32 p1_hi) + (p2_lo + 2^32 p2_hi)) + 2^64 (p3 ) = + // (p0_lo ) + 2^32 (p0_hi + p1_lo + p2_lo ) + 2^64 (p1_hi + + // p2_hi + p3) = (p0_lo ) + 2^32 (Q ) + 2^64 (H ) = (p0_lo ) + + // 2^32 (Q_lo + 2^32 Q_hi ) + 2^64 (H ) + // + // (Since Q might be larger than 2^32 - 1) + // + // = (p0_lo + 2^32 Q_lo) + 2^64 (Q_hi + H) + // + // (Q_hi + H does not overflow a 64-bit int) + // + // = p_lo + 2^64 p_hi + + const std::uint64_t u_lo = x.f & 0xFFFFFFFFu; + const std::uint64_t u_hi = x.f >> 32u; + const std::uint64_t v_lo = y.f & 0xFFFFFFFFu; + const std::uint64_t v_hi = y.f >> 32u; + + const std::uint64_t p0 = u_lo * v_lo; + const std::uint64_t p1 = u_lo * v_hi; + const std::uint64_t p2 = u_hi * v_lo; + const std::uint64_t p3 = u_hi * v_hi; + + const std::uint64_t p0_hi = p0 >> 32u; + const std::uint64_t p1_lo = p1 & 0xFFFFFFFFu; + const std::uint64_t p1_hi = p1 >> 32u; + const std::uint64_t p2_lo = p2 & 0xFFFFFFFFu; + const std::uint64_t p2_hi = p2 >> 32u; + + std::uint64_t Q = p0_hi + p1_lo + p2_lo; + + // The full product might now be computed as + // + // p_hi = p3 + p2_hi + p1_hi + (Q >> 32) + // p_lo = p0_lo + (Q << 32) + // + // But in this particular case here, the full p_lo is not required. + // Effectively we only need to add the highest bit in p_lo to p_hi (and + // Q_hi + 1 does not overflow). + + Q += std::uint64_t{1} << (64u - 32u - 1u); // round, ties up + + const std::uint64_t h = p3 + p2_hi + p1_hi + (Q >> 32u); + + return {h, x.e + y.e + 64}; + } + + /*! + @brief normalize x such that the significand is >= 2^(q-1) + @pre x.f != 0 + */ + static diyfp normalize(diyfp x) noexcept { + + while ((x.f >> 63u) == 0) { + x.f <<= 1u; + x.e--; + } + + return x; + } + + /*! + @brief normalize x such that the result has the exponent E + @pre e >= x.e and the upper e - x.e bits of x.f must be zero. + */ + static diyfp normalize_to(const diyfp &x, + const int target_exponent) noexcept { + const int delta = x.e - target_exponent; + + return {x.f << delta, target_exponent}; + } +}; + +struct boundaries { + diyfp w; + diyfp minus; + diyfp plus; +}; + +/*! +Compute the (normalized) diyfp representing the input number 'value' and its +boundaries. +@pre value must be finite and positive +*/ +template boundaries compute_boundaries(FloatType value) { + + // Convert the IEEE representation into a diyfp. + // + // If v is denormal: + // value = 0.F * 2^(1 - bias) = ( F) * 2^(1 - bias - (p-1)) + // If v is normalized: + // value = 1.F * 2^(E - bias) = (2^(p-1) + F) * 2^(E - bias - (p-1)) + + static_assert(std::numeric_limits::is_iec559, + "internal error: dtoa_short requires an IEEE-754 " + "floating-point implementation"); + + constexpr int kPrecision = + std::numeric_limits::digits; // = p (includes the hidden bit) + constexpr int kBias = + std::numeric_limits::max_exponent - 1 + (kPrecision - 1); + constexpr int kMinExp = 1 - kBias; + constexpr std::uint64_t kHiddenBit = std::uint64_t{1} + << (kPrecision - 1); // = 2^(p-1) + + using bits_type = typename std::conditional::type; + + const std::uint64_t bits = reinterpret_bits(value); + const std::uint64_t E = bits >> (kPrecision - 1); + const std::uint64_t F = bits & (kHiddenBit - 1); + + const bool is_denormal = E == 0; + const diyfp v = is_denormal + ? diyfp(F, kMinExp) + : diyfp(F + kHiddenBit, static_cast(E) - kBias); + + // Compute the boundaries m- and m+ of the floating-point value + // v = f * 2^e. + // + // Determine v- and v+, the floating-point predecessor and successor if v, + // respectively. + // + // v- = v - 2^e if f != 2^(p-1) or e == e_min (A) + // = v - 2^(e-1) if f == 2^(p-1) and e > e_min (B) + // + // v+ = v + 2^e + // + // Let m- = (v- + v) / 2 and m+ = (v + v+) / 2. All real numbers _strictly_ + // between m- and m+ round to v, regardless of how the input rounding + // algorithm breaks ties. + // + // ---+-------------+-------------+-------------+-------------+--- (A) + // v- m- v m+ v+ + // + // -----------------+------+------+-------------+-------------+--- (B) + // v- m- v m+ v+ + + const bool lower_boundary_is_closer = F == 0 && E > 1; + const diyfp m_plus = diyfp(2 * v.f + 1, v.e - 1); + const diyfp m_minus = lower_boundary_is_closer + ? diyfp(4 * v.f - 1, v.e - 2) // (B) + : diyfp(2 * v.f - 1, v.e - 1); // (A) + + // Determine the normalized w+ = m+. + const diyfp w_plus = diyfp::normalize(m_plus); + + // Determine w- = m- such that e_(w-) = e_(w+). + const diyfp w_minus = diyfp::normalize_to(m_minus, w_plus.e); + + return {diyfp::normalize(v), w_minus, w_plus}; +} + +// Given normalized diyfp w, Grisu needs to find a (normalized) cached +// power-of-ten c, such that the exponent of the product c * w = f * 2^e lies +// within a certain range [alpha, gamma] (Definition 3.2 from [1]) +// +// alpha <= e = e_c + e_w + q <= gamma +// +// or +// +// f_c * f_w * 2^alpha <= f_c 2^(e_c) * f_w 2^(e_w) * 2^q +// <= f_c * f_w * 2^gamma +// +// Since c and w are normalized, i.e. 2^(q-1) <= f < 2^q, this implies +// +// 2^(q-1) * 2^(q-1) * 2^alpha <= c * w * 2^q < 2^q * 2^q * 2^gamma +// +// or +// +// 2^(q - 2 + alpha) <= c * w < 2^(q + gamma) +// +// The choice of (alpha,gamma) determines the size of the table and the form of +// the digit generation procedure. Using (alpha,gamma)=(-60,-32) works out well +// in practice: +// +// The idea is to cut the number c * w = f * 2^e into two parts, which can be +// processed independently: An integral part p1, and a fractional part p2: +// +// f * 2^e = ( (f div 2^-e) * 2^-e + (f mod 2^-e) ) * 2^e +// = (f div 2^-e) + (f mod 2^-e) * 2^e +// = p1 + p2 * 2^e +// +// The conversion of p1 into decimal form requires a series of divisions and +// modulos by (a power of) 10. These operations are faster for 32-bit than for +// 64-bit integers, so p1 should ideally fit into a 32-bit integer. This can be +// achieved by choosing +// +// -e >= 32 or e <= -32 := gamma +// +// In order to convert the fractional part +// +// p2 * 2^e = p2 / 2^-e = d[-1] / 10^1 + d[-2] / 10^2 + ... +// +// into decimal form, the fraction is repeatedly multiplied by 10 and the digits +// d[-i] are extracted in order: +// +// (10 * p2) div 2^-e = d[-1] +// (10 * p2) mod 2^-e = d[-2] / 10^1 + ... +// +// The multiplication by 10 must not overflow. It is sufficient to choose +// +// 10 * p2 < 16 * p2 = 2^4 * p2 <= 2^64. +// +// Since p2 = f mod 2^-e < 2^-e, +// +// -e <= 60 or e >= -60 := alpha + +constexpr int kAlpha = -60; +constexpr int kGamma = -32; + +struct cached_power // c = f * 2^e ~= 10^k +{ + std::uint64_t f; + int e; + int k; +}; + +/*! +For a normalized diyfp w = f * 2^e, this function returns a (normalized) cached +power-of-ten c = f_c * 2^e_c, such that the exponent of the product w * c +satisfies (Definition 3.2 from [1]) + alpha <= e_c + e + q <= gamma. +*/ +inline cached_power get_cached_power_for_binary_exponent(int e) { + // Now + // + // alpha <= e_c + e + q <= gamma (1) + // ==> f_c * 2^alpha <= c * 2^e * 2^q + // + // and since the c's are normalized, 2^(q-1) <= f_c, + // + // ==> 2^(q - 1 + alpha) <= c * 2^(e + q) + // ==> 2^(alpha - e - 1) <= c + // + // If c were an exact power of ten, i.e. c = 10^k, one may determine k as + // + // k = ceil( log_10( 2^(alpha - e - 1) ) ) + // = ceil( (alpha - e - 1) * log_10(2) ) + // + // From the paper: + // "In theory the result of the procedure could be wrong since c is rounded, + // and the computation itself is approximated [...]. In practice, however, + // this simple function is sufficient." + // + // For IEEE double precision floating-point numbers converted into + // normalized diyfp's w = f * 2^e, with q = 64, + // + // e >= -1022 (min IEEE exponent) + // -52 (p - 1) + // -52 (p - 1, possibly normalize denormal IEEE numbers) + // -11 (normalize the diyfp) + // = -1137 + // + // and + // + // e <= +1023 (max IEEE exponent) + // -52 (p - 1) + // -11 (normalize the diyfp) + // = 960 + // + // This binary exponent range [-1137,960] results in a decimal exponent + // range [-307,324]. One does not need to store a cached power for each + // k in this range. For each such k it suffices to find a cached power + // such that the exponent of the product lies in [alpha,gamma]. + // This implies that the difference of the decimal exponents of adjacent + // table entries must be less than or equal to + // + // floor( (gamma - alpha) * log_10(2) ) = 8. + // + // (A smaller distance gamma-alpha would require a larger table.) + + // NB: + // Actually this function returns c, such that -60 <= e_c + e + 64 <= -34. + + constexpr int kCachedPowersMinDecExp = -300; + constexpr int kCachedPowersDecStep = 8; + + static constexpr std::array kCachedPowers = {{ + {0xAB70FE17C79AC6CA, -1060, -300}, {0xFF77B1FCBEBCDC4F, -1034, -292}, + {0xBE5691EF416BD60C, -1007, -284}, {0x8DD01FAD907FFC3C, -980, -276}, + {0xD3515C2831559A83, -954, -268}, {0x9D71AC8FADA6C9B5, -927, -260}, + {0xEA9C227723EE8BCB, -901, -252}, {0xAECC49914078536D, -874, -244}, + {0x823C12795DB6CE57, -847, -236}, {0xC21094364DFB5637, -821, -228}, + {0x9096EA6F3848984F, -794, -220}, {0xD77485CB25823AC7, -768, -212}, + {0xA086CFCD97BF97F4, -741, -204}, {0xEF340A98172AACE5, -715, -196}, + {0xB23867FB2A35B28E, -688, -188}, {0x84C8D4DFD2C63F3B, -661, -180}, + {0xC5DD44271AD3CDBA, -635, -172}, {0x936B9FCEBB25C996, -608, -164}, + {0xDBAC6C247D62A584, -582, -156}, {0xA3AB66580D5FDAF6, -555, -148}, + {0xF3E2F893DEC3F126, -529, -140}, {0xB5B5ADA8AAFF80B8, -502, -132}, + {0x87625F056C7C4A8B, -475, -124}, {0xC9BCFF6034C13053, -449, -116}, + {0x964E858C91BA2655, -422, -108}, {0xDFF9772470297EBD, -396, -100}, + {0xA6DFBD9FB8E5B88F, -369, -92}, {0xF8A95FCF88747D94, -343, -84}, + {0xB94470938FA89BCF, -316, -76}, {0x8A08F0F8BF0F156B, -289, -68}, + {0xCDB02555653131B6, -263, -60}, {0x993FE2C6D07B7FAC, -236, -52}, + {0xE45C10C42A2B3B06, -210, -44}, {0xAA242499697392D3, -183, -36}, + {0xFD87B5F28300CA0E, -157, -28}, {0xBCE5086492111AEB, -130, -20}, + {0x8CBCCC096F5088CC, -103, -12}, {0xD1B71758E219652C, -77, -4}, + {0x9C40000000000000, -50, 4}, {0xE8D4A51000000000, -24, 12}, + {0xAD78EBC5AC620000, 3, 20}, {0x813F3978F8940984, 30, 28}, + {0xC097CE7BC90715B3, 56, 36}, {0x8F7E32CE7BEA5C70, 83, 44}, + {0xD5D238A4ABE98068, 109, 52}, {0x9F4F2726179A2245, 136, 60}, + {0xED63A231D4C4FB27, 162, 68}, {0xB0DE65388CC8ADA8, 189, 76}, + {0x83C7088E1AAB65DB, 216, 84}, {0xC45D1DF942711D9A, 242, 92}, + {0x924D692CA61BE758, 269, 100}, {0xDA01EE641A708DEA, 295, 108}, + {0xA26DA3999AEF774A, 322, 116}, {0xF209787BB47D6B85, 348, 124}, + {0xB454E4A179DD1877, 375, 132}, {0x865B86925B9BC5C2, 402, 140}, + {0xC83553C5C8965D3D, 428, 148}, {0x952AB45CFA97A0B3, 455, 156}, + {0xDE469FBD99A05FE3, 481, 164}, {0xA59BC234DB398C25, 508, 172}, + {0xF6C69A72A3989F5C, 534, 180}, {0xB7DCBF5354E9BECE, 561, 188}, + {0x88FCF317F22241E2, 588, 196}, {0xCC20CE9BD35C78A5, 614, 204}, + {0x98165AF37B2153DF, 641, 212}, {0xE2A0B5DC971F303A, 667, 220}, + {0xA8D9D1535CE3B396, 694, 228}, {0xFB9B7CD9A4A7443C, 720, 236}, + {0xBB764C4CA7A44410, 747, 244}, {0x8BAB8EEFB6409C1A, 774, 252}, + {0xD01FEF10A657842C, 800, 260}, {0x9B10A4E5E9913129, 827, 268}, + {0xE7109BFBA19C0C9D, 853, 276}, {0xAC2820D9623BF429, 880, 284}, + {0x80444B5E7AA7CF85, 907, 292}, {0xBF21E44003ACDD2D, 933, 300}, + {0x8E679C2F5E44FF8F, 960, 308}, {0xD433179D9C8CB841, 986, 316}, + {0x9E19DB92B4E31BA9, 1013, 324}, + }}; + + // This computation gives exactly the same results for k as + // k = ceil((kAlpha - e - 1) * 0.30102999566398114) + // for |e| <= 1500, but doesn't require floating-point operations. + // NB: log_10(2) ~= 78913 / 2^18 + const int f = kAlpha - e - 1; + const int k = (f * 78913) / (1 << 18) + static_cast(f > 0); + + const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) / + kCachedPowersDecStep; + + const cached_power cached = kCachedPowers[static_cast(index)]; + + return cached; +} + +/*! +For n != 0, returns k, such that pow10 := 10^(k-1) <= n < 10^k. +For n == 0, returns 1 and sets pow10 := 1. +*/ +inline int find_largest_pow10(const std::uint32_t n, std::uint32_t &pow10) { + // LCOV_EXCL_START + if (n >= 1000000000) { + pow10 = 1000000000; + return 10; + } + // LCOV_EXCL_STOP + else if (n >= 100000000) { + pow10 = 100000000; + return 9; + } else if (n >= 10000000) { + pow10 = 10000000; + return 8; + } else if (n >= 1000000) { + pow10 = 1000000; + return 7; + } else if (n >= 100000) { + pow10 = 100000; + return 6; + } else if (n >= 10000) { + pow10 = 10000; + return 5; + } else if (n >= 1000) { + pow10 = 1000; + return 4; + } else if (n >= 100) { + pow10 = 100; + return 3; + } else if (n >= 10) { + pow10 = 10; + return 2; + } else { + pow10 = 1; + return 1; + } +} + +inline void grisu2_round(char *buf, int len, std::uint64_t dist, + std::uint64_t delta, std::uint64_t rest, + std::uint64_t ten_k) { + + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // ten_k + // <------> + // <---- rest ----> + // --------------[------------------+----+--------------]-------------- + // w V + // = buf * 10^k + // + // ten_k represents a unit-in-the-last-place in the decimal representation + // stored in buf. + // Decrement buf by ten_k while this takes buf closer to w. + + // The tests are written in this order to avoid overflow in unsigned + // integer arithmetic. + + while (rest < dist && delta - rest >= ten_k && + (rest + ten_k < dist || dist - rest > rest + ten_k - dist)) { + buf[len - 1]--; + rest += ten_k; + } +} + +/*! +Generates V = buffer * 10^decimal_exponent, such that M- <= V <= M+. +M- and M+ must be normalized and share the same exponent -60 <= e <= -32. +*/ +inline void grisu2_digit_gen(char *buffer, int &length, int &decimal_exponent, + diyfp M_minus, diyfp w, diyfp M_plus) { + static_assert(kAlpha >= -60, "internal error"); + static_assert(kGamma <= -32, "internal error"); + + // Generates the digits (and the exponent) of a decimal floating-point + // number V = buffer * 10^decimal_exponent in the range [M-, M+]. The diyfp's + // w, M- and M+ share the same exponent e, which satisfies alpha <= e <= + // gamma. + // + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // Grisu2 generates the digits of M+ from left to right and stops as soon as + // V is in [M-,M+]. + + std::uint64_t delta = + diyfp::sub(M_plus, M_minus) + .f; // (significand of (M+ - M-), implicit exponent is e) + std::uint64_t dist = + diyfp::sub(M_plus, w) + .f; // (significand of (M+ - w ), implicit exponent is e) + + // Split M+ = f * 2^e into two parts p1 and p2 (note: e < 0): + // + // M+ = f * 2^e + // = ((f div 2^-e) * 2^-e + (f mod 2^-e)) * 2^e + // = ((p1 ) * 2^-e + (p2 )) * 2^e + // = p1 + p2 * 2^e + + const diyfp one(std::uint64_t{1} << -M_plus.e, M_plus.e); + + auto p1 = static_cast( + M_plus.f >> + -one.e); // p1 = f div 2^-e (Since -e >= 32, p1 fits into a 32-bit int.) + std::uint64_t p2 = M_plus.f & (one.f - 1); // p2 = f mod 2^-e + + // 1) + // + // Generate the digits of the integral part p1 = d[n-1]...d[1]d[0] + + std::uint32_t pow10; + const int k = find_largest_pow10(p1, pow10); + + // 10^(k-1) <= p1 < 10^k, pow10 = 10^(k-1) + // + // p1 = (p1 div 10^(k-1)) * 10^(k-1) + (p1 mod 10^(k-1)) + // = (d[k-1] ) * 10^(k-1) + (p1 mod 10^(k-1)) + // + // M+ = p1 + p2 * 2^e + // = d[k-1] * 10^(k-1) + (p1 mod 10^(k-1)) + p2 * 2^e + // = d[k-1] * 10^(k-1) + ((p1 mod 10^(k-1)) * 2^-e + p2) * 2^e + // = d[k-1] * 10^(k-1) + ( rest) * 2^e + // + // Now generate the digits d[n] of p1 from left to right (n = k-1,...,0) + // + // p1 = d[k-1]...d[n] * 10^n + d[n-1]...d[0] + // + // but stop as soon as + // + // rest * 2^e = (d[n-1]...d[0] * 2^-e + p2) * 2^e <= delta * 2^e + + int n = k; + while (n > 0) { + // Invariants: + // M+ = buffer * 10^n + (p1 + p2 * 2^e) (buffer = 0 for n = k) + // pow10 = 10^(n-1) <= p1 < 10^n + // + const std::uint32_t d = p1 / pow10; // d = p1 div 10^(n-1) + const std::uint32_t r = p1 % pow10; // r = p1 mod 10^(n-1) + // + // M+ = buffer * 10^n + (d * 10^(n-1) + r) + p2 * 2^e + // = (buffer * 10 + d) * 10^(n-1) + (r + p2 * 2^e) + // + buffer[length++] = static_cast('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(n-1) + (r + p2 * 2^e) + // + p1 = r; + n--; + // + // M+ = buffer * 10^n + (p1 + p2 * 2^e) + // pow10 = 10^n + // + + // Now check if enough digits have been generated. + // Compute + // + // p1 + p2 * 2^e = (p1 * 2^-e + p2) * 2^e = rest * 2^e + // + // Note: + // Since rest and delta share the same exponent e, it suffices to + // compare the significands. + const std::uint64_t rest = (std::uint64_t{p1} << -one.e) + p2; + if (rest <= delta) { + // V = buffer * 10^n, with M- <= V <= M+. + + decimal_exponent += n; + + // We may now just stop. But instead look if the buffer could be + // decremented to bring V closer to w. + // + // pow10 = 10^n is now 1 ulp in the decimal representation V. + // The rounding procedure works with diyfp's with an implicit + // exponent of e. + // + // 10^n = (10^n * 2^-e) * 2^e = ulp * 2^e + // + const std::uint64_t ten_n = std::uint64_t{pow10} << -one.e; + grisu2_round(buffer, length, dist, delta, rest, ten_n); + + return; + } + + pow10 /= 10; + // + // pow10 = 10^(n-1) <= p1 < 10^n + // Invariants restored. + } + + // 2) + // + // The digits of the integral part have been generated: + // + // M+ = d[k-1]...d[1]d[0] + p2 * 2^e + // = buffer + p2 * 2^e + // + // Now generate the digits of the fractional part p2 * 2^e. + // + // Note: + // No decimal point is generated: the exponent is adjusted instead. + // + // p2 actually represents the fraction + // + // p2 * 2^e + // = p2 / 2^-e + // = d[-1] / 10^1 + d[-2] / 10^2 + ... + // + // Now generate the digits d[-m] of p1 from left to right (m = 1,2,...) + // + // p2 * 2^e = d[-1]d[-2]...d[-m] * 10^-m + // + 10^-m * (d[-m-1] / 10^1 + d[-m-2] / 10^2 + ...) + // + // using + // + // 10^m * p2 = ((10^m * p2) div 2^-e) * 2^-e + ((10^m * p2) mod 2^-e) + // = ( d) * 2^-e + ( r) + // + // or + // 10^m * p2 * 2^e = d + r * 2^e + // + // i.e. + // + // M+ = buffer + p2 * 2^e + // = buffer + 10^-m * (d + r * 2^e) + // = (buffer * 10^m + d) * 10^-m + 10^-m * r * 2^e + // + // and stop as soon as 10^-m * r * 2^e <= delta * 2^e + + int m = 0; + for (;;) { + // Invariant: + // M+ = buffer * 10^-m + 10^-m * (d[-m-1] / 10 + d[-m-2] / 10^2 + ...) + // * 2^e + // = buffer * 10^-m + 10^-m * (p2 ) + // * 2^e = buffer * 10^-m + 10^-m * (1/10 * (10 * p2) ) * 2^e = + // buffer * 10^-m + 10^-m * (1/10 * ((10*p2 div 2^-e) * 2^-e + + // (10*p2 mod 2^-e)) * 2^e + // + p2 *= 10; + const std::uint64_t d = p2 >> -one.e; // d = (10 * p2) div 2^-e + const std::uint64_t r = p2 & (one.f - 1); // r = (10 * p2) mod 2^-e + // + // M+ = buffer * 10^-m + 10^-m * (1/10 * (d * 2^-e + r) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * (d + r * 2^e)) + // = (buffer * 10 + d) * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + buffer[length++] = static_cast('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + p2 = r; + m++; + // + // M+ = buffer * 10^-m + 10^-m * p2 * 2^e + // Invariant restored. + + // Check if enough digits have been generated. + // + // 10^-m * p2 * 2^e <= delta * 2^e + // p2 * 2^e <= 10^m * delta * 2^e + // p2 <= 10^m * delta + delta *= 10; + dist *= 10; + if (p2 <= delta) { + break; + } + } + + // V = buffer * 10^-m, with M- <= V <= M+. + + decimal_exponent -= m; + + // 1 ulp in the decimal representation is now 10^-m. + // Since delta and dist are now scaled by 10^m, we need to do the + // same with ulp in order to keep the units in sync. + // + // 10^m * 10^-m = 1 = 2^-e * 2^e = ten_m * 2^e + // + const std::uint64_t ten_m = one.f; + grisu2_round(buffer, length, dist, delta, p2, ten_m); + + // By construction this algorithm generates the shortest possible decimal + // number (Loitsch, Theorem 6.2) which rounds back to w. + // For an input number of precision p, at least + // + // N = 1 + ceil(p * log_10(2)) + // + // decimal digits are sufficient to identify all binary floating-point + // numbers (Matula, "In-and-Out conversions"). + // This implies that the algorithm does not produce more than N decimal + // digits. + // + // N = 17 for p = 53 (IEEE double precision) + // N = 9 for p = 24 (IEEE single precision) +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +inline void grisu2(char *buf, int &len, int &decimal_exponent, diyfp m_minus, + diyfp v, diyfp m_plus) { + + // --------(-----------------------+-----------------------)-------- (A) + // m- v m+ + // + // --------------------(-----------+-----------------------)-------- (B) + // m- v m+ + // + // First scale v (and m- and m+) such that the exponent is in the range + // [alpha, gamma]. + + const cached_power cached = get_cached_power_for_binary_exponent(m_plus.e); + + const diyfp c_minus_k(cached.f, cached.e); // = c ~= 10^-k + + // The exponent of the products is = v.e + c_minus_k.e + q and is in the range + // [alpha,gamma] + const diyfp w = diyfp::mul(v, c_minus_k); + const diyfp w_minus = diyfp::mul(m_minus, c_minus_k); + const diyfp w_plus = diyfp::mul(m_plus, c_minus_k); + + // ----(---+---)---------------(---+---)---------------(---+---)---- + // w- w w+ + // = c*m- = c*v = c*m+ + // + // diyfp::mul rounds its result and c_minus_k is approximated too. w, w- and + // w+ are now off by a small amount. + // In fact: + // + // w - v * 10^k < 1 ulp + // + // To account for this inaccuracy, add resp. subtract 1 ulp. + // + // --------+---[---------------(---+---)---------------]---+-------- + // w- M- w M+ w+ + // + // Now any number in [M-, M+] (bounds included) will round to w when input, + // regardless of how the input rounding algorithm breaks ties. + // + // And digit_gen generates the shortest possible such number in [M-, M+]. + // Note that this does not mean that Grisu2 always generates the shortest + // possible number in the interval (m-, m+). + const diyfp M_minus(w_minus.f + 1, w_minus.e); + const diyfp M_plus(w_plus.f - 1, w_plus.e); + + decimal_exponent = -cached.k; // = -(-k) = k + + grisu2_digit_gen(buf, len, decimal_exponent, M_minus, w, M_plus); +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +template +void grisu2(char *buf, int &len, int &decimal_exponent, FloatType value) { + static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, + "internal error: not enough precision"); + + // If the neighbors (and boundaries) of 'value' are always computed for + // double-precision numbers, all float's can be recovered using strtod (and + // strtof). However, the resulting decimal representations are not exactly + // "short". + // + // The documentation for 'std::to_chars' + // (https://en.cppreference.com/w/cpp/utility/to_chars) says "value is + // converted to a string as if by std::sprintf in the default ("C") locale" + // and since sprintf promotes float's to double's, I think this is exactly + // what 'std::to_chars' does. On the other hand, the documentation for + // 'std::to_chars' requires that "parsing the representation using the + // corresponding std::from_chars function recovers value exactly". That + // indicates that single precision floating-point numbers should be recovered + // using 'std::strtof'. + // + // NB: If the neighbors are computed for single-precision numbers, there is a + // single float + // (7.0385307e-26f) which can't be recovered using strtod. The resulting + // double precision value is off by 1 ulp. +#if 0 + const boundaries w = compute_boundaries(static_cast(value)); +#else + const boundaries w = compute_boundaries(value); +#endif + + grisu2(buf, len, decimal_exponent, w.minus, w.w, w.plus); +} + +/*! +@brief appends a decimal representation of e to buf +@return a pointer to the element following the exponent. +@pre -1000 < e < 1000 +*/ +inline char *append_exponent(char *buf, int e) { + + if (e < 0) { + e = -e; + *buf++ = '-'; + } else { + *buf++ = '+'; + } + + auto k = static_cast(e); + if (k < 10) { + // Always print at least two digits in the exponent. + // This is for compatibility with printf("%g"). + *buf++ = '0'; + *buf++ = static_cast('0' + k); + } else if (k < 100) { + *buf++ = static_cast('0' + k / 10); + k %= 10; + *buf++ = static_cast('0' + k); + } else { + *buf++ = static_cast('0' + k / 100); + k %= 100; + *buf++ = static_cast('0' + k / 10); + k %= 10; + *buf++ = static_cast('0' + k); + } + + return buf; +} + +/*! +@brief prettify v = buf * 10^decimal_exponent +If v is in the range [10^min_exp, 10^max_exp) it will be printed in fixed-point +notation. Otherwise it will be printed in exponential notation. +@pre min_exp < 0 +@pre max_exp > 0 +*/ +inline char *format_buffer(char *buf, int len, int decimal_exponent, + int min_exp, int max_exp) { + + const int k = len; + const int n = len + decimal_exponent; + + // v = buf * 10^(n-k) + // k is the length of the buffer (number of decimal digits) + // n is the position of the decimal point relative to the start of the buffer. + + if (k <= n && n <= max_exp) { + // digits[000] + // len <= max_exp + 2 + + std::memset(buf + k, '0', static_cast(n) - static_cast(k)); + // Make it look like a floating-point number (#362, #378) + buf[n + 0] = '.'; + buf[n + 1] = '0'; + return buf + (static_cast(n)) + 2; + } + + if (0 < n && n <= max_exp) { + // dig.its + // len <= max_digits10 + 1 + std::memmove(buf + (static_cast(n) + 1), buf + n, + static_cast(k) - static_cast(n)); + buf[n] = '.'; + return buf + (static_cast(k) + 1U); + } + + if (min_exp < n && n <= 0) { + // 0.[000]digits + // len <= 2 + (-min_exp - 1) + max_digits10 + + std::memmove(buf + (2 + static_cast(-n)), buf, + static_cast(k)); + buf[0] = '0'; + buf[1] = '.'; + std::memset(buf + 2, '0', static_cast(-n)); + return buf + (2U + static_cast(-n) + static_cast(k)); + } + + if (k == 1) { + // dE+123 + // len <= 1 + 5 + + buf += 1; + } else { + // d.igitsE+123 + // len <= max_digits10 + 1 + 5 + + std::memmove(buf + 2, buf + 1, static_cast(k) - 1); + buf[1] = '.'; + buf += 1 + static_cast(k); + } + + *buf++ = 'e'; + return append_exponent(buf, n - 1); +} + +} // namespace dtoa_impl + +/*! +The format of the resulting decimal representation is similar to printf's %g +format. Returns an iterator pointing past-the-end of the decimal representation. +@note The input number must be finite, i.e. NaN's and Inf's are not supported. +@note The buffer must be large enough. +@note The result is NOT null-terminated. +*/ +char *to_chars(char *first, const char *last, double value) { + static_cast(last); // maybe unused - fix warning + bool negative = std::signbit(value); + if (negative) { + value = -value; + *first++ = '-'; + } + + if (value == 0) // +-0 + { + *first++ = '0'; + // Make it look like a floating-point number (#362, #378) + *first++ = '.'; + *first++ = '0'; + return first; + } + // Compute v = buffer * 10^decimal_exponent. + // The decimal digits are stored in the buffer, which needs to be interpreted + // as an unsigned decimal integer. + // len is the length of the buffer, i.e. the number of decimal digits. + int len = 0; + int decimal_exponent = 0; + dtoa_impl::grisu2(first, len, decimal_exponent, value); + // Format the buffer like printf("%.*g", prec, value) + constexpr int kMinExp = -4; + constexpr int kMaxExp = std::numeric_limits::digits10; + + return dtoa_impl::format_buffer(first, len, decimal_exponent, kMinExp, + kMaxExp); +} +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_SRC_TO_CHARS_CPP +/* end file to_chars.cpp */ +/* including from_chars.cpp: #include */ +/* begin file from_chars.cpp */ +#ifndef SIMDJSON_SRC_FROM_CHARS_CPP +#define SIMDJSON_SRC_FROM_CHARS_CPP + +/* skipped duplicate #include */ + +#include +#include +#include + +namespace simdjson { +namespace internal { + +/** + * The code in the internal::from_chars function is meant to handle the floating-point number parsing + * when we have more than 19 digits in the decimal mantissa. This should only be seen + * in adversarial scenarios: we do not expect production systems to even produce + * such floating-point numbers. + * + * The parser is based on work by Nigel Tao (at https://github.com/google/wuffs/) + * who credits Ken Thompson for the design (via a reference to the Go source + * code). See + * https://github.com/google/wuffs/blob/aa46859ea40c72516deffa1b146121952d6dfd3b/internal/cgen/base/floatconv-submodule-data.c + * https://github.com/google/wuffs/blob/46cd8105f47ca07ae2ba8e6a7818ef9c0df6c152/internal/cgen/base/floatconv-submodule-code.c + * It is probably not very fast but it is a fallback that should almost never be + * called in real life. Google Wuffs is published under APL 2.0. + **/ + +namespace { +constexpr uint32_t max_digits = 768; +constexpr int32_t decimal_point_range = 2047; +} // namespace + +struct adjusted_mantissa { + uint64_t mantissa; + int power2; + adjusted_mantissa() : mantissa(0), power2(0) {} +}; + +struct decimal { + uint32_t num_digits; + int32_t decimal_point; + bool negative; + bool truncated; + uint8_t digits[max_digits]; +}; + +template struct binary_format { + static constexpr int mantissa_explicit_bits(); + static constexpr int minimum_exponent(); + static constexpr int infinite_power(); + static constexpr int sign_index(); +}; + +template <> constexpr int binary_format::mantissa_explicit_bits() { + return 52; +} + +template <> constexpr int binary_format::minimum_exponent() { + return -1023; +} +template <> constexpr int binary_format::infinite_power() { + return 0x7FF; +} + +template <> constexpr int binary_format::sign_index() { return 63; } + +bool is_integer(char c) noexcept { return (c >= '0' && c <= '9'); } + +// This should always succeed since it follows a call to parse_number. +decimal parse_decimal(const char *&p) noexcept { + decimal answer; + answer.num_digits = 0; + answer.decimal_point = 0; + answer.truncated = false; + answer.negative = (*p == '-'); + if ((*p == '-') || (*p == '+')) { + ++p; + } + + while (*p == '0') { + ++p; + } + while (is_integer(*p)) { + if (answer.num_digits < max_digits) { + answer.digits[answer.num_digits] = uint8_t(*p - '0'); + } + answer.num_digits++; + ++p; + } + if (*p == '.') { + ++p; + const char *first_after_period = p; + // if we have not yet encountered a zero, we have to skip it as well + if (answer.num_digits == 0) { + // skip zeros + while (*p == '0') { + ++p; + } + } + while (is_integer(*p)) { + if (answer.num_digits < max_digits) { + answer.digits[answer.num_digits] = uint8_t(*p - '0'); + } + answer.num_digits++; + ++p; + } + answer.decimal_point = int32_t(first_after_period - p); + } + if(answer.num_digits > 0) { + const char *preverse = p - 1; + int32_t trailing_zeros = 0; + while ((*preverse == '0') || (*preverse == '.')) { + if(*preverse == '0') { trailing_zeros++; }; + --preverse; + } + answer.decimal_point += int32_t(answer.num_digits); + answer.num_digits -= uint32_t(trailing_zeros); + } + if(answer.num_digits > max_digits ) { + answer.num_digits = max_digits; + answer.truncated = true; + } + if (('e' == *p) || ('E' == *p)) { + ++p; + bool neg_exp = false; + if ('-' == *p) { + neg_exp = true; + ++p; + } else if ('+' == *p) { + ++p; + } + int32_t exp_number = 0; // exponential part + while (is_integer(*p)) { + uint8_t digit = uint8_t(*p - '0'); + if (exp_number < 0x10000) { + exp_number = 10 * exp_number + digit; + } + ++p; + } + answer.decimal_point += (neg_exp ? -exp_number : exp_number); + } + return answer; +} + +// This should always succeed since it follows a call to parse_number. +// Will not read at or beyond the "end" pointer. +decimal parse_decimal(const char *&p, const char * end) noexcept { + decimal answer; + answer.num_digits = 0; + answer.decimal_point = 0; + answer.truncated = false; + if(p == end) { return answer; } // should never happen + answer.negative = (*p == '-'); + if ((*p == '-') || (*p == '+')) { + ++p; + } + + while ((p != end) && (*p == '0')) { + ++p; + } + while ((p != end) && is_integer(*p)) { + if (answer.num_digits < max_digits) { + answer.digits[answer.num_digits] = uint8_t(*p - '0'); + } + answer.num_digits++; + ++p; + } + if ((p != end) && (*p == '.')) { + ++p; + if(p == end) { return answer; } // should never happen + const char *first_after_period = p; + // if we have not yet encountered a zero, we have to skip it as well + if (answer.num_digits == 0) { + // skip zeros + while (*p == '0') { + ++p; + } + } + while ((p != end) && is_integer(*p)) { + if (answer.num_digits < max_digits) { + answer.digits[answer.num_digits] = uint8_t(*p - '0'); + } + answer.num_digits++; + ++p; + } + answer.decimal_point = int32_t(first_after_period - p); + } + if(answer.num_digits > 0) { + const char *preverse = p - 1; + int32_t trailing_zeros = 0; + while ((*preverse == '0') || (*preverse == '.')) { + if(*preverse == '0') { trailing_zeros++; }; + --preverse; + } + answer.decimal_point += int32_t(answer.num_digits); + answer.num_digits -= uint32_t(trailing_zeros); + } + if(answer.num_digits > max_digits ) { + answer.num_digits = max_digits; + answer.truncated = true; + } + if ((p != end) && (('e' == *p) || ('E' == *p))) { + ++p; + if(p == end) { return answer; } // should never happen + bool neg_exp = false; + if ('-' == *p) { + neg_exp = true; + ++p; + } else if ('+' == *p) { + ++p; + } + int32_t exp_number = 0; // exponential part + while ((p != end) && is_integer(*p)) { + uint8_t digit = uint8_t(*p - '0'); + if (exp_number < 0x10000) { + exp_number = 10 * exp_number + digit; + } + ++p; + } + answer.decimal_point += (neg_exp ? -exp_number : exp_number); + } + return answer; +} + +namespace { + +// remove all final zeroes +inline void trim(decimal &h) { + while ((h.num_digits > 0) && (h.digits[h.num_digits - 1] == 0)) { + h.num_digits--; + } +} + +uint32_t number_of_digits_decimal_left_shift(decimal &h, uint32_t shift) { + shift &= 63; + const static uint16_t number_of_digits_decimal_left_shift_table[65] = { + 0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817, + 0x181D, 0x2024, 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067, + 0x3073, 0x3080, 0x388E, 0x389C, 0x38AB, 0x38BB, 0x40CC, 0x40DD, 0x40EF, + 0x4902, 0x4915, 0x4929, 0x513E, 0x5153, 0x5169, 0x5180, 0x5998, 0x59B0, + 0x59C9, 0x61E3, 0x61FD, 0x6218, 0x6A34, 0x6A50, 0x6A6D, 0x6A8B, 0x72AA, + 0x72C9, 0x72E9, 0x7B0A, 0x7B2B, 0x7B4D, 0x8370, 0x8393, 0x83B7, 0x83DC, + 0x8C02, 0x8C28, 0x8C4F, 0x9477, 0x949F, 0x94C8, 0x9CF2, 0x051C, 0x051C, + 0x051C, 0x051C, + }; + uint32_t x_a = number_of_digits_decimal_left_shift_table[shift]; + uint32_t x_b = number_of_digits_decimal_left_shift_table[shift + 1]; + uint32_t num_new_digits = x_a >> 11; + uint32_t pow5_a = 0x7FF & x_a; + uint32_t pow5_b = 0x7FF & x_b; + const static uint8_t + number_of_digits_decimal_left_shift_table_powers_of_5[0x051C] = { + 5, 2, 5, 1, 2, 5, 6, 2, 5, 3, 1, 2, 5, 1, 5, 6, 2, 5, 7, 8, 1, 2, 5, + 3, 9, 0, 6, 2, 5, 1, 9, 5, 3, 1, 2, 5, 9, 7, 6, 5, 6, 2, 5, 4, 8, 8, + 2, 8, 1, 2, 5, 2, 4, 4, 1, 4, 0, 6, 2, 5, 1, 2, 2, 0, 7, 0, 3, 1, 2, + 5, 6, 1, 0, 3, 5, 1, 5, 6, 2, 5, 3, 0, 5, 1, 7, 5, 7, 8, 1, 2, 5, 1, + 5, 2, 5, 8, 7, 8, 9, 0, 6, 2, 5, 7, 6, 2, 9, 3, 9, 4, 5, 3, 1, 2, 5, + 3, 8, 1, 4, 6, 9, 7, 2, 6, 5, 6, 2, 5, 1, 9, 0, 7, 3, 4, 8, 6, 3, 2, + 8, 1, 2, 5, 9, 5, 3, 6, 7, 4, 3, 1, 6, 4, 0, 6, 2, 5, 4, 7, 6, 8, 3, + 7, 1, 5, 8, 2, 0, 3, 1, 2, 5, 2, 3, 8, 4, 1, 8, 5, 7, 9, 1, 0, 1, 5, + 6, 2, 5, 1, 1, 9, 2, 0, 9, 2, 8, 9, 5, 5, 0, 7, 8, 1, 2, 5, 5, 9, 6, + 0, 4, 6, 4, 4, 7, 7, 5, 3, 9, 0, 6, 2, 5, 2, 9, 8, 0, 2, 3, 2, 2, 3, + 8, 7, 6, 9, 5, 3, 1, 2, 5, 1, 4, 9, 0, 1, 1, 6, 1, 1, 9, 3, 8, 4, 7, + 6, 5, 6, 2, 5, 7, 4, 5, 0, 5, 8, 0, 5, 9, 6, 9, 2, 3, 8, 2, 8, 1, 2, + 5, 3, 7, 2, 5, 2, 9, 0, 2, 9, 8, 4, 6, 1, 9, 1, 4, 0, 6, 2, 5, 1, 8, + 6, 2, 6, 4, 5, 1, 4, 9, 2, 3, 0, 9, 5, 7, 0, 3, 1, 2, 5, 9, 3, 1, 3, + 2, 2, 5, 7, 4, 6, 1, 5, 4, 7, 8, 5, 1, 5, 6, 2, 5, 4, 6, 5, 6, 6, 1, + 2, 8, 7, 3, 0, 7, 7, 3, 9, 2, 5, 7, 8, 1, 2, 5, 2, 3, 2, 8, 3, 0, 6, + 4, 3, 6, 5, 3, 8, 6, 9, 6, 2, 8, 9, 0, 6, 2, 5, 1, 1, 6, 4, 1, 5, 3, + 2, 1, 8, 2, 6, 9, 3, 4, 8, 1, 4, 4, 5, 3, 1, 2, 5, 5, 8, 2, 0, 7, 6, + 6, 0, 9, 1, 3, 4, 6, 7, 4, 0, 7, 2, 2, 6, 5, 6, 2, 5, 2, 9, 1, 0, 3, + 8, 3, 0, 4, 5, 6, 7, 3, 3, 7, 0, 3, 6, 1, 3, 2, 8, 1, 2, 5, 1, 4, 5, + 5, 1, 9, 1, 5, 2, 2, 8, 3, 6, 6, 8, 5, 1, 8, 0, 6, 6, 4, 0, 6, 2, 5, + 7, 2, 7, 5, 9, 5, 7, 6, 1, 4, 1, 8, 3, 4, 2, 5, 9, 0, 3, 3, 2, 0, 3, + 1, 2, 5, 3, 6, 3, 7, 9, 7, 8, 8, 0, 7, 0, 9, 1, 7, 1, 2, 9, 5, 1, 6, + 6, 0, 1, 5, 6, 2, 5, 1, 8, 1, 8, 9, 8, 9, 4, 0, 3, 5, 4, 5, 8, 5, 6, + 4, 7, 5, 8, 3, 0, 0, 7, 8, 1, 2, 5, 9, 0, 9, 4, 9, 4, 7, 0, 1, 7, 7, + 2, 9, 2, 8, 2, 3, 7, 9, 1, 5, 0, 3, 9, 0, 6, 2, 5, 4, 5, 4, 7, 4, 7, + 3, 5, 0, 8, 8, 6, 4, 6, 4, 1, 1, 8, 9, 5, 7, 5, 1, 9, 5, 3, 1, 2, 5, + 2, 2, 7, 3, 7, 3, 6, 7, 5, 4, 4, 3, 2, 3, 2, 0, 5, 9, 4, 7, 8, 7, 5, + 9, 7, 6, 5, 6, 2, 5, 1, 1, 3, 6, 8, 6, 8, 3, 7, 7, 2, 1, 6, 1, 6, 0, + 2, 9, 7, 3, 9, 3, 7, 9, 8, 8, 2, 8, 1, 2, 5, 5, 6, 8, 4, 3, 4, 1, 8, + 8, 6, 0, 8, 0, 8, 0, 1, 4, 8, 6, 9, 6, 8, 9, 9, 4, 1, 4, 0, 6, 2, 5, + 2, 8, 4, 2, 1, 7, 0, 9, 4, 3, 0, 4, 0, 4, 0, 0, 7, 4, 3, 4, 8, 4, 4, + 9, 7, 0, 7, 0, 3, 1, 2, 5, 1, 4, 2, 1, 0, 8, 5, 4, 7, 1, 5, 2, 0, 2, + 0, 0, 3, 7, 1, 7, 4, 2, 2, 4, 8, 5, 3, 5, 1, 5, 6, 2, 5, 7, 1, 0, 5, + 4, 2, 7, 3, 5, 7, 6, 0, 1, 0, 0, 1, 8, 5, 8, 7, 1, 1, 2, 4, 2, 6, 7, + 5, 7, 8, 1, 2, 5, 3, 5, 5, 2, 7, 1, 3, 6, 7, 8, 8, 0, 0, 5, 0, 0, 9, + 2, 9, 3, 5, 5, 6, 2, 1, 3, 3, 7, 8, 9, 0, 6, 2, 5, 1, 7, 7, 6, 3, 5, + 6, 8, 3, 9, 4, 0, 0, 2, 5, 0, 4, 6, 4, 6, 7, 7, 8, 1, 0, 6, 6, 8, 9, + 4, 5, 3, 1, 2, 5, 8, 8, 8, 1, 7, 8, 4, 1, 9, 7, 0, 0, 1, 2, 5, 2, 3, + 2, 3, 3, 8, 9, 0, 5, 3, 3, 4, 4, 7, 2, 6, 5, 6, 2, 5, 4, 4, 4, 0, 8, + 9, 2, 0, 9, 8, 5, 0, 0, 6, 2, 6, 1, 6, 1, 6, 9, 4, 5, 2, 6, 6, 7, 2, + 3, 6, 3, 2, 8, 1, 2, 5, 2, 2, 2, 0, 4, 4, 6, 0, 4, 9, 2, 5, 0, 3, 1, + 3, 0, 8, 0, 8, 4, 7, 2, 6, 3, 3, 3, 6, 1, 8, 1, 6, 4, 0, 6, 2, 5, 1, + 1, 1, 0, 2, 2, 3, 0, 2, 4, 6, 2, 5, 1, 5, 6, 5, 4, 0, 4, 2, 3, 6, 3, + 1, 6, 6, 8, 0, 9, 0, 8, 2, 0, 3, 1, 2, 5, 5, 5, 5, 1, 1, 1, 5, 1, 2, + 3, 1, 2, 5, 7, 8, 2, 7, 0, 2, 1, 1, 8, 1, 5, 8, 3, 4, 0, 4, 5, 4, 1, + 0, 1, 5, 6, 2, 5, 2, 7, 7, 5, 5, 5, 7, 5, 6, 1, 5, 6, 2, 8, 9, 1, 3, + 5, 1, 0, 5, 9, 0, 7, 9, 1, 7, 0, 2, 2, 7, 0, 5, 0, 7, 8, 1, 2, 5, 1, + 3, 8, 7, 7, 7, 8, 7, 8, 0, 7, 8, 1, 4, 4, 5, 6, 7, 5, 5, 2, 9, 5, 3, + 9, 5, 8, 5, 1, 1, 3, 5, 2, 5, 3, 9, 0, 6, 2, 5, 6, 9, 3, 8, 8, 9, 3, + 9, 0, 3, 9, 0, 7, 2, 2, 8, 3, 7, 7, 6, 4, 7, 6, 9, 7, 9, 2, 5, 5, 6, + 7, 6, 2, 6, 9, 5, 3, 1, 2, 5, 3, 4, 6, 9, 4, 4, 6, 9, 5, 1, 9, 5, 3, + 6, 1, 4, 1, 8, 8, 8, 2, 3, 8, 4, 8, 9, 6, 2, 7, 8, 3, 8, 1, 3, 4, 7, + 6, 5, 6, 2, 5, 1, 7, 3, 4, 7, 2, 3, 4, 7, 5, 9, 7, 6, 8, 0, 7, 0, 9, + 4, 4, 1, 1, 9, 2, 4, 4, 8, 1, 3, 9, 1, 9, 0, 6, 7, 3, 8, 2, 8, 1, 2, + 5, 8, 6, 7, 3, 6, 1, 7, 3, 7, 9, 8, 8, 4, 0, 3, 5, 4, 7, 2, 0, 5, 9, + 6, 2, 2, 4, 0, 6, 9, 5, 9, 5, 3, 3, 6, 9, 1, 4, 0, 6, 2, 5, + }; + const uint8_t *pow5 = + &number_of_digits_decimal_left_shift_table_powers_of_5[pow5_a]; + uint32_t i = 0; + uint32_t n = pow5_b - pow5_a; + for (; i < n; i++) { + if (i >= h.num_digits) { + return num_new_digits - 1; + } else if (h.digits[i] == pow5[i]) { + continue; + } else if (h.digits[i] < pow5[i]) { + return num_new_digits - 1; + } else { + return num_new_digits; + } + } + return num_new_digits; +} + +} // end of anonymous namespace + +uint64_t round(decimal &h) { + if ((h.num_digits == 0) || (h.decimal_point < 0)) { + return 0; + } else if (h.decimal_point > 18) { + return UINT64_MAX; + } + // at this point, we know that h.decimal_point >= 0 + uint32_t dp = uint32_t(h.decimal_point); + uint64_t n = 0; + for (uint32_t i = 0; i < dp; i++) { + n = (10 * n) + ((i < h.num_digits) ? h.digits[i] : 0); + } + bool round_up = false; + if (dp < h.num_digits) { + round_up = h.digits[dp] >= 5; // normally, we round up + // but we may need to round to even! + if ((h.digits[dp] == 5) && (dp + 1 == h.num_digits)) { + round_up = h.truncated || ((dp > 0) && (1 & h.digits[dp - 1])); + } + } + if (round_up) { + n++; + } + return n; +} + +// computes h * 2^-shift +void decimal_left_shift(decimal &h, uint32_t shift) { + if (h.num_digits == 0) { + return; + } + uint32_t num_new_digits = number_of_digits_decimal_left_shift(h, shift); + int32_t read_index = int32_t(h.num_digits - 1); + uint32_t write_index = h.num_digits - 1 + num_new_digits; + uint64_t n = 0; + + while (read_index >= 0) { + n += uint64_t(h.digits[read_index]) << shift; + uint64_t quotient = n / 10; + uint64_t remainder = n - (10 * quotient); + if (write_index < max_digits) { + h.digits[write_index] = uint8_t(remainder); + } else if (remainder > 0) { + h.truncated = true; + } + n = quotient; + write_index--; + read_index--; + } + while (n > 0) { + uint64_t quotient = n / 10; + uint64_t remainder = n - (10 * quotient); + if (write_index < max_digits) { + h.digits[write_index] = uint8_t(remainder); + } else if (remainder > 0) { + h.truncated = true; + } + n = quotient; + write_index--; + } + h.num_digits += num_new_digits; + if (h.num_digits > max_digits) { + h.num_digits = max_digits; + } + h.decimal_point += int32_t(num_new_digits); + trim(h); +} + +// computes h * 2^shift +void decimal_right_shift(decimal &h, uint32_t shift) { + uint32_t read_index = 0; + uint32_t write_index = 0; + + uint64_t n = 0; + + while ((n >> shift) == 0) { + if (read_index < h.num_digits) { + n = (10 * n) + h.digits[read_index++]; + } else if (n == 0) { + return; + } else { + while ((n >> shift) == 0) { + n = 10 * n; + read_index++; + } + break; + } + } + h.decimal_point -= int32_t(read_index - 1); + if (h.decimal_point < -decimal_point_range) { // it is zero + h.num_digits = 0; + h.decimal_point = 0; + h.negative = false; + h.truncated = false; + return; + } + uint64_t mask = (uint64_t(1) << shift) - 1; + while (read_index < h.num_digits) { + uint8_t new_digit = uint8_t(n >> shift); + n = (10 * (n & mask)) + h.digits[read_index++]; + h.digits[write_index++] = new_digit; + } + while (n > 0) { + uint8_t new_digit = uint8_t(n >> shift); + n = 10 * (n & mask); + if (write_index < max_digits) { + h.digits[write_index++] = new_digit; + } else if (new_digit > 0) { + h.truncated = true; + } + } + h.num_digits = write_index; + trim(h); +} + +template adjusted_mantissa compute_float(decimal &d) { + adjusted_mantissa answer; + if (d.num_digits == 0) { + // should be zero + answer.power2 = 0; + answer.mantissa = 0; + return answer; + } + // At this point, going further, we can assume that d.num_digits > 0. + // We want to guard against excessive decimal point values because + // they can result in long running times. Indeed, we do + // shifts by at most 60 bits. We have that log(10**400)/log(2**60) ~= 22 + // which is fine, but log(10**299995)/log(2**60) ~= 16609 which is not + // fine (runs for a long time). + // + if(d.decimal_point < -324) { + // We have something smaller than 1e-324 which is always zero + // in binary64 and binary32. + // It should be zero. + answer.power2 = 0; + answer.mantissa = 0; + return answer; + } else if(d.decimal_point >= 310) { + // We have something at least as large as 0.1e310 which is + // always infinite. + answer.power2 = binary::infinite_power(); + answer.mantissa = 0; + return answer; + } + + static const uint32_t max_shift = 60; + static const uint32_t num_powers = 19; + static const uint8_t powers[19] = { + 0, 3, 6, 9, 13, 16, 19, 23, 26, 29, // + 33, 36, 39, 43, 46, 49, 53, 56, 59, // + }; + int32_t exp2 = 0; + while (d.decimal_point > 0) { + uint32_t n = uint32_t(d.decimal_point); + uint32_t shift = (n < num_powers) ? powers[n] : max_shift; + decimal_right_shift(d, shift); + if (d.decimal_point < -decimal_point_range) { + // should be zero + answer.power2 = 0; + answer.mantissa = 0; + return answer; + } + exp2 += int32_t(shift); + } + // We shift left toward [1/2 ... 1]. + while (d.decimal_point <= 0) { + uint32_t shift; + if (d.decimal_point == 0) { + if (d.digits[0] >= 5) { + break; + } + shift = (d.digits[0] < 2) ? 2 : 1; + } else { + uint32_t n = uint32_t(-d.decimal_point); + shift = (n < num_powers) ? powers[n] : max_shift; + } + decimal_left_shift(d, shift); + if (d.decimal_point > decimal_point_range) { + // we want to get infinity: + answer.power2 = 0xFF; + answer.mantissa = 0; + return answer; + } + exp2 -= int32_t(shift); + } + // We are now in the range [1/2 ... 1] but the binary format uses [1 ... 2]. + exp2--; + constexpr int32_t minimum_exponent = binary::minimum_exponent(); + while ((minimum_exponent + 1) > exp2) { + uint32_t n = uint32_t((minimum_exponent + 1) - exp2); + if (n > max_shift) { + n = max_shift; + } + decimal_right_shift(d, n); + exp2 += int32_t(n); + } + if ((exp2 - minimum_exponent) >= binary::infinite_power()) { + answer.power2 = binary::infinite_power(); + answer.mantissa = 0; + return answer; + } + + const int mantissa_size_in_bits = binary::mantissa_explicit_bits() + 1; + decimal_left_shift(d, mantissa_size_in_bits); + + uint64_t mantissa = round(d); + // It is possible that we have an overflow, in which case we need + // to shift back. + if (mantissa >= (uint64_t(1) << mantissa_size_in_bits)) { + decimal_right_shift(d, 1); + exp2 += 1; + mantissa = round(d); + if ((exp2 - minimum_exponent) >= binary::infinite_power()) { + answer.power2 = binary::infinite_power(); + answer.mantissa = 0; + return answer; + } + } + answer.power2 = exp2 - binary::minimum_exponent(); + if (mantissa < (uint64_t(1) << binary::mantissa_explicit_bits())) { + answer.power2--; + } + answer.mantissa = + mantissa & ((uint64_t(1) << binary::mantissa_explicit_bits()) - 1); + return answer; +} + +template +adjusted_mantissa parse_long_mantissa(const char *first) { + decimal d = parse_decimal(first); + return compute_float(d); +} + +template +adjusted_mantissa parse_long_mantissa(const char *first, const char *end) { + decimal d = parse_decimal(first, end); + return compute_float(d); +} + +double from_chars(const char *first) noexcept { + bool negative = first[0] == '-'; + if (negative) { + first++; + } + adjusted_mantissa am = parse_long_mantissa>(first); + uint64_t word = am.mantissa; + word |= uint64_t(am.power2) + << binary_format::mantissa_explicit_bits(); + word = negative ? word | (uint64_t(1) << binary_format::sign_index()) + : word; + double value; + std::memcpy(&value, &word, sizeof(double)); + return value; +} + + +double from_chars(const char *first, const char *end) noexcept { + bool negative = first[0] == '-'; + if (negative) { + first++; + } + adjusted_mantissa am = parse_long_mantissa>(first, end); + uint64_t word = am.mantissa; + word |= uint64_t(am.power2) + << binary_format::mantissa_explicit_bits(); + word = negative ? word | (uint64_t(1) << binary_format::sign_index()) + : word; + double value; + std::memcpy(&value, &word, sizeof(double)); + return value; +} + +} // internal +} // simdjson + +#endif // SIMDJSON_SRC_FROM_CHARS_CPP +/* end file from_chars.cpp */ +/* including internal/error_tables.cpp: #include */ +/* begin file internal/error_tables.cpp */ +#ifndef SIMDJSON_SRC_ERROR_TABLES_CPP +#define SIMDJSON_SRC_ERROR_TABLES_CPP + +/* including simdjson/internal/jsoncharutils_tables.h: #include */ +/* begin file simdjson/internal/jsoncharutils_tables.h */ +#ifndef SIMDJSON_INTERNAL_JSONCHARUTILS_TABLES_H +#define SIMDJSON_INTERNAL_JSONCHARUTILS_TABLES_H + +/* skipped duplicate #include "simdjson/base.h" */ + +#ifdef JSON_TEST_STRINGS +void found_string(const uint8_t *buf, const uint8_t *parsed_begin, + const uint8_t *parsed_end); +void found_bad_string(const uint8_t *buf); +#endif + +namespace simdjson { +namespace internal { +// structural chars here are +// they are { 0x7b } 0x7d : 0x3a [ 0x5b ] 0x5d , 0x2c (and NULL) +// we are also interested in the four whitespace characters +// space 0x20, linefeed 0x0a, horizontal tab 0x09 and carriage return 0x0d + +extern SIMDJSON_DLLIMPORTEXPORT const bool structural_or_whitespace_negated[256]; +extern SIMDJSON_DLLIMPORTEXPORT const bool structural_or_whitespace[256]; +extern SIMDJSON_DLLIMPORTEXPORT const uint32_t digit_to_val32[886]; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_JSONCHARUTILS_TABLES_H +/* end file simdjson/internal/jsoncharutils_tables.h */ +/* including simdjson/error-inl.h: #include */ +/* begin file simdjson/error-inl.h */ +#ifndef SIMDJSON_ERROR_INL_H +#define SIMDJSON_ERROR_INL_H + +/* skipped duplicate #include "simdjson/error.h" */ + +#include + +namespace simdjson { +namespace internal { + // We store the error code so we can validate the error message is associated with the right code + struct error_code_info { + error_code code; + const char* message; // do not use a fancy std::string where a simple C string will do (no alloc, no destructor) + }; + // These MUST match the codes in error_code. We check this constraint in basictests. + extern SIMDJSON_DLLIMPORTEXPORT const error_code_info error_codes[]; +} // namespace internal + + +inline const char *error_message(error_code error) noexcept { + // If you're using error_code, we're trusting you got it from the enum. + return internal::error_codes[int(error)].message; +} + +// deprecated function +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +inline const std::string error_message(int error) noexcept { + if (error < 0 || error >= error_code::NUM_ERROR_CODES) { + return internal::error_codes[UNEXPECTED_ERROR].message; + } + return internal::error_codes[error].message; +} +#endif // SIMDJSON_DISABLE_DEPRECATED_API + +inline std::ostream& operator<<(std::ostream& out, error_code error) noexcept { + return out << error_message(error); +} + +namespace internal { + +// +// internal::simdjson_result_base inline implementation +// + +template +simdjson_inline void simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T&& simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline simdjson_result_base::simdjson_result_base(T &&value, error_code error) noexcept + : std::pair(std::forward(value), error) {} +template +simdjson_inline simdjson_result_base::simdjson_result_base(error_code error) noexcept + : simdjson_result_base(T{}, error) {} +template +simdjson_inline simdjson_result_base::simdjson_result_base(T &&value) noexcept + : simdjson_result_base(std::forward(value), SUCCESS) {} +template +simdjson_inline simdjson_result_base::simdjson_result_base() noexcept + : simdjson_result_base(T{}, UNINITIALIZED) {} + +} // namespace internal + +/// +/// simdjson_result inline implementation +/// + +template +simdjson_inline void simdjson_result::tie(T &value, error_code &error) && noexcept { + std::forward>(*this).tie(value, error); +} + +template +simdjson_warn_unused simdjson_inline error_code simdjson_result::get(T &value) && noexcept { + return std::forward>(*this).get(value); +} + +template +simdjson_inline error_code simdjson_result::error() const noexcept { + return internal::simdjson_result_base::error(); +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& simdjson_result::value() & noexcept(false) { + return internal::simdjson_result_base::value(); +} + +template +simdjson_inline T&& simdjson_result::value() && noexcept(false) { + return std::forward>(*this).value(); +} + +template +simdjson_inline T&& simdjson_result::take_value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline simdjson_result::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& simdjson_result::value_unsafe() const& noexcept { + return internal::simdjson_result_base::value_unsafe(); +} + +template +simdjson_inline T&& simdjson_result::value_unsafe() && noexcept { + return std::forward>(*this).value_unsafe(); +} + +template +simdjson_inline simdjson_result::simdjson_result(T &&value, error_code error) noexcept + : internal::simdjson_result_base(std::forward(value), error) {} +template +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : internal::simdjson_result_base(error) {} +template +simdjson_inline simdjson_result::simdjson_result(T &&value) noexcept + : internal::simdjson_result_base(std::forward(value)) {} +template +simdjson_inline simdjson_result::simdjson_result() noexcept + : internal::simdjson_result_base() {} + +} // namespace simdjson + +#endif // SIMDJSON_ERROR_INL_H +/* end file simdjson/error-inl.h */ + +namespace simdjson { +namespace internal { + + SIMDJSON_DLLIMPORTEXPORT const error_code_info error_codes[] { + { SUCCESS, "SUCCESS: No error" }, + { CAPACITY, "CAPACITY: This parser can't support a document that big" }, + { MEMALLOC, "MEMALLOC: Error allocating memory, we're most likely out of memory" }, + { TAPE_ERROR, "TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc." }, + { DEPTH_ERROR, "DEPTH_ERROR: The JSON document was too deep (too many nested objects and arrays)" }, + { STRING_ERROR, "STRING_ERROR: Problem while parsing a string" }, + { T_ATOM_ERROR, "T_ATOM_ERROR: Problem while parsing an atom starting with the letter 't'" }, + { F_ATOM_ERROR, "F_ATOM_ERROR: Problem while parsing an atom starting with the letter 'f'" }, + { N_ATOM_ERROR, "N_ATOM_ERROR: Problem while parsing an atom starting with the letter 'n'" }, + { NUMBER_ERROR, "NUMBER_ERROR: Problem while parsing a number" }, + { UTF8_ERROR, "UTF8_ERROR: The input is not valid UTF-8" }, + { UNINITIALIZED, "UNINITIALIZED: Uninitialized" }, + { EMPTY, "EMPTY: no JSON found" }, + { UNESCAPED_CHARS, "UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters" }, + { UNCLOSED_STRING, "UNCLOSED_STRING: A string is opened, but never closed." }, + { UNSUPPORTED_ARCHITECTURE, "UNSUPPORTED_ARCHITECTURE: simdjson does not have an implementation supported by this CPU architecture. Please report this error to the core team as it should never happen." }, + { INCORRECT_TYPE, "INCORRECT_TYPE: The JSON element does not have the requested type." }, + { NUMBER_OUT_OF_RANGE, "NUMBER_OUT_OF_RANGE: The JSON number is too large or too small to fit within the requested type." }, + { INDEX_OUT_OF_BOUNDS, "INDEX_OUT_OF_BOUNDS: Attempted to access an element of a JSON array that is beyond its length." }, + { NO_SUCH_FIELD, "NO_SUCH_FIELD: The JSON field referenced does not exist in this object." }, + { IO_ERROR, "IO_ERROR: Error reading the file." }, + { INVALID_JSON_POINTER, "INVALID_JSON_POINTER: Invalid JSON pointer syntax." }, + { INVALID_URI_FRAGMENT, "INVALID_URI_FRAGMENT: Invalid URI fragment syntax." }, + { UNEXPECTED_ERROR, "UNEXPECTED_ERROR: Unexpected error, consider reporting this problem as you may have found a bug in simdjson" }, + { PARSER_IN_USE, "PARSER_IN_USE: Cannot parse a new document while a document is still in use." }, + { OUT_OF_ORDER_ITERATION, "OUT_OF_ORDER_ITERATION: Objects and arrays can only be iterated when they are first encountered." }, + { INSUFFICIENT_PADDING, "INSUFFICIENT_PADDING: simdjson requires the input JSON string to have at least SIMDJSON_PADDING extra bytes allocated, beyond the string's length. Consider using the simdjson::padded_string class if needed." }, + { INCOMPLETE_ARRAY_OR_OBJECT, "INCOMPLETE_ARRAY_OR_OBJECT: JSON document ended early in the middle of an object or array." }, + { SCALAR_DOCUMENT_AS_VALUE, "SCALAR_DOCUMENT_AS_VALUE: A JSON document made of a scalar (number, Boolean, null or string) is treated as a value. Use get_bool(), get_double(), etc. on the document instead. "}, + { OUT_OF_BOUNDS, "OUT_OF_BOUNDS: Attempt to access location outside of document."}, + { TRAILING_CONTENT, "TRAILING_CONTENT: Unexpected trailing content in the JSON input."} + }; // error_messages[] + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_SRC_ERROR_TABLES_CPP +/* end file internal/error_tables.cpp */ +/* including internal/jsoncharutils_tables.cpp: #include */ +/* begin file internal/jsoncharutils_tables.cpp */ +#ifndef SIMDJSON_SRC_JSONCHARUTILS_TABLES_CPP +#define SIMDJSON_SRC_JSONCHARUTILS_TABLES_CPP + +/* skipped duplicate #include */ + +namespace simdjson { +namespace internal { + +// structural chars here are +// they are { 0x7b } 0x7d : 0x3a [ 0x5b ] 0x5d , 0x2c (and NULL) +// we are also interested in the four whitespace characters +// space 0x20, linefeed 0x0a, horizontal tab 0x09 and carriage return 0x0d + +SIMDJSON_DLLIMPORTEXPORT const bool structural_or_whitespace_negated[256] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + +SIMDJSON_DLLIMPORTEXPORT const bool structural_or_whitespace[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +SIMDJSON_DLLIMPORTEXPORT const uint32_t digit_to_val32[886] = { + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, + 0x6, 0x7, 0x8, 0x9, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xa, 0xb, 0xc, 0xd, 0xe, + 0xf, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0x0, 0x10, 0x20, 0x30, 0x40, 0x50, + 0x60, 0x70, 0x80, 0x90, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xa0, + 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, + 0xf0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0x0, 0x100, 0x200, 0x300, 0x400, 0x500, + 0x600, 0x700, 0x800, 0x900, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xa00, + 0xb00, 0xc00, 0xd00, 0xe00, 0xf00, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00, + 0xf00, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0x0, 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, + 0x6000, 0x7000, 0x8000, 0x9000, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xa000, + 0xb000, 0xc000, 0xd000, 0xe000, 0xf000, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xa000, 0xb000, 0xc000, 0xd000, 0xe000, + 0xf000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_SRC_JSONCHARUTILS_TABLES_CPP +/* end file internal/jsoncharutils_tables.cpp */ +/* including internal/numberparsing_tables.cpp: #include */ +/* begin file internal/numberparsing_tables.cpp */ +#ifndef SIMDJSON_SRC_NUMBERPARSING_TABLES_CPP +#define SIMDJSON_SRC_NUMBERPARSING_TABLES_CPP + +/* skipped duplicate #include */ +/* including simdjson/internal/numberparsing_tables.h: #include */ +/* begin file simdjson/internal/numberparsing_tables.h */ +#ifndef SIMDJSON_INTERNAL_NUMBERPARSING_TABLES_H +#define SIMDJSON_INTERNAL_NUMBERPARSING_TABLES_H + +/* skipped duplicate #include "simdjson/base.h" */ + +namespace simdjson { +namespace internal { +/** + * The smallest non-zero float (binary64) is 2^-1074. + * We take as input numbers of the form w x 10^q where w < 2^64. + * We have that w * 10^-343 < 2^(64-344) 5^-343 < 2^-1076. + * However, we have that + * (2^64-1) * 10^-342 = (2^64-1) * 2^-342 * 5^-342 > 2^-1074. + * Thus it is possible for a number of the form w * 10^-342 where + * w is a 64-bit value to be a non-zero floating-point number. + ********* + * Any number of form w * 10^309 where w>= 1 is going to be + * infinite in binary64 so we never need to worry about powers + * of 5 greater than 308. + */ +constexpr int smallest_power = -342; +constexpr int largest_power = 308; + +/** + * Represents a 128-bit value. + * low: least significant 64 bits. + * high: most significant 64 bits. + */ +struct value128 { + uint64_t low; + uint64_t high; +}; + + +// Precomputed powers of ten from 10^0 to 10^22. These +// can be represented exactly using the double type. +extern SIMDJSON_DLLIMPORTEXPORT const double power_of_ten[]; + + +/** + * When mapping numbers from decimal to binary, + * we go from w * 10^q to m * 2^p but we have + * 10^q = 5^q * 2^q, so effectively + * we are trying to match + * w * 2^q * 5^q to m * 2^p. Thus the powers of two + * are not a concern since they can be represented + * exactly using the binary notation, only the powers of five + * affect the binary significand. + */ + + +// The truncated powers of five from 5^-342 all the way to 5^308 +// The mantissa is truncated to 128 bits, and +// never rounded up. Uses about 10KB. +extern SIMDJSON_DLLIMPORTEXPORT const uint64_t power_of_five_128[]; +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_NUMBERPARSING_TABLES_H +/* end file simdjson/internal/numberparsing_tables.h */ + +// Precomputed powers of ten from 10^0 to 10^22. These +// can be represented exactly using the double type. +SIMDJSON_DLLIMPORTEXPORT const double simdjson::internal::power_of_ten[] = { + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, + 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22}; + +/** + * When mapping numbers from decimal to binary, + * we go from w * 10^q to m * 2^p but we have + * 10^q = 5^q * 2^q, so effectively + * we are trying to match + * w * 2^q * 5^q to m * 2^p. Thus the powers of two + * are not a concern since they can be represented + * exactly using the binary notation, only the powers of five + * affect the binary significand. + */ + + +// The truncated powers of five from 5^-342 all the way to 5^308 +// The mantissa is truncated to 128 bits, and +// never rounded up. Uses about 10KB. +SIMDJSON_DLLIMPORTEXPORT const uint64_t simdjson::internal::power_of_five_128[]= { + 0xeef453d6923bd65a,0x113faa2906a13b3f, + 0x9558b4661b6565f8,0x4ac7ca59a424c507, + 0xbaaee17fa23ebf76,0x5d79bcf00d2df649, + 0xe95a99df8ace6f53,0xf4d82c2c107973dc, + 0x91d8a02bb6c10594,0x79071b9b8a4be869, + 0xb64ec836a47146f9,0x9748e2826cdee284, + 0xe3e27a444d8d98b7,0xfd1b1b2308169b25, + 0x8e6d8c6ab0787f72,0xfe30f0f5e50e20f7, + 0xb208ef855c969f4f,0xbdbd2d335e51a935, + 0xde8b2b66b3bc4723,0xad2c788035e61382, + 0x8b16fb203055ac76,0x4c3bcb5021afcc31, + 0xaddcb9e83c6b1793,0xdf4abe242a1bbf3d, + 0xd953e8624b85dd78,0xd71d6dad34a2af0d, + 0x87d4713d6f33aa6b,0x8672648c40e5ad68, + 0xa9c98d8ccb009506,0x680efdaf511f18c2, + 0xd43bf0effdc0ba48,0x212bd1b2566def2, + 0x84a57695fe98746d,0x14bb630f7604b57, + 0xa5ced43b7e3e9188,0x419ea3bd35385e2d, + 0xcf42894a5dce35ea,0x52064cac828675b9, + 0x818995ce7aa0e1b2,0x7343efebd1940993, + 0xa1ebfb4219491a1f,0x1014ebe6c5f90bf8, + 0xca66fa129f9b60a6,0xd41a26e077774ef6, + 0xfd00b897478238d0,0x8920b098955522b4, + 0x9e20735e8cb16382,0x55b46e5f5d5535b0, + 0xc5a890362fddbc62,0xeb2189f734aa831d, + 0xf712b443bbd52b7b,0xa5e9ec7501d523e4, + 0x9a6bb0aa55653b2d,0x47b233c92125366e, + 0xc1069cd4eabe89f8,0x999ec0bb696e840a, + 0xf148440a256e2c76,0xc00670ea43ca250d, + 0x96cd2a865764dbca,0x380406926a5e5728, + 0xbc807527ed3e12bc,0xc605083704f5ecf2, + 0xeba09271e88d976b,0xf7864a44c633682e, + 0x93445b8731587ea3,0x7ab3ee6afbe0211d, + 0xb8157268fdae9e4c,0x5960ea05bad82964, + 0xe61acf033d1a45df,0x6fb92487298e33bd, + 0x8fd0c16206306bab,0xa5d3b6d479f8e056, + 0xb3c4f1ba87bc8696,0x8f48a4899877186c, + 0xe0b62e2929aba83c,0x331acdabfe94de87, + 0x8c71dcd9ba0b4925,0x9ff0c08b7f1d0b14, + 0xaf8e5410288e1b6f,0x7ecf0ae5ee44dd9, + 0xdb71e91432b1a24a,0xc9e82cd9f69d6150, + 0x892731ac9faf056e,0xbe311c083a225cd2, + 0xab70fe17c79ac6ca,0x6dbd630a48aaf406, + 0xd64d3d9db981787d,0x92cbbccdad5b108, + 0x85f0468293f0eb4e,0x25bbf56008c58ea5, + 0xa76c582338ed2621,0xaf2af2b80af6f24e, + 0xd1476e2c07286faa,0x1af5af660db4aee1, + 0x82cca4db847945ca,0x50d98d9fc890ed4d, + 0xa37fce126597973c,0xe50ff107bab528a0, + 0xcc5fc196fefd7d0c,0x1e53ed49a96272c8, + 0xff77b1fcbebcdc4f,0x25e8e89c13bb0f7a, + 0x9faacf3df73609b1,0x77b191618c54e9ac, + 0xc795830d75038c1d,0xd59df5b9ef6a2417, + 0xf97ae3d0d2446f25,0x4b0573286b44ad1d, + 0x9becce62836ac577,0x4ee367f9430aec32, + 0xc2e801fb244576d5,0x229c41f793cda73f, + 0xf3a20279ed56d48a,0x6b43527578c1110f, + 0x9845418c345644d6,0x830a13896b78aaa9, + 0xbe5691ef416bd60c,0x23cc986bc656d553, + 0xedec366b11c6cb8f,0x2cbfbe86b7ec8aa8, + 0x94b3a202eb1c3f39,0x7bf7d71432f3d6a9, + 0xb9e08a83a5e34f07,0xdaf5ccd93fb0cc53, + 0xe858ad248f5c22c9,0xd1b3400f8f9cff68, + 0x91376c36d99995be,0x23100809b9c21fa1, + 0xb58547448ffffb2d,0xabd40a0c2832a78a, + 0xe2e69915b3fff9f9,0x16c90c8f323f516c, + 0x8dd01fad907ffc3b,0xae3da7d97f6792e3, + 0xb1442798f49ffb4a,0x99cd11cfdf41779c, + 0xdd95317f31c7fa1d,0x40405643d711d583, + 0x8a7d3eef7f1cfc52,0x482835ea666b2572, + 0xad1c8eab5ee43b66,0xda3243650005eecf, + 0xd863b256369d4a40,0x90bed43e40076a82, + 0x873e4f75e2224e68,0x5a7744a6e804a291, + 0xa90de3535aaae202,0x711515d0a205cb36, + 0xd3515c2831559a83,0xd5a5b44ca873e03, + 0x8412d9991ed58091,0xe858790afe9486c2, + 0xa5178fff668ae0b6,0x626e974dbe39a872, + 0xce5d73ff402d98e3,0xfb0a3d212dc8128f, + 0x80fa687f881c7f8e,0x7ce66634bc9d0b99, + 0xa139029f6a239f72,0x1c1fffc1ebc44e80, + 0xc987434744ac874e,0xa327ffb266b56220, + 0xfbe9141915d7a922,0x4bf1ff9f0062baa8, + 0x9d71ac8fada6c9b5,0x6f773fc3603db4a9, + 0xc4ce17b399107c22,0xcb550fb4384d21d3, + 0xf6019da07f549b2b,0x7e2a53a146606a48, + 0x99c102844f94e0fb,0x2eda7444cbfc426d, + 0xc0314325637a1939,0xfa911155fefb5308, + 0xf03d93eebc589f88,0x793555ab7eba27ca, + 0x96267c7535b763b5,0x4bc1558b2f3458de, + 0xbbb01b9283253ca2,0x9eb1aaedfb016f16, + 0xea9c227723ee8bcb,0x465e15a979c1cadc, + 0x92a1958a7675175f,0xbfacd89ec191ec9, + 0xb749faed14125d36,0xcef980ec671f667b, + 0xe51c79a85916f484,0x82b7e12780e7401a, + 0x8f31cc0937ae58d2,0xd1b2ecb8b0908810, + 0xb2fe3f0b8599ef07,0x861fa7e6dcb4aa15, + 0xdfbdcece67006ac9,0x67a791e093e1d49a, + 0x8bd6a141006042bd,0xe0c8bb2c5c6d24e0, + 0xaecc49914078536d,0x58fae9f773886e18, + 0xda7f5bf590966848,0xaf39a475506a899e, + 0x888f99797a5e012d,0x6d8406c952429603, + 0xaab37fd7d8f58178,0xc8e5087ba6d33b83, + 0xd5605fcdcf32e1d6,0xfb1e4a9a90880a64, + 0x855c3be0a17fcd26,0x5cf2eea09a55067f, + 0xa6b34ad8c9dfc06f,0xf42faa48c0ea481e, + 0xd0601d8efc57b08b,0xf13b94daf124da26, + 0x823c12795db6ce57,0x76c53d08d6b70858, + 0xa2cb1717b52481ed,0x54768c4b0c64ca6e, + 0xcb7ddcdda26da268,0xa9942f5dcf7dfd09, + 0xfe5d54150b090b02,0xd3f93b35435d7c4c, + 0x9efa548d26e5a6e1,0xc47bc5014a1a6daf, + 0xc6b8e9b0709f109a,0x359ab6419ca1091b, + 0xf867241c8cc6d4c0,0xc30163d203c94b62, + 0x9b407691d7fc44f8,0x79e0de63425dcf1d, + 0xc21094364dfb5636,0x985915fc12f542e4, + 0xf294b943e17a2bc4,0x3e6f5b7b17b2939d, + 0x979cf3ca6cec5b5a,0xa705992ceecf9c42, + 0xbd8430bd08277231,0x50c6ff782a838353, + 0xece53cec4a314ebd,0xa4f8bf5635246428, + 0x940f4613ae5ed136,0x871b7795e136be99, + 0xb913179899f68584,0x28e2557b59846e3f, + 0xe757dd7ec07426e5,0x331aeada2fe589cf, + 0x9096ea6f3848984f,0x3ff0d2c85def7621, + 0xb4bca50b065abe63,0xfed077a756b53a9, + 0xe1ebce4dc7f16dfb,0xd3e8495912c62894, + 0x8d3360f09cf6e4bd,0x64712dd7abbbd95c, + 0xb080392cc4349dec,0xbd8d794d96aacfb3, + 0xdca04777f541c567,0xecf0d7a0fc5583a0, + 0x89e42caaf9491b60,0xf41686c49db57244, + 0xac5d37d5b79b6239,0x311c2875c522ced5, + 0xd77485cb25823ac7,0x7d633293366b828b, + 0x86a8d39ef77164bc,0xae5dff9c02033197, + 0xa8530886b54dbdeb,0xd9f57f830283fdfc, + 0xd267caa862a12d66,0xd072df63c324fd7b, + 0x8380dea93da4bc60,0x4247cb9e59f71e6d, + 0xa46116538d0deb78,0x52d9be85f074e608, + 0xcd795be870516656,0x67902e276c921f8b, + 0x806bd9714632dff6,0xba1cd8a3db53b6, + 0xa086cfcd97bf97f3,0x80e8a40eccd228a4, + 0xc8a883c0fdaf7df0,0x6122cd128006b2cd, + 0xfad2a4b13d1b5d6c,0x796b805720085f81, + 0x9cc3a6eec6311a63,0xcbe3303674053bb0, + 0xc3f490aa77bd60fc,0xbedbfc4411068a9c, + 0xf4f1b4d515acb93b,0xee92fb5515482d44, + 0x991711052d8bf3c5,0x751bdd152d4d1c4a, + 0xbf5cd54678eef0b6,0xd262d45a78a0635d, + 0xef340a98172aace4,0x86fb897116c87c34, + 0x9580869f0e7aac0e,0xd45d35e6ae3d4da0, + 0xbae0a846d2195712,0x8974836059cca109, + 0xe998d258869facd7,0x2bd1a438703fc94b, + 0x91ff83775423cc06,0x7b6306a34627ddcf, + 0xb67f6455292cbf08,0x1a3bc84c17b1d542, + 0xe41f3d6a7377eeca,0x20caba5f1d9e4a93, + 0x8e938662882af53e,0x547eb47b7282ee9c, + 0xb23867fb2a35b28d,0xe99e619a4f23aa43, + 0xdec681f9f4c31f31,0x6405fa00e2ec94d4, + 0x8b3c113c38f9f37e,0xde83bc408dd3dd04, + 0xae0b158b4738705e,0x9624ab50b148d445, + 0xd98ddaee19068c76,0x3badd624dd9b0957, + 0x87f8a8d4cfa417c9,0xe54ca5d70a80e5d6, + 0xa9f6d30a038d1dbc,0x5e9fcf4ccd211f4c, + 0xd47487cc8470652b,0x7647c3200069671f, + 0x84c8d4dfd2c63f3b,0x29ecd9f40041e073, + 0xa5fb0a17c777cf09,0xf468107100525890, + 0xcf79cc9db955c2cc,0x7182148d4066eeb4, + 0x81ac1fe293d599bf,0xc6f14cd848405530, + 0xa21727db38cb002f,0xb8ada00e5a506a7c, + 0xca9cf1d206fdc03b,0xa6d90811f0e4851c, + 0xfd442e4688bd304a,0x908f4a166d1da663, + 0x9e4a9cec15763e2e,0x9a598e4e043287fe, + 0xc5dd44271ad3cdba,0x40eff1e1853f29fd, + 0xf7549530e188c128,0xd12bee59e68ef47c, + 0x9a94dd3e8cf578b9,0x82bb74f8301958ce, + 0xc13a148e3032d6e7,0xe36a52363c1faf01, + 0xf18899b1bc3f8ca1,0xdc44e6c3cb279ac1, + 0x96f5600f15a7b7e5,0x29ab103a5ef8c0b9, + 0xbcb2b812db11a5de,0x7415d448f6b6f0e7, + 0xebdf661791d60f56,0x111b495b3464ad21, + 0x936b9fcebb25c995,0xcab10dd900beec34, + 0xb84687c269ef3bfb,0x3d5d514f40eea742, + 0xe65829b3046b0afa,0xcb4a5a3112a5112, + 0x8ff71a0fe2c2e6dc,0x47f0e785eaba72ab, + 0xb3f4e093db73a093,0x59ed216765690f56, + 0xe0f218b8d25088b8,0x306869c13ec3532c, + 0x8c974f7383725573,0x1e414218c73a13fb, + 0xafbd2350644eeacf,0xe5d1929ef90898fa, + 0xdbac6c247d62a583,0xdf45f746b74abf39, + 0x894bc396ce5da772,0x6b8bba8c328eb783, + 0xab9eb47c81f5114f,0x66ea92f3f326564, + 0xd686619ba27255a2,0xc80a537b0efefebd, + 0x8613fd0145877585,0xbd06742ce95f5f36, + 0xa798fc4196e952e7,0x2c48113823b73704, + 0xd17f3b51fca3a7a0,0xf75a15862ca504c5, + 0x82ef85133de648c4,0x9a984d73dbe722fb, + 0xa3ab66580d5fdaf5,0xc13e60d0d2e0ebba, + 0xcc963fee10b7d1b3,0x318df905079926a8, + 0xffbbcfe994e5c61f,0xfdf17746497f7052, + 0x9fd561f1fd0f9bd3,0xfeb6ea8bedefa633, + 0xc7caba6e7c5382c8,0xfe64a52ee96b8fc0, + 0xf9bd690a1b68637b,0x3dfdce7aa3c673b0, + 0x9c1661a651213e2d,0x6bea10ca65c084e, + 0xc31bfa0fe5698db8,0x486e494fcff30a62, + 0xf3e2f893dec3f126,0x5a89dba3c3efccfa, + 0x986ddb5c6b3a76b7,0xf89629465a75e01c, + 0xbe89523386091465,0xf6bbb397f1135823, + 0xee2ba6c0678b597f,0x746aa07ded582e2c, + 0x94db483840b717ef,0xa8c2a44eb4571cdc, + 0xba121a4650e4ddeb,0x92f34d62616ce413, + 0xe896a0d7e51e1566,0x77b020baf9c81d17, + 0x915e2486ef32cd60,0xace1474dc1d122e, + 0xb5b5ada8aaff80b8,0xd819992132456ba, + 0xe3231912d5bf60e6,0x10e1fff697ed6c69, + 0x8df5efabc5979c8f,0xca8d3ffa1ef463c1, + 0xb1736b96b6fd83b3,0xbd308ff8a6b17cb2, + 0xddd0467c64bce4a0,0xac7cb3f6d05ddbde, + 0x8aa22c0dbef60ee4,0x6bcdf07a423aa96b, + 0xad4ab7112eb3929d,0x86c16c98d2c953c6, + 0xd89d64d57a607744,0xe871c7bf077ba8b7, + 0x87625f056c7c4a8b,0x11471cd764ad4972, + 0xa93af6c6c79b5d2d,0xd598e40d3dd89bcf, + 0xd389b47879823479,0x4aff1d108d4ec2c3, + 0x843610cb4bf160cb,0xcedf722a585139ba, + 0xa54394fe1eedb8fe,0xc2974eb4ee658828, + 0xce947a3da6a9273e,0x733d226229feea32, + 0x811ccc668829b887,0x806357d5a3f525f, + 0xa163ff802a3426a8,0xca07c2dcb0cf26f7, + 0xc9bcff6034c13052,0xfc89b393dd02f0b5, + 0xfc2c3f3841f17c67,0xbbac2078d443ace2, + 0x9d9ba7832936edc0,0xd54b944b84aa4c0d, + 0xc5029163f384a931,0xa9e795e65d4df11, + 0xf64335bcf065d37d,0x4d4617b5ff4a16d5, + 0x99ea0196163fa42e,0x504bced1bf8e4e45, + 0xc06481fb9bcf8d39,0xe45ec2862f71e1d6, + 0xf07da27a82c37088,0x5d767327bb4e5a4c, + 0x964e858c91ba2655,0x3a6a07f8d510f86f, + 0xbbe226efb628afea,0x890489f70a55368b, + 0xeadab0aba3b2dbe5,0x2b45ac74ccea842e, + 0x92c8ae6b464fc96f,0x3b0b8bc90012929d, + 0xb77ada0617e3bbcb,0x9ce6ebb40173744, + 0xe55990879ddcaabd,0xcc420a6a101d0515, + 0x8f57fa54c2a9eab6,0x9fa946824a12232d, + 0xb32df8e9f3546564,0x47939822dc96abf9, + 0xdff9772470297ebd,0x59787e2b93bc56f7, + 0x8bfbea76c619ef36,0x57eb4edb3c55b65a, + 0xaefae51477a06b03,0xede622920b6b23f1, + 0xdab99e59958885c4,0xe95fab368e45eced, + 0x88b402f7fd75539b,0x11dbcb0218ebb414, + 0xaae103b5fcd2a881,0xd652bdc29f26a119, + 0xd59944a37c0752a2,0x4be76d3346f0495f, + 0x857fcae62d8493a5,0x6f70a4400c562ddb, + 0xa6dfbd9fb8e5b88e,0xcb4ccd500f6bb952, + 0xd097ad07a71f26b2,0x7e2000a41346a7a7, + 0x825ecc24c873782f,0x8ed400668c0c28c8, + 0xa2f67f2dfa90563b,0x728900802f0f32fa, + 0xcbb41ef979346bca,0x4f2b40a03ad2ffb9, + 0xfea126b7d78186bc,0xe2f610c84987bfa8, + 0x9f24b832e6b0f436,0xdd9ca7d2df4d7c9, + 0xc6ede63fa05d3143,0x91503d1c79720dbb, + 0xf8a95fcf88747d94,0x75a44c6397ce912a, + 0x9b69dbe1b548ce7c,0xc986afbe3ee11aba, + 0xc24452da229b021b,0xfbe85badce996168, + 0xf2d56790ab41c2a2,0xfae27299423fb9c3, + 0x97c560ba6b0919a5,0xdccd879fc967d41a, + 0xbdb6b8e905cb600f,0x5400e987bbc1c920, + 0xed246723473e3813,0x290123e9aab23b68, + 0x9436c0760c86e30b,0xf9a0b6720aaf6521, + 0xb94470938fa89bce,0xf808e40e8d5b3e69, + 0xe7958cb87392c2c2,0xb60b1d1230b20e04, + 0x90bd77f3483bb9b9,0xb1c6f22b5e6f48c2, + 0xb4ecd5f01a4aa828,0x1e38aeb6360b1af3, + 0xe2280b6c20dd5232,0x25c6da63c38de1b0, + 0x8d590723948a535f,0x579c487e5a38ad0e, + 0xb0af48ec79ace837,0x2d835a9df0c6d851, + 0xdcdb1b2798182244,0xf8e431456cf88e65, + 0x8a08f0f8bf0f156b,0x1b8e9ecb641b58ff, + 0xac8b2d36eed2dac5,0xe272467e3d222f3f, + 0xd7adf884aa879177,0x5b0ed81dcc6abb0f, + 0x86ccbb52ea94baea,0x98e947129fc2b4e9, + 0xa87fea27a539e9a5,0x3f2398d747b36224, + 0xd29fe4b18e88640e,0x8eec7f0d19a03aad, + 0x83a3eeeef9153e89,0x1953cf68300424ac, + 0xa48ceaaab75a8e2b,0x5fa8c3423c052dd7, + 0xcdb02555653131b6,0x3792f412cb06794d, + 0x808e17555f3ebf11,0xe2bbd88bbee40bd0, + 0xa0b19d2ab70e6ed6,0x5b6aceaeae9d0ec4, + 0xc8de047564d20a8b,0xf245825a5a445275, + 0xfb158592be068d2e,0xeed6e2f0f0d56712, + 0x9ced737bb6c4183d,0x55464dd69685606b, + 0xc428d05aa4751e4c,0xaa97e14c3c26b886, + 0xf53304714d9265df,0xd53dd99f4b3066a8, + 0x993fe2c6d07b7fab,0xe546a8038efe4029, + 0xbf8fdb78849a5f96,0xde98520472bdd033, + 0xef73d256a5c0f77c,0x963e66858f6d4440, + 0x95a8637627989aad,0xdde7001379a44aa8, + 0xbb127c53b17ec159,0x5560c018580d5d52, + 0xe9d71b689dde71af,0xaab8f01e6e10b4a6, + 0x9226712162ab070d,0xcab3961304ca70e8, + 0xb6b00d69bb55c8d1,0x3d607b97c5fd0d22, + 0xe45c10c42a2b3b05,0x8cb89a7db77c506a, + 0x8eb98a7a9a5b04e3,0x77f3608e92adb242, + 0xb267ed1940f1c61c,0x55f038b237591ed3, + 0xdf01e85f912e37a3,0x6b6c46dec52f6688, + 0x8b61313bbabce2c6,0x2323ac4b3b3da015, + 0xae397d8aa96c1b77,0xabec975e0a0d081a, + 0xd9c7dced53c72255,0x96e7bd358c904a21, + 0x881cea14545c7575,0x7e50d64177da2e54, + 0xaa242499697392d2,0xdde50bd1d5d0b9e9, + 0xd4ad2dbfc3d07787,0x955e4ec64b44e864, + 0x84ec3c97da624ab4,0xbd5af13bef0b113e, + 0xa6274bbdd0fadd61,0xecb1ad8aeacdd58e, + 0xcfb11ead453994ba,0x67de18eda5814af2, + 0x81ceb32c4b43fcf4,0x80eacf948770ced7, + 0xa2425ff75e14fc31,0xa1258379a94d028d, + 0xcad2f7f5359a3b3e,0x96ee45813a04330, + 0xfd87b5f28300ca0d,0x8bca9d6e188853fc, + 0x9e74d1b791e07e48,0x775ea264cf55347e, + 0xc612062576589dda,0x95364afe032a81a0, + 0xf79687aed3eec551,0x3a83ddbd83f52210, + 0x9abe14cd44753b52,0xc4926a9672793580, + 0xc16d9a0095928a27,0x75b7053c0f178400, + 0xf1c90080baf72cb1,0x5324c68b12dd6800, + 0x971da05074da7bee,0xd3f6fc16ebca8000, + 0xbce5086492111aea,0x88f4bb1ca6bd0000, + 0xec1e4a7db69561a5,0x2b31e9e3d0700000, + 0x9392ee8e921d5d07,0x3aff322e62600000, + 0xb877aa3236a4b449,0x9befeb9fad487c3, + 0xe69594bec44de15b,0x4c2ebe687989a9b4, + 0x901d7cf73ab0acd9,0xf9d37014bf60a11, + 0xb424dc35095cd80f,0x538484c19ef38c95, + 0xe12e13424bb40e13,0x2865a5f206b06fba, + 0x8cbccc096f5088cb,0xf93f87b7442e45d4, + 0xafebff0bcb24aafe,0xf78f69a51539d749, + 0xdbe6fecebdedd5be,0xb573440e5a884d1c, + 0x89705f4136b4a597,0x31680a88f8953031, + 0xabcc77118461cefc,0xfdc20d2b36ba7c3e, + 0xd6bf94d5e57a42bc,0x3d32907604691b4d, + 0x8637bd05af6c69b5,0xa63f9a49c2c1b110, + 0xa7c5ac471b478423,0xfcf80dc33721d54, + 0xd1b71758e219652b,0xd3c36113404ea4a9, + 0x83126e978d4fdf3b,0x645a1cac083126ea, + 0xa3d70a3d70a3d70a,0x3d70a3d70a3d70a4, + 0xcccccccccccccccc,0xcccccccccccccccd, + 0x8000000000000000,0x0, + 0xa000000000000000,0x0, + 0xc800000000000000,0x0, + 0xfa00000000000000,0x0, + 0x9c40000000000000,0x0, + 0xc350000000000000,0x0, + 0xf424000000000000,0x0, + 0x9896800000000000,0x0, + 0xbebc200000000000,0x0, + 0xee6b280000000000,0x0, + 0x9502f90000000000,0x0, + 0xba43b74000000000,0x0, + 0xe8d4a51000000000,0x0, + 0x9184e72a00000000,0x0, + 0xb5e620f480000000,0x0, + 0xe35fa931a0000000,0x0, + 0x8e1bc9bf04000000,0x0, + 0xb1a2bc2ec5000000,0x0, + 0xde0b6b3a76400000,0x0, + 0x8ac7230489e80000,0x0, + 0xad78ebc5ac620000,0x0, + 0xd8d726b7177a8000,0x0, + 0x878678326eac9000,0x0, + 0xa968163f0a57b400,0x0, + 0xd3c21bcecceda100,0x0, + 0x84595161401484a0,0x0, + 0xa56fa5b99019a5c8,0x0, + 0xcecb8f27f4200f3a,0x0, + 0x813f3978f8940984,0x4000000000000000, + 0xa18f07d736b90be5,0x5000000000000000, + 0xc9f2c9cd04674ede,0xa400000000000000, + 0xfc6f7c4045812296,0x4d00000000000000, + 0x9dc5ada82b70b59d,0xf020000000000000, + 0xc5371912364ce305,0x6c28000000000000, + 0xf684df56c3e01bc6,0xc732000000000000, + 0x9a130b963a6c115c,0x3c7f400000000000, + 0xc097ce7bc90715b3,0x4b9f100000000000, + 0xf0bdc21abb48db20,0x1e86d40000000000, + 0x96769950b50d88f4,0x1314448000000000, + 0xbc143fa4e250eb31,0x17d955a000000000, + 0xeb194f8e1ae525fd,0x5dcfab0800000000, + 0x92efd1b8d0cf37be,0x5aa1cae500000000, + 0xb7abc627050305ad,0xf14a3d9e40000000, + 0xe596b7b0c643c719,0x6d9ccd05d0000000, + 0x8f7e32ce7bea5c6f,0xe4820023a2000000, + 0xb35dbf821ae4f38b,0xdda2802c8a800000, + 0xe0352f62a19e306e,0xd50b2037ad200000, + 0x8c213d9da502de45,0x4526f422cc340000, + 0xaf298d050e4395d6,0x9670b12b7f410000, + 0xdaf3f04651d47b4c,0x3c0cdd765f114000, + 0x88d8762bf324cd0f,0xa5880a69fb6ac800, + 0xab0e93b6efee0053,0x8eea0d047a457a00, + 0xd5d238a4abe98068,0x72a4904598d6d880, + 0x85a36366eb71f041,0x47a6da2b7f864750, + 0xa70c3c40a64e6c51,0x999090b65f67d924, + 0xd0cf4b50cfe20765,0xfff4b4e3f741cf6d, + 0x82818f1281ed449f,0xbff8f10e7a8921a4, + 0xa321f2d7226895c7,0xaff72d52192b6a0d, + 0xcbea6f8ceb02bb39,0x9bf4f8a69f764490, + 0xfee50b7025c36a08,0x2f236d04753d5b4, + 0x9f4f2726179a2245,0x1d762422c946590, + 0xc722f0ef9d80aad6,0x424d3ad2b7b97ef5, + 0xf8ebad2b84e0d58b,0xd2e0898765a7deb2, + 0x9b934c3b330c8577,0x63cc55f49f88eb2f, + 0xc2781f49ffcfa6d5,0x3cbf6b71c76b25fb, + 0xf316271c7fc3908a,0x8bef464e3945ef7a, + 0x97edd871cfda3a56,0x97758bf0e3cbb5ac, + 0xbde94e8e43d0c8ec,0x3d52eeed1cbea317, + 0xed63a231d4c4fb27,0x4ca7aaa863ee4bdd, + 0x945e455f24fb1cf8,0x8fe8caa93e74ef6a, + 0xb975d6b6ee39e436,0xb3e2fd538e122b44, + 0xe7d34c64a9c85d44,0x60dbbca87196b616, + 0x90e40fbeea1d3a4a,0xbc8955e946fe31cd, + 0xb51d13aea4a488dd,0x6babab6398bdbe41, + 0xe264589a4dcdab14,0xc696963c7eed2dd1, + 0x8d7eb76070a08aec,0xfc1e1de5cf543ca2, + 0xb0de65388cc8ada8,0x3b25a55f43294bcb, + 0xdd15fe86affad912,0x49ef0eb713f39ebe, + 0x8a2dbf142dfcc7ab,0x6e3569326c784337, + 0xacb92ed9397bf996,0x49c2c37f07965404, + 0xd7e77a8f87daf7fb,0xdc33745ec97be906, + 0x86f0ac99b4e8dafd,0x69a028bb3ded71a3, + 0xa8acd7c0222311bc,0xc40832ea0d68ce0c, + 0xd2d80db02aabd62b,0xf50a3fa490c30190, + 0x83c7088e1aab65db,0x792667c6da79e0fa, + 0xa4b8cab1a1563f52,0x577001b891185938, + 0xcde6fd5e09abcf26,0xed4c0226b55e6f86, + 0x80b05e5ac60b6178,0x544f8158315b05b4, + 0xa0dc75f1778e39d6,0x696361ae3db1c721, + 0xc913936dd571c84c,0x3bc3a19cd1e38e9, + 0xfb5878494ace3a5f,0x4ab48a04065c723, + 0x9d174b2dcec0e47b,0x62eb0d64283f9c76, + 0xc45d1df942711d9a,0x3ba5d0bd324f8394, + 0xf5746577930d6500,0xca8f44ec7ee36479, + 0x9968bf6abbe85f20,0x7e998b13cf4e1ecb, + 0xbfc2ef456ae276e8,0x9e3fedd8c321a67e, + 0xefb3ab16c59b14a2,0xc5cfe94ef3ea101e, + 0x95d04aee3b80ece5,0xbba1f1d158724a12, + 0xbb445da9ca61281f,0x2a8a6e45ae8edc97, + 0xea1575143cf97226,0xf52d09d71a3293bd, + 0x924d692ca61be758,0x593c2626705f9c56, + 0xb6e0c377cfa2e12e,0x6f8b2fb00c77836c, + 0xe498f455c38b997a,0xb6dfb9c0f956447, + 0x8edf98b59a373fec,0x4724bd4189bd5eac, + 0xb2977ee300c50fe7,0x58edec91ec2cb657, + 0xdf3d5e9bc0f653e1,0x2f2967b66737e3ed, + 0x8b865b215899f46c,0xbd79e0d20082ee74, + 0xae67f1e9aec07187,0xecd8590680a3aa11, + 0xda01ee641a708de9,0xe80e6f4820cc9495, + 0x884134fe908658b2,0x3109058d147fdcdd, + 0xaa51823e34a7eede,0xbd4b46f0599fd415, + 0xd4e5e2cdc1d1ea96,0x6c9e18ac7007c91a, + 0x850fadc09923329e,0x3e2cf6bc604ddb0, + 0xa6539930bf6bff45,0x84db8346b786151c, + 0xcfe87f7cef46ff16,0xe612641865679a63, + 0x81f14fae158c5f6e,0x4fcb7e8f3f60c07e, + 0xa26da3999aef7749,0xe3be5e330f38f09d, + 0xcb090c8001ab551c,0x5cadf5bfd3072cc5, + 0xfdcb4fa002162a63,0x73d9732fc7c8f7f6, + 0x9e9f11c4014dda7e,0x2867e7fddcdd9afa, + 0xc646d63501a1511d,0xb281e1fd541501b8, + 0xf7d88bc24209a565,0x1f225a7ca91a4226, + 0x9ae757596946075f,0x3375788de9b06958, + 0xc1a12d2fc3978937,0x52d6b1641c83ae, + 0xf209787bb47d6b84,0xc0678c5dbd23a49a, + 0x9745eb4d50ce6332,0xf840b7ba963646e0, + 0xbd176620a501fbff,0xb650e5a93bc3d898, + 0xec5d3fa8ce427aff,0xa3e51f138ab4cebe, + 0x93ba47c980e98cdf,0xc66f336c36b10137, + 0xb8a8d9bbe123f017,0xb80b0047445d4184, + 0xe6d3102ad96cec1d,0xa60dc059157491e5, + 0x9043ea1ac7e41392,0x87c89837ad68db2f, + 0xb454e4a179dd1877,0x29babe4598c311fb, + 0xe16a1dc9d8545e94,0xf4296dd6fef3d67a, + 0x8ce2529e2734bb1d,0x1899e4a65f58660c, + 0xb01ae745b101e9e4,0x5ec05dcff72e7f8f, + 0xdc21a1171d42645d,0x76707543f4fa1f73, + 0x899504ae72497eba,0x6a06494a791c53a8, + 0xabfa45da0edbde69,0x487db9d17636892, + 0xd6f8d7509292d603,0x45a9d2845d3c42b6, + 0x865b86925b9bc5c2,0xb8a2392ba45a9b2, + 0xa7f26836f282b732,0x8e6cac7768d7141e, + 0xd1ef0244af2364ff,0x3207d795430cd926, + 0x8335616aed761f1f,0x7f44e6bd49e807b8, + 0xa402b9c5a8d3a6e7,0x5f16206c9c6209a6, + 0xcd036837130890a1,0x36dba887c37a8c0f, + 0x802221226be55a64,0xc2494954da2c9789, + 0xa02aa96b06deb0fd,0xf2db9baa10b7bd6c, + 0xc83553c5c8965d3d,0x6f92829494e5acc7, + 0xfa42a8b73abbf48c,0xcb772339ba1f17f9, + 0x9c69a97284b578d7,0xff2a760414536efb, + 0xc38413cf25e2d70d,0xfef5138519684aba, + 0xf46518c2ef5b8cd1,0x7eb258665fc25d69, + 0x98bf2f79d5993802,0xef2f773ffbd97a61, + 0xbeeefb584aff8603,0xaafb550ffacfd8fa, + 0xeeaaba2e5dbf6784,0x95ba2a53f983cf38, + 0x952ab45cfa97a0b2,0xdd945a747bf26183, + 0xba756174393d88df,0x94f971119aeef9e4, + 0xe912b9d1478ceb17,0x7a37cd5601aab85d, + 0x91abb422ccb812ee,0xac62e055c10ab33a, + 0xb616a12b7fe617aa,0x577b986b314d6009, + 0xe39c49765fdf9d94,0xed5a7e85fda0b80b, + 0x8e41ade9fbebc27d,0x14588f13be847307, + 0xb1d219647ae6b31c,0x596eb2d8ae258fc8, + 0xde469fbd99a05fe3,0x6fca5f8ed9aef3bb, + 0x8aec23d680043bee,0x25de7bb9480d5854, + 0xada72ccc20054ae9,0xaf561aa79a10ae6a, + 0xd910f7ff28069da4,0x1b2ba1518094da04, + 0x87aa9aff79042286,0x90fb44d2f05d0842, + 0xa99541bf57452b28,0x353a1607ac744a53, + 0xd3fa922f2d1675f2,0x42889b8997915ce8, + 0x847c9b5d7c2e09b7,0x69956135febada11, + 0xa59bc234db398c25,0x43fab9837e699095, + 0xcf02b2c21207ef2e,0x94f967e45e03f4bb, + 0x8161afb94b44f57d,0x1d1be0eebac278f5, + 0xa1ba1ba79e1632dc,0x6462d92a69731732, + 0xca28a291859bbf93,0x7d7b8f7503cfdcfe, + 0xfcb2cb35e702af78,0x5cda735244c3d43e, + 0x9defbf01b061adab,0x3a0888136afa64a7, + 0xc56baec21c7a1916,0x88aaa1845b8fdd0, + 0xf6c69a72a3989f5b,0x8aad549e57273d45, + 0x9a3c2087a63f6399,0x36ac54e2f678864b, + 0xc0cb28a98fcf3c7f,0x84576a1bb416a7dd, + 0xf0fdf2d3f3c30b9f,0x656d44a2a11c51d5, + 0x969eb7c47859e743,0x9f644ae5a4b1b325, + 0xbc4665b596706114,0x873d5d9f0dde1fee, + 0xeb57ff22fc0c7959,0xa90cb506d155a7ea, + 0x9316ff75dd87cbd8,0x9a7f12442d588f2, + 0xb7dcbf5354e9bece,0xc11ed6d538aeb2f, + 0xe5d3ef282a242e81,0x8f1668c8a86da5fa, + 0x8fa475791a569d10,0xf96e017d694487bc, + 0xb38d92d760ec4455,0x37c981dcc395a9ac, + 0xe070f78d3927556a,0x85bbe253f47b1417, + 0x8c469ab843b89562,0x93956d7478ccec8e, + 0xaf58416654a6babb,0x387ac8d1970027b2, + 0xdb2e51bfe9d0696a,0x6997b05fcc0319e, + 0x88fcf317f22241e2,0x441fece3bdf81f03, + 0xab3c2fddeeaad25a,0xd527e81cad7626c3, + 0xd60b3bd56a5586f1,0x8a71e223d8d3b074, + 0x85c7056562757456,0xf6872d5667844e49, + 0xa738c6bebb12d16c,0xb428f8ac016561db, + 0xd106f86e69d785c7,0xe13336d701beba52, + 0x82a45b450226b39c,0xecc0024661173473, + 0xa34d721642b06084,0x27f002d7f95d0190, + 0xcc20ce9bd35c78a5,0x31ec038df7b441f4, + 0xff290242c83396ce,0x7e67047175a15271, + 0x9f79a169bd203e41,0xf0062c6e984d386, + 0xc75809c42c684dd1,0x52c07b78a3e60868, + 0xf92e0c3537826145,0xa7709a56ccdf8a82, + 0x9bbcc7a142b17ccb,0x88a66076400bb691, + 0xc2abf989935ddbfe,0x6acff893d00ea435, + 0xf356f7ebf83552fe,0x583f6b8c4124d43, + 0x98165af37b2153de,0xc3727a337a8b704a, + 0xbe1bf1b059e9a8d6,0x744f18c0592e4c5c, + 0xeda2ee1c7064130c,0x1162def06f79df73, + 0x9485d4d1c63e8be7,0x8addcb5645ac2ba8, + 0xb9a74a0637ce2ee1,0x6d953e2bd7173692, + 0xe8111c87c5c1ba99,0xc8fa8db6ccdd0437, + 0x910ab1d4db9914a0,0x1d9c9892400a22a2, + 0xb54d5e4a127f59c8,0x2503beb6d00cab4b, + 0xe2a0b5dc971f303a,0x2e44ae64840fd61d, + 0x8da471a9de737e24,0x5ceaecfed289e5d2, + 0xb10d8e1456105dad,0x7425a83e872c5f47, + 0xdd50f1996b947518,0xd12f124e28f77719, + 0x8a5296ffe33cc92f,0x82bd6b70d99aaa6f, + 0xace73cbfdc0bfb7b,0x636cc64d1001550b, + 0xd8210befd30efa5a,0x3c47f7e05401aa4e, + 0x8714a775e3e95c78,0x65acfaec34810a71, + 0xa8d9d1535ce3b396,0x7f1839a741a14d0d, + 0xd31045a8341ca07c,0x1ede48111209a050, + 0x83ea2b892091e44d,0x934aed0aab460432, + 0xa4e4b66b68b65d60,0xf81da84d5617853f, + 0xce1de40642e3f4b9,0x36251260ab9d668e, + 0x80d2ae83e9ce78f3,0xc1d72b7c6b426019, + 0xa1075a24e4421730,0xb24cf65b8612f81f, + 0xc94930ae1d529cfc,0xdee033f26797b627, + 0xfb9b7cd9a4a7443c,0x169840ef017da3b1, + 0x9d412e0806e88aa5,0x8e1f289560ee864e, + 0xc491798a08a2ad4e,0xf1a6f2bab92a27e2, + 0xf5b5d7ec8acb58a2,0xae10af696774b1db, + 0x9991a6f3d6bf1765,0xacca6da1e0a8ef29, + 0xbff610b0cc6edd3f,0x17fd090a58d32af3, + 0xeff394dcff8a948e,0xddfc4b4cef07f5b0, + 0x95f83d0a1fb69cd9,0x4abdaf101564f98e, + 0xbb764c4ca7a4440f,0x9d6d1ad41abe37f1, + 0xea53df5fd18d5513,0x84c86189216dc5ed, + 0x92746b9be2f8552c,0x32fd3cf5b4e49bb4, + 0xb7118682dbb66a77,0x3fbc8c33221dc2a1, + 0xe4d5e82392a40515,0xfabaf3feaa5334a, + 0x8f05b1163ba6832d,0x29cb4d87f2a7400e, + 0xb2c71d5bca9023f8,0x743e20e9ef511012, + 0xdf78e4b2bd342cf6,0x914da9246b255416, + 0x8bab8eefb6409c1a,0x1ad089b6c2f7548e, + 0xae9672aba3d0c320,0xa184ac2473b529b1, + 0xda3c0f568cc4f3e8,0xc9e5d72d90a2741e, + 0x8865899617fb1871,0x7e2fa67c7a658892, + 0xaa7eebfb9df9de8d,0xddbb901b98feeab7, + 0xd51ea6fa85785631,0x552a74227f3ea565, + 0x8533285c936b35de,0xd53a88958f87275f, + 0xa67ff273b8460356,0x8a892abaf368f137, + 0xd01fef10a657842c,0x2d2b7569b0432d85, + 0x8213f56a67f6b29b,0x9c3b29620e29fc73, + 0xa298f2c501f45f42,0x8349f3ba91b47b8f, + 0xcb3f2f7642717713,0x241c70a936219a73, + 0xfe0efb53d30dd4d7,0xed238cd383aa0110, + 0x9ec95d1463e8a506,0xf4363804324a40aa, + 0xc67bb4597ce2ce48,0xb143c6053edcd0d5, + 0xf81aa16fdc1b81da,0xdd94b7868e94050a, + 0x9b10a4e5e9913128,0xca7cf2b4191c8326, + 0xc1d4ce1f63f57d72,0xfd1c2f611f63a3f0, + 0xf24a01a73cf2dccf,0xbc633b39673c8cec, + 0x976e41088617ca01,0xd5be0503e085d813, + 0xbd49d14aa79dbc82,0x4b2d8644d8a74e18, + 0xec9c459d51852ba2,0xddf8e7d60ed1219e, + 0x93e1ab8252f33b45,0xcabb90e5c942b503, + 0xb8da1662e7b00a17,0x3d6a751f3b936243, + 0xe7109bfba19c0c9d,0xcc512670a783ad4, + 0x906a617d450187e2,0x27fb2b80668b24c5, + 0xb484f9dc9641e9da,0xb1f9f660802dedf6, + 0xe1a63853bbd26451,0x5e7873f8a0396973, + 0x8d07e33455637eb2,0xdb0b487b6423e1e8, + 0xb049dc016abc5e5f,0x91ce1a9a3d2cda62, + 0xdc5c5301c56b75f7,0x7641a140cc7810fb, + 0x89b9b3e11b6329ba,0xa9e904c87fcb0a9d, + 0xac2820d9623bf429,0x546345fa9fbdcd44, + 0xd732290fbacaf133,0xa97c177947ad4095, + 0x867f59a9d4bed6c0,0x49ed8eabcccc485d, + 0xa81f301449ee8c70,0x5c68f256bfff5a74, + 0xd226fc195c6a2f8c,0x73832eec6fff3111, + 0x83585d8fd9c25db7,0xc831fd53c5ff7eab, + 0xa42e74f3d032f525,0xba3e7ca8b77f5e55, + 0xcd3a1230c43fb26f,0x28ce1bd2e55f35eb, + 0x80444b5e7aa7cf85,0x7980d163cf5b81b3, + 0xa0555e361951c366,0xd7e105bcc332621f, + 0xc86ab5c39fa63440,0x8dd9472bf3fefaa7, + 0xfa856334878fc150,0xb14f98f6f0feb951, + 0x9c935e00d4b9d8d2,0x6ed1bf9a569f33d3, + 0xc3b8358109e84f07,0xa862f80ec4700c8, + 0xf4a642e14c6262c8,0xcd27bb612758c0fa, + 0x98e7e9cccfbd7dbd,0x8038d51cb897789c, + 0xbf21e44003acdd2c,0xe0470a63e6bd56c3, + 0xeeea5d5004981478,0x1858ccfce06cac74, + 0x95527a5202df0ccb,0xf37801e0c43ebc8, + 0xbaa718e68396cffd,0xd30560258f54e6ba, + 0xe950df20247c83fd,0x47c6b82ef32a2069, + 0x91d28b7416cdd27e,0x4cdc331d57fa5441, + 0xb6472e511c81471d,0xe0133fe4adf8e952, + 0xe3d8f9e563a198e5,0x58180fddd97723a6, + 0x8e679c2f5e44ff8f,0x570f09eaa7ea7648,}; + +#endif // SIMDJSON_SRC_NUMBERPARSING_TABLES_CPP +/* end file internal/numberparsing_tables.cpp */ +/* including internal/simdprune_tables.cpp: #include */ +/* begin file internal/simdprune_tables.cpp */ +#ifndef SIMDJSON_SRC_SIMDPRUNE_TABLES_CPP +#define SIMDJSON_SRC_SIMDPRUNE_TABLES_CPP + +/* including simdjson/implementation_detection.h: #include */ +/* begin file simdjson/implementation_detection.h */ +#ifndef SIMDJSON_IMPLEMENTATION_DETECTION_H +#define SIMDJSON_IMPLEMENTATION_DETECTION_H + +/* skipped duplicate #include "simdjson/base.h" */ + +// 0 is reserved, because undefined SIMDJSON_IMPLEMENTATION equals 0 in preprocessor macros. +#define SIMDJSON_IMPLEMENTATION_ID_arm64 1 +#define SIMDJSON_IMPLEMENTATION_ID_fallback 2 +#define SIMDJSON_IMPLEMENTATION_ID_haswell 3 +#define SIMDJSON_IMPLEMENTATION_ID_icelake 4 +#define SIMDJSON_IMPLEMENTATION_ID_ppc64 5 +#define SIMDJSON_IMPLEMENTATION_ID_westmere 6 + +#define SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL) SIMDJSON_CAT(SIMDJSON_IMPLEMENTATION_ID_, IMPL) +#define SIMDJSON_IMPLEMENTATION_ID SIMDJSON_IMPLEMENTATION_ID_FOR(SIMDJSON_IMPLEMENTATION) + +#define SIMDJSON_IMPLEMENTATION_IS(IMPL) SIMDJSON_IMPLEMENTATION_ID == SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL) + +// +// First, figure out which implementations can be run. Doing it here makes it so we don't have to worry about the order +// in which we include them. +// + +#ifndef SIMDJSON_IMPLEMENTATION_ARM64 +#define SIMDJSON_IMPLEMENTATION_ARM64 (SIMDJSON_IS_ARM64) +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_ARM64 SIMDJSON_IMPLEMENTATION_ARM64 && SIMDJSON_IS_ARM64 + +// Default Icelake to on if this is x86-64. Even if we're not compiled for it, it could be selected +// at runtime. +#ifndef SIMDJSON_IMPLEMENTATION_ICELAKE +#define SIMDJSON_IMPLEMENTATION_ICELAKE ((SIMDJSON_IS_X86_64) && (SIMDJSON_AVX512_ALLOWED) && (SIMDJSON_COMPILER_SUPPORTS_VBMI2)) +#endif + +#ifdef _MSC_VER +// To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see +// https://github.com/simdjson/simdjson/issues/1247 +#define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__)) +#else +#define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__)) +#endif + +// Default Haswell to on if this is x86-64. Even if we're not compiled for it, it could be selected +// at runtime. +#ifndef SIMDJSON_IMPLEMENTATION_HASWELL +#if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +// if icelake is always available, never enable haswell. +#define SIMDJSON_IMPLEMENTATION_HASWELL 0 +#else +#define SIMDJSON_IMPLEMENTATION_HASWELL SIMDJSON_IS_X86_64 +#endif +#endif +#ifdef _MSC_VER +// To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see +// https://github.com/simdjson/simdjson/issues/1247 +#define SIMDJSON_CAN_ALWAYS_RUN_HASWELL ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__)) +#else +#define SIMDJSON_CAN_ALWAYS_RUN_HASWELL ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__)) +#endif + +// Default Westmere to on if this is x86-64. +#ifndef SIMDJSON_IMPLEMENTATION_WESTMERE +#if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL +// if icelake or haswell are always available, never enable westmere. +#define SIMDJSON_IMPLEMENTATION_WESTMERE 0 +#else +#define SIMDJSON_IMPLEMENTATION_WESTMERE SIMDJSON_IS_X86_64 +#endif +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_WESTMERE (SIMDJSON_IMPLEMENTATION_WESTMERE && SIMDJSON_IS_X86_64 && __SSE4_2__ && __PCLMUL__) + +#ifndef SIMDJSON_IMPLEMENTATION_PPC64 +#define SIMDJSON_IMPLEMENTATION_PPC64 (SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX) +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_PPC64 SIMDJSON_IMPLEMENTATION_PPC64 && SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX + +// Default Fallback to on unless a builtin implementation has already been selected. +#ifndef SIMDJSON_IMPLEMENTATION_FALLBACK +#if SIMDJSON_CAN_ALWAYS_RUN_ARM64 || SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL || SIMDJSON_CAN_ALWAYS_RUN_WESTMERE || SIMDJSON_CAN_ALWAYS_RUN_PPC64 +// if anything at all except fallback can always run, then disable fallback. +#define SIMDJSON_IMPLEMENTATION_FALLBACK 0 +#else +#define SIMDJSON_IMPLEMENTATION_FALLBACK 1 +#endif +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_FALLBACK SIMDJSON_IMPLEMENTATION_FALLBACK + +// Determine the best builtin implementation +#ifndef SIMDJSON_BUILTIN_IMPLEMENTATION + +#if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +#define SIMDJSON_BUILTIN_IMPLEMENTATION icelake +#elif SIMDJSON_CAN_ALWAYS_RUN_HASWELL +#define SIMDJSON_BUILTIN_IMPLEMENTATION haswell +#elif SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +#define SIMDJSON_BUILTIN_IMPLEMENTATION westmere +#elif SIMDJSON_CAN_ALWAYS_RUN_ARM64 +#define SIMDJSON_BUILTIN_IMPLEMENTATION arm64 +#elif SIMDJSON_CAN_ALWAYS_RUN_PPC64 +#define SIMDJSON_BUILTIN_IMPLEMENTATION ppc64 +#elif SIMDJSON_CAN_ALWAYS_RUN_FALLBACK +#define SIMDJSON_BUILTIN_IMPLEMENTATION fallback +#else +#error "All possible implementations (including fallback) have been disabled! simdjson will not run." +#endif + +#endif // SIMDJSON_BUILTIN_IMPLEMENTATION + +#define SIMDJSON_BUILTIN_IMPLEMENTATION_ID SIMDJSON_IMPLEMENTATION_ID_FOR(SIMDJSON_BUILTIN_IMPLEMENTATION) +#define SIMDJSON_BUILTIN_IMPLEMENTATION_IS(IMPL) SIMDJSON_BUILTIN_IMPLEMENTATION_ID == SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL) + +#endif // SIMDJSON_IMPLEMENTATION_DETECTION_H +/* end file simdjson/implementation_detection.h */ + +#if SIMDJSON_IMPLEMENTATION_ARM64 || SIMDJSON_IMPLEMENTATION_ICELAKE || SIMDJSON_IMPLEMENTATION_HASWELL || SIMDJSON_IMPLEMENTATION_WESTMERE || SIMDJSON_IMPLEMENTATION_PPC64 + +#include + +namespace simdjson { // table modified and copied from +namespace internal { // http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetTable +SIMDJSON_DLLIMPORTEXPORT const unsigned char BitsSetTable256mul2[256] = { + 0, 2, 2, 4, 2, 4, 4, 6, 2, 4, 4, 6, 4, 6, 6, 8, 2, 4, 4, + 6, 4, 6, 6, 8, 4, 6, 6, 8, 6, 8, 8, 10, 2, 4, 4, 6, 4, 6, + 6, 8, 4, 6, 6, 8, 6, 8, 8, 10, 4, 6, 6, 8, 6, 8, 8, 10, 6, + 8, 8, 10, 8, 10, 10, 12, 2, 4, 4, 6, 4, 6, 6, 8, 4, 6, 6, 8, + 6, 8, 8, 10, 4, 6, 6, 8, 6, 8, 8, 10, 6, 8, 8, 10, 8, 10, 10, + 12, 4, 6, 6, 8, 6, 8, 8, 10, 6, 8, 8, 10, 8, 10, 10, 12, 6, 8, + 8, 10, 8, 10, 10, 12, 8, 10, 10, 12, 10, 12, 12, 14, 2, 4, 4, 6, 4, + 6, 6, 8, 4, 6, 6, 8, 6, 8, 8, 10, 4, 6, 6, 8, 6, 8, 8, 10, + 6, 8, 8, 10, 8, 10, 10, 12, 4, 6, 6, 8, 6, 8, 8, 10, 6, 8, 8, + 10, 8, 10, 10, 12, 6, 8, 8, 10, 8, 10, 10, 12, 8, 10, 10, 12, 10, 12, + 12, 14, 4, 6, 6, 8, 6, 8, 8, 10, 6, 8, 8, 10, 8, 10, 10, 12, 6, + 8, 8, 10, 8, 10, 10, 12, 8, 10, 10, 12, 10, 12, 12, 14, 6, 8, 8, 10, + 8, 10, 10, 12, 8, 10, 10, 12, 10, 12, 12, 14, 8, 10, 10, 12, 10, 12, 12, + 14, 10, 12, 12, 14, 12, 14, 14, 16}; + +SIMDJSON_DLLIMPORTEXPORT const uint8_t pshufb_combine_table[272] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0xff, 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0xff, 0xff, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x01, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +// 256 * 8 bytes = 2kB, easily fits in cache. +SIMDJSON_DLLIMPORTEXPORT const uint64_t thintable_epi8[256] = { + 0x0706050403020100, 0x0007060504030201, 0x0007060504030200, + 0x0000070605040302, 0x0007060504030100, 0x0000070605040301, + 0x0000070605040300, 0x0000000706050403, 0x0007060504020100, + 0x0000070605040201, 0x0000070605040200, 0x0000000706050402, + 0x0000070605040100, 0x0000000706050401, 0x0000000706050400, + 0x0000000007060504, 0x0007060503020100, 0x0000070605030201, + 0x0000070605030200, 0x0000000706050302, 0x0000070605030100, + 0x0000000706050301, 0x0000000706050300, 0x0000000007060503, + 0x0000070605020100, 0x0000000706050201, 0x0000000706050200, + 0x0000000007060502, 0x0000000706050100, 0x0000000007060501, + 0x0000000007060500, 0x0000000000070605, 0x0007060403020100, + 0x0000070604030201, 0x0000070604030200, 0x0000000706040302, + 0x0000070604030100, 0x0000000706040301, 0x0000000706040300, + 0x0000000007060403, 0x0000070604020100, 0x0000000706040201, + 0x0000000706040200, 0x0000000007060402, 0x0000000706040100, + 0x0000000007060401, 0x0000000007060400, 0x0000000000070604, + 0x0000070603020100, 0x0000000706030201, 0x0000000706030200, + 0x0000000007060302, 0x0000000706030100, 0x0000000007060301, + 0x0000000007060300, 0x0000000000070603, 0x0000000706020100, + 0x0000000007060201, 0x0000000007060200, 0x0000000000070602, + 0x0000000007060100, 0x0000000000070601, 0x0000000000070600, + 0x0000000000000706, 0x0007050403020100, 0x0000070504030201, + 0x0000070504030200, 0x0000000705040302, 0x0000070504030100, + 0x0000000705040301, 0x0000000705040300, 0x0000000007050403, + 0x0000070504020100, 0x0000000705040201, 0x0000000705040200, + 0x0000000007050402, 0x0000000705040100, 0x0000000007050401, + 0x0000000007050400, 0x0000000000070504, 0x0000070503020100, + 0x0000000705030201, 0x0000000705030200, 0x0000000007050302, + 0x0000000705030100, 0x0000000007050301, 0x0000000007050300, + 0x0000000000070503, 0x0000000705020100, 0x0000000007050201, + 0x0000000007050200, 0x0000000000070502, 0x0000000007050100, + 0x0000000000070501, 0x0000000000070500, 0x0000000000000705, + 0x0000070403020100, 0x0000000704030201, 0x0000000704030200, + 0x0000000007040302, 0x0000000704030100, 0x0000000007040301, + 0x0000000007040300, 0x0000000000070403, 0x0000000704020100, + 0x0000000007040201, 0x0000000007040200, 0x0000000000070402, + 0x0000000007040100, 0x0000000000070401, 0x0000000000070400, + 0x0000000000000704, 0x0000000703020100, 0x0000000007030201, + 0x0000000007030200, 0x0000000000070302, 0x0000000007030100, + 0x0000000000070301, 0x0000000000070300, 0x0000000000000703, + 0x0000000007020100, 0x0000000000070201, 0x0000000000070200, + 0x0000000000000702, 0x0000000000070100, 0x0000000000000701, + 0x0000000000000700, 0x0000000000000007, 0x0006050403020100, + 0x0000060504030201, 0x0000060504030200, 0x0000000605040302, + 0x0000060504030100, 0x0000000605040301, 0x0000000605040300, + 0x0000000006050403, 0x0000060504020100, 0x0000000605040201, + 0x0000000605040200, 0x0000000006050402, 0x0000000605040100, + 0x0000000006050401, 0x0000000006050400, 0x0000000000060504, + 0x0000060503020100, 0x0000000605030201, 0x0000000605030200, + 0x0000000006050302, 0x0000000605030100, 0x0000000006050301, + 0x0000000006050300, 0x0000000000060503, 0x0000000605020100, + 0x0000000006050201, 0x0000000006050200, 0x0000000000060502, + 0x0000000006050100, 0x0000000000060501, 0x0000000000060500, + 0x0000000000000605, 0x0000060403020100, 0x0000000604030201, + 0x0000000604030200, 0x0000000006040302, 0x0000000604030100, + 0x0000000006040301, 0x0000000006040300, 0x0000000000060403, + 0x0000000604020100, 0x0000000006040201, 0x0000000006040200, + 0x0000000000060402, 0x0000000006040100, 0x0000000000060401, + 0x0000000000060400, 0x0000000000000604, 0x0000000603020100, + 0x0000000006030201, 0x0000000006030200, 0x0000000000060302, + 0x0000000006030100, 0x0000000000060301, 0x0000000000060300, + 0x0000000000000603, 0x0000000006020100, 0x0000000000060201, + 0x0000000000060200, 0x0000000000000602, 0x0000000000060100, + 0x0000000000000601, 0x0000000000000600, 0x0000000000000006, + 0x0000050403020100, 0x0000000504030201, 0x0000000504030200, + 0x0000000005040302, 0x0000000504030100, 0x0000000005040301, + 0x0000000005040300, 0x0000000000050403, 0x0000000504020100, + 0x0000000005040201, 0x0000000005040200, 0x0000000000050402, + 0x0000000005040100, 0x0000000000050401, 0x0000000000050400, + 0x0000000000000504, 0x0000000503020100, 0x0000000005030201, + 0x0000000005030200, 0x0000000000050302, 0x0000000005030100, + 0x0000000000050301, 0x0000000000050300, 0x0000000000000503, + 0x0000000005020100, 0x0000000000050201, 0x0000000000050200, + 0x0000000000000502, 0x0000000000050100, 0x0000000000000501, + 0x0000000000000500, 0x0000000000000005, 0x0000000403020100, + 0x0000000004030201, 0x0000000004030200, 0x0000000000040302, + 0x0000000004030100, 0x0000000000040301, 0x0000000000040300, + 0x0000000000000403, 0x0000000004020100, 0x0000000000040201, + 0x0000000000040200, 0x0000000000000402, 0x0000000000040100, + 0x0000000000000401, 0x0000000000000400, 0x0000000000000004, + 0x0000000003020100, 0x0000000000030201, 0x0000000000030200, + 0x0000000000000302, 0x0000000000030100, 0x0000000000000301, + 0x0000000000000300, 0x0000000000000003, 0x0000000000020100, + 0x0000000000000201, 0x0000000000000200, 0x0000000000000002, + 0x0000000000000100, 0x0000000000000001, 0x0000000000000000, + 0x0000000000000000, +}; //static uint64_t thintable_epi8[256] + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_IMPLEMENTATION_ARM64 || SIMDJSON_IMPLEMENTATION_ICELAKE || SIMDJSON_IMPLEMENTATION_HASWELL || SIMDJSON_IMPLEMENTATION_WESTMERE || SIMDJSON_IMPLEMENTATION_PPC64 + +#endif // SIMDJSON_SRC_SIMDPRUNE_TABLES_CPP +/* end file internal/simdprune_tables.cpp */ + +/* including simdjson/generic/dependencies.h: #include */ +/* begin file simdjson/generic/dependencies.h */ +#ifdef SIMDJSON_CONDITIONAL_INCLUDE +#error simdjson/generic/dependencies.h must be included before defining SIMDJSON_CONDITIONAL_INCLUDE! +#endif + +#ifndef SIMDJSON_GENERIC_DEPENDENCIES_H +#define SIMDJSON_GENERIC_DEPENDENCIES_H + +// Internal headers needed for generics. +// All includes referencing simdjson headers *not* under simdjson/generic must be here! +// Otherwise, amalgamation will fail. +/* skipped duplicate #include "simdjson/base.h" */ +/* including simdjson/implementation.h: #include "simdjson/implementation.h" */ +/* begin file simdjson/implementation.h */ +#ifndef SIMDJSON_IMPLEMENTATION_H +#define SIMDJSON_IMPLEMENTATION_H + +/* including simdjson/internal/atomic_ptr.h: #include "simdjson/internal/atomic_ptr.h" */ +/* begin file simdjson/internal/atomic_ptr.h */ +#ifndef SIMDJSON_INTERNAL_ATOMIC_PTR_H +#define SIMDJSON_INTERNAL_ATOMIC_PTR_H + +/* skipped duplicate #include "simdjson/base.h" */ +#include + +namespace simdjson { +namespace internal { + +template +class atomic_ptr { +public: + atomic_ptr(T *_ptr) : ptr{_ptr} {} + + operator const T*() const { return ptr.load(); } + const T& operator*() const { return *ptr; } + const T* operator->() const { return ptr.load(); } + + operator T*() { return ptr.load(); } + T& operator*() { return *ptr; } + T* operator->() { return ptr.load(); } + atomic_ptr& operator=(T *_ptr) { ptr = _ptr; return *this; } + +private: + std::atomic ptr; +}; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_ATOMIC_PTR_H +/* end file simdjson/internal/atomic_ptr.h */ +/* including simdjson/internal/dom_parser_implementation.h: #include "simdjson/internal/dom_parser_implementation.h" */ +/* begin file simdjson/internal/dom_parser_implementation.h */ +#ifndef SIMDJSON_INTERNAL_DOM_PARSER_IMPLEMENTATION_H +#define SIMDJSON_INTERNAL_DOM_PARSER_IMPLEMENTATION_H + +/* skipped duplicate #include "simdjson/base.h" */ +/* skipped duplicate #include "simdjson/error.h" */ +#include + +namespace simdjson { + +namespace dom { +class document; +} // namespace dom + +/** +* This enum is used with the dom_parser_implementation::stage1 function. +* 1) The regular mode expects a fully formed JSON document. +* 2) The streaming_partial mode expects a possibly truncated +* input within a stream on JSON documents. +* 3) The stream_final mode allows us to truncate final +* unterminated strings. It is useful in conjunction with streaming_partial. +*/ +enum class stage1_mode { regular, streaming_partial, streaming_final}; + +/** + * Returns true if mode == streaming_partial or mode == streaming_final + */ +inline bool is_streaming(stage1_mode mode) { + // performance note: it is probably faster to check that mode is different + // from regular than checking that it is either streaming_partial or streaming_final. + return (mode != stage1_mode::regular); + // return (mode == stage1_mode::streaming_partial || mode == stage1_mode::streaming_final); +} + + +namespace internal { + + +/** + * An implementation of simdjson's DOM parser for a particular CPU architecture. + * + * This class is expected to be accessed only by pointer, and never move in memory (though the + * pointer can move). + */ +class dom_parser_implementation { +public: + + /** + * @private For internal implementation use + * + * Run a full JSON parse on a single document (stage1 + stage2). + * + * Guaranteed only to be called when capacity > document length. + * + * Overridden by each implementation. + * + * @param buf The json document to parse. *MUST* be allocated up to len + SIMDJSON_PADDING bytes. + * @param len The length of the json document. + * @return The error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept = 0; + + /** + * @private For internal implementation use + * + * Stage 1 of the document parser. + * + * Guaranteed only to be called when capacity > document length. + * + * Overridden by each implementation. + * + * @param buf The json document to parse. + * @param len The length of the json document. + * @param streaming Whether this is being called by parser::parse_many. + * @return The error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code stage1(const uint8_t *buf, size_t len, stage1_mode streaming) noexcept = 0; + + /** + * @private For internal implementation use + * + * Stage 2 of the document parser. + * + * Called after stage1(). + * + * Overridden by each implementation. + * + * @param doc The document to output to. + * @return The error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code stage2(dom::document &doc) noexcept = 0; + + /** + * @private For internal implementation use + * + * Stage 2 of the document parser for parser::parse_many. + * + * Guaranteed only to be called after stage1(). + * Overridden by each implementation. + * + * @param doc The document to output to. + * @return The error code, SUCCESS if there was no error, or EMPTY if all documents have been parsed. + */ + simdjson_warn_unused virtual error_code stage2_next(dom::document &doc) noexcept = 0; + + /** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + * + * Overridden by each implementation. + * + * @param str pointer to the beginning of a valid UTF-8 JSON string, must end with an unescaped quote. + * @param dst pointer to a destination buffer, it must point a region in memory of sufficient size. + * @param allow_replacement whether we allow a replacement character when the UTF-8 contains unmatched surrogate pairs. + * @return end of the of the written region (exclusive) or nullptr in case of error. + */ + simdjson_warn_unused virtual uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept = 0; + + /** + * Unescape a NON-valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + * + * Overridden by each implementation. + * + * @param str pointer to the beginning of a possibly invalid UTF-8 JSON string, must end with an unescaped quote. + * @param dst pointer to a destination buffer, it must point a region in memory of sufficient size. + * @return end of the of the written region (exclusive) or nullptr in case of error. + */ + simdjson_warn_unused virtual uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept = 0; + + /** + * Change the capacity of this parser. + * + * The capacity can never exceed SIMDJSON_MAXSIZE_BYTES (e.g., 4 GB) + * and an CAPACITY error is returned if it is attempted. + * + * Generally used for reallocation. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. + * @return The error code, or SUCCESS if there was no error. + */ + virtual error_code set_capacity(size_t capacity) noexcept = 0; + + /** + * Change the max depth of this parser. + * + * Generally used for reallocation. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. + * @return The error code, or SUCCESS if there was no error. + */ + virtual error_code set_max_depth(size_t max_depth) noexcept = 0; + + /** + * Deallocate this parser. + */ + virtual ~dom_parser_implementation() = default; + + /** Number of structural indices passed from stage 1 to stage 2 */ + uint32_t n_structural_indexes{0}; + /** Structural indices passed from stage 1 to stage 2 */ + std::unique_ptr structural_indexes{}; + /** Next structural index to parse */ + uint32_t next_structural_index{0}; + + /** + * The largest document this parser can support without reallocating. + * + * @return Current capacity, in bytes. + */ + simdjson_inline size_t capacity() const noexcept; + + /** + * The maximum level of nested object and arrays supported by this parser. + * + * @return Maximum depth, in bytes. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused inline error_code allocate(size_t capacity, size_t max_depth) noexcept; + + +protected: + /** + * The maximum document length this parser supports. + * + * Buffers are large enough to handle any document up to this length. + */ + size_t _capacity{0}; + + /** + * The maximum depth (number of nested objects and arrays) supported by this parser. + * + * Defaults to DEFAULT_MAX_DEPTH. + */ + size_t _max_depth{0}; + + // Declaring these so that subclasses can use them to implement their constructors. + simdjson_inline dom_parser_implementation() noexcept; + simdjson_inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + simdjson_inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + + simdjson_inline dom_parser_implementation(const dom_parser_implementation &) noexcept = delete; + simdjson_inline dom_parser_implementation &operator=(const dom_parser_implementation &other) noexcept = delete; +}; // class dom_parser_implementation + +simdjson_inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +simdjson_inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +simdjson_inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +simdjson_inline size_t dom_parser_implementation::capacity() const noexcept { + return _capacity; +} + +simdjson_inline size_t dom_parser_implementation::max_depth() const noexcept { + return _max_depth; +} + +simdjson_warn_unused +inline error_code dom_parser_implementation::allocate(size_t capacity, size_t max_depth) noexcept { + if (this->max_depth() != max_depth) { + error_code err = set_max_depth(max_depth); + if (err) { return err; } + } + if (_capacity != capacity) { + error_code err = set_capacity(capacity); + if (err) { return err; } + } + return SUCCESS; +} + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/internal/dom_parser_implementation.h */ + +#include + +namespace simdjson { + +/** + * Validate the UTF-8 string. + * + * @param buf the string to validate. + * @param len the length of the string in bytes. + * @return true if the string is valid UTF-8. + */ +simdjson_warn_unused bool validate_utf8(const char * buf, size_t len) noexcept; +/** + * Validate the UTF-8 string. + * + * @param sv the string_view to validate. + * @return true if the string is valid UTF-8. + */ +simdjson_inline simdjson_warn_unused bool validate_utf8(const std::string_view sv) noexcept { + return validate_utf8(sv.data(), sv.size()); +} + +/** + * Validate the UTF-8 string. + * + * @param p the string to validate. + * @return true if the string is valid UTF-8. + */ +simdjson_inline simdjson_warn_unused bool validate_utf8(const std::string& s) noexcept { + return validate_utf8(s.data(), s.size()); +} + +/** + * An implementation of simdjson for a particular CPU architecture. + * + * Also used to maintain the currently active implementation. The active implementation is + * automatically initialized on first use to the most advanced implementation supported by the host. + */ +class implementation { +public: + + /** + * The name of this implementation. + * + * const implementation *impl = simdjson::get_active_implementation(); + * cout << "simdjson is optimized for " << impl->name() << "(" << impl->description() << ")" << endl; + * + * @return the name of the implementation, e.g. "haswell", "westmere", "arm64". + */ + virtual const std::string &name() const { return _name; } + + /** + * The description of this implementation. + * + * const implementation *impl = simdjson::get_active_implementation(); + * cout << "simdjson is optimized for " << impl->name() << "(" << impl->description() << ")" << endl; + * + * @return the description of the implementation, e.g. "Intel/AMD AVX2", "Intel/AMD SSE4.2", "ARM NEON". + */ + virtual const std::string &description() const { return _description; } + + /** + * The instruction sets this implementation is compiled against + * and the current CPU match. This function may poll the current CPU/system + * and should therefore not be called too often if performance is a concern. + * + * @return true if the implementation can be safely used on the current system (determined at runtime). + */ + bool supported_by_runtime_system() const; + + /** + * @private For internal implementation use + * + * The instruction sets this implementation is compiled against. + * + * @return a mask of all required `internal::instruction_set::` values. + */ + virtual uint32_t required_instruction_sets() const { return _required_instruction_sets; } + + /** + * @private For internal implementation use + * + * const implementation *impl = simdjson::get_active_implementation(); + * cout << "simdjson is optimized for " << impl->name() << "(" << impl->description() << ")" << endl; + * + * @param capacity The largest document that will be passed to the parser. + * @param max_depth The maximum JSON object/array nesting this parser is expected to handle. + * @param dst The place to put the resulting parser implementation. + * @return the error code, or SUCCESS if there was no error. + */ + virtual error_code create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr &dst + ) const noexcept = 0; + + /** + * @private For internal implementation use + * + * Minify the input string assuming that it represents a JSON string, does not parse or validate. + * + * Overridden by each implementation. + * + * @param buf the json document to minify. + * @param len the length of the json document. + * @param dst the buffer to write the minified document to. *MUST* be allocated up to len + SIMDJSON_PADDING bytes. + * @param dst_len the number of bytes written. Output only. + * @return the error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept = 0; + + + /** + * Validate the UTF-8 string. + * + * Overridden by each implementation. + * + * @param buf the string to validate. + * @param len the length of the string in bytes. + * @return true if and only if the string is valid UTF-8. + */ + simdjson_warn_unused virtual bool validate_utf8(const char *buf, size_t len) const noexcept = 0; + +protected: + /** @private Construct an implementation with the given name and description. For subclasses. */ + simdjson_inline implementation( + std::string_view name, + std::string_view description, + uint32_t required_instruction_sets + ) : + _name(name), + _description(description), + _required_instruction_sets(required_instruction_sets) + { + } + virtual ~implementation()=default; + +private: + /** + * The name of this implementation. + */ + const std::string _name; + + /** + * The description of this implementation. + */ + const std::string _description; + + /** + * Instruction sets required for this implementation. + */ + const uint32_t _required_instruction_sets; +}; + +/** @private */ +namespace internal { + +/** + * The list of available implementations compiled into simdjson. + */ +class available_implementation_list { +public: + /** Get the list of available implementations compiled into simdjson */ + simdjson_inline available_implementation_list() {} + /** Number of implementations */ + size_t size() const noexcept; + /** STL const begin() iterator */ + const implementation * const *begin() const noexcept; + /** STL const end() iterator */ + const implementation * const *end() const noexcept; + + /** + * Get the implementation with the given name. + * + * Case sensitive. + * + * const implementation *impl = simdjson::get_available_implementations()["westmere"]; + * if (!impl) { exit(1); } + * if (!imp->supported_by_runtime_system()) { exit(1); } + * simdjson::get_active_implementation() = impl; + * + * @param name the implementation to find, e.g. "westmere", "haswell", "arm64" + * @return the implementation, or nullptr if the parse failed. + */ + const implementation * operator[](const std::string_view &name) const noexcept { + for (const implementation * impl : *this) { + if (impl->name() == name) { return impl; } + } + return nullptr; + } + + /** + * Detect the most advanced implementation supported by the current host. + * + * This is used to initialize the implementation on startup. + * + * const implementation *impl = simdjson::available_implementation::detect_best_supported(); + * simdjson::get_active_implementation() = impl; + * + * @return the most advanced supported implementation for the current host, or an + * implementation that returns UNSUPPORTED_ARCHITECTURE if there is no supported + * implementation. Will never return nullptr. + */ + const implementation *detect_best_supported() const noexcept; +}; + +} // namespace internal + +/** + * The list of available implementations compiled into simdjson. + */ +extern SIMDJSON_DLLIMPORTEXPORT const internal::available_implementation_list& get_available_implementations(); + +/** + * The active implementation. + * + * Automatically initialized on first use to the most advanced implementation supported by this hardware. + */ +extern SIMDJSON_DLLIMPORTEXPORT internal::atomic_ptr& get_active_implementation(); + +} // namespace simdjson + +#endif // SIMDJSON_IMPLEMENTATION_H +/* end file simdjson/implementation.h */ +/* skipped duplicate #include "simdjson/implementation_detection.h" */ +/* including simdjson/internal/instruction_set.h: #include "simdjson/internal/instruction_set.h" */ +/* begin file simdjson/internal/instruction_set.h */ +/* From +https://github.com/endorno/pytorch/blob/master/torch/lib/TH/generic/simd/simd.h +Highly modified. + +Copyright (c) 2016- Facebook, Inc (Adam Paszke) +Copyright (c) 2014- Facebook, Inc (Soumith Chintala) +Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) +Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) +Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) +Copyright (c) 2011-2013 NYU (Clement Farabet) +Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, +Iain Melvin, Jason Weston) Copyright (c) 2006 Idiap Research Institute +(Samy Bengio) Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, +Samy Bengio, Johnny Mariethoz) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories +America and IDIAP Research Institute nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef SIMDJSON_INTERNAL_INSTRUCTION_SET_H +#define SIMDJSON_INTERNAL_INSTRUCTION_SET_H + +namespace simdjson { +namespace internal { + +enum instruction_set { + DEFAULT = 0x0, + NEON = 0x1, + AVX2 = 0x4, + SSE42 = 0x8, + PCLMULQDQ = 0x10, + BMI1 = 0x20, + BMI2 = 0x40, + ALTIVEC = 0x80, + AVX512F = 0x100, + AVX512DQ = 0x200, + AVX512IFMA = 0x400, + AVX512PF = 0x800, + AVX512ER = 0x1000, + AVX512CD = 0x2000, + AVX512BW = 0x4000, + AVX512VL = 0x8000, + AVX512VBMI2 = 0x10000 +}; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_INSTRUCTION_SET_H +/* end file simdjson/internal/instruction_set.h */ +/* skipped duplicate #include "simdjson/internal/dom_parser_implementation.h" */ +/* skipped duplicate #include "simdjson/internal/jsoncharutils_tables.h" */ +/* skipped duplicate #include "simdjson/internal/numberparsing_tables.h" */ +/* including simdjson/internal/simdprune_tables.h: #include "simdjson/internal/simdprune_tables.h" */ +/* begin file simdjson/internal/simdprune_tables.h */ +#ifndef SIMDJSON_INTERNAL_SIMDPRUNE_TABLES_H +#define SIMDJSON_INTERNAL_SIMDPRUNE_TABLES_H + +/* skipped duplicate #include "simdjson/base.h" */ + +#include + +namespace simdjson { // table modified and copied from +namespace internal { // http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetTable + +extern SIMDJSON_DLLIMPORTEXPORT const unsigned char BitsSetTable256mul2[256]; + +extern SIMDJSON_DLLIMPORTEXPORT const uint8_t pshufb_combine_table[272]; + +// 256 * 8 bytes = 2kB, easily fits in cache. +extern SIMDJSON_DLLIMPORTEXPORT const uint64_t thintable_epi8[256]; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_SIMDPRUNE_TABLES_H +/* end file simdjson/internal/simdprune_tables.h */ + +#endif // SIMDJSON_GENERIC_DEPENDENCIES_H +/* end file simdjson/generic/dependencies.h */ +/* including generic/dependencies.h: #include */ +/* begin file generic/dependencies.h */ +#ifdef SIMDJSON_CONDITIONAL_INCLUDE +#error generic/dependencies.h must be included before defining SIMDJSON_CONDITIONAL_INCLUDE! +#endif + +#ifndef SIMDJSON_SRC_GENERIC_DEPENDENCIES_H +#define SIMDJSON_SRC_GENERIC_DEPENDENCIES_H + +/* skipped duplicate #include */ + +#endif // SIMDJSON_SRC_GENERIC_DEPENDENCIES_H +/* end file generic/dependencies.h */ +/* including generic/stage1/dependencies.h: #include */ +/* begin file generic/stage1/dependencies.h */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_DEPENDENCIES_H +#define SIMDJSON_SRC_GENERIC_STAGE1_DEPENDENCIES_H + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_DEPENDENCIES_H +/* end file generic/stage1/dependencies.h */ +/* including generic/stage2/dependencies.h: #include */ +/* begin file generic/stage2/dependencies.h */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_DEPENDENCIES_H +#define SIMDJSON_SRC_GENERIC_STAGE2_DEPENDENCIES_H + +/* including simdjson/dom/document.h: #include */ +/* begin file simdjson/dom/document.h */ +#ifndef SIMDJSON_DOM_DOCUMENT_H +#define SIMDJSON_DOM_DOCUMENT_H + +/* including simdjson/dom/base.h: #include "simdjson/dom/base.h" */ +/* begin file simdjson/dom/base.h */ +#ifndef SIMDJSON_DOM_BASE_H +#define SIMDJSON_DOM_BASE_H + +/* skipped duplicate #include "simdjson/base.h" */ + +namespace simdjson { + +/** + * @brief A DOM API on top of the simdjson parser. + */ +namespace dom { + +/** The default batch size for parser.parse_many() and parser.load_many() */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * It is wasteful to allocate memory for tiny documents (e.g., 4 bytes). + */ +static constexpr size_t MINIMAL_DOCUMENT_CAPACITY = 32; + +class array; +class document; +class document_stream; +class element; +class key_value_pair; +class object; +class parser; + +#ifdef SIMDJSON_THREADS_ENABLED +struct stage1_worker; +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace dom + +namespace internal { + +template +class string_builder; +class tape_ref; + +} // namespace internal + +} // namespace simdjson + +#endif // SIMDJSON_DOM_BASE_H +/* end file simdjson/dom/base.h */ + +#include + +namespace simdjson { +namespace dom { + +/** + * A parsed JSON document. + * + * This class cannot be copied, only moved, to avoid unintended allocations. + */ +class document { +public: + /** + * Create a document container with zero capacity. + * + * The parser will allocate capacity as needed. + */ + document() noexcept = default; + ~document() noexcept = default; + + /** + * Take another document's buffers. + * + * @param other The document to take. Its capacity is zeroed and it is invalidated. + */ + document(document &&other) noexcept = default; + /** @private */ + document(const document &) = delete; // Disallow copying + /** + * Take another document's buffers. + * + * @param other The document to take. Its capacity is zeroed. + */ + document &operator=(document &&other) noexcept = default; + /** @private */ + document &operator=(const document &) = delete; // Disallow copying + + /** + * Get the root element of this document as a JSON array. + */ + element root() const noexcept; + + /** + * @private Dump the raw tape for debugging. + * + * @param os the stream to output to. + * @return false if the tape is likely wrong (e.g., you did not parse a valid JSON). + */ + bool dump_raw_tape(std::ostream &os) const noexcept; + + /** @private Structural values. */ + std::unique_ptr tape{}; + + /** @private String values. + * + * Should be at least byte_capacity. + */ + std::unique_ptr string_buf{}; + /** @private Allocate memory to support + * input JSON documents of up to len bytes. + * + * When calling this function, you lose + * all the data. + * + * The memory allocation is strict: you + * can you use this function to increase + * or lower the amount of allocated memory. + * Passsing zero clears the memory. + */ + error_code allocate(size_t len) noexcept; + /** @private Capacity in bytes, in terms + * of how many bytes of input JSON we can + * support. + */ + size_t capacity() const noexcept; + + +private: + size_t allocated_capacity{0}; + friend class parser; +}; // class document + +} // namespace dom +} // namespace simdjson + +#endif // SIMDJSON_DOM_DOCUMENT_H +/* end file simdjson/dom/document.h */ +/* including simdjson/internal/tape_type.h: #include */ +/* begin file simdjson/internal/tape_type.h */ +#ifndef SIMDJSON_INTERNAL_TAPE_TYPE_H +#define SIMDJSON_INTERNAL_TAPE_TYPE_H + +namespace simdjson { +namespace internal { + +/** + * The possible types in the tape. + */ +enum class tape_type { + ROOT = 'r', + START_ARRAY = '[', + START_OBJECT = '{', + END_ARRAY = ']', + END_OBJECT = '}', + STRING = '"', + INT64 = 'l', + UINT64 = 'u', + DOUBLE = 'd', + TRUE_VALUE = 't', + FALSE_VALUE = 'f', + NULL_VALUE = 'n' +}; // enum class tape_type + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_TAPE_TYPE_H +/* end file simdjson/internal/tape_type.h */ + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_DEPENDENCIES_H +/* end file generic/stage2/dependencies.h */ + +/* including implementation.cpp: #include */ +/* begin file implementation.cpp */ +#ifndef SIMDJSON_SRC_IMPLEMENTATION_CPP +#define SIMDJSON_SRC_IMPLEMENTATION_CPP + +/* skipped duplicate #include */ +/* skipped duplicate #include */ +/* skipped duplicate #include */ +/* including internal/isadetection.h: #include */ +/* begin file internal/isadetection.h */ +/* From +https://github.com/endorno/pytorch/blob/master/torch/lib/TH/generic/simd/simd.h +Highly modified. + +Copyright (c) 2016- Facebook, Inc (Adam Paszke) +Copyright (c) 2014- Facebook, Inc (Soumith Chintala) +Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) +Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) +Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) +Copyright (c) 2011-2013 NYU (Clement Farabet) +Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, +Iain Melvin, Jason Weston) Copyright (c) 2006 Idiap Research Institute +(Samy Bengio) Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, +Samy Bengio, Johnny Mariethoz) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories +America and IDIAP Research Institute nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef SIMDJSON_INTERNAL_ISADETECTION_H +#define SIMDJSON_INTERNAL_ISADETECTION_H + +/* skipped duplicate #include "simdjson/internal/instruction_set.h" */ + +#include +#include +#if defined(_MSC_VER) +#include +#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID) +#include +#endif + +namespace simdjson { +namespace internal { + +#if defined(__PPC64__) + +static inline uint32_t detect_supported_architectures() { + return instruction_set::ALTIVEC; +} + +#elif defined(__aarch64__) || defined(_M_ARM64) + +static inline uint32_t detect_supported_architectures() { + return instruction_set::NEON; +} + +#elif defined(__x86_64__) || defined(_M_AMD64) // x64 + + +namespace { +// Can be found on Intel ISA Reference for CPUID +constexpr uint32_t cpuid_avx2_bit = 1 << 5; ///< @private Bit 5 of EBX for EAX=0x7 +constexpr uint32_t cpuid_bmi1_bit = 1 << 3; ///< @private bit 3 of EBX for EAX=0x7 +constexpr uint32_t cpuid_bmi2_bit = 1 << 8; ///< @private bit 8 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512f_bit = 1 << 16; ///< @private bit 16 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512dq_bit = 1 << 17; ///< @private bit 17 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512ifma_bit = 1 << 21; ///< @private bit 21 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512pf_bit = 1 << 26; ///< @private bit 26 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512er_bit = 1 << 27; ///< @private bit 27 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512cd_bit = 1 << 28; ///< @private bit 28 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512bw_bit = 1 << 30; ///< @private bit 30 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512vl_bit = 1U << 31; ///< @private bit 31 of EBX for EAX=0x7 +constexpr uint32_t cpuid_avx512vbmi2_bit = 1 << 6; ///< @private bit 6 of ECX for EAX=0x7 +constexpr uint64_t cpuid_avx256_saved = uint64_t(1) << 2; ///< @private bit 2 = AVX +constexpr uint64_t cpuid_avx512_saved = uint64_t(7) << 5; ///< @private bits 5,6,7 = opmask, ZMM_hi256, hi16_ZMM +constexpr uint32_t cpuid_sse42_bit = 1 << 20; ///< @private bit 20 of ECX for EAX=0x1 +constexpr uint32_t cpuid_osxsave = (uint32_t(1) << 26) | (uint32_t(1) << 27); ///< @private bits 26+27 of ECX for EAX=0x1 +constexpr uint32_t cpuid_pclmulqdq_bit = 1 << 1; ///< @private bit 1 of ECX for EAX=0x1 +} + + + +static inline void cpuid(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, + uint32_t *edx) { +#if defined(_MSC_VER) + int cpu_info[4]; + __cpuidex(cpu_info, *eax, *ecx); + *eax = cpu_info[0]; + *ebx = cpu_info[1]; + *ecx = cpu_info[2]; + *edx = cpu_info[3]; +#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID) + uint32_t level = *eax; + __get_cpuid(level, eax, ebx, ecx, edx); +#else + uint32_t a = *eax, b, c = *ecx, d; + asm volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d)); + *eax = a; + *ebx = b; + *ecx = c; + *edx = d; +#endif +} + + +static inline uint64_t xgetbv() { +#if defined(_MSC_VER) + return _xgetbv(0); +#else + uint32_t xcr0_lo, xcr0_hi; + asm volatile("xgetbv\n\t" : "=a" (xcr0_lo), "=d" (xcr0_hi) : "c" (0)); + return xcr0_lo | (uint64_t(xcr0_hi) << 32); +#endif +} + +static inline uint32_t detect_supported_architectures() { + uint32_t eax, ebx, ecx, edx; + uint32_t host_isa = 0x0; + + // EBX for EAX=0x1 + eax = 0x1; + ecx = 0x0; + cpuid(&eax, &ebx, &ecx, &edx); + + if (ecx & cpuid_sse42_bit) { + host_isa |= instruction_set::SSE42; + } else { + return host_isa; // everything after is redundant + } + + if (ecx & cpuid_pclmulqdq_bit) { + host_isa |= instruction_set::PCLMULQDQ; + } + + + if ((ecx & cpuid_osxsave) != cpuid_osxsave) { + return host_isa; + } + + // xgetbv for checking if the OS saves registers + uint64_t xcr0 = xgetbv(); + + if ((xcr0 & cpuid_avx256_saved) == 0) { + return host_isa; + } + + // ECX for EAX=0x7 + eax = 0x7; + ecx = 0x0; + cpuid(&eax, &ebx, &ecx, &edx); + if (ebx & cpuid_avx2_bit) { + host_isa |= instruction_set::AVX2; + } + if (ebx & cpuid_bmi1_bit) { + host_isa |= instruction_set::BMI1; + } + + if (ebx & cpuid_bmi2_bit) { + host_isa |= instruction_set::BMI2; + } + + if (!((xcr0 & cpuid_avx512_saved) == cpuid_avx512_saved)) { + return host_isa; + } + + if (ebx & cpuid_avx512f_bit) { + host_isa |= instruction_set::AVX512F; + } + + if (ebx & cpuid_avx512dq_bit) { + host_isa |= instruction_set::AVX512DQ; + } + + if (ebx & cpuid_avx512ifma_bit) { + host_isa |= instruction_set::AVX512IFMA; + } + + if (ebx & cpuid_avx512pf_bit) { + host_isa |= instruction_set::AVX512PF; + } + + if (ebx & cpuid_avx512er_bit) { + host_isa |= instruction_set::AVX512ER; + } + + if (ebx & cpuid_avx512cd_bit) { + host_isa |= instruction_set::AVX512CD; + } + + if (ebx & cpuid_avx512bw_bit) { + host_isa |= instruction_set::AVX512BW; + } + + if (ebx & cpuid_avx512vl_bit) { + host_isa |= instruction_set::AVX512VL; + } + + if (ecx & cpuid_avx512vbmi2_bit) { + host_isa |= instruction_set::AVX512VBMI2; + } + + return host_isa; +} +#else // fallback + + +static inline uint32_t detect_supported_architectures() { + return instruction_set::DEFAULT; +} + + +#endif // end SIMD extension detection code + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_ISADETECTION_H +/* end file internal/isadetection.h */ + +#include + +namespace simdjson { + +bool implementation::supported_by_runtime_system() const { + uint32_t required_instruction_sets = this->required_instruction_sets(); + uint32_t supported_instruction_sets = internal::detect_supported_architectures(); + return ((supported_instruction_sets & required_instruction_sets) == required_instruction_sets); +} + +} // namespace simdjson + +/* defining SIMDJSON_CONDITIONAL_INCLUDE */ +#define SIMDJSON_CONDITIONAL_INCLUDE + +#if SIMDJSON_IMPLEMENTATION_ARM64 +/* including simdjson/arm64/implementation.h: #include */ +/* begin file simdjson/arm64/implementation.h */ +#ifndef SIMDJSON_ARM64_IMPLEMENTATION_H +#define SIMDJSON_ARM64_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation("arm64", "ARM NEON", internal::instruction_set::NEON) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_IMPLEMENTATION_H +/* end file simdjson/arm64/implementation.h */ +namespace simdjson { +namespace internal { +static const arm64::implementation* get_arm64_singleton() { + static const arm64::implementation arm64_singleton{}; + return &arm64_singleton; +} +} // namespace internal +} // namespace simdjson +#endif // SIMDJSON_IMPLEMENTATION_ARM64 + +#if SIMDJSON_IMPLEMENTATION_FALLBACK +/* including simdjson/fallback/implementation.h: #include */ +/* begin file simdjson/fallback/implementation.h */ +#ifndef SIMDJSON_FALLBACK_IMPLEMENTATION_H +#define SIMDJSON_FALLBACK_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "fallback", + "Generic fallback implementation", + 0 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_IMPLEMENTATION_H +/* end file simdjson/fallback/implementation.h */ +namespace simdjson { +namespace internal { +static const fallback::implementation* get_fallback_singleton() { + static const fallback::implementation fallback_singleton{}; + return &fallback_singleton; +} +} // namespace internal +} // namespace simdjson +#endif // SIMDJSON_IMPLEMENTATION_FALLBACK + + +#if SIMDJSON_IMPLEMENTATION_HASWELL +/* including simdjson/haswell/implementation.h: #include */ +/* begin file simdjson/haswell/implementation.h */ +#ifndef SIMDJSON_HASWELL_IMPLEMENTATION_H +#define SIMDJSON_HASWELL_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_HASWELL +namespace simdjson { +namespace haswell { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "haswell", + "Intel/AMD AVX2", + internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_IMPLEMENTATION_H +/* end file simdjson/haswell/implementation.h */ +namespace simdjson { +namespace internal { +static const haswell::implementation* get_haswell_singleton() { + static const haswell::implementation haswell_singleton{}; + return &haswell_singleton; +} +} // namespace internal +} // namespace simdjson +#endif + +#if SIMDJSON_IMPLEMENTATION_ICELAKE +/* including simdjson/icelake/implementation.h: #include */ +/* begin file simdjson/icelake/implementation.h */ +#ifndef SIMDJSON_ICELAKE_IMPLEMENTATION_H +#define SIMDJSON_ICELAKE_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_ICELAKE +namespace simdjson { +namespace icelake { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "icelake", + "Intel/AMD AVX512", + internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 | internal::instruction_set::AVX512F | internal::instruction_set::AVX512DQ | internal::instruction_set::AVX512CD | internal::instruction_set::AVX512BW | internal::instruction_set::AVX512VL | internal::instruction_set::AVX512VBMI2 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_IMPLEMENTATION_H +/* end file simdjson/icelake/implementation.h */ +namespace simdjson { +namespace internal { +static const icelake::implementation* get_icelake_singleton() { + static const icelake::implementation icelake_singleton{}; + return &icelake_singleton; +} +} // namespace internal +} // namespace simdjson +#endif + +#if SIMDJSON_IMPLEMENTATION_PPC64 +/* including simdjson/ppc64/implementation.h: #include */ +/* begin file simdjson/ppc64/implementation.h */ +#ifndef SIMDJSON_PPC64_IMPLEMENTATION_H +#define SIMDJSON_PPC64_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +/** + * Implementation for ALTIVEC (PPC64). + */ +namespace ppc64 { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() + : simdjson::implementation("ppc64", "PPC64 ALTIVEC", + internal::instruction_set::ALTIVEC) {} + + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, size_t max_length, + std::unique_ptr &dst) + const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, + uint8_t *dst, + size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, + size_t len) const noexcept final; +}; + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_IMPLEMENTATION_H +/* end file simdjson/ppc64/implementation.h */ +namespace simdjson { +namespace internal { +static const ppc64::implementation* get_ppc64_singleton() { + static const ppc64::implementation ppc64_singleton{}; + return &ppc64_singleton; +} +} // namespace internal +} // namespace simdjson +#endif // SIMDJSON_IMPLEMENTATION_PPC64 + +#if SIMDJSON_IMPLEMENTATION_WESTMERE +/* including simdjson/westmere/implementation.h: #include */ +/* begin file simdjson/westmere/implementation.h */ +#ifndef SIMDJSON_WESTMERE_IMPLEMENTATION_H +#define SIMDJSON_WESTMERE_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +namespace westmere { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation("westmere", "Intel/AMD SSE4.2", internal::instruction_set::SSE42 | internal::instruction_set::PCLMULQDQ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_IMPLEMENTATION_H +/* end file simdjson/westmere/implementation.h */ +namespace simdjson { +namespace internal { +static const simdjson::westmere::implementation* get_westmere_singleton() { + static const simdjson::westmere::implementation westmere_singleton{}; + return &westmere_singleton; +} +} // namespace internal +} // namespace simdjson +#endif // SIMDJSON_IMPLEMENTATION_WESTMERE + +/* undefining SIMDJSON_CONDITIONAL_INCLUDE */ +#undef SIMDJSON_CONDITIONAL_INCLUDE + +namespace simdjson { +namespace internal { + +// Static array of known implementations. We're hoping these get baked into the executable +// without requiring a static initializer. + +/** + * @private Detects best supported implementation on first use, and sets it + */ +class detect_best_supported_implementation_on_first_use final : public implementation { +public: + const std::string &name() const noexcept final { return set_best()->name(); } + const std::string &description() const noexcept final { return set_best()->description(); } + uint32_t required_instruction_sets() const noexcept final { return set_best()->required_instruction_sets(); } + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final { + return set_best()->create_dom_parser_implementation(capacity, max_length, dst); + } + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final { + return set_best()->minify(buf, len, dst, dst_len); + } + simdjson_warn_unused bool validate_utf8(const char * buf, size_t len) const noexcept final override { + return set_best()->validate_utf8(buf, len); + } + simdjson_inline detect_best_supported_implementation_on_first_use() noexcept : implementation("best_supported_detector", "Detects the best supported implementation and sets it", 0) {} +private: + const implementation *set_best() const noexcept; +}; + +static const std::initializer_list& get_available_implementation_pointers() { + static const std::initializer_list available_implementation_pointers { +#if SIMDJSON_IMPLEMENTATION_ICELAKE + get_icelake_singleton(), +#endif +#if SIMDJSON_IMPLEMENTATION_HASWELL + get_haswell_singleton(), +#endif +#if SIMDJSON_IMPLEMENTATION_WESTMERE + get_westmere_singleton(), +#endif +#if SIMDJSON_IMPLEMENTATION_ARM64 + get_arm64_singleton(), +#endif +#if SIMDJSON_IMPLEMENTATION_PPC64 + get_ppc64_singleton(), +#endif +#if SIMDJSON_IMPLEMENTATION_FALLBACK + get_fallback_singleton(), +#endif + }; // available_implementation_pointers + return available_implementation_pointers; +} + +// So we can return UNSUPPORTED_ARCHITECTURE from the parser when there is no support +class unsupported_implementation final : public implementation { +public: + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t, + size_t, + std::unique_ptr& + ) const noexcept final { + return UNSUPPORTED_ARCHITECTURE; + } + simdjson_warn_unused error_code minify(const uint8_t *, size_t, uint8_t *, size_t &) const noexcept final override { + return UNSUPPORTED_ARCHITECTURE; + } + simdjson_warn_unused bool validate_utf8(const char *, size_t) const noexcept final override { + return false; // Just refuse to validate. Given that we have a fallback implementation + // it seems unlikely that unsupported_implementation will ever be used. If it is used, + // then it will flag all strings as invalid. The alternative is to return an error_code + // from which the user has to figure out whether the string is valid UTF-8... which seems + // like a lot of work just to handle the very unlikely case that we have an unsupported + // implementation. And, when it does happen (that we have an unsupported implementation), + // what are the chances that the programmer has a fallback? Given that *we* provide the + // fallback, it implies that the programmer would need a fallback for our fallback. + } + unsupported_implementation() : implementation("unsupported", "Unsupported CPU (no detected SIMD instructions)", 0) {} +}; + +const unsupported_implementation* get_unsupported_singleton() { + static const unsupported_implementation unsupported_singleton{}; + return &unsupported_singleton; +} + +size_t available_implementation_list::size() const noexcept { + return internal::get_available_implementation_pointers().size(); +} +const implementation * const *available_implementation_list::begin() const noexcept { + return internal::get_available_implementation_pointers().begin(); +} +const implementation * const *available_implementation_list::end() const noexcept { + return internal::get_available_implementation_pointers().end(); +} +const implementation *available_implementation_list::detect_best_supported() const noexcept { + // They are prelisted in priority order, so we just go down the list + uint32_t supported_instruction_sets = internal::detect_supported_architectures(); + for (const implementation *impl : internal::get_available_implementation_pointers()) { + uint32_t required_instruction_sets = impl->required_instruction_sets(); + if ((supported_instruction_sets & required_instruction_sets) == required_instruction_sets) { return impl; } + } + return get_unsupported_singleton(); // this should never happen? +} + +const implementation *detect_best_supported_implementation_on_first_use::set_best() const noexcept { + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + char *force_implementation_name = getenv("SIMDJSON_FORCE_IMPLEMENTATION"); + SIMDJSON_POP_DISABLE_WARNINGS + + if (force_implementation_name) { + auto force_implementation = get_available_implementations()[force_implementation_name]; + if (force_implementation) { + return get_active_implementation() = force_implementation; + } else { + // Note: abort() and stderr usage within the library is forbidden. + return get_active_implementation() = get_unsupported_singleton(); + } + } + return get_active_implementation() = get_available_implementations().detect_best_supported(); +} + +} // namespace internal + +SIMDJSON_DLLIMPORTEXPORT const internal::available_implementation_list& get_available_implementations() { + static const internal::available_implementation_list available_implementations{}; + return available_implementations; +} + +SIMDJSON_DLLIMPORTEXPORT internal::atomic_ptr& get_active_implementation() { + static const internal::detect_best_supported_implementation_on_first_use detect_best_supported_implementation_on_first_use_singleton; + static internal::atomic_ptr active_implementation{&detect_best_supported_implementation_on_first_use_singleton}; + return active_implementation; +} + +simdjson_warn_unused error_code minify(const char *buf, size_t len, char *dst, size_t &dst_len) noexcept { + return get_active_implementation()->minify(reinterpret_cast(buf), len, reinterpret_cast(dst), dst_len); +} +simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) noexcept { + return get_active_implementation()->validate_utf8(buf, len); +} +const implementation * builtin_implementation() { + static const implementation * builtin_impl = get_available_implementations()[SIMDJSON_STRINGIFY(SIMDJSON_BUILTIN_IMPLEMENTATION)]; + assert(builtin_impl); + return builtin_impl; +} + +} // namespace simdjson + +#endif // SIMDJSON_SRC_IMPLEMENTATION_CPP +/* end file implementation.cpp */ + +/* defining SIMDJSON_CONDITIONAL_INCLUDE */ +#define SIMDJSON_CONDITIONAL_INCLUDE + +#if SIMDJSON_IMPLEMENTATION_ARM64 +/* including arm64.cpp: #include */ +/* begin file arm64.cpp */ +#ifndef SIMDJSON_SRC_ARM64_CPP +#define SIMDJSON_SRC_ARM64_CPP + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* including simdjson/arm64.h: #include */ +/* begin file simdjson/arm64.h */ +#ifndef SIMDJSON_ARM64_H +#define SIMDJSON_ARM64_H + +/* including simdjson/arm64/begin.h: #include "simdjson/arm64/begin.h" */ +/* begin file simdjson/arm64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "arm64" */ +#define SIMDJSON_IMPLEMENTATION arm64 +/* including simdjson/arm64/base.h: #include "simdjson/arm64/base.h" */ +/* begin file simdjson/arm64/base.h */ +#ifndef SIMDJSON_ARM64_BASE_H +#define SIMDJSON_ARM64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for NEON (ARMv8). + */ +namespace arm64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BASE_H +/* end file simdjson/arm64/base.h */ +/* including simdjson/arm64/intrinsics.h: #include "simdjson/arm64/intrinsics.h" */ +/* begin file simdjson/arm64/intrinsics.h */ +#ifndef SIMDJSON_ARM64_INTRINSICS_H +#define SIMDJSON_ARM64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +static_assert(sizeof(uint8x16_t) <= simdjson::SIMDJSON_PADDING, "insufficient padding for arm64"); + +#endif // SIMDJSON_ARM64_INTRINSICS_H +/* end file simdjson/arm64/intrinsics.h */ +/* including simdjson/arm64/bitmanipulation.h: #include "simdjson/arm64/bitmanipulation.h" */ +/* begin file simdjson/arm64/bitmanipulation.h */ +#ifndef SIMDJSON_ARM64_BITMANIPULATION_H +#define SIMDJSON_ARM64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int count_ones(uint64_t input_num) { + return vaddv_u8(vcnt_u8(vcreate_u8(input_num))); +} + + +#if defined(__GNUC__) // catches clang and gcc +/** + * ARM has a fast 64-bit "bit reversal function" that is handy. However, + * it is not generally available as an intrinsic function under Visual + * Studio (though this might be changing). Even under clang/gcc, we + * apparently need to invoke inline assembly. + */ +/* + * We use SIMDJSON_PREFER_REVERSE_BITS as a hint that algorithms that + * work well with bit reversal may use it. + */ +#define SIMDJSON_PREFER_REVERSE_BITS 1 + +/* reverse the bits */ +simdjson_inline uint64_t reverse_bits(uint64_t input_num) { + uint64_t rev_bits; + __asm("rbit %0, %1" : "=r"(rev_bits) : "r"(input_num)); + return rev_bits; +} + +/** + * Flips bit at index 63 - lz. Thus if you have 'leading_zeroes' leading zeroes, + * then this will set to zero the leading bit. It is possible for leading_zeroes to be + * greating or equal to 63 in which case we trigger undefined behavior, but the output + * of such undefined behavior is never used. + **/ +SIMDJSON_NO_SANITIZE_UNDEFINED +simdjson_inline uint64_t zero_leading_bit(uint64_t rev_bits, int leading_zeroes) { + return rev_bits ^ (uint64_t(0x8000000000000000) >> leading_zeroes); +} + +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BITMANIPULATION_H +/* end file simdjson/arm64/bitmanipulation.h */ +/* including simdjson/arm64/bitmask.h: #include "simdjson/arm64/bitmask.h" */ +/* begin file simdjson/arm64/bitmask.h */ +#ifndef SIMDJSON_ARM64_BITMASK_H +#define SIMDJSON_ARM64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + ///////////// + // We could do this with PMULL, but it is apparently slow. + // + //#ifdef __ARM_FEATURE_CRYPTO // some ARM processors lack this extension + //return vmull_p64(-1ULL, bitmask); + //#else + // Analysis by @sebpop: + // When diffing the assembly for src/stage1_find_marks.cpp I see that the eors are all spread out + // in between other vector code, so effectively the extra cycles of the sequence do not matter + // because the GPR units are idle otherwise and the critical path is on the FP side. + // Also the PMULL requires two extra fmovs: GPR->FP (3 cycles in N1, 5 cycles in A72 ) + // and FP->GPR (2 cycles on N1 and 5 cycles on A72.) + /////////// + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif +/* end file simdjson/arm64/bitmask.h */ +/* including simdjson/arm64/numberparsing_defs.h: #include "simdjson/arm64/numberparsing_defs.h" */ +/* begin file simdjson/arm64/numberparsing_defs.h */ +#ifndef SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +#define SIMDJSON_ARM64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if _M_ARM64 +// __umulh requires intrin.h +#include +#endif // _M_ARM64 + +namespace simdjson { +namespace arm64 { +namespace numberparsing { + +// we don't have SSE, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace arm64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +/* end file simdjson/arm64/numberparsing_defs.h */ +/* including simdjson/arm64/simd.h: #include "simdjson/arm64/simd.h" */ +/* begin file simdjson/arm64/simd.h */ +#ifndef SIMDJSON_ARM64_SIMD_H +#define SIMDJSON_ARM64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace simd { + +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO +namespace { +// Start of private section with Visual Studio workaround + + +/** + * make_uint8x16_t initializes a SIMD register (uint8x16_t). + * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} + * is not recognized under Visual Studio! This is a workaround. + * Using a std::initializer_list as a parameter resulted in + * inefficient code. With the current approach, if the parameters are + * compile-time constants, + * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. + * You should not use this function except for compile-time constants: + * it is not efficient. + */ +simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, + uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, + uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { + // Doing a load like so end ups generating worse code. + // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_u8(array); + uint8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_u8(x1, x, 0); + x = vsetq_lane_u8(x2, x, 1); + x = vsetq_lane_u8(x3, x, 2); + x = vsetq_lane_u8(x4, x, 3); + x = vsetq_lane_u8(x5, x, 4); + x = vsetq_lane_u8(x6, x, 5); + x = vsetq_lane_u8(x7, x, 6); + x = vsetq_lane_u8(x8, x, 7); + x = vsetq_lane_u8(x9, x, 8); + x = vsetq_lane_u8(x10, x, 9); + x = vsetq_lane_u8(x11, x, 10); + x = vsetq_lane_u8(x12, x, 11); + x = vsetq_lane_u8(x13, x, 12); + x = vsetq_lane_u8(x14, x, 13); + x = vsetq_lane_u8(x15, x, 14); + x = vsetq_lane_u8(x16, x, 15); + return x; +} + +simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { + uint8x8_t x{}; + x = vset_lane_u8(x1, x, 0); + x = vset_lane_u8(x2, x, 1); + x = vset_lane_u8(x3, x, 2); + x = vset_lane_u8(x4, x, 3); + x = vset_lane_u8(x5, x, 4); + x = vset_lane_u8(x6, x, 5); + x = vset_lane_u8(x7, x, 6); + x = vset_lane_u8(x8, x, 7); + return x; +} + +// We have to do the same work for make_int8x16_t +simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, + int8_t x5, int8_t x6, int8_t x7, int8_t x8, + int8_t x9, int8_t x10, int8_t x11, int8_t x12, + int8_t x13, int8_t x14, int8_t x15, int8_t x16) { + // Doing a load like so end ups generating worse code. + // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_s8(array); + int8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_s8(x1, x, 0); + x = vsetq_lane_s8(x2, x, 1); + x = vsetq_lane_s8(x3, x, 2); + x = vsetq_lane_s8(x4, x, 3); + x = vsetq_lane_s8(x5, x, 4); + x = vsetq_lane_s8(x6, x, 5); + x = vsetq_lane_s8(x7, x, 6); + x = vsetq_lane_s8(x8, x, 7); + x = vsetq_lane_s8(x9, x, 8); + x = vsetq_lane_s8(x10, x, 9); + x = vsetq_lane_s8(x11, x, 10); + x = vsetq_lane_s8(x12, x, 11); + x = vsetq_lane_s8(x13, x, 12); + x = vsetq_lane_s8(x14, x, 13); + x = vsetq_lane_s8(x15, x, 14); + x = vsetq_lane_s8(x16, x, 15); + return x; +} + +// End of private section with Visual Studio workaround +} // namespace +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO + + + template + struct simd8; + + // + // Base class of simd8 and simd8, both of which use uint8x16_t internally. + // + template> + struct base_u8 { + uint8x16_t value; + static const int SIZE = sizeof(value); + + // Conversion from/to SIMD register + simdjson_inline base_u8(const uint8x16_t _value) : value(_value) {} + simdjson_inline operator const uint8x16_t&() const { return this->value; } + simdjson_inline operator uint8x16_t&() { return this->value; } + + // Bit operations + simdjson_inline simd8 operator|(const simd8 other) const { return vorrq_u8(*this, other); } + simdjson_inline simd8 operator&(const simd8 other) const { return vandq_u8(*this, other); } + simdjson_inline simd8 operator^(const simd8 other) const { return veorq_u8(*this, other); } + simdjson_inline simd8 bit_andnot(const simd8 other) const { return vbicq_u8(*this, other); } + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + simdjson_inline simd8& operator|=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline simd8& operator&=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline simd8& operator^=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast ^ other; return *this_cast; } + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return vceqq_u8(lhs, rhs); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_u8(prev_chunk, *this, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base_u8 { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + static simdjson_inline simd8 splat(bool _value) { return vmovq_n_u8(uint8_t(-(!!_value))); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // False constructor + simdjson_inline simd8() : simd8(vdupq_n_u8(0)) {} + // Splat constructor + simdjson_inline simd8(bool _value) : simd8(splat(_value)) {} + + // We return uint32_t instead of uint16_t because that seems to be more efficient for most + // purposes (cutting it down to uint16_t costs performance in some compilers). + simdjson_inline uint32_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); +#else + const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +#endif + auto minput = *this & bit_mask; + uint8x16_t tmp = vpaddq_u8(minput, minput); + tmp = vpaddq_u8(tmp, tmp); + tmp = vpaddq_u8(tmp, tmp); + return vgetq_lane_u16(vreinterpretq_u16_u8(tmp), 0); + } + simdjson_inline bool any() const { return vmaxvq_u8(*this) != 0; } + }; + + // Unsigned bytes + template<> + struct simd8: base_u8 { + static simdjson_inline uint8x16_t splat(uint8_t _value) { return vmovq_n_u8(_value); } + static simdjson_inline uint8x16_t zero() { return vdupq_n_u8(0); } + static simdjson_inline uint8x16_t load(const uint8_t* values) { return vld1q_u8(values); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[16]) : simd8(load(values)) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(make_uint8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(uint8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(uint8_t dst[16]) const { return vst1q_u8(dst, *this); } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return vqaddq_u8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return vqsubq_u8(*this, other); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_u8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_u8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-specific operations + simdjson_inline uint8_t max_val() const { return vmaxvq_u8(*this); } + simdjson_inline uint8_t min_val() const { return vminvq_u8(*this); } + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_u8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_u8(*this, other); } + simdjson_inline simd8 operator<=(const simd8 other) const { return vcleq_u8(*this, other); } + simdjson_inline simd8 operator>=(const simd8 other) const { return vcgeq_u8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_u8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_u8(*this, other); } + // Same as >, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 gt_bits(const simd8 other) const { return simd8(*this > other); } + // Same as <, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 lt_bits(const simd8 other) const { return simd8(*this < other); } + + // Bit-specific operations + simdjson_inline simd8 any_bits_set(simd8 bits) const { return vtstq_u8(*this, bits); } + simdjson_inline bool any_bits_set_anywhere() const { return this->max_val() != 0; } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return (*this & bits).any_bits_set_anywhere(); } + template + simdjson_inline simd8 shr() const { return vshrq_n_u8(*this, N); } + template + simdjson_inline simd8 shl() const { return vshlq_n_u8(*this, N); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint16_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + uint64x2_t shufmask64 = {thintable_epi8[mask1], thintable_epi8[mask2]}; + uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + shufmask = vaddq_u8(shufmask, inc); + // this is the version "nearly pruned" + uint8x16_t pruned = vqtbl1q_u8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + uint8x16_t compactmask = vld1q_u8(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + uint8x16_t answer = vqtbl1q_u8(pruned, compactmask); + vst1q_u8(reinterpret_cast(output), answer); + } + + // Copies all bytes corresponding to a 0 in the low half of the mask (interpreted as a + // bitset) to output1, then those corresponding to a 0 in the high half to output2. + template + simdjson_inline void compress_halves(uint16_t mask, L *output1, L *output2) const { + using internal::thintable_epi8; + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + uint8x8_t compactmask1 = vcreate_u8(thintable_epi8[mask1]); + uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + compactmask2 = vadd_u8(compactmask2, inc); + // store each result (with the second store possibly overlapping the first) + vst1_u8((uint8_t*)output1, vqtbl1_u8(*this, compactmask1)); + vst1_u8((uint8_t*)output2, vqtbl1_u8(*this, compactmask2)); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_u8(*this, simd8(original)); + } + }; + + // Signed bytes + template<> + struct simd8 { + int8x16_t value; + + static simdjson_inline simd8 splat(int8_t _value) { return vmovq_n_s8(_value); } + static simdjson_inline simd8 zero() { return vdupq_n_s8(0); } + static simdjson_inline simd8 load(const int8_t values[16]) { return vld1q_s8(values); } + + // Conversion from/to SIMD register + simdjson_inline simd8(const int8x16_t _value) : value{_value} {} + simdjson_inline operator const int8x16_t&() const { return this->value; } + simdjson_inline operator int8x16_t&() { return this->value; } + + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(make_int8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(int8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(int8_t dst[16]) const { return vst1q_s8(dst, *this); } + + // Explicit conversion to/from unsigned + // + // Under Visual Studio/ARM64 uint8x16_t and int8x16_t are apparently the same type. + // In theory, we could check this occurrence with std::same_as and std::enabled_if but it is C++14 + // and relatively ugly and hard to read. +#ifndef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline explicit simd8(const uint8x16_t other): simd8(vreinterpretq_s8_u8(other)) {} +#endif + simdjson_inline explicit operator simd8() const { return vreinterpretq_u8_s8(this->value); } + + // Math + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_s8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_s8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_s8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_s8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_s8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_s8(*this, other); } + simdjson_inline simd8 operator==(const simd8 other) const { return vceqq_s8(*this, other); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_s8(prev_chunk, *this, 16 - N); + } + + // Perform a lookup assuming no value is larger than 16 + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_s8(*this, simd8(original)); + } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "ARM kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint64_t popcounts = vget_lane_u64(vreinterpret_u64_u8(vcnt_u8(vcreate_u8(~mask))), 0); + // compute the prefix sum of the popcounts of each byte + uint64_t offsets = popcounts * 0x0101010101010101; + this->chunks[0].compress_halves(uint16_t(mask), output, &output[popcounts & 0xFF]); + this->chunks[1].compress_halves(uint16_t(mask >> 16), &output[(offsets >> 8) & 0xFF], &output[(offsets >> 16) & 0xFF]); + this->chunks[2].compress_halves(uint16_t(mask >> 32), &output[(offsets >> 24) & 0xFF], &output[(offsets >> 32) & 0xFF]); + this->chunks[3].compress_halves(uint16_t(mask >> 48), &output[(offsets >> 40) & 0xFF], &output[(offsets >> 48) & 0xFF]); + return offsets >> 56; + } + + simdjson_inline uint64_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t( + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + ); +#else + const uint8x16_t bit_mask = { + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + }; +#endif + // Add each of the elements next to each other, successively, to stuff each 8 byte mask into one. + uint8x16_t sum0 = vpaddq_u8(this->chunks[0] & bit_mask, this->chunks[1] & bit_mask); + uint8x16_t sum1 = vpaddq_u8(this->chunks[2] & bit_mask, this->chunks[3] & bit_mask); + sum0 = vpaddq_u8(sum0, sum1); + sum0 = vpaddq_u8(sum0, sum0); + return vgetq_lane_u64(vreinterpretq_u64_u8(sum0), 0); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_SIMD_H +/* end file simdjson/arm64/simd.h */ +/* including simdjson/arm64/stringparsing_defs.h: #include "simdjson/arm64/stringparsing_defs.h" */ +/* begin file simdjson/arm64/stringparsing_defs.h */ +#ifndef SIMDJSON_ARM64_STRINGPARSING_DEFS_H +#define SIMDJSON_ARM64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on ARM; therefore, we + // smash them together into a 64-byte mask and get the bitmask from there. + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_STRINGPARSING_DEFS_H +/* end file simdjson/arm64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/arm64/begin.h */ +/* including simdjson/generic/amalgamated.h for arm64: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for arm64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for arm64: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for arm64 */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for arm64 */ +/* including simdjson/generic/jsoncharutils.h for arm64: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for arm64 */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for arm64 */ +/* including simdjson/generic/atomparsing.h for arm64: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace arm64 { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for arm64 */ +/* including simdjson/generic/dom_parser_implementation.h for arm64: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for arm64 */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { +namespace arm64 { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for arm64 */ +/* including simdjson/generic/implementation_simdjson_result_base.h for arm64: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for arm64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for arm64 */ +/* including simdjson/generic/numberparsing.h for arm64: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for arm64 */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace arm64 { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for arm64 */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for arm64: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for arm64 */ +/* end file simdjson/generic/amalgamated.h for arm64 */ +/* including simdjson/arm64/end.h: #include "simdjson/arm64/end.h" */ +/* begin file simdjson/arm64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "arm64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/arm64/end.h */ + +#endif // SIMDJSON_ARM64_H +/* end file simdjson/arm64.h */ +/* including simdjson/arm64/implementation.h: #include */ +/* begin file simdjson/arm64/implementation.h */ +#ifndef SIMDJSON_ARM64_IMPLEMENTATION_H +#define SIMDJSON_ARM64_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation("arm64", "ARM NEON", internal::instruction_set::NEON) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_IMPLEMENTATION_H +/* end file simdjson/arm64/implementation.h */ + +/* including simdjson/arm64/begin.h: #include */ +/* begin file simdjson/arm64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "arm64" */ +#define SIMDJSON_IMPLEMENTATION arm64 +/* including simdjson/arm64/base.h: #include "simdjson/arm64/base.h" */ +/* begin file simdjson/arm64/base.h */ +#ifndef SIMDJSON_ARM64_BASE_H +#define SIMDJSON_ARM64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for NEON (ARMv8). + */ +namespace arm64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BASE_H +/* end file simdjson/arm64/base.h */ +/* including simdjson/arm64/intrinsics.h: #include "simdjson/arm64/intrinsics.h" */ +/* begin file simdjson/arm64/intrinsics.h */ +#ifndef SIMDJSON_ARM64_INTRINSICS_H +#define SIMDJSON_ARM64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +static_assert(sizeof(uint8x16_t) <= simdjson::SIMDJSON_PADDING, "insufficient padding for arm64"); + +#endif // SIMDJSON_ARM64_INTRINSICS_H +/* end file simdjson/arm64/intrinsics.h */ +/* including simdjson/arm64/bitmanipulation.h: #include "simdjson/arm64/bitmanipulation.h" */ +/* begin file simdjson/arm64/bitmanipulation.h */ +#ifndef SIMDJSON_ARM64_BITMANIPULATION_H +#define SIMDJSON_ARM64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int count_ones(uint64_t input_num) { + return vaddv_u8(vcnt_u8(vcreate_u8(input_num))); +} + + +#if defined(__GNUC__) // catches clang and gcc +/** + * ARM has a fast 64-bit "bit reversal function" that is handy. However, + * it is not generally available as an intrinsic function under Visual + * Studio (though this might be changing). Even under clang/gcc, we + * apparently need to invoke inline assembly. + */ +/* + * We use SIMDJSON_PREFER_REVERSE_BITS as a hint that algorithms that + * work well with bit reversal may use it. + */ +#define SIMDJSON_PREFER_REVERSE_BITS 1 + +/* reverse the bits */ +simdjson_inline uint64_t reverse_bits(uint64_t input_num) { + uint64_t rev_bits; + __asm("rbit %0, %1" : "=r"(rev_bits) : "r"(input_num)); + return rev_bits; +} + +/** + * Flips bit at index 63 - lz. Thus if you have 'leading_zeroes' leading zeroes, + * then this will set to zero the leading bit. It is possible for leading_zeroes to be + * greating or equal to 63 in which case we trigger undefined behavior, but the output + * of such undefined behavior is never used. + **/ +SIMDJSON_NO_SANITIZE_UNDEFINED +simdjson_inline uint64_t zero_leading_bit(uint64_t rev_bits, int leading_zeroes) { + return rev_bits ^ (uint64_t(0x8000000000000000) >> leading_zeroes); +} + +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BITMANIPULATION_H +/* end file simdjson/arm64/bitmanipulation.h */ +/* including simdjson/arm64/bitmask.h: #include "simdjson/arm64/bitmask.h" */ +/* begin file simdjson/arm64/bitmask.h */ +#ifndef SIMDJSON_ARM64_BITMASK_H +#define SIMDJSON_ARM64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + ///////////// + // We could do this with PMULL, but it is apparently slow. + // + //#ifdef __ARM_FEATURE_CRYPTO // some ARM processors lack this extension + //return vmull_p64(-1ULL, bitmask); + //#else + // Analysis by @sebpop: + // When diffing the assembly for src/stage1_find_marks.cpp I see that the eors are all spread out + // in between other vector code, so effectively the extra cycles of the sequence do not matter + // because the GPR units are idle otherwise and the critical path is on the FP side. + // Also the PMULL requires two extra fmovs: GPR->FP (3 cycles in N1, 5 cycles in A72 ) + // and FP->GPR (2 cycles on N1 and 5 cycles on A72.) + /////////// + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif +/* end file simdjson/arm64/bitmask.h */ +/* including simdjson/arm64/numberparsing_defs.h: #include "simdjson/arm64/numberparsing_defs.h" */ +/* begin file simdjson/arm64/numberparsing_defs.h */ +#ifndef SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +#define SIMDJSON_ARM64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if _M_ARM64 +// __umulh requires intrin.h +#include +#endif // _M_ARM64 + +namespace simdjson { +namespace arm64 { +namespace numberparsing { + +// we don't have SSE, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace arm64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +/* end file simdjson/arm64/numberparsing_defs.h */ +/* including simdjson/arm64/simd.h: #include "simdjson/arm64/simd.h" */ +/* begin file simdjson/arm64/simd.h */ +#ifndef SIMDJSON_ARM64_SIMD_H +#define SIMDJSON_ARM64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace simd { + +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO +namespace { +// Start of private section with Visual Studio workaround + + +/** + * make_uint8x16_t initializes a SIMD register (uint8x16_t). + * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} + * is not recognized under Visual Studio! This is a workaround. + * Using a std::initializer_list as a parameter resulted in + * inefficient code. With the current approach, if the parameters are + * compile-time constants, + * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. + * You should not use this function except for compile-time constants: + * it is not efficient. + */ +simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, + uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, + uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { + // Doing a load like so end ups generating worse code. + // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_u8(array); + uint8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_u8(x1, x, 0); + x = vsetq_lane_u8(x2, x, 1); + x = vsetq_lane_u8(x3, x, 2); + x = vsetq_lane_u8(x4, x, 3); + x = vsetq_lane_u8(x5, x, 4); + x = vsetq_lane_u8(x6, x, 5); + x = vsetq_lane_u8(x7, x, 6); + x = vsetq_lane_u8(x8, x, 7); + x = vsetq_lane_u8(x9, x, 8); + x = vsetq_lane_u8(x10, x, 9); + x = vsetq_lane_u8(x11, x, 10); + x = vsetq_lane_u8(x12, x, 11); + x = vsetq_lane_u8(x13, x, 12); + x = vsetq_lane_u8(x14, x, 13); + x = vsetq_lane_u8(x15, x, 14); + x = vsetq_lane_u8(x16, x, 15); + return x; +} + +simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { + uint8x8_t x{}; + x = vset_lane_u8(x1, x, 0); + x = vset_lane_u8(x2, x, 1); + x = vset_lane_u8(x3, x, 2); + x = vset_lane_u8(x4, x, 3); + x = vset_lane_u8(x5, x, 4); + x = vset_lane_u8(x6, x, 5); + x = vset_lane_u8(x7, x, 6); + x = vset_lane_u8(x8, x, 7); + return x; +} + +// We have to do the same work for make_int8x16_t +simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, + int8_t x5, int8_t x6, int8_t x7, int8_t x8, + int8_t x9, int8_t x10, int8_t x11, int8_t x12, + int8_t x13, int8_t x14, int8_t x15, int8_t x16) { + // Doing a load like so end ups generating worse code. + // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_s8(array); + int8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_s8(x1, x, 0); + x = vsetq_lane_s8(x2, x, 1); + x = vsetq_lane_s8(x3, x, 2); + x = vsetq_lane_s8(x4, x, 3); + x = vsetq_lane_s8(x5, x, 4); + x = vsetq_lane_s8(x6, x, 5); + x = vsetq_lane_s8(x7, x, 6); + x = vsetq_lane_s8(x8, x, 7); + x = vsetq_lane_s8(x9, x, 8); + x = vsetq_lane_s8(x10, x, 9); + x = vsetq_lane_s8(x11, x, 10); + x = vsetq_lane_s8(x12, x, 11); + x = vsetq_lane_s8(x13, x, 12); + x = vsetq_lane_s8(x14, x, 13); + x = vsetq_lane_s8(x15, x, 14); + x = vsetq_lane_s8(x16, x, 15); + return x; +} + +// End of private section with Visual Studio workaround +} // namespace +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO + + + template + struct simd8; + + // + // Base class of simd8 and simd8, both of which use uint8x16_t internally. + // + template> + struct base_u8 { + uint8x16_t value; + static const int SIZE = sizeof(value); + + // Conversion from/to SIMD register + simdjson_inline base_u8(const uint8x16_t _value) : value(_value) {} + simdjson_inline operator const uint8x16_t&() const { return this->value; } + simdjson_inline operator uint8x16_t&() { return this->value; } + + // Bit operations + simdjson_inline simd8 operator|(const simd8 other) const { return vorrq_u8(*this, other); } + simdjson_inline simd8 operator&(const simd8 other) const { return vandq_u8(*this, other); } + simdjson_inline simd8 operator^(const simd8 other) const { return veorq_u8(*this, other); } + simdjson_inline simd8 bit_andnot(const simd8 other) const { return vbicq_u8(*this, other); } + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + simdjson_inline simd8& operator|=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline simd8& operator&=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline simd8& operator^=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast ^ other; return *this_cast; } + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return vceqq_u8(lhs, rhs); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_u8(prev_chunk, *this, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base_u8 { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + static simdjson_inline simd8 splat(bool _value) { return vmovq_n_u8(uint8_t(-(!!_value))); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // False constructor + simdjson_inline simd8() : simd8(vdupq_n_u8(0)) {} + // Splat constructor + simdjson_inline simd8(bool _value) : simd8(splat(_value)) {} + + // We return uint32_t instead of uint16_t because that seems to be more efficient for most + // purposes (cutting it down to uint16_t costs performance in some compilers). + simdjson_inline uint32_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); +#else + const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +#endif + auto minput = *this & bit_mask; + uint8x16_t tmp = vpaddq_u8(minput, minput); + tmp = vpaddq_u8(tmp, tmp); + tmp = vpaddq_u8(tmp, tmp); + return vgetq_lane_u16(vreinterpretq_u16_u8(tmp), 0); + } + simdjson_inline bool any() const { return vmaxvq_u8(*this) != 0; } + }; + + // Unsigned bytes + template<> + struct simd8: base_u8 { + static simdjson_inline uint8x16_t splat(uint8_t _value) { return vmovq_n_u8(_value); } + static simdjson_inline uint8x16_t zero() { return vdupq_n_u8(0); } + static simdjson_inline uint8x16_t load(const uint8_t* values) { return vld1q_u8(values); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[16]) : simd8(load(values)) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(make_uint8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(uint8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(uint8_t dst[16]) const { return vst1q_u8(dst, *this); } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return vqaddq_u8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return vqsubq_u8(*this, other); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_u8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_u8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-specific operations + simdjson_inline uint8_t max_val() const { return vmaxvq_u8(*this); } + simdjson_inline uint8_t min_val() const { return vminvq_u8(*this); } + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_u8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_u8(*this, other); } + simdjson_inline simd8 operator<=(const simd8 other) const { return vcleq_u8(*this, other); } + simdjson_inline simd8 operator>=(const simd8 other) const { return vcgeq_u8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_u8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_u8(*this, other); } + // Same as >, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 gt_bits(const simd8 other) const { return simd8(*this > other); } + // Same as <, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 lt_bits(const simd8 other) const { return simd8(*this < other); } + + // Bit-specific operations + simdjson_inline simd8 any_bits_set(simd8 bits) const { return vtstq_u8(*this, bits); } + simdjson_inline bool any_bits_set_anywhere() const { return this->max_val() != 0; } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return (*this & bits).any_bits_set_anywhere(); } + template + simdjson_inline simd8 shr() const { return vshrq_n_u8(*this, N); } + template + simdjson_inline simd8 shl() const { return vshlq_n_u8(*this, N); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint16_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + uint64x2_t shufmask64 = {thintable_epi8[mask1], thintable_epi8[mask2]}; + uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + shufmask = vaddq_u8(shufmask, inc); + // this is the version "nearly pruned" + uint8x16_t pruned = vqtbl1q_u8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + uint8x16_t compactmask = vld1q_u8(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + uint8x16_t answer = vqtbl1q_u8(pruned, compactmask); + vst1q_u8(reinterpret_cast(output), answer); + } + + // Copies all bytes corresponding to a 0 in the low half of the mask (interpreted as a + // bitset) to output1, then those corresponding to a 0 in the high half to output2. + template + simdjson_inline void compress_halves(uint16_t mask, L *output1, L *output2) const { + using internal::thintable_epi8; + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + uint8x8_t compactmask1 = vcreate_u8(thintable_epi8[mask1]); + uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + compactmask2 = vadd_u8(compactmask2, inc); + // store each result (with the second store possibly overlapping the first) + vst1_u8((uint8_t*)output1, vqtbl1_u8(*this, compactmask1)); + vst1_u8((uint8_t*)output2, vqtbl1_u8(*this, compactmask2)); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_u8(*this, simd8(original)); + } + }; + + // Signed bytes + template<> + struct simd8 { + int8x16_t value; + + static simdjson_inline simd8 splat(int8_t _value) { return vmovq_n_s8(_value); } + static simdjson_inline simd8 zero() { return vdupq_n_s8(0); } + static simdjson_inline simd8 load(const int8_t values[16]) { return vld1q_s8(values); } + + // Conversion from/to SIMD register + simdjson_inline simd8(const int8x16_t _value) : value{_value} {} + simdjson_inline operator const int8x16_t&() const { return this->value; } + simdjson_inline operator int8x16_t&() { return this->value; } + + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(make_int8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(int8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(int8_t dst[16]) const { return vst1q_s8(dst, *this); } + + // Explicit conversion to/from unsigned + // + // Under Visual Studio/ARM64 uint8x16_t and int8x16_t are apparently the same type. + // In theory, we could check this occurrence with std::same_as and std::enabled_if but it is C++14 + // and relatively ugly and hard to read. +#ifndef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline explicit simd8(const uint8x16_t other): simd8(vreinterpretq_s8_u8(other)) {} +#endif + simdjson_inline explicit operator simd8() const { return vreinterpretq_u8_s8(this->value); } + + // Math + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_s8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_s8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_s8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_s8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_s8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_s8(*this, other); } + simdjson_inline simd8 operator==(const simd8 other) const { return vceqq_s8(*this, other); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_s8(prev_chunk, *this, 16 - N); + } + + // Perform a lookup assuming no value is larger than 16 + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_s8(*this, simd8(original)); + } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "ARM kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint64_t popcounts = vget_lane_u64(vreinterpret_u64_u8(vcnt_u8(vcreate_u8(~mask))), 0); + // compute the prefix sum of the popcounts of each byte + uint64_t offsets = popcounts * 0x0101010101010101; + this->chunks[0].compress_halves(uint16_t(mask), output, &output[popcounts & 0xFF]); + this->chunks[1].compress_halves(uint16_t(mask >> 16), &output[(offsets >> 8) & 0xFF], &output[(offsets >> 16) & 0xFF]); + this->chunks[2].compress_halves(uint16_t(mask >> 32), &output[(offsets >> 24) & 0xFF], &output[(offsets >> 32) & 0xFF]); + this->chunks[3].compress_halves(uint16_t(mask >> 48), &output[(offsets >> 40) & 0xFF], &output[(offsets >> 48) & 0xFF]); + return offsets >> 56; + } + + simdjson_inline uint64_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t( + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + ); +#else + const uint8x16_t bit_mask = { + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + }; +#endif + // Add each of the elements next to each other, successively, to stuff each 8 byte mask into one. + uint8x16_t sum0 = vpaddq_u8(this->chunks[0] & bit_mask, this->chunks[1] & bit_mask); + uint8x16_t sum1 = vpaddq_u8(this->chunks[2] & bit_mask, this->chunks[3] & bit_mask); + sum0 = vpaddq_u8(sum0, sum1); + sum0 = vpaddq_u8(sum0, sum0); + return vgetq_lane_u64(vreinterpretq_u64_u8(sum0), 0); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_SIMD_H +/* end file simdjson/arm64/simd.h */ +/* including simdjson/arm64/stringparsing_defs.h: #include "simdjson/arm64/stringparsing_defs.h" */ +/* begin file simdjson/arm64/stringparsing_defs.h */ +#ifndef SIMDJSON_ARM64_STRINGPARSING_DEFS_H +#define SIMDJSON_ARM64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on ARM; therefore, we + // smash them together into a 64-byte mask and get the bitmask from there. + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_STRINGPARSING_DEFS_H +/* end file simdjson/arm64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/arm64/begin.h */ +/* including generic/amalgamated.h for arm64: #include */ +/* begin file generic/amalgamated.h for arm64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_SRC_GENERIC_DEPENDENCIES_H) +#error generic/dependencies.h must be included before generic/amalgamated.h! +#endif + +/* including generic/base.h for arm64: #include */ +/* begin file generic/base.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +struct json_character_block; + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_BASE_H +/* end file generic/base.h for arm64 */ +/* including generic/dom_parser_implementation.h for arm64: #include */ +/* begin file generic/dom_parser_implementation.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// Interface a dom parser implementation must fulfill +namespace simdjson { +namespace arm64 { +namespace { + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3); +simdjson_inline bool is_ascii(const simd8x64& input); + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file generic/dom_parser_implementation.h for arm64 */ +/* including generic/json_character_block.h for arm64: #include */ +/* begin file generic/json_character_block.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +struct json_character_block { + static simdjson_inline json_character_block classify(const simd::simd8x64& in); + + simdjson_inline uint64_t whitespace() const noexcept { return _whitespace; } + simdjson_inline uint64_t op() const noexcept { return _op; } + simdjson_inline uint64_t scalar() const noexcept { return ~(op() | whitespace()); } + + uint64_t _whitespace; + uint64_t _op; +}; + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H +/* end file generic/json_character_block.h for arm64 */ +/* end file generic/amalgamated.h for arm64 */ +/* including generic/stage1/amalgamated.h for arm64: #include */ +/* begin file generic/stage1/amalgamated.h for arm64 */ +// Stuff other things depend on +/* including generic/stage1/base.h for arm64: #include */ +/* begin file generic/stage1/base.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +class bit_indexer; +template +struct buf_block_reader; +struct json_block; +class json_minifier; +class json_scanner; +struct json_string_block; +class json_string_scanner; +class json_structural_indexer; + +} // namespace stage1 + +namespace utf8_validation { +struct utf8_checker; +} // namespace utf8_validation + +using utf8_validation::utf8_checker; + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BASE_H +/* end file generic/stage1/base.h for arm64 */ +/* including generic/stage1/buf_block_reader.h for arm64: #include */ +/* begin file generic/stage1/buf_block_reader.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +// Walks through a buffer in block-sized increments, loading the last part with spaces +template +struct buf_block_reader { +public: + simdjson_inline buf_block_reader(const uint8_t *_buf, size_t _len); + simdjson_inline size_t block_index(); + simdjson_inline bool has_full_block() const; + simdjson_inline const uint8_t *full_block() const; + /** + * Get the last block, padded with spaces. + * + * There will always be a last block, with at least 1 byte, unless len == 0 (in which case this + * function fills the buffer with spaces and returns 0. In particular, if len == STEP_SIZE there + * will be 0 full_blocks and 1 remainder block with STEP_SIZE bytes and no spaces for padding. + * + * @return the number of effective characters in the last block. + */ + simdjson_inline size_t get_remainder(uint8_t *dst) const; + simdjson_inline void advance(); +private: + const uint8_t *buf; + const size_t len; + const size_t lenminusstep; + size_t idx; +}; + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text_64(const uint8_t *text) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i); i++) { + buf[i] = int8_t(text[i]) < ' ' ? '_' : int8_t(text[i]); + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text(const simd8x64& in) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] < ' ') { buf[i] = '_'; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_input_text(const simd8x64& in, uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] <= ' ') { buf[i] = '_'; } + if (!(mask & (size_t(1) << i))) { buf[i] = ' '; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_mask(uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i<64; i++) { + buf[i] = (mask & (size_t(1) << i)) ? 'X' : ' '; + } + buf[64] = '\0'; + return buf; +} + +template +simdjson_inline buf_block_reader::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {} + +template +simdjson_inline size_t buf_block_reader::block_index() { return idx; } + +template +simdjson_inline bool buf_block_reader::has_full_block() const { + return idx < lenminusstep; +} + +template +simdjson_inline const uint8_t *buf_block_reader::full_block() const { + return &buf[idx]; +} + +template +simdjson_inline size_t buf_block_reader::get_remainder(uint8_t *dst) const { + if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers + std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once. + std::memcpy(dst, buf + idx, len - idx); + return len - idx; +} + +template +simdjson_inline void buf_block_reader::advance() { + idx += STEP_SIZE; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H +/* end file generic/stage1/buf_block_reader.h for arm64 */ +/* including generic/stage1/json_escape_scanner.h for arm64: #include */ +/* begin file generic/stage1/json_escape_scanner.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +/** + * Scans for escape characters in JSON, taking care with multiple backslashes (\\n vs. \n). + */ +struct json_escape_scanner { + /** The actual escape characters (the backslashes themselves). */ + uint64_t next_is_escaped = 0ULL; + + struct escaped_and_escape { + /** + * Mask of escaped characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 0100100010100101000 + * n \ \ n \ \ + * ``` + */ + uint64_t escaped; + /** + * Mask of escape characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 1001000101001010001 + * \ \ \ \ \ \ \ + * ``` + */ + uint64_t escape; + }; + + /** + * Get a mask of both escape and escaped characters (the characters following a backslash). + * + * @param potential_escape A mask of the character that can escape others (but could be + * escaped itself). e.g. block.eq('\\') + */ + simdjson_really_inline escaped_and_escape next(uint64_t backslash) noexcept { + +#if !SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT + if (!backslash) { return {next_escaped_without_backslashes(), 0}; } +#endif + + // | | Mask (shows characters instead of 1's) | Depth | Instructions | + // |--------------------------------|----------------------------------------|-------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | | | + // | | ` even odd even odd odd` | | | + // | potential_escape | ` \ \\\ \\\ \\\\ \\\\ \\\` | 1 | 1 (backslash & ~first_is_escaped) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 5 | 5 (next_escape_and_terminal_code()) + // | escaped | `\ \ n \ n \ \ \ \ \ ` X | 6 | 7 (escape_and_terminal_code ^ (potential_escape | first_is_escaped)) + // | escape | ` \ \ \ \ \ \ \ \ \ \` | 6 | 8 (escape_and_terminal_code & backslash) + // | first_is_escaped | `\ ` | 7 (*) | 9 (escape >> 63) () + // (*) this is not needed until the next iteration + uint64_t escape_and_terminal_code = next_escape_and_terminal_code(backslash & ~this->next_is_escaped); + uint64_t escaped = escape_and_terminal_code ^ (backslash | this->next_is_escaped); + uint64_t escape = escape_and_terminal_code & backslash; + this->next_is_escaped = escape >> 63; + return {escaped, escape}; + } + +private: + static constexpr const uint64_t ODD_BITS = 0xAAAAAAAAAAAAAAAAULL; + + simdjson_really_inline uint64_t next_escaped_without_backslashes() noexcept { + uint64_t escaped = this->next_is_escaped; + this->next_is_escaped = 0; + return escaped; + } + + /** + * Returns a mask of the next escape characters (masking out escaped backslashes), along with + * any non-backslash escape codes. + * + * \n \\n \\\n \\\\n returns: + * \n \ \ \n \ \ + * 11 100 1011 10100 + * + * You are expected to mask out the first bit yourself if the previous block had a trailing + * escape. + * + * & the result with potential_escape to get just the escape characters. + * ^ the result with (potential_escape | first_is_escaped) to get escaped characters. + */ + static simdjson_really_inline uint64_t next_escape_and_terminal_code(uint64_t potential_escape) noexcept { + // If we were to just shift and mask out any odd bits, we'd actually get a *half* right answer: + // any even-aligned backslash runs would be correct! Odd-aligned backslash runs would be + // inverted (\\\ would be 010 instead of 101). + // + // ``` + // string: | ____\\\\_\\\\_____ | + // maybe_escaped | ODD | \ \ \ \ | + // even-aligned ^^^ ^^^^ odd-aligned + // ``` + // + // Taking that into account, our basic strategy is: + // + // 1. Use subtraction to produce a mask with 1's for even-aligned runs and 0's for + // odd-aligned runs. + // 2. XOR all odd bits, which masks out the odd bits in even-aligned runs, and brings IN the + // odd bits in odd-aligned runs. + // 3. & with backslash to clean up any stray bits. + // runs are set to 0, and then XORing with "odd": + // + // | | Mask (shows characters instead of 1's) | Instructions | + // |--------------------------------|----------------------------------------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | + // | | ` even odd even odd odd` | + // | maybe_escaped | ` n \\n \\n \\\_ \\\_ \\` X | 1 (potential_escape << 1) + // | maybe_escaped_and_odd | ` \n_ \\n _ \\\n_ _ \\\__ _\\\_ \\\` | 1 (maybe_escaped | odd) + // | even_series_codes_and_odd | ` n_\\\ _ n_ _\\\\ _ _ ` | 1 (maybe_escaped_and_odd - potential_escape) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 1 (^ odd) + // + + // Escaped characters are characters following an escape. + uint64_t maybe_escaped = potential_escape << 1; + + // To distinguish odd from even escape sequences, therefore, we turn on any *starting* + // escapes that are on an odd byte. (We actually bring in all odd bits, for speed.) + // - Odd runs of backslashes are 0000, and the code at the end ("n" in \n or \\n) is 1. + // - Odd runs of backslashes are 1111, and the code at the end ("n" in \n or \\n) is 0. + // - All other odd bytes are 1, and even bytes are 0. + uint64_t maybe_escaped_and_odd_bits = maybe_escaped | ODD_BITS; + uint64_t even_series_codes_and_odd_bits = maybe_escaped_and_odd_bits - potential_escape; + + // Now we flip all odd bytes back with xor. This: + // - Makes odd runs of backslashes go from 0000 to 1010 + // - Makes even runs of backslashes go from 1111 to 1010 + // - Sets actually-escaped codes to 1 (the n in \n and \\n: \n = 11, \\n = 100) + // - Resets all other bytes to 0 + return even_series_codes_and_odd_bits ^ ODD_BITS; + } +}; + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_escape_scanner.h for arm64 */ +/* including generic/stage1/json_string_scanner.h for arm64: #include */ +/* begin file generic/stage1/json_string_scanner.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +struct json_string_block { + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_really_inline json_string_block(uint64_t escaped, uint64_t quote, uint64_t in_string) : + _escaped(escaped), _quote(quote), _in_string(in_string) {} + + // Escaped characters (characters following an escape() character) + simdjson_really_inline uint64_t escaped() const { return _escaped; } + // Real (non-backslashed) quotes + simdjson_really_inline uint64_t quote() const { return _quote; } + // Only characters inside the string (not including the quotes) + simdjson_really_inline uint64_t string_content() const { return _in_string & ~_quote; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_inside_string(uint64_t mask) const { return mask & _in_string; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_outside_string(uint64_t mask) const { return mask & ~_in_string; } + // Tail of string (everything except the start quote) + simdjson_really_inline uint64_t string_tail() const { return _in_string ^ _quote; } + + // escaped characters (backslashed--does not include the hex characters after \u) + uint64_t _escaped; + // real quotes (non-escaped ones) + uint64_t _quote; + // string characters (includes start quote but not end quote) + uint64_t _in_string; +}; + +// Scans blocks for string characters, storing the state necessary to do so +class json_string_scanner { +public: + simdjson_really_inline json_string_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_really_inline error_code finish(); + +private: + // Scans for escape characters + json_escape_scanner escape_scanner{}; + // Whether the last iteration was still inside a string (all 1's = true, all 0's = false). + uint64_t prev_in_string = 0ULL; +}; + +// +// Return a mask of all string characters plus end quotes. +// +// prev_escaped is overflow saying whether the next character is escaped. +// prev_in_string is overflow saying whether we're still in a string. +// +// Backslash sequences outside of quotes will be detected in stage 2. +// +simdjson_really_inline json_string_block json_string_scanner::next(const simd::simd8x64& in) { + const uint64_t backslash = in.eq('\\'); + const uint64_t escaped = escape_scanner.next(backslash).escaped; + const uint64_t quote = in.eq('"') & ~escaped; + + // + // prefix_xor flips on bits inside the string (and flips off the end quote). + // + // Then we xor with prev_in_string: if we were in a string already, its effect is flipped + // (characters inside strings are outside, and characters outside strings are inside). + // + const uint64_t in_string = prefix_xor(quote) ^ prev_in_string; + + // + // Check if we're still in a string at the end of the box so the next block will know + // + prev_in_string = uint64_t(static_cast(in_string) >> 63); + + // Use ^ to turn the beginning quote off, and the end quote on. + + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_string_block(escaped, quote, in_string); +} + +simdjson_really_inline error_code json_string_scanner::finish() { + if (prev_in_string) { + return UNCLOSED_STRING; + } + return SUCCESS; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_string_scanner.h for arm64 */ +/* including generic/stage1/utf8_lookup4_algorithm.h for arm64: #include */ +/* begin file generic/stage1/utf8_lookup4_algorithm.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace utf8_validation { + +using namespace simd; + + simdjson_inline simd8 check_special_cases(const simd8 input, const simd8 prev1) { +// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII) +// Bit 1 = Too Long (ASCII followed by continuation) +// Bit 2 = Overlong 3-byte +// Bit 4 = Surrogate +// Bit 5 = Overlong 2-byte +// Bit 7 = Two Continuations + constexpr const uint8_t TOO_SHORT = 1<<0; // 11______ 0_______ + // 11______ 11______ + constexpr const uint8_t TOO_LONG = 1<<1; // 0_______ 10______ + constexpr const uint8_t OVERLONG_3 = 1<<2; // 11100000 100_____ + constexpr const uint8_t SURROGATE = 1<<4; // 11101101 101_____ + constexpr const uint8_t OVERLONG_2 = 1<<5; // 1100000_ 10______ + constexpr const uint8_t TWO_CONTS = 1<<7; // 10______ 10______ + constexpr const uint8_t TOO_LARGE = 1<<3; // 11110100 1001____ + // 11110100 101_____ + // 11110101 1001____ + // 11110101 101_____ + // 1111011_ 1001____ + // 1111011_ 101_____ + // 11111___ 1001____ + // 11111___ 101_____ + constexpr const uint8_t TOO_LARGE_1000 = 1<<6; + // 11110101 1000____ + // 1111011_ 1000____ + // 11111___ 1000____ + constexpr const uint8_t OVERLONG_4 = 1<<6; // 11110000 1000____ + + const simd8 byte_1_high = prev1.shr<4>().lookup_16( + // 0_______ ________ + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + // 10______ ________ + TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS, + // 1100____ ________ + TOO_SHORT | OVERLONG_2, + // 1101____ ________ + TOO_SHORT, + // 1110____ ________ + TOO_SHORT | OVERLONG_3 | SURROGATE, + // 1111____ ________ + TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4 + ); + constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 . + const simd8 byte_1_low = (prev1 & 0x0F).lookup_16( + // ____0000 ________ + CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4, + // ____0001 ________ + CARRY | OVERLONG_2, + // ____001_ ________ + CARRY, + CARRY, + + // ____0100 ________ + CARRY | TOO_LARGE, + // ____0101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____011_ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + + // ____1___ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____1101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000 + ); + const simd8 byte_2_high = input.shr<4>().lookup_16( + // ________ 0_______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + + // ________ 1000____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4, + // ________ 1001____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE, + // ________ 101_____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + + // ________ 11______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT + ); + return (byte_1_high & byte_1_low & byte_2_high); + } + simdjson_inline simd8 check_multibyte_lengths(const simd8 input, + const simd8 prev_input, const simd8 sc) { + simd8 prev2 = input.prev<2>(prev_input); + simd8 prev3 = input.prev<3>(prev_input); + simd8 must23 = simd8(must_be_2_3_continuation(prev2, prev3)); + simd8 must23_80 = must23 & uint8_t(0x80); + return must23_80 ^ sc; + } + + // + // Return nonzero if there are incomplete multibyte characters at the end of the block: + // e.g. if there is a 4-byte character, but it's 3 bytes from the end. + // + simdjson_inline simd8 is_incomplete(const simd8 input) { + // If the previous input's last 3 bytes match this, they're too short (they ended at EOF): + // ... 1111____ 111_____ 11______ +#if SIMDJSON_IMPLEMENTATION_ICELAKE + static const uint8_t max_array[64] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#else + static const uint8_t max_array[32] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#endif + const simd8 max_value(&max_array[sizeof(max_array)-sizeof(simd8)]); + return input.gt_bits(max_value); + } + + struct utf8_checker { + // If this is nonzero, there has been a UTF-8 error. + simd8 error; + // The last input we received + simd8 prev_input_block; + // Whether the last input we received was incomplete (used for ASCII fast path) + simd8 prev_incomplete; + + // + // Check whether the current bytes are valid UTF-8. + // + simdjson_inline void check_utf8_bytes(const simd8 input, const simd8 prev_input) { + // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes + // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers) + simd8 prev1 = input.prev<1>(prev_input); + simd8 sc = check_special_cases(input, prev1); + this->error |= check_multibyte_lengths(input, prev_input, sc); + } + + // The only problem that can happen at EOF is that a multibyte character is too short + // or a byte value too large in the last bytes: check_special_cases only checks for bytes + // too large in the first of two bytes. + simdjson_inline void check_eof() { + // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't + // possibly finish them. + this->error |= this->prev_incomplete; + } + + simdjson_inline void check_next_input(const simd8x64& input) { + if(simdjson_likely(is_ascii(input))) { + this->error |= this->prev_incomplete; + } else { + // you might think that a for-loop would work, but under Visual Studio, it is not good enough. + static_assert((simd8x64::NUM_CHUNKS == 1) + ||(simd8x64::NUM_CHUNKS == 2) + || (simd8x64::NUM_CHUNKS == 4), + "We support one, two or four chunks per 64-byte block."); + SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 1) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 2) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 4) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + this->check_utf8_bytes(input.chunks[2], input.chunks[1]); + this->check_utf8_bytes(input.chunks[3], input.chunks[2]); + } + this->prev_incomplete = is_incomplete(input.chunks[simd8x64::NUM_CHUNKS-1]); + this->prev_input_block = input.chunks[simd8x64::NUM_CHUNKS-1]; + } + } + // do not forget to call check_eof! + simdjson_inline error_code errors() { + return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS; + } + + }; // struct utf8_checker +} // namespace utf8_validation + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H +/* end file generic/stage1/utf8_lookup4_algorithm.h for arm64 */ +/* including generic/stage1/json_scanner.h for arm64: #include */ +/* begin file generic/stage1/json_scanner.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +/** + * A block of scanned json, with information on operators and scalars. + * + * We seek to identify pseudo-structural characters. Anything that is inside + * a string must be omitted (hence & ~_string.string_tail()). + * Otherwise, pseudo-structural characters come in two forms. + * 1. We have the structural characters ([,],{,},:, comma). The + * term 'structural character' is from the JSON RFC. + * 2. We have the 'scalar pseudo-structural characters'. + * Scalars are quotes, and any character except structural characters and white space. + * + * To identify the scalar pseudo-structural characters, we must look at what comes + * before them: it must be a space, a quote or a structural characters. + * Starting with simdjson v0.3, we identify them by + * negation: we identify everything that is followed by a non-quote scalar, + * and we negate that. Whatever remains must be a 'scalar pseudo-structural character'. + */ +struct json_block { +public: + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_inline json_block(json_string_block&& string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(std::move(string)), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + simdjson_inline json_block(json_string_block string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + + /** + * The start of structurals. + * In simdjson prior to v0.3, these were called the pseudo-structural characters. + **/ + simdjson_inline uint64_t structural_start() const noexcept { return potential_structural_start() & ~_string.string_tail(); } + /** All JSON whitespace (i.e. not in a string) */ + simdjson_inline uint64_t whitespace() const noexcept { return non_quote_outside_string(_characters.whitespace()); } + + // Helpers + + /** Whether the given characters are inside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_inside_string(uint64_t mask) const noexcept { return _string.non_quote_inside_string(mask); } + /** Whether the given characters are outside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_outside_string(uint64_t mask) const noexcept { return _string.non_quote_outside_string(mask); } + + // string and escape characters + json_string_block _string; + // whitespace, structural characters ('operators'), scalars + json_character_block _characters; + // whether the previous character was a scalar + uint64_t _follows_potential_nonquote_scalar; +private: + // Potential structurals (i.e. disregarding strings) + + /** + * structural elements ([,],{,},:, comma) plus scalar starts like 123, true and "abc". + * They may reside inside a string. + **/ + simdjson_inline uint64_t potential_structural_start() const noexcept { return _characters.op() | potential_scalar_start(); } + /** + * The start of non-operator runs, like 123, true and "abc". + * It main reside inside a string. + **/ + simdjson_inline uint64_t potential_scalar_start() const noexcept { + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // Whenever it is preceded by something that is not a structural element ({,},[,],:, ") nor a white-space + // then we know that it is irrelevant structurally. + return _characters.scalar() & ~follows_potential_scalar(); + } + /** + * Whether the given character is immediately after a non-operator like 123, true. + * The characters following a quote are not included. + */ + simdjson_inline uint64_t follows_potential_scalar() const noexcept { + // _follows_potential_nonquote_scalar: is defined as marking any character that follows a character + // that is not a structural element ({,},[,],:, comma) nor a quote (") and that is not a + // white space. + // It is understood that within quoted region, anything at all could be marked (irrelevant). + return _follows_potential_nonquote_scalar; + } +}; + +/** + * Scans JSON for important bits: structural characters or 'operators', strings, and scalars. + * + * The scanner starts by calculating two distinct things: + * - string characters (taking \" into account) + * - structural characters or 'operators' ([]{},:, comma) + * and scalars (runs of non-operators like 123, true and "abc") + * + * To minimize data dependency (a key component of the scanner's speed), it finds these in parallel: + * in particular, the operator/scalar bit will find plenty of things that are actually part of + * strings. When we're done, json_block will fuse the two together by masking out tokens that are + * part of a string. + */ +class json_scanner { +public: + json_scanner() = default; + simdjson_inline json_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_inline error_code finish(); + +private: + // Whether the last character of the previous iteration is part of a scalar token + // (anything except whitespace or a structural character/'operator'). + uint64_t prev_scalar = 0ULL; + json_string_scanner string_scanner{}; +}; + + +// +// Check if the current character immediately follows a matching character. +// +// For example, this checks for quotes with backslashes in front of them: +// +// const uint64_t backslashed_quote = in.eq('"') & immediately_follows(in.eq('\'), prev_backslash); +// +simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) { + const uint64_t result = match << 1 | overflow; + overflow = match >> 63; + return result; +} + +simdjson_inline json_block json_scanner::next(const simd::simd8x64& in) { + json_string_block strings = string_scanner.next(in); + // identifies the white-space and the structural characters + json_character_block characters = json_character_block::classify(in); + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // We want follows_scalar to mark anything that follows a non-quote scalar (so letters and numbers). + // + // A terminal quote should either be followed by a structural character (comma, brace, bracket, colon) + // or nothing. However, we still want ' "a string"true ' to mark the 't' of 'true' as a potential + // pseudo-structural character just like we would if we had ' "a string" true '; otherwise we + // may need to add an extra check when parsing strings. + // + // Performance: there are many ways to skin this cat. + const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote(); + uint64_t follows_nonquote_scalar = follows(nonquote_scalar, prev_scalar); + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_block( + strings,// strings is a function-local object so either it moves or the copy is elided. + characters, + follows_nonquote_scalar + ); +} + +simdjson_inline error_code json_scanner::finish() { + return string_scanner.finish(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H +/* end file generic/stage1/json_scanner.h for arm64 */ + +// All other declarations +/* including generic/stage1/find_next_document_index.h for arm64: #include */ +/* begin file generic/stage1/find_next_document_index.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +/** + * This algorithm is used to quickly identify the last structural position that + * makes up a complete document. + * + * It does this by going backwards and finding the last *document boundary* (a + * place where one value follows another without a comma between them). If the + * last document (the characters after the boundary) has an equal number of + * start and end brackets, it is considered complete. + * + * Simply put, we iterate over the structural characters, starting from + * the end. We consider that we found the end of a JSON document when the + * first element of the pair is NOT one of these characters: '{' '[' ':' ',' + * and when the second element is NOT one of these characters: '}' ']' ':' ','. + * + * This simple comparison works most of the time, but it does not cover cases + * where the batch's structural indexes contain a perfect amount of documents. + * In such a case, we do not have access to the structural index which follows + * the last document, therefore, we do not have access to the second element in + * the pair, and that means we cannot identify the last document. To fix this + * issue, we keep a count of the open and closed curly/square braces we found + * while searching for the pair. When we find a pair AND the count of open and + * closed curly/square braces is the same, we know that we just passed a + * complete document, therefore the last json buffer location is the end of the + * batch. + */ +simdjson_inline uint32_t find_next_document_index(dom_parser_implementation &parser) { + // Variant: do not count separately, just figure out depth + if(parser.n_structural_indexes == 0) { return 0; } + auto arr_cnt = 0; + auto obj_cnt = 0; + for (auto i = parser.n_structural_indexes - 1; i > 0; i--) { + auto idxb = parser.structural_indexes[i]; + switch (parser.buf[idxb]) { + case ':': + case ',': + continue; + case '}': + obj_cnt--; + continue; + case ']': + arr_cnt--; + continue; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + auto idxa = parser.structural_indexes[i - 1]; + switch (parser.buf[idxa]) { + case '{': + case '[': + case ':': + case ',': + continue; + } + // Last document is complete, so the next document will appear after! + if (!arr_cnt && !obj_cnt) { + return parser.n_structural_indexes; + } + // Last document is incomplete; mark the document at i + 1 as the next one + return i; + } + // If we made it to the end, we want to finish counting to see if we have a full document. + switch (parser.buf[parser.structural_indexes[0]]) { + case '}': + obj_cnt--; + break; + case ']': + arr_cnt--; + break; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + if (!arr_cnt && !obj_cnt) { + // We have a complete document. + return parser.n_structural_indexes; + } + return 0; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H +/* end file generic/stage1/find_next_document_index.h for arm64 */ +/* including generic/stage1/json_minifier.h for arm64: #include */ +/* begin file generic/stage1/json_minifier.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +class json_minifier { +public: + template + static error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept; + +private: + simdjson_inline json_minifier(uint8_t *_dst) + : dst{_dst} + {} + template + simdjson_inline void step(const uint8_t *block_buf, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block); + simdjson_inline error_code finish(uint8_t *dst_start, size_t &dst_len); + json_scanner scanner{}; + uint8_t *dst; +}; + +simdjson_inline void json_minifier::next(const simd::simd8x64& in, const json_block& block) { + uint64_t mask = block.whitespace(); + dst += in.compress(mask, dst); +} + +simdjson_inline error_code json_minifier::finish(uint8_t *dst_start, size_t &dst_len) { + error_code error = scanner.finish(); + if (error) { dst_len = 0; return error; } + dst_len = dst - dst_start; + return SUCCESS; +} + +template<> +simdjson_inline void json_minifier::step<128>(const uint8_t *block_buf, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + simd::simd8x64 in_2(block_buf+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1); + this->next(in_2, block_2); + reader.advance(); +} + +template<> +simdjson_inline void json_minifier::step<64>(const uint8_t *block_buf, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + json_block block_1 = scanner.next(in_1); + this->next(block_buf, block_1); + reader.advance(); +} + +template +error_code json_minifier::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept { + buf_block_reader reader(buf, len); + json_minifier minifier(dst); + + // Index the first n-1 blocks + while (reader.has_full_block()) { + minifier.step(reader.full_block(), reader); + } + + // Index the last (remainder) block, padded with spaces + uint8_t block[STEP_SIZE]; + size_t remaining_bytes = reader.get_remainder(block); + if (remaining_bytes > 0) { + // We do not want to write directly to the output stream. Rather, we write + // to a local buffer (for safety). + uint8_t out_block[STEP_SIZE]; + uint8_t * const guarded_dst{minifier.dst}; + minifier.dst = out_block; + minifier.step(block, reader); + size_t to_write = minifier.dst - out_block; + // In some cases, we could be enticed to consider the padded spaces + // as part of the string. This is fine as long as we do not write more + // than we consumed. + if(to_write > remaining_bytes) { to_write = remaining_bytes; } + memcpy(guarded_dst, out_block, to_write); + minifier.dst = guarded_dst + to_write; + } + return minifier.finish(dst, dst_len); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H +/* end file generic/stage1/json_minifier.h for arm64 */ +/* including generic/stage1/json_structural_indexer.h for arm64: #include */ +/* begin file generic/stage1/json_structural_indexer.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +class bit_indexer { +public: + uint32_t *tail; + + simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {} + +#if SIMDJSON_PREFER_REVERSE_BITS + /** + * ARM lacks a fast trailing zero instruction, but it has a fast + * bit reversal instruction and a fast leading zero instruction. + * Thus it may be profitable to reverse the bits (once) and then + * to rely on a sequence of instructions that call the leading + * zero instruction. + * + * Performance notes: + * The chosen routine is not optimal in terms of data dependency + * since zero_leading_bit might require two instructions. However, + * it tends to minimize the total number of instructions which is + * beneficial. + */ + simdjson_inline void write_index(uint32_t idx, uint64_t& rev_bits, int i) { + int lz = leading_zeroes(rev_bits); + this->tail[i] = static_cast(idx) + lz; + rev_bits = zero_leading_bit(rev_bits, lz); + } +#else + /** + * Under recent x64 systems, we often have both a fast trailing zero + * instruction and a fast 'clear-lower-bit' instruction so the following + * algorithm can be competitive. + */ + + simdjson_inline void write_index(uint32_t idx, uint64_t& bits, int i) { + this->tail[i] = idx + trailing_zeroes(bits); + bits = clear_lowest_bit(bits); + } +#endif // SIMDJSON_PREFER_REVERSE_BITS + + template + simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) { + write_index(idx, bits, START); + SIMDJSON_IF_CONSTEXPR (N > 1) { + write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits); + } + return START+N; + } + + template + simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) { + write_indexes(idx, bits); + SIMDJSON_IF_CONSTEXPR ((START+STEP) < END) { + if (simdjson_unlikely((START+STEP) < cnt)) { + write_indexes_stepped<(START+STEP(idx, bits, cnt); + } + } + return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP; + } + + // flatten out values in 'bits' assuming that they are are to have values of idx + // plus their position in the bitvector, and store these indexes at + // base_ptr[base] incrementing base as we go + // will potentially store extra values beyond end of valid bits, so base_ptr + // needs to be large enough to handle this + // + // If the kernel sets SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER, then it + // will provide its own version of the code. +#ifdef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + simdjson_inline void write(uint32_t idx, uint64_t bits); +#else + simdjson_inline void write(uint32_t idx, uint64_t bits) { + // In some instances, the next branch is expensive because it is mispredicted. + // Unfortunately, in other cases, + // it helps tremendously. + if (bits == 0) + return; + + int cnt = static_cast(count_ones(bits)); + +#if SIMDJSON_PREFER_REVERSE_BITS + bits = reverse_bits(bits); +#endif +#ifdef SIMDJSON_STRUCTURAL_INDEXER_STEP + static constexpr const int STEP = SIMDJSON_STRUCTURAL_INDEXER_STEP; +#else + static constexpr const int STEP = 4; +#endif + static constexpr const int STEP_UNTIL = 24; + + write_indexes_stepped<0, STEP_UNTIL, STEP>(idx, bits, cnt); + SIMDJSON_IF_CONSTEXPR (STEP_UNTIL < 64) { + if (simdjson_unlikely(STEP_UNTIL < cnt)) { + for (int i=STEP_UNTIL; itail += cnt; + } +#endif // SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +}; + +class json_structural_indexer { +public: + /** + * Find the important bits of JSON in a 128-byte chunk, and add them to structural_indexes. + * + * @param partial Setting the partial parameter to true allows the find_structural_bits to + * tolerate unclosed strings. The caller should still ensure that the input is valid UTF-8. If + * you are processing substrings, you may want to call on a function like trimmed_length_safe_utf8. + */ + template + static error_code index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept; + +private: + simdjson_inline json_structural_indexer(uint32_t *structural_indexes); + template + simdjson_inline void step(const uint8_t *block, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block, size_t idx); + simdjson_inline error_code finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial); + + json_scanner scanner{}; + utf8_checker checker{}; + bit_indexer indexer; + uint64_t prev_structurals = 0; + uint64_t unescaped_chars_error = 0; +}; + +simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {} + +// Skip the last character if it is partial +simdjson_inline size_t trim_partial_utf8(const uint8_t *buf, size_t len) { + if (simdjson_unlikely(len < 3)) { + switch (len) { + case 2: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 2 bytes left + return len; + case 1: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + return len; + case 0: + return len; + } + } + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 1 byte left + if (buf[len-3] >= 0xf0) { return len-3; } // 4-byte characters with only 3 bytes left + return len; +} + +// +// PERF NOTES: +// We pipe 2 inputs through these stages: +// 1. Load JSON into registers. This takes a long time and is highly parallelizable, so we load +// 2 inputs' worth at once so that by the time step 2 is looking for them input, it's available. +// 2. Scan the JSON for critical data: strings, scalars and operators. This is the critical path. +// The output of step 1 depends entirely on this information. These functions don't quite use +// up enough CPU: the second half of the functions is highly serial, only using 1 execution core +// at a time. The second input's scans has some dependency on the first ones finishing it, but +// they can make a lot of progress before they need that information. +// 3. Step 1 doesn't use enough capacity, so we run some extra stuff while we're waiting for that +// to finish: utf-8 checks and generating the output from the last iteration. +// +// The reason we run 2 inputs at a time, is steps 2 and 3 are *still* not enough to soak up all +// available capacity with just one input. Running 2 at a time seems to give the CPU a good enough +// workout. +// +template +error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept { + if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; } + // We guard the rest of the code so that we can assume that len > 0 throughout. + if (len == 0) { return EMPTY; } + if (is_streaming(partial)) { + len = trim_partial_utf8(buf, len); + // If you end up with an empty window after trimming + // the partial UTF-8 bytes, then chances are good that you + // have an UTF-8 formatting error. + if(len == 0) { return UTF8_ERROR; } + } + buf_block_reader reader(buf, len); + json_structural_indexer indexer(parser.structural_indexes.get()); + + // Read all but the last block + while (reader.has_full_block()) { + indexer.step(reader.full_block(), reader); + } + // Take care of the last block (will always be there unless file is empty which is + // not supposed to happen.) + uint8_t block[STEP_SIZE]; + if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; } + indexer.step(block, reader); + return indexer.finish(parser, reader.block_index(), len, partial); +} + +template<> +simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block); + simd::simd8x64 in_2(block+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1, reader.block_index()); + this->next(in_2, block_2, reader.block_index()+64); + reader.advance(); +} + +template<> +simdjson_inline void json_structural_indexer::step<64>(const uint8_t *block, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block); + json_block block_1 = scanner.next(in_1); + this->next(in_1, block_1, reader.block_index()); + reader.advance(); +} + +simdjson_inline void json_structural_indexer::next(const simd::simd8x64& in, const json_block& block, size_t idx) { + uint64_t unescaped = in.lteq(0x1F); +#if SIMDJSON_UTF8VALIDATION + checker.check_next_input(in); +#endif + indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser + prev_structurals = block.structural_start(); + unescaped_chars_error |= block.non_quote_inside_string(unescaped); +} + +simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) { + // Write out the final iteration's structurals + indexer.write(uint32_t(idx-64), prev_structurals); + error_code error = scanner.finish(); + // We deliberately break down the next expression so that it is + // human readable. + const bool should_we_exit = is_streaming(partial) ? + ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING + : (error != SUCCESS); // if partial is false, we must have SUCCESS + const bool have_unclosed_string = (error == UNCLOSED_STRING); + if (simdjson_unlikely(should_we_exit)) { return error; } + + if (unescaped_chars_error) { + return UNESCAPED_CHARS; + } + parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get()); + /*** + * The On Demand API requires special padding. + * + * This is related to https://github.com/simdjson/simdjson/issues/906 + * Basically, we want to make sure that if the parsing continues beyond the last (valid) + * structural character, it quickly stops. + * Only three structural characters can be repeated without triggering an error in JSON: [,] and }. + * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing + * continues, then it must be [,] or }. + * Suppose it is ] or }. We backtrack to the first character, what could it be that would + * not trigger an error? It could be ] or } but no, because you can't start a document that way. + * It can't be a comma, a colon or any simple value. So the only way we could continue is + * if the repeated character is [. But if so, the document must start with [. But if the document + * starts with [, it should end with ]. If we enforce that rule, then we would get + * ][[ which is invalid. + * + * This is illustrated with the test array_iterate_unclosed_error() on the following input: + * R"({ "a": [,,)" + **/ + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final + parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len); + parser.structural_indexes[parser.n_structural_indexes + 2] = 0; + parser.next_structural_index = 0; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + return EMPTY; + } + if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) { + return UNEXPECTED_ERROR; + } + if (partial == stage1_mode::streaming_partial) { + // If we have an unclosed string, then the last structural + // will be the quote and we want to make sure to omit it. + if(have_unclosed_string) { + parser.n_structural_indexes--; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; } + } + // We truncate the input to the end of the last complete document (or zero). + auto new_structural_indexes = find_next_document_index(parser); + if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) { + if(parser.structural_indexes[0] == 0) { + // If the buffer is partial and we started at index 0 but the document is + // incomplete, it's too big to parse. + return CAPACITY; + } else { + // It is possible that the document could be parsed, we just had a lot + // of white space. + parser.n_structural_indexes = 0; + return EMPTY; + } + } + + parser.n_structural_indexes = new_structural_indexes; + } else if (partial == stage1_mode::streaming_final) { + if(have_unclosed_string) { parser.n_structural_indexes--; } + // We truncate the input to the end of the last complete document (or zero). + // Because partial == stage1_mode::streaming_final, it means that we may + // silently ignore trailing garbage. Though it sounds bad, we do it + // deliberately because many people who have streams of JSON documents + // will truncate them for processing. E.g., imagine that you are uncompressing + // the data from a size file or receiving it in chunks from the network. You + // may not know where exactly the last document will be. Meanwhile the + // document_stream instances allow people to know the JSON documents they are + // parsing (see the iterator.source() method). + parser.n_structural_indexes = find_next_document_index(parser); + // We store the initial n_structural_indexes so that the client can see + // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes, + // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len, + // otherwise, it will copy some prior index. + parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes]; + // This next line is critical, do not change it unless you understand what you are + // doing. + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + // We tolerate an unclosed string at the very end of the stream. Indeed, users + // often load their data in bulk without being careful and they want us to ignore + // the trailing garbage. + return EMPTY; + } + } + checker.check_eof(); + return checker.errors(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +// Clear CUSTOM_BIT_INDEXER so other implementations can set it if they need to. +#undef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H +/* end file generic/stage1/json_structural_indexer.h for arm64 */ +/* including generic/stage1/utf8_validator.h for arm64: #include */ +/* begin file generic/stage1/utf8_validator.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage1 { + +/** + * Validates that the string is actual UTF-8. + */ +template +bool generic_validate_utf8(const uint8_t * input, size_t length) { + checker c{}; + buf_block_reader<64> reader(input, length); + while (reader.has_full_block()) { + simd::simd8x64 in(reader.full_block()); + c.check_next_input(in); + reader.advance(); + } + uint8_t block[64]{}; + reader.get_remainder(block); + simd::simd8x64 in(block); + c.check_next_input(in); + reader.advance(); + c.check_eof(); + return c.errors() == error_code::SUCCESS; +} + +bool generic_validate_utf8(const char * input, size_t length) { + return generic_validate_utf8(reinterpret_cast(input),length); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H +/* end file generic/stage1/utf8_validator.h for arm64 */ +/* end file generic/stage1/amalgamated.h for arm64 */ +/* including generic/stage2/amalgamated.h for arm64: #include */ +/* begin file generic/stage2/amalgamated.h for arm64 */ +// Stuff other things depend on +/* including generic/stage2/base.h for arm64: #include */ +/* begin file generic/stage2/base.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage2 { + +class json_iterator; +class structural_iterator; +struct tape_builder; +struct tape_writer; + +} // namespace stage2 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_BASE_H +/* end file generic/stage2/base.h for arm64 */ +/* including generic/stage2/tape_writer.h for arm64: #include */ +/* begin file generic/stage2/tape_writer.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage2 { + +struct tape_writer { + /** The next place to write to tape */ + uint64_t *next_tape_loc; + + /** Write a signed 64-bit value to tape. */ + simdjson_inline void append_s64(int64_t value) noexcept; + + /** Write an unsigned 64-bit value to tape. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + + /** Write a double value to tape. */ + simdjson_inline void append_double(double value) noexcept; + + /** + * Append a tape entry (an 8-bit type,and 56 bits worth of value). + */ + simdjson_inline void append(uint64_t val, internal::tape_type t) noexcept; + + /** + * Skip the current tape entry without writing. + * + * Used to skip the start of the container, since we'll come back later to fill it in when the + * container ends. + */ + simdjson_inline void skip() noexcept; + + /** + * Skip the number of tape entries necessary to write a large u64 or i64. + */ + simdjson_inline void skip_large_integer() noexcept; + + /** + * Skip the number of tape entries necessary to write a double. + */ + simdjson_inline void skip_double() noexcept; + + /** + * Write a value to a known location on tape. + * + * Used to go back and write out the start of a container after the container ends. + */ + simdjson_inline static void write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept; + +private: + /** + * Append both the tape entry, and a supplementary value following it. Used for types that need + * all 64 bits, such as double and uint64_t. + */ + template + simdjson_inline void append2(uint64_t val, T val2, internal::tape_type t) noexcept; +}; // struct tape_writer + +simdjson_inline void tape_writer::append_s64(int64_t value) noexcept { + append2(0, value, internal::tape_type::INT64); +} + +simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept { + append(0, internal::tape_type::UINT64); + *next_tape_loc = value; + next_tape_loc++; +} + +/** Write a double value to tape. */ +simdjson_inline void tape_writer::append_double(double value) noexcept { + append2(0, value, internal::tape_type::DOUBLE); +} + +simdjson_inline void tape_writer::skip() noexcept { + next_tape_loc++; +} + +simdjson_inline void tape_writer::skip_large_integer() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::skip_double() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept { + *next_tape_loc = val | ((uint64_t(char(t))) << 56); + next_tape_loc++; +} + +template +simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept { + append(val, t); + static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!"); + memcpy(next_tape_loc, &val2, sizeof(val2)); + next_tape_loc++; +} + +simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept { + tape_loc = val | ((uint64_t(char(t))) << 56); +} + +} // namespace stage2 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H +/* end file generic/stage2/tape_writer.h for arm64 */ +/* including generic/stage2/logger.h for arm64: #include */ +/* begin file generic/stage2/logger.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + + +// This is for an internal-only stage 2 specific logger. +// Set LOG_ENABLED = true to log what stage 2 is doing! +namespace simdjson { +namespace arm64 { +namespace { +namespace logger { + + static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + static constexpr const int LOG_EVENT_LEN = 20; + static constexpr const int LOG_BUFFER_LEN = 30; + static constexpr const int LOG_SMALL_BUFFER_LEN = 10; + static constexpr const int LOG_INDEX_LEN = 5; + + static int log_depth; // Not threadsafe. Log only. + + // Helper to turn unprintable or newline characters into spaces + static simdjson_inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } + } + + // Print the header and set up log_start + static simdjson_inline void log_start() { + if (LOG_ENABLED) { + log_depth = 0; + printf("\n"); + printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#"); + printf("|%.*s|%.*s|%.*s|%.*s|--------|\n", LOG_EVENT_LEN+2, DASHES, LOG_BUFFER_LEN+2, DASHES, LOG_SMALL_BUFFER_LEN+2, DASHES, 5+2, DASHES); + } + } + + simdjson_unused static simdjson_inline void log_string(const char *message) { + if (LOG_ENABLED) { + printf("%s\n", message); + } + } + + // Logs a single line from the stage 2 DOM parser + template + static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) { + if (LOG_ENABLED) { + printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title); + auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1; + auto next_index = structurals.next_structural; + auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast(" "); + auto next = &structurals.buf[*next_index]; + { + // Print the next N characters in the buffer. + printf("| "); + // Otherwise, print the characters starting from the buffer position. + // Print spaces for unprintable or newline characters. + for (int i=0;i */ +/* begin file generic/stage2/json_iterator.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage2 { + +class json_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + uint32_t depth{0}; + + /** + * Walk the JSON document. + * + * The visitor receives callbacks when values are encountered. All callbacks pass the iterator as + * the first parameter; some callbacks have other parameters as well: + * + * - visit_document_start() - at the beginning. + * - visit_document_end() - at the end (if things were successful). + * + * - visit_array_start() - at the start `[` of a non-empty array. + * - visit_array_end() - at the end `]` of a non-empty array. + * - visit_empty_array() - when an empty array is encountered. + * + * - visit_object_end() - at the start `]` of a non-empty object. + * - visit_object_start() - at the end `]` of a non-empty object. + * - visit_empty_object() - when an empty object is encountered. + * - visit_key(const uint8_t *key) - when a key in an object field is encountered. key is + * guaranteed to point at the first quote of the string (`"key"`). + * - visit_primitive(const uint8_t *value) - when a value is a string, number, boolean or null. + * - visit_root_primitive(iter, uint8_t *value) - when the top-level value is a string, number, boolean or null. + * + * - increment_count(iter) - each time a value is found in an array or object. + */ + template + simdjson_warn_unused simdjson_inline error_code walk_document(V &visitor) noexcept; + + /** + * Create an iterator capable of walking a JSON document. + * + * The document must have already passed through stage 1. + */ + simdjson_inline json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index); + + /** + * Look at the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *peek() const noexcept; + /** + * Advance to the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *advance() noexcept; + /** + * Get the remaining length of the document, from the start of the current token. + */ + simdjson_inline size_t remaining_len() const noexcept; + /** + * Check if we are at the end of the document. + * + * If this is true, there are no more tokens. + */ + simdjson_inline bool at_eof() const noexcept; + /** + * Check if we are at the beginning of the document. + */ + simdjson_inline bool at_beginning() const noexcept; + simdjson_inline uint8_t last_structural() const noexcept; + + /** + * Log that a value has been found. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_value(const char *type) const noexcept; + /** + * Log the start of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_start_value(const char *type) const noexcept; + /** + * Log the end of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_end_value(const char *type) const noexcept; + /** + * Log an error. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_error(const char *error) const noexcept; + + template + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(V &visitor, const uint8_t *value) noexcept; + template + simdjson_warn_unused simdjson_inline error_code visit_primitive(V &visitor, const uint8_t *value) noexcept; +}; + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept { + logger::log_start(); + + // + // Start the document + // + if (at_eof()) { return EMPTY; } + log_start_value("document"); + SIMDJSON_TRY( visitor.visit_document_start(*this) ); + + // + // Read first value + // + { + auto value = advance(); + + // Make sure the outer object or array is closed before continuing; otherwise, there are ways we + // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906 + if (!STREAMING) { + switch (*value) { + case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break; + case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break; + } + } + + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break; + } + } + goto document_end; + +// +// Object parser states +// +object_begin: + log_start_value("object"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = false; + SIMDJSON_TRY( visitor.visit_object_start(*this) ); + + { + auto key = advance(); + if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.increment_count(*this) ); + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + +object_field: + if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; } + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +object_continue: + switch (*advance()) { + case ',': + SIMDJSON_TRY( visitor.increment_count(*this) ); + { + auto key = advance(); + if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + goto object_field; + case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end; + default: log_error("No comma between object fields"); return TAPE_ERROR; + } + +scope_end: + depth--; + if (depth == 0) { goto document_end; } + if (dom_parser.is_array[depth]) { goto array_continue; } + goto object_continue; + +// +// Array parser states +// +array_begin: + log_start_value("array"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = true; + SIMDJSON_TRY( visitor.visit_array_start(*this) ); + SIMDJSON_TRY( visitor.increment_count(*this) ); + +array_value: + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +array_continue: + switch (*advance()) { + case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value; + case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end; + default: log_error("Missing comma between array values"); return TAPE_ERROR; + } + +document_end: + log_end_value("document"); + SIMDJSON_TRY( visitor.visit_document_end(*this) ); + + dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]); + + // If we didn't make it to the end, it's an error + if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) { + log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); + return TAPE_ERROR; + } + + return SUCCESS; + +} // walk_document() + +simdjson_inline json_iterator::json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { +} + +simdjson_inline const uint8_t *json_iterator::peek() const noexcept { + return &buf[*(next_structural)]; +} +simdjson_inline const uint8_t *json_iterator::advance() noexcept { + return &buf[*(next_structural++)]; +} +simdjson_inline size_t json_iterator::remaining_len() const noexcept { + return dom_parser.len - *(next_structural-1); +} + +simdjson_inline bool json_iterator::at_eof() const noexcept { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; +} +simdjson_inline bool json_iterator::at_beginning() const noexcept { + return next_structural == dom_parser.structural_indexes.get(); +} +simdjson_inline uint8_t json_iterator::last_structural() const noexcept { + return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]]; +} + +simdjson_inline void json_iterator::log_value(const char *type) const noexcept { + logger::log_line(*this, "", type, ""); +} + +simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept { + logger::log_line(*this, "+", type, ""); + if (logger::LOG_ENABLED) { logger::log_depth++; } +} + +simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept { + if (logger::LOG_ENABLED) { logger::log_depth--; } + logger::log_line(*this, "-", type, ""); +} + +simdjson_inline void json_iterator::log_error(const char *error) const noexcept { + logger::log_line(*this, "", "ERROR", error); +} + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept { + switch (*value) { + case '"': return visitor.visit_root_string(*this, value); + case 't': return visitor.visit_root_true_atom(*this, value); + case 'f': return visitor.visit_root_false_atom(*this, value); + case 'n': return visitor.visit_root_null_atom(*this, value); + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return visitor.visit_root_number(*this, value); + default: + log_error("Document starts with a non-value character"); + return TAPE_ERROR; + } +} +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept { + // Use the fact that most scalars are going to be either strings or numbers. + if(*value == '"') { + return visitor.visit_string(*this, value); + } else if (((*value - '0') < 10) || (*value == '-')) { + return visitor.visit_number(*this, value); + } + // true, false, null are uncommon. + switch (*value) { + case 't': return visitor.visit_true_atom(*this, value); + case 'f': return visitor.visit_false_atom(*this, value); + case 'n': return visitor.visit_null_atom(*this, value); + default: + log_error("Non-value found when value was expected!"); + return TAPE_ERROR; + } +} + +} // namespace stage2 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H +/* end file generic/stage2/json_iterator.h for arm64 */ +/* including generic/stage2/stringparsing.h for arm64: #include */ +/* begin file generic/stage2/stringparsing.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses +// It is intended to be included multiple times and compiled multiple times + +namespace simdjson { +namespace arm64 { +namespace { +/// @private +namespace stringparsing { + +// begin copypasta +// These chars yield themselves: " \ / +// b -> backspace, f -> formfeed, n -> newline, r -> cr, t -> horizontal tab +// u not handled in this table as it's complex +static const uint8_t escape_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x0. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2f, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x4. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c, 0, 0, 0, // 0x5. + 0, 0, 0x08, 0, 0, 0, 0x0c, 0, 0, 0, 0, 0, 0, 0, 0x0a, 0, // 0x6. + 0, 0, 0x0d, 0, 0x09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x7. + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +// handle a unicode codepoint +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint(const uint8_t **src_ptr, + uint8_t **dst_ptr, bool allow_replacement) { + // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD) + constexpr uint32_t substitution_code_point = 0xfffd; + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) != ((static_cast ('\\') << 8) | static_cast ('u'))) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + + // We have already checked that the high surrogate is valid and + // (code_point - 0xd800) < 1024. + // + // Check that code_point_2 is in the range 0xdc00..0xdfff + // and that code_point_2 was parsed from valid hex. + uint32_t low_bit = code_point_2 - 0xdc00; + if (low_bit >> 10) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + code_point = (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + + } + } else if (code_point >= 0xdc00 && code_point <= 0xdfff) { + // If we encounter a low surrogate (not preceded by a high surrogate) + // then we have an error. + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +// handle a unicode codepoint using the wobbly convention +// https://simonsapin.github.io/wtf-8/ +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint_wobbly(const uint8_t **src_ptr, + uint8_t **dst_ptr) { + // It is not ideal that this function is nearly identical to handle_unicode_codepoint. + // + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) == ((static_cast ('\\') << 8) | static_cast ('u'))) { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + uint32_t low_bit = code_point_2 - 0xdc00; + if ((low_bit >> 10) == 0) { + code_point = + (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + } + } + + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +/** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + */ +simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) { + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { + // It is not ideal that this function is nearly identical to parse_string. + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint_wobbly(&src, &dst)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +} // namespace stringparsing +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H +/* end file generic/stage2/stringparsing.h for arm64 */ +/* including generic/stage2/structural_iterator.h for arm64: #include */ +/* begin file generic/stage2/structural_iterator.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage2 { + +class structural_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + + // Start a structural + simdjson_inline structural_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { + } + // Get the buffer position of the current structural character + simdjson_inline const uint8_t* current() { + return &buf[*(next_structural-1)]; + } + // Get the current structural character + simdjson_inline char current_char() { + return buf[*(next_structural-1)]; + } + // Get the next structural character without advancing + simdjson_inline char peek_next_char() { + return buf[*next_structural]; + } + simdjson_inline const uint8_t* peek() { + return &buf[*next_structural]; + } + simdjson_inline const uint8_t* advance() { + return &buf[*(next_structural++)]; + } + simdjson_inline char advance_char() { + return buf[*(next_structural++)]; + } + simdjson_inline size_t remaining_len() { + return dom_parser.len - *(next_structural-1); + } + + simdjson_inline bool at_end() { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; + } + simdjson_inline bool at_beginning() { + return next_structural == dom_parser.structural_indexes.get(); + } +}; + +} // namespace stage2 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H +/* end file generic/stage2/structural_iterator.h for arm64 */ +/* including generic/stage2/tape_builder.h for arm64: #include */ +/* begin file generic/stage2/tape_builder.h for arm64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace arm64 { +namespace { +namespace stage2 { + +struct tape_builder { + template + simdjson_warn_unused static simdjson_inline error_code parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept; + + /** Called when a non-empty document starts. */ + simdjson_warn_unused simdjson_inline error_code visit_document_start(json_iterator &iter) noexcept; + /** Called when a non-empty document ends without error. */ + simdjson_warn_unused simdjson_inline error_code visit_document_end(json_iterator &iter) noexcept; + + /** Called when a non-empty array starts. */ + simdjson_warn_unused simdjson_inline error_code visit_array_start(json_iterator &iter) noexcept; + /** Called when a non-empty array ends. */ + simdjson_warn_unused simdjson_inline error_code visit_array_end(json_iterator &iter) noexcept; + /** Called when an empty array is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_array(json_iterator &iter) noexcept; + + /** Called when a non-empty object starts. */ + simdjson_warn_unused simdjson_inline error_code visit_object_start(json_iterator &iter) noexcept; + /** + * Called when a key in a field is encountered. + * + * primitive, visit_object_start, visit_empty_object, visit_array_start, or visit_empty_array + * will be called after this with the field value. + */ + simdjson_warn_unused simdjson_inline error_code visit_key(json_iterator &iter, const uint8_t *key) noexcept; + /** Called when a non-empty object ends. */ + simdjson_warn_unused simdjson_inline error_code visit_object_end(json_iterator &iter) noexcept; + /** Called when an empty object is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_object(json_iterator &iter) noexcept; + + /** + * Called when a string, number, boolean or null is found. + */ + simdjson_warn_unused simdjson_inline error_code visit_primitive(json_iterator &iter, const uint8_t *value) noexcept; + /** + * Called when a string, number, boolean or null is found at the top level of a document (i.e. + * when there is no array or object and the entire document is a single string, number, boolean or + * null. + * + * This is separate from primitive() because simdjson's normal primitive parsing routines assume + * there is at least one more token after the value, which is only true in an array or object. + */ + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_string(json_iterator &iter, const uint8_t *value, bool key = false) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_root_string(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + /** Called each time a new field or element in an array or object is found. */ + simdjson_warn_unused simdjson_inline error_code increment_count(json_iterator &iter) noexcept; + + /** Next location to write to tape */ + tape_writer tape; +private: + /** Next write location in the string buf for stage 2 parsing */ + uint8_t *current_string_buf_loc; + + simdjson_inline tape_builder(dom::document &doc) noexcept; + + simdjson_inline uint32_t next_tape_index(json_iterator &iter) const noexcept; + simdjson_inline void start_container(json_iterator &iter) noexcept; + simdjson_warn_unused simdjson_inline error_code end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_warn_unused simdjson_inline error_code empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_inline uint8_t *on_start_string(json_iterator &iter) noexcept; + simdjson_inline void on_end_string(uint8_t *dst) noexcept; +}; // struct tape_builder + +template +simdjson_warn_unused simdjson_inline error_code tape_builder::parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept { + dom_parser.doc = &doc; + json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0); + tape_builder builder(doc); + return iter.walk_document(builder); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_root_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept { + constexpr uint32_t start_tape_index = 0; + tape.append(start_tape_index, internal::tape_type::ROOT); + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept { + return visit_string(iter, key, true); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1 + return SUCCESS; +} + +simdjson_inline tape_builder::tape_builder(dom::document &doc) noexcept : tape{doc.tape.get()}, current_string_buf_loc{doc.string_buf.get()} {} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept { + iter.log_value(key ? "key" : "string"); + uint8_t *dst = on_start_string(iter); + dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid. + if (dst == nullptr) { + iter.log_error("Invalid escape in string"); + return STRING_ERROR; + } + on_end_string(dst); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept { + return visit_string(iter, value); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("number"); + return numberparsing::parse_number(value, tape); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_number(json_iterator &iter, const uint8_t *value) noexcept { + // + // We need to make a copy to make sure that the string is space terminated. + // This is not about padding the input, which should already padded up + // to len + SIMDJSON_PADDING. However, we have no control at this stage + // on how the padding was done. What if the input string was padded with nulls? + // It is quite common for an input string to have an extra null character (C string). + // We do not want to allow 9\0 (where \0 is the null character) inside a JSON + // document, but the string "9\0" by itself is fine. So we make a copy and + // pad the input with spaces when we know that there is just one input element. + // This copy is relatively expensive, but it will almost never be called in + // practice unless you are in the strange scenario where you have many JSON + // documents made of single atoms. + // + std::unique_ptrcopy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]); + if (copy.get() == nullptr) { return MEMALLOC; } + std::memcpy(copy.get(), value, iter.remaining_len()); + std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING); + error_code error = visit_number(iter, copy.get()); + return error; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value)) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +// private: + +simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept { + return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get()); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + auto start_index = next_tape_index(iter); + tape.append(start_index+2, start); + tape.append(start_index, end); + return SUCCESS; +} + +simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter); + iter.dom_parser.open_containers[iter.depth].count = 0; + tape.skip(); // We don't actually *write* the start element until the end. +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + // Write the ending tape element, pointing at the start location + const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index; + tape.append(start_tape_index, end); + // Write the start tape element, pointing at the end location (and including count) + // count can overflow if it exceeds 24 bits... so we saturate + // the convention being that a cnt of 0xffffff or more is undetermined in value (>= 0xffffff). + const uint32_t count = iter.dom_parser.open_containers[iter.depth].count; + const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count; + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start); + return SUCCESS; +} + +simdjson_inline uint8_t *tape_builder::on_start_string(json_iterator &iter) noexcept { + // we advance the point, accounting for the fact that we have a NULL termination + tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING); + return current_string_buf_loc + sizeof(uint32_t); +} + +simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept { + uint32_t str_length = uint32_t(dst - (current_string_buf_loc + sizeof(uint32_t))); + // TODO check for overflow in case someone has a crazy string (>=4GB?) + // But only add the overflow check when the document itself exceeds 4GB + // Currently unneeded because we refuse to parse docs larger or equal to 4GB. + memcpy(current_string_buf_loc, &str_length, sizeof(uint32_t)); + // NULL termination is still handy if you expect all your strings to + // be NULL terminated? It comes at a small cost + *dst = 0; + current_string_buf_loc = dst + 1; +} + +} // namespace stage2 +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H +/* end file generic/stage2/tape_builder.h for arm64 */ +/* end file generic/stage2/amalgamated.h for arm64 */ + +// +// Stage 1 +// +namespace simdjson { +namespace arm64 { + +simdjson_warn_unused error_code implementation::create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr& dst +) const noexcept { + dst.reset( new (std::nothrow) dom_parser_implementation() ); + if (!dst) { return MEMALLOC; } + if (auto err = dst->set_capacity(capacity)) + return err; + if (auto err = dst->set_max_depth(max_depth)) + return err; + return SUCCESS; +} + +namespace { + +using namespace simd; + +simdjson_inline json_character_block json_character_block::classify(const simd::simd8x64& in) { + // Functional programming causes trouble with Visual Studio. + // Keeping this version in comments since it is much nicer: + // auto v = in.map([&](simd8 chunk) { + // auto nib_lo = chunk & 0xf; + // auto nib_hi = chunk.shr<4>(); + // auto shuf_lo = nib_lo.lookup_16(16, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 1, 2, 9, 0, 0); + // auto shuf_hi = nib_hi.lookup_16(8, 0, 18, 4, 0, 1, 0, 1, 0, 0, 0, 3, 2, 1, 0, 0); + // return shuf_lo & shuf_hi; + // }); + const simd8 table1(16, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 1, 2, 9, 0, 0); + const simd8 table2(8, 0, 18, 4, 0, 1, 0, 1, 0, 0, 0, 3, 2, 1, 0, 0); + + simd8x64 v( + (in.chunks[0] & 0xf).lookup_16(table1) & (in.chunks[0].shr<4>()).lookup_16(table2), + (in.chunks[1] & 0xf).lookup_16(table1) & (in.chunks[1].shr<4>()).lookup_16(table2), + (in.chunks[2] & 0xf).lookup_16(table1) & (in.chunks[2].shr<4>()).lookup_16(table2), + (in.chunks[3] & 0xf).lookup_16(table1) & (in.chunks[3].shr<4>()).lookup_16(table2) + ); + + + // We compute whitespace and op separately. If the code later only use one or the + // other, given the fact that all functions are aggressively inlined, we can + // hope that useless computations will be omitted. This is namely case when + // minifying (we only need whitespace). *However* if we only need spaces, + // it is likely that we will still compute 'v' above with two lookup_16: one + // could do it a bit cheaper. This is in contrast with the x64 implementations + // where we can, efficiently, do the white space and structural matching + // separately. One reason for this difference is that on ARM NEON, the table + // lookups either zero or leave unchanged the characters exceeding 0xF whereas + // on x64, the equivalent instruction (pshufb) automatically applies a mask, + // ignoring the 4 most significant bits. Thus the x64 implementation is + // optimized differently. This being said, if you use this code strictly + // just for minification (or just to identify the structural characters), + // there is a small untaken optimization opportunity here. We deliberately + // do not pick it up. + + uint64_t op = simd8x64( + v.chunks[0].any_bits_set(0x7), + v.chunks[1].any_bits_set(0x7), + v.chunks[2].any_bits_set(0x7), + v.chunks[3].any_bits_set(0x7) + ).to_bitmask(); + + uint64_t whitespace = simd8x64( + v.chunks[0].any_bits_set(0x18), + v.chunks[1].any_bits_set(0x18), + v.chunks[2].any_bits_set(0x18), + v.chunks[3].any_bits_set(0x18) + ).to_bitmask(); + + return { whitespace, op }; +} + +simdjson_inline bool is_ascii(const simd8x64& input) { + simd8 bits = input.reduce_or(); + return bits.max_val() < 0x80u; +} + +simdjson_unused simdjson_inline simd8 must_be_continuation(const simd8 prev1, const simd8 prev2, const simd8 prev3) { + simd8 is_second_byte = prev1 >= uint8_t(0xc0u); + simd8 is_third_byte = prev2 >= uint8_t(0xe0u); + simd8 is_fourth_byte = prev3 >= uint8_t(0xf0u); + // Use ^ instead of | for is_*_byte, because ^ is commutative, and the caller is using ^ as well. + // This will work fine because we only have to report errors for cases with 0-1 lead bytes. + // Multiple lead bytes implies 2 overlapping multibyte characters, and if that happens, there is + // guaranteed to be at least *one* lead byte that is part of only 1 other multibyte character. + // The error will be detected there. + return is_second_byte ^ is_third_byte ^ is_fourth_byte; +} + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3) { + simd8 is_third_byte = prev2 >= uint8_t(0xe0u); + simd8 is_fourth_byte = prev3 >= uint8_t(0xf0u); + return is_third_byte ^ is_fourth_byte; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +// +// Stage 2 +// + +// +// Implementation-specific overrides +// +namespace simdjson { +namespace arm64 { + +simdjson_warn_unused error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept { + return arm64::stage1::json_minifier::minify<64>(buf, len, dst, dst_len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept { + this->buf = _buf; + this->len = _len; + return arm64::stage1::json_structural_indexer::index<64>(buf, len, *this, streaming); +} + +simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept { + return arm64::stage1::generic_validate_utf8(buf,len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept { + return arm64::stringparsing::parse_string(src, dst, allow_replacement); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept { + return arm64::stringparsing::parse_wobbly_string(src, dst); +} + +simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept { + auto error = stage1(_buf, _len, stage1_mode::regular); + if (error) { return error; } + return stage2(_doc); +} + +} // namespace arm64 +} // namespace simdjson + +/* including simdjson/arm64/end.h: #include */ +/* begin file simdjson/arm64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "arm64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/arm64/end.h */ + +#endif // SIMDJSON_SRC_ARM64_CPP +/* end file arm64.cpp */ +#endif +#if SIMDJSON_IMPLEMENTATION_FALLBACK +/* including fallback.cpp: #include */ +/* begin file fallback.cpp */ +#ifndef SIMDJSON_SRC_FALLBACK_CPP +#define SIMDJSON_SRC_FALLBACK_CPP + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* including simdjson/fallback.h: #include */ +/* begin file simdjson/fallback.h */ +#ifndef SIMDJSON_FALLBACK_H +#define SIMDJSON_FALLBACK_H + +/* including simdjson/fallback/begin.h: #include "simdjson/fallback/begin.h" */ +/* begin file simdjson/fallback/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "fallback" */ +#define SIMDJSON_IMPLEMENTATION fallback +/* including simdjson/fallback/base.h: #include "simdjson/fallback/base.h" */ +/* begin file simdjson/fallback/base.h */ +#ifndef SIMDJSON_FALLBACK_BASE_H +#define SIMDJSON_FALLBACK_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Fallback implementation (runs on any machine). + */ +namespace fallback { + +class implementation; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BASE_H +/* end file simdjson/fallback/base.h */ +/* including simdjson/fallback/bitmanipulation.h: #include "simdjson/fallback/bitmanipulation.h" */ +/* begin file simdjson/fallback/bitmanipulation.h */ +#ifndef SIMDJSON_FALLBACK_BITMANIPULATION_H +#define SIMDJSON_FALLBACK_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +#if defined(_MSC_VER) && !defined(_M_ARM64) && !defined(_M_X64) +static inline unsigned char _BitScanForward64(unsigned long* ret, uint64_t x) { + unsigned long x0 = (unsigned long)x, top, bottom; + _BitScanForward(&top, (unsigned long)(x >> 32)); + _BitScanForward(&bottom, x0); + *ret = x0 ? bottom : 32 + top; + return x != 0; +} +static unsigned char _BitScanReverse64(unsigned long* ret, uint64_t x) { + unsigned long x1 = (unsigned long)(x >> 32), top, bottom; + _BitScanReverse(&top, x1); + _BitScanReverse(&bottom, (unsigned long)x); + *ret = x1 ? top + 32 : bottom; + return x != 0; +} +#endif + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef _MSC_VER + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// _MSC_VER +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BITMANIPULATION_H +/* end file simdjson/fallback/bitmanipulation.h */ +/* including simdjson/fallback/stringparsing_defs.h: #include "simdjson/fallback/stringparsing_defs.h" */ +/* begin file simdjson/fallback/stringparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +#define SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 1; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return c == '"'; } + simdjson_inline bool has_backslash() { return c == '\\'; } + simdjson_inline int quote_index() { return c == '"' ? 0 : 1; } + simdjson_inline int backslash_index() { return c == '\\' ? 0 : 1; } + + uint8_t c; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // store to dest unconditionally - we can overwrite the bits we don't like later + dst[0] = src[0]; + return { src[0] }; +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +/* end file simdjson/fallback/stringparsing_defs.h */ +/* including simdjson/fallback/numberparsing_defs.h: #include "simdjson/fallback/numberparsing_defs.h" */ +/* begin file simdjson/fallback/numberparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +#define SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#ifdef JSON_TEST_NUMBERS // for unit testing +void found_invalid_number(const uint8_t *buf); +void found_integer(int64_t result, const uint8_t *buf); +void found_unsigned_integer(uint64_t result, const uint8_t *buf); +void found_float(double result, const uint8_t *buf); +#endif + +namespace simdjson { +namespace fallback { +namespace numberparsing { + +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const char *chars) { + uint64_t val; + memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + return parse_eight_digits_unrolled(reinterpret_cast(chars)); +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace fallback +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +/* end file simdjson/fallback/numberparsing_defs.h */ +/* end file simdjson/fallback/begin.h */ +/* including simdjson/generic/amalgamated.h for fallback: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for fallback */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for fallback: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for fallback */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for fallback */ +/* including simdjson/generic/jsoncharutils.h for fallback: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for fallback */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for fallback */ +/* including simdjson/generic/atomparsing.h for fallback: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for fallback */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace fallback { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for fallback */ +/* including simdjson/generic/dom_parser_implementation.h for fallback: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for fallback */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace fallback +} // namespace simdjson + +namespace simdjson { +namespace fallback { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for fallback */ +/* including simdjson/generic/implementation_simdjson_result_base.h for fallback: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for fallback */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for fallback */ +/* including simdjson/generic/numberparsing.h for fallback: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for fallback */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace fallback { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for fallback */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for fallback: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for fallback */ +/* end file simdjson/generic/amalgamated.h for fallback */ +/* including simdjson/fallback/end.h: #include "simdjson/fallback/end.h" */ +/* begin file simdjson/fallback/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* undefining SIMDJSON_IMPLEMENTATION from "fallback" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/fallback/end.h */ + +#endif // SIMDJSON_FALLBACK_H +/* end file simdjson/fallback.h */ +/* including simdjson/fallback/implementation.h: #include */ +/* begin file simdjson/fallback/implementation.h */ +#ifndef SIMDJSON_FALLBACK_IMPLEMENTATION_H +#define SIMDJSON_FALLBACK_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "fallback", + "Generic fallback implementation", + 0 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_IMPLEMENTATION_H +/* end file simdjson/fallback/implementation.h */ + +/* including simdjson/fallback/begin.h: #include */ +/* begin file simdjson/fallback/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "fallback" */ +#define SIMDJSON_IMPLEMENTATION fallback +/* including simdjson/fallback/base.h: #include "simdjson/fallback/base.h" */ +/* begin file simdjson/fallback/base.h */ +#ifndef SIMDJSON_FALLBACK_BASE_H +#define SIMDJSON_FALLBACK_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Fallback implementation (runs on any machine). + */ +namespace fallback { + +class implementation; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BASE_H +/* end file simdjson/fallback/base.h */ +/* including simdjson/fallback/bitmanipulation.h: #include "simdjson/fallback/bitmanipulation.h" */ +/* begin file simdjson/fallback/bitmanipulation.h */ +#ifndef SIMDJSON_FALLBACK_BITMANIPULATION_H +#define SIMDJSON_FALLBACK_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +#if defined(_MSC_VER) && !defined(_M_ARM64) && !defined(_M_X64) +static inline unsigned char _BitScanForward64(unsigned long* ret, uint64_t x) { + unsigned long x0 = (unsigned long)x, top, bottom; + _BitScanForward(&top, (unsigned long)(x >> 32)); + _BitScanForward(&bottom, x0); + *ret = x0 ? bottom : 32 + top; + return x != 0; +} +static unsigned char _BitScanReverse64(unsigned long* ret, uint64_t x) { + unsigned long x1 = (unsigned long)(x >> 32), top, bottom; + _BitScanReverse(&top, x1); + _BitScanReverse(&bottom, (unsigned long)x); + *ret = x1 ? top + 32 : bottom; + return x != 0; +} +#endif + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef _MSC_VER + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// _MSC_VER +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BITMANIPULATION_H +/* end file simdjson/fallback/bitmanipulation.h */ +/* including simdjson/fallback/stringparsing_defs.h: #include "simdjson/fallback/stringparsing_defs.h" */ +/* begin file simdjson/fallback/stringparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +#define SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 1; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return c == '"'; } + simdjson_inline bool has_backslash() { return c == '\\'; } + simdjson_inline int quote_index() { return c == '"' ? 0 : 1; } + simdjson_inline int backslash_index() { return c == '\\' ? 0 : 1; } + + uint8_t c; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // store to dest unconditionally - we can overwrite the bits we don't like later + dst[0] = src[0]; + return { src[0] }; +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +/* end file simdjson/fallback/stringparsing_defs.h */ +/* including simdjson/fallback/numberparsing_defs.h: #include "simdjson/fallback/numberparsing_defs.h" */ +/* begin file simdjson/fallback/numberparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +#define SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#ifdef JSON_TEST_NUMBERS // for unit testing +void found_invalid_number(const uint8_t *buf); +void found_integer(int64_t result, const uint8_t *buf); +void found_unsigned_integer(uint64_t result, const uint8_t *buf); +void found_float(double result, const uint8_t *buf); +#endif + +namespace simdjson { +namespace fallback { +namespace numberparsing { + +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const char *chars) { + uint64_t val; + memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + return parse_eight_digits_unrolled(reinterpret_cast(chars)); +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace fallback +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +/* end file simdjson/fallback/numberparsing_defs.h */ +/* end file simdjson/fallback/begin.h */ +/* including generic/stage1/find_next_document_index.h for fallback: #include */ +/* begin file generic/stage1/find_next_document_index.h for fallback */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { +namespace stage1 { + +/** + * This algorithm is used to quickly identify the last structural position that + * makes up a complete document. + * + * It does this by going backwards and finding the last *document boundary* (a + * place where one value follows another without a comma between them). If the + * last document (the characters after the boundary) has an equal number of + * start and end brackets, it is considered complete. + * + * Simply put, we iterate over the structural characters, starting from + * the end. We consider that we found the end of a JSON document when the + * first element of the pair is NOT one of these characters: '{' '[' ':' ',' + * and when the second element is NOT one of these characters: '}' ']' ':' ','. + * + * This simple comparison works most of the time, but it does not cover cases + * where the batch's structural indexes contain a perfect amount of documents. + * In such a case, we do not have access to the structural index which follows + * the last document, therefore, we do not have access to the second element in + * the pair, and that means we cannot identify the last document. To fix this + * issue, we keep a count of the open and closed curly/square braces we found + * while searching for the pair. When we find a pair AND the count of open and + * closed curly/square braces is the same, we know that we just passed a + * complete document, therefore the last json buffer location is the end of the + * batch. + */ +simdjson_inline uint32_t find_next_document_index(dom_parser_implementation &parser) { + // Variant: do not count separately, just figure out depth + if(parser.n_structural_indexes == 0) { return 0; } + auto arr_cnt = 0; + auto obj_cnt = 0; + for (auto i = parser.n_structural_indexes - 1; i > 0; i--) { + auto idxb = parser.structural_indexes[i]; + switch (parser.buf[idxb]) { + case ':': + case ',': + continue; + case '}': + obj_cnt--; + continue; + case ']': + arr_cnt--; + continue; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + auto idxa = parser.structural_indexes[i - 1]; + switch (parser.buf[idxa]) { + case '{': + case '[': + case ':': + case ',': + continue; + } + // Last document is complete, so the next document will appear after! + if (!arr_cnt && !obj_cnt) { + return parser.n_structural_indexes; + } + // Last document is incomplete; mark the document at i + 1 as the next one + return i; + } + // If we made it to the end, we want to finish counting to see if we have a full document. + switch (parser.buf[parser.structural_indexes[0]]) { + case '}': + obj_cnt--; + break; + case ']': + arr_cnt--; + break; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + if (!arr_cnt && !obj_cnt) { + // We have a complete document. + return parser.n_structural_indexes; + } + return 0; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H +/* end file generic/stage1/find_next_document_index.h for fallback */ +/* including generic/stage2/stringparsing.h for fallback: #include */ +/* begin file generic/stage2/stringparsing.h for fallback */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses +// It is intended to be included multiple times and compiled multiple times + +namespace simdjson { +namespace fallback { +namespace { +/// @private +namespace stringparsing { + +// begin copypasta +// These chars yield themselves: " \ / +// b -> backspace, f -> formfeed, n -> newline, r -> cr, t -> horizontal tab +// u not handled in this table as it's complex +static const uint8_t escape_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x0. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2f, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x4. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c, 0, 0, 0, // 0x5. + 0, 0, 0x08, 0, 0, 0, 0x0c, 0, 0, 0, 0, 0, 0, 0, 0x0a, 0, // 0x6. + 0, 0, 0x0d, 0, 0x09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x7. + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +// handle a unicode codepoint +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint(const uint8_t **src_ptr, + uint8_t **dst_ptr, bool allow_replacement) { + // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD) + constexpr uint32_t substitution_code_point = 0xfffd; + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) != ((static_cast ('\\') << 8) | static_cast ('u'))) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + + // We have already checked that the high surrogate is valid and + // (code_point - 0xd800) < 1024. + // + // Check that code_point_2 is in the range 0xdc00..0xdfff + // and that code_point_2 was parsed from valid hex. + uint32_t low_bit = code_point_2 - 0xdc00; + if (low_bit >> 10) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + code_point = (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + + } + } else if (code_point >= 0xdc00 && code_point <= 0xdfff) { + // If we encounter a low surrogate (not preceded by a high surrogate) + // then we have an error. + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +// handle a unicode codepoint using the wobbly convention +// https://simonsapin.github.io/wtf-8/ +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint_wobbly(const uint8_t **src_ptr, + uint8_t **dst_ptr) { + // It is not ideal that this function is nearly identical to handle_unicode_codepoint. + // + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) == ((static_cast ('\\') << 8) | static_cast ('u'))) { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + uint32_t low_bit = code_point_2 - 0xdc00; + if ((low_bit >> 10) == 0) { + code_point = + (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + } + } + + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +/** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + */ +simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) { + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { + // It is not ideal that this function is nearly identical to parse_string. + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint_wobbly(&src, &dst)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +} // namespace stringparsing +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H +/* end file generic/stage2/stringparsing.h for fallback */ +/* including generic/stage2/logger.h for fallback: #include */ +/* begin file generic/stage2/logger.h for fallback */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + + +// This is for an internal-only stage 2 specific logger. +// Set LOG_ENABLED = true to log what stage 2 is doing! +namespace simdjson { +namespace fallback { +namespace { +namespace logger { + + static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + static constexpr const int LOG_EVENT_LEN = 20; + static constexpr const int LOG_BUFFER_LEN = 30; + static constexpr const int LOG_SMALL_BUFFER_LEN = 10; + static constexpr const int LOG_INDEX_LEN = 5; + + static int log_depth; // Not threadsafe. Log only. + + // Helper to turn unprintable or newline characters into spaces + static simdjson_inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } + } + + // Print the header and set up log_start + static simdjson_inline void log_start() { + if (LOG_ENABLED) { + log_depth = 0; + printf("\n"); + printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#"); + printf("|%.*s|%.*s|%.*s|%.*s|--------|\n", LOG_EVENT_LEN+2, DASHES, LOG_BUFFER_LEN+2, DASHES, LOG_SMALL_BUFFER_LEN+2, DASHES, 5+2, DASHES); + } + } + + simdjson_unused static simdjson_inline void log_string(const char *message) { + if (LOG_ENABLED) { + printf("%s\n", message); + } + } + + // Logs a single line from the stage 2 DOM parser + template + static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) { + if (LOG_ENABLED) { + printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title); + auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1; + auto next_index = structurals.next_structural; + auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast(" "); + auto next = &structurals.buf[*next_index]; + { + // Print the next N characters in the buffer. + printf("| "); + // Otherwise, print the characters starting from the buffer position. + // Print spaces for unprintable or newline characters. + for (int i=0;i */ +/* begin file generic/stage2/json_iterator.h for fallback */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { +namespace stage2 { + +class json_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + uint32_t depth{0}; + + /** + * Walk the JSON document. + * + * The visitor receives callbacks when values are encountered. All callbacks pass the iterator as + * the first parameter; some callbacks have other parameters as well: + * + * - visit_document_start() - at the beginning. + * - visit_document_end() - at the end (if things were successful). + * + * - visit_array_start() - at the start `[` of a non-empty array. + * - visit_array_end() - at the end `]` of a non-empty array. + * - visit_empty_array() - when an empty array is encountered. + * + * - visit_object_end() - at the start `]` of a non-empty object. + * - visit_object_start() - at the end `]` of a non-empty object. + * - visit_empty_object() - when an empty object is encountered. + * - visit_key(const uint8_t *key) - when a key in an object field is encountered. key is + * guaranteed to point at the first quote of the string (`"key"`). + * - visit_primitive(const uint8_t *value) - when a value is a string, number, boolean or null. + * - visit_root_primitive(iter, uint8_t *value) - when the top-level value is a string, number, boolean or null. + * + * - increment_count(iter) - each time a value is found in an array or object. + */ + template + simdjson_warn_unused simdjson_inline error_code walk_document(V &visitor) noexcept; + + /** + * Create an iterator capable of walking a JSON document. + * + * The document must have already passed through stage 1. + */ + simdjson_inline json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index); + + /** + * Look at the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *peek() const noexcept; + /** + * Advance to the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *advance() noexcept; + /** + * Get the remaining length of the document, from the start of the current token. + */ + simdjson_inline size_t remaining_len() const noexcept; + /** + * Check if we are at the end of the document. + * + * If this is true, there are no more tokens. + */ + simdjson_inline bool at_eof() const noexcept; + /** + * Check if we are at the beginning of the document. + */ + simdjson_inline bool at_beginning() const noexcept; + simdjson_inline uint8_t last_structural() const noexcept; + + /** + * Log that a value has been found. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_value(const char *type) const noexcept; + /** + * Log the start of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_start_value(const char *type) const noexcept; + /** + * Log the end of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_end_value(const char *type) const noexcept; + /** + * Log an error. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_error(const char *error) const noexcept; + + template + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(V &visitor, const uint8_t *value) noexcept; + template + simdjson_warn_unused simdjson_inline error_code visit_primitive(V &visitor, const uint8_t *value) noexcept; +}; + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept { + logger::log_start(); + + // + // Start the document + // + if (at_eof()) { return EMPTY; } + log_start_value("document"); + SIMDJSON_TRY( visitor.visit_document_start(*this) ); + + // + // Read first value + // + { + auto value = advance(); + + // Make sure the outer object or array is closed before continuing; otherwise, there are ways we + // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906 + if (!STREAMING) { + switch (*value) { + case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break; + case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break; + } + } + + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break; + } + } + goto document_end; + +// +// Object parser states +// +object_begin: + log_start_value("object"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = false; + SIMDJSON_TRY( visitor.visit_object_start(*this) ); + + { + auto key = advance(); + if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.increment_count(*this) ); + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + +object_field: + if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; } + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +object_continue: + switch (*advance()) { + case ',': + SIMDJSON_TRY( visitor.increment_count(*this) ); + { + auto key = advance(); + if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + goto object_field; + case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end; + default: log_error("No comma between object fields"); return TAPE_ERROR; + } + +scope_end: + depth--; + if (depth == 0) { goto document_end; } + if (dom_parser.is_array[depth]) { goto array_continue; } + goto object_continue; + +// +// Array parser states +// +array_begin: + log_start_value("array"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = true; + SIMDJSON_TRY( visitor.visit_array_start(*this) ); + SIMDJSON_TRY( visitor.increment_count(*this) ); + +array_value: + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +array_continue: + switch (*advance()) { + case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value; + case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end; + default: log_error("Missing comma between array values"); return TAPE_ERROR; + } + +document_end: + log_end_value("document"); + SIMDJSON_TRY( visitor.visit_document_end(*this) ); + + dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]); + + // If we didn't make it to the end, it's an error + if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) { + log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); + return TAPE_ERROR; + } + + return SUCCESS; + +} // walk_document() + +simdjson_inline json_iterator::json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { +} + +simdjson_inline const uint8_t *json_iterator::peek() const noexcept { + return &buf[*(next_structural)]; +} +simdjson_inline const uint8_t *json_iterator::advance() noexcept { + return &buf[*(next_structural++)]; +} +simdjson_inline size_t json_iterator::remaining_len() const noexcept { + return dom_parser.len - *(next_structural-1); +} + +simdjson_inline bool json_iterator::at_eof() const noexcept { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; +} +simdjson_inline bool json_iterator::at_beginning() const noexcept { + return next_structural == dom_parser.structural_indexes.get(); +} +simdjson_inline uint8_t json_iterator::last_structural() const noexcept { + return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]]; +} + +simdjson_inline void json_iterator::log_value(const char *type) const noexcept { + logger::log_line(*this, "", type, ""); +} + +simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept { + logger::log_line(*this, "+", type, ""); + if (logger::LOG_ENABLED) { logger::log_depth++; } +} + +simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept { + if (logger::LOG_ENABLED) { logger::log_depth--; } + logger::log_line(*this, "-", type, ""); +} + +simdjson_inline void json_iterator::log_error(const char *error) const noexcept { + logger::log_line(*this, "", "ERROR", error); +} + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept { + switch (*value) { + case '"': return visitor.visit_root_string(*this, value); + case 't': return visitor.visit_root_true_atom(*this, value); + case 'f': return visitor.visit_root_false_atom(*this, value); + case 'n': return visitor.visit_root_null_atom(*this, value); + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return visitor.visit_root_number(*this, value); + default: + log_error("Document starts with a non-value character"); + return TAPE_ERROR; + } +} +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept { + // Use the fact that most scalars are going to be either strings or numbers. + if(*value == '"') { + return visitor.visit_string(*this, value); + } else if (((*value - '0') < 10) || (*value == '-')) { + return visitor.visit_number(*this, value); + } + // true, false, null are uncommon. + switch (*value) { + case 't': return visitor.visit_true_atom(*this, value); + case 'f': return visitor.visit_false_atom(*this, value); + case 'n': return visitor.visit_null_atom(*this, value); + default: + log_error("Non-value found when value was expected!"); + return TAPE_ERROR; + } +} + +} // namespace stage2 +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H +/* end file generic/stage2/json_iterator.h for fallback */ +/* including generic/stage2/tape_writer.h for fallback: #include */ +/* begin file generic/stage2/tape_writer.h for fallback */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace fallback { +namespace { +namespace stage2 { + +struct tape_writer { + /** The next place to write to tape */ + uint64_t *next_tape_loc; + + /** Write a signed 64-bit value to tape. */ + simdjson_inline void append_s64(int64_t value) noexcept; + + /** Write an unsigned 64-bit value to tape. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + + /** Write a double value to tape. */ + simdjson_inline void append_double(double value) noexcept; + + /** + * Append a tape entry (an 8-bit type,and 56 bits worth of value). + */ + simdjson_inline void append(uint64_t val, internal::tape_type t) noexcept; + + /** + * Skip the current tape entry without writing. + * + * Used to skip the start of the container, since we'll come back later to fill it in when the + * container ends. + */ + simdjson_inline void skip() noexcept; + + /** + * Skip the number of tape entries necessary to write a large u64 or i64. + */ + simdjson_inline void skip_large_integer() noexcept; + + /** + * Skip the number of tape entries necessary to write a double. + */ + simdjson_inline void skip_double() noexcept; + + /** + * Write a value to a known location on tape. + * + * Used to go back and write out the start of a container after the container ends. + */ + simdjson_inline static void write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept; + +private: + /** + * Append both the tape entry, and a supplementary value following it. Used for types that need + * all 64 bits, such as double and uint64_t. + */ + template + simdjson_inline void append2(uint64_t val, T val2, internal::tape_type t) noexcept; +}; // struct tape_writer + +simdjson_inline void tape_writer::append_s64(int64_t value) noexcept { + append2(0, value, internal::tape_type::INT64); +} + +simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept { + append(0, internal::tape_type::UINT64); + *next_tape_loc = value; + next_tape_loc++; +} + +/** Write a double value to tape. */ +simdjson_inline void tape_writer::append_double(double value) noexcept { + append2(0, value, internal::tape_type::DOUBLE); +} + +simdjson_inline void tape_writer::skip() noexcept { + next_tape_loc++; +} + +simdjson_inline void tape_writer::skip_large_integer() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::skip_double() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept { + *next_tape_loc = val | ((uint64_t(char(t))) << 56); + next_tape_loc++; +} + +template +simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept { + append(val, t); + static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!"); + memcpy(next_tape_loc, &val2, sizeof(val2)); + next_tape_loc++; +} + +simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept { + tape_loc = val | ((uint64_t(char(t))) << 56); +} + +} // namespace stage2 +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H +/* end file generic/stage2/tape_writer.h for fallback */ +/* including generic/stage2/tape_builder.h for fallback: #include */ +/* begin file generic/stage2/tape_builder.h for fallback */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace fallback { +namespace { +namespace stage2 { + +struct tape_builder { + template + simdjson_warn_unused static simdjson_inline error_code parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept; + + /** Called when a non-empty document starts. */ + simdjson_warn_unused simdjson_inline error_code visit_document_start(json_iterator &iter) noexcept; + /** Called when a non-empty document ends without error. */ + simdjson_warn_unused simdjson_inline error_code visit_document_end(json_iterator &iter) noexcept; + + /** Called when a non-empty array starts. */ + simdjson_warn_unused simdjson_inline error_code visit_array_start(json_iterator &iter) noexcept; + /** Called when a non-empty array ends. */ + simdjson_warn_unused simdjson_inline error_code visit_array_end(json_iterator &iter) noexcept; + /** Called when an empty array is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_array(json_iterator &iter) noexcept; + + /** Called when a non-empty object starts. */ + simdjson_warn_unused simdjson_inline error_code visit_object_start(json_iterator &iter) noexcept; + /** + * Called when a key in a field is encountered. + * + * primitive, visit_object_start, visit_empty_object, visit_array_start, or visit_empty_array + * will be called after this with the field value. + */ + simdjson_warn_unused simdjson_inline error_code visit_key(json_iterator &iter, const uint8_t *key) noexcept; + /** Called when a non-empty object ends. */ + simdjson_warn_unused simdjson_inline error_code visit_object_end(json_iterator &iter) noexcept; + /** Called when an empty object is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_object(json_iterator &iter) noexcept; + + /** + * Called when a string, number, boolean or null is found. + */ + simdjson_warn_unused simdjson_inline error_code visit_primitive(json_iterator &iter, const uint8_t *value) noexcept; + /** + * Called when a string, number, boolean or null is found at the top level of a document (i.e. + * when there is no array or object and the entire document is a single string, number, boolean or + * null. + * + * This is separate from primitive() because simdjson's normal primitive parsing routines assume + * there is at least one more token after the value, which is only true in an array or object. + */ + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_string(json_iterator &iter, const uint8_t *value, bool key = false) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_root_string(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + /** Called each time a new field or element in an array or object is found. */ + simdjson_warn_unused simdjson_inline error_code increment_count(json_iterator &iter) noexcept; + + /** Next location to write to tape */ + tape_writer tape; +private: + /** Next write location in the string buf for stage 2 parsing */ + uint8_t *current_string_buf_loc; + + simdjson_inline tape_builder(dom::document &doc) noexcept; + + simdjson_inline uint32_t next_tape_index(json_iterator &iter) const noexcept; + simdjson_inline void start_container(json_iterator &iter) noexcept; + simdjson_warn_unused simdjson_inline error_code end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_warn_unused simdjson_inline error_code empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_inline uint8_t *on_start_string(json_iterator &iter) noexcept; + simdjson_inline void on_end_string(uint8_t *dst) noexcept; +}; // struct tape_builder + +template +simdjson_warn_unused simdjson_inline error_code tape_builder::parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept { + dom_parser.doc = &doc; + json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0); + tape_builder builder(doc); + return iter.walk_document(builder); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_root_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept { + constexpr uint32_t start_tape_index = 0; + tape.append(start_tape_index, internal::tape_type::ROOT); + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept { + return visit_string(iter, key, true); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1 + return SUCCESS; +} + +simdjson_inline tape_builder::tape_builder(dom::document &doc) noexcept : tape{doc.tape.get()}, current_string_buf_loc{doc.string_buf.get()} {} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept { + iter.log_value(key ? "key" : "string"); + uint8_t *dst = on_start_string(iter); + dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid. + if (dst == nullptr) { + iter.log_error("Invalid escape in string"); + return STRING_ERROR; + } + on_end_string(dst); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept { + return visit_string(iter, value); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("number"); + return numberparsing::parse_number(value, tape); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_number(json_iterator &iter, const uint8_t *value) noexcept { + // + // We need to make a copy to make sure that the string is space terminated. + // This is not about padding the input, which should already padded up + // to len + SIMDJSON_PADDING. However, we have no control at this stage + // on how the padding was done. What if the input string was padded with nulls? + // It is quite common for an input string to have an extra null character (C string). + // We do not want to allow 9\0 (where \0 is the null character) inside a JSON + // document, but the string "9\0" by itself is fine. So we make a copy and + // pad the input with spaces when we know that there is just one input element. + // This copy is relatively expensive, but it will almost never be called in + // practice unless you are in the strange scenario where you have many JSON + // documents made of single atoms. + // + std::unique_ptrcopy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]); + if (copy.get() == nullptr) { return MEMALLOC; } + std::memcpy(copy.get(), value, iter.remaining_len()); + std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING); + error_code error = visit_number(iter, copy.get()); + return error; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value)) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +// private: + +simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept { + return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get()); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + auto start_index = next_tape_index(iter); + tape.append(start_index+2, start); + tape.append(start_index, end); + return SUCCESS; +} + +simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter); + iter.dom_parser.open_containers[iter.depth].count = 0; + tape.skip(); // We don't actually *write* the start element until the end. +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + // Write the ending tape element, pointing at the start location + const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index; + tape.append(start_tape_index, end); + // Write the start tape element, pointing at the end location (and including count) + // count can overflow if it exceeds 24 bits... so we saturate + // the convention being that a cnt of 0xffffff or more is undetermined in value (>= 0xffffff). + const uint32_t count = iter.dom_parser.open_containers[iter.depth].count; + const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count; + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start); + return SUCCESS; +} + +simdjson_inline uint8_t *tape_builder::on_start_string(json_iterator &iter) noexcept { + // we advance the point, accounting for the fact that we have a NULL termination + tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING); + return current_string_buf_loc + sizeof(uint32_t); +} + +simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept { + uint32_t str_length = uint32_t(dst - (current_string_buf_loc + sizeof(uint32_t))); + // TODO check for overflow in case someone has a crazy string (>=4GB?) + // But only add the overflow check when the document itself exceeds 4GB + // Currently unneeded because we refuse to parse docs larger or equal to 4GB. + memcpy(current_string_buf_loc, &str_length, sizeof(uint32_t)); + // NULL termination is still handy if you expect all your strings to + // be NULL terminated? It comes at a small cost + *dst = 0; + current_string_buf_loc = dst + 1; +} + +} // namespace stage2 +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H +/* end file generic/stage2/tape_builder.h for fallback */ + +// +// Stage 1 +// + +namespace simdjson { +namespace fallback { + +simdjson_warn_unused error_code implementation::create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr& dst +) const noexcept { + dst.reset( new (std::nothrow) fallback::dom_parser_implementation() ); + if (!dst) { return MEMALLOC; } + if (auto err = dst->set_capacity(capacity)) + return err; + if (auto err = dst->set_max_depth(max_depth)) + return err; + return SUCCESS; +} + +namespace { +namespace stage1 { + +class structural_scanner { +public: + +simdjson_inline structural_scanner(dom_parser_implementation &_parser, stage1_mode _partial) + : buf{_parser.buf}, + next_structural_index{_parser.structural_indexes.get()}, + parser{_parser}, + len{static_cast(_parser.len)}, + partial{_partial} { +} + +simdjson_inline void add_structural() { + *next_structural_index = idx; + next_structural_index++; +} + +simdjson_inline bool is_continuation(uint8_t c) { + return (c & 0xc0) == 0x80; +} + +simdjson_inline void validate_utf8_character() { + // Continuation + if (simdjson_unlikely((buf[idx] & 0x40) == 0)) { + // extra continuation + error = UTF8_ERROR; + idx++; + return; + } + + // 2-byte + if ((buf[idx] & 0x20) == 0) { + // missing continuation + if (simdjson_unlikely(idx+1 > len || !is_continuation(buf[idx+1]))) { + if (idx+1 > len && is_streaming(partial)) { idx = len; return; } + error = UTF8_ERROR; + idx++; + return; + } + // overlong: 1100000_ 10______ + if (buf[idx] <= 0xc1) { error = UTF8_ERROR; } + idx += 2; + return; + } + + // 3-byte + if ((buf[idx] & 0x10) == 0) { + // missing continuation + if (simdjson_unlikely(idx+2 > len || !is_continuation(buf[idx+1]) || !is_continuation(buf[idx+2]))) { + if (idx+2 > len && is_streaming(partial)) { idx = len; return; } + error = UTF8_ERROR; + idx++; + return; + } + // overlong: 11100000 100_____ ________ + if (buf[idx] == 0xe0 && buf[idx+1] <= 0x9f) { error = UTF8_ERROR; } + // surrogates: U+D800-U+DFFF 11101101 101_____ + if (buf[idx] == 0xed && buf[idx+1] >= 0xa0) { error = UTF8_ERROR; } + idx += 3; + return; + } + + // 4-byte + // missing continuation + if (simdjson_unlikely(idx+3 > len || !is_continuation(buf[idx+1]) || !is_continuation(buf[idx+2]) || !is_continuation(buf[idx+3]))) { + if (idx+2 > len && is_streaming(partial)) { idx = len; return; } + error = UTF8_ERROR; + idx++; + return; + } + // overlong: 11110000 1000____ ________ ________ + if (buf[idx] == 0xf0 && buf[idx+1] <= 0x8f) { error = UTF8_ERROR; } + // too large: > U+10FFFF: + // 11110100 (1001|101_)____ + // 1111(1___|011_|0101) 10______ + // also includes 5, 6, 7 and 8 byte characters: + // 11111___ + if (buf[idx] == 0xf4 && buf[idx+1] >= 0x90) { error = UTF8_ERROR; } + if (buf[idx] >= 0xf5) { error = UTF8_ERROR; } + idx += 4; +} + +// Returns true if the string is unclosed. +simdjson_inline bool validate_string() { + idx++; // skip first quote + while (idx < len && buf[idx] != '"') { + if (buf[idx] == '\\') { + idx += 2; + } else if (simdjson_unlikely(buf[idx] & 0x80)) { + validate_utf8_character(); + } else { + if (buf[idx] < 0x20) { error = UNESCAPED_CHARS; } + idx++; + } + } + if (idx >= len) { return true; } + return false; +} + +simdjson_inline bool is_whitespace_or_operator(uint8_t c) { + switch (c) { + case '{': case '}': case '[': case ']': case ',': case ':': + case ' ': case '\r': case '\n': case '\t': + return true; + default: + return false; + } +} + +// +// Parse the entire input in STEP_SIZE-byte chunks. +// +simdjson_inline error_code scan() { + bool unclosed_string = false; + for (;idx 0) { + if(parser.structural_indexes[0] == 0) { + // If the buffer is partial and we started at index 0 but the document is + // incomplete, it's too big to parse. + return CAPACITY; + } else { + // It is possible that the document could be parsed, we just had a lot + // of white space. + parser.n_structural_indexes = 0; + return EMPTY; + } + } + parser.n_structural_indexes = new_structural_indexes; + } else if(partial == stage1_mode::streaming_final) { + if(unclosed_string) { parser.n_structural_indexes--; } + // We truncate the input to the end of the last complete document (or zero). + // Because partial == stage1_mode::streaming_final, it means that we may + // silently ignore trailing garbage. Though it sounds bad, we do it + // deliberately because many people who have streams of JSON documents + // will truncate them for processing. E.g., imagine that you are uncompressing + // the data from a size file or receiving it in chunks from the network. You + // may not know where exactly the last document will be. Meanwhile the + // document_stream instances allow people to know the JSON documents they are + // parsing (see the iterator.source() method). + parser.n_structural_indexes = find_next_document_index(parser); + // We store the initial n_structural_indexes so that the client can see + // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes, + // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len, + // otherwise, it will copy some prior index. + parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes]; + // This next line is critical, do not change it unless you understand what you are + // doing. + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); + if (parser.n_structural_indexes == 0) { return EMPTY; } + } else if(unclosed_string) { error = UNCLOSED_STRING; } + return error; +} + +private: + const uint8_t *buf; + uint32_t *next_structural_index; + dom_parser_implementation &parser; + uint32_t len; + uint32_t idx{0}; + error_code error{SUCCESS}; + stage1_mode partial; +}; // structural_scanner + +} // namespace stage1 +} // unnamed namespace + +simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode partial) noexcept { + this->buf = _buf; + this->len = _len; + stage1::structural_scanner scanner(*this, partial); + return scanner.scan(); +} + +// big table for the minifier +static uint8_t jump_table[256 * 3] = { + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, +}; + +simdjson_warn_unused error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept { + size_t i = 0, pos = 0; + uint8_t quote = 0; + uint8_t nonescape = 1; + + while (i < len) { + unsigned char c = buf[i]; + uint8_t *meta = jump_table + 3 * c; + + quote = quote ^ (meta[0] & nonescape); + dst[pos] = c; + pos += meta[2] | quote; + + i += 1; + nonescape = uint8_t(~nonescape) | (meta[1]); + } + dst_len = pos; // we intentionally do not work with a reference + // for fear of aliasing + return quote ? UNCLOSED_STRING : SUCCESS; +} + +// credit: based on code from Google Fuchsia (Apache Licensed) +simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept { + const uint8_t *data = reinterpret_cast(buf); + uint64_t pos = 0; + uint32_t code_point = 0; + while (pos < len) { + // check of the next 8 bytes are ascii. + uint64_t next_pos = pos + 16; + if (next_pos <= len) { // if it is safe to read 8 more bytes, check that they are ascii + uint64_t v1; + memcpy(&v1, data + pos, sizeof(uint64_t)); + uint64_t v2; + memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t)); + uint64_t v{v1 | v2}; + if ((v & 0x8080808080808080) == 0) { + pos = next_pos; + continue; + } + } + unsigned char byte = data[pos]; + if (byte < 0x80) { + pos++; + continue; + } else if ((byte & 0xe0) == 0xc0) { + next_pos = pos + 2; + if (next_pos > len) { return false; } + if ((data[pos + 1] & 0xc0) != 0x80) { return false; } + // range check + code_point = (byte & 0x1f) << 6 | (data[pos + 1] & 0x3f); + if (code_point < 0x80 || 0x7ff < code_point) { return false; } + } else if ((byte & 0xf0) == 0xe0) { + next_pos = pos + 3; + if (next_pos > len) { return false; } + if ((data[pos + 1] & 0xc0) != 0x80) { return false; } + if ((data[pos + 2] & 0xc0) != 0x80) { return false; } + // range check + code_point = (byte & 0x0f) << 12 | + (data[pos + 1] & 0x3f) << 6 | + (data[pos + 2] & 0x3f); + if (code_point < 0x800 || 0xffff < code_point || + (0xd7ff < code_point && code_point < 0xe000)) { + return false; + } + } else if ((byte & 0xf8) == 0xf0) { // 0b11110000 + next_pos = pos + 4; + if (next_pos > len) { return false; } + if ((data[pos + 1] & 0xc0) != 0x80) { return false; } + if ((data[pos + 2] & 0xc0) != 0x80) { return false; } + if ((data[pos + 3] & 0xc0) != 0x80) { return false; } + // range check + code_point = + (byte & 0x07) << 18 | (data[pos + 1] & 0x3f) << 12 | + (data[pos + 2] & 0x3f) << 6 | (data[pos + 3] & 0x3f); + if (code_point <= 0xffff || 0x10ffff < code_point) { return false; } + } else { + // we may have a continuation + return false; + } + pos = next_pos; + } + return true; +} + +} // namespace fallback +} // namespace simdjson + +// +// Stage 2 +// + +namespace simdjson { +namespace fallback { + +simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool replacement_char) const noexcept { + return fallback::stringparsing::parse_string(src, dst, replacement_char); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept { + return fallback::stringparsing::parse_wobbly_string(src, dst); +} + +simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept { + auto error = stage1(_buf, _len, stage1_mode::regular); + if (error) { return error; } + return stage2(_doc); +} + +} // namespace fallback +} // namespace simdjson + +/* including simdjson/fallback/end.h: #include */ +/* begin file simdjson/fallback/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* undefining SIMDJSON_IMPLEMENTATION from "fallback" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/fallback/end.h */ + +#endif // SIMDJSON_SRC_FALLBACK_CPP +/* end file fallback.cpp */ +#endif +#if SIMDJSON_IMPLEMENTATION_HASWELL +/* including haswell.cpp: #include */ +/* begin file haswell.cpp */ +#ifndef SIMDJSON_SRC_HASWELL_CPP +#define SIMDJSON_SRC_HASWELL_CPP + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* including simdjson/haswell.h: #include */ +/* begin file simdjson/haswell.h */ +#ifndef SIMDJSON_HASWELL_H +#define SIMDJSON_HASWELL_H + +/* including simdjson/haswell/begin.h: #include "simdjson/haswell/begin.h" */ +/* begin file simdjson/haswell/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "haswell" */ +#define SIMDJSON_IMPLEMENTATION haswell + +/* including simdjson/haswell/base.h: #include "simdjson/haswell/base.h" */ +/* begin file simdjson/haswell/base.h */ +#ifndef SIMDJSON_HASWELL_BASE_H +#define SIMDJSON_HASWELL_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_HASWELL +namespace simdjson { +/** + * Implementation for Haswell (Intel AVX2). + */ +namespace haswell { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BASE_H +/* end file simdjson/haswell/base.h */ +/* including simdjson/haswell/intrinsics.h: #include "simdjson/haswell/intrinsics.h" */ +/* begin file simdjson/haswell/intrinsics.h */ +#ifndef SIMDJSON_HASWELL_INTRINSICS_H +#define SIMDJSON_HASWELL_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m256i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for haswell kernel."); + +#endif // SIMDJSON_HASWELL_INTRINSICS_H +/* end file simdjson/haswell/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_TARGET_REGION("avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/haswell/bitmanipulation.h: #include "simdjson/haswell/bitmanipulation.h" */ +/* begin file simdjson/haswell/bitmanipulation.h */ +#ifndef SIMDJSON_HASWELL_BITMANIPULATION_H +#define SIMDJSON_HASWELL_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmask.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMANIPULATION_H +/* end file simdjson/haswell/bitmanipulation.h */ +/* including simdjson/haswell/bitmask.h: #include "simdjson/haswell/bitmask.h" */ +/* begin file simdjson/haswell/bitmask.h */ +#ifndef SIMDJSON_HASWELL_BITMASK_H +#define SIMDJSON_HASWELL_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMASK_H +/* end file simdjson/haswell/bitmask.h */ +/* including simdjson/haswell/numberparsing_defs.h: #include "simdjson/haswell/numberparsing_defs.h" */ +/* begin file simdjson/haswell/numberparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +#define SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace haswell +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +/* end file simdjson/haswell/numberparsing_defs.h */ +/* including simdjson/haswell/simd.h: #include "simdjson/haswell/simd.h" */ +/* begin file simdjson/haswell/simd.h */ +#ifndef SIMDJSON_HASWELL_SIMD_H +#define SIMDJSON_HASWELL_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m256i value; + + // Zero constructor + simdjson_inline base() : value{__m256i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m256i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m256i&() const { return this->value; } + simdjson_inline operator __m256i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm256_andnot_si256(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m256i _value) : base>(_value) {} + + friend simdjson_really_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm256_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm256_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m256i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm256_testz_si256(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm256_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm256_setzero_si256(); } + static simdjson_inline simd8 load(const T values[32]) { + return _mm256_loadu_si256(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m256i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[32]) const { return _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm256_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm256_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm256_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint32_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in four steps, first 8 bytes and then second 8 bytes... + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // second least significant 8 bits + uint8_t mask3 = uint8_t(mask >> 16); // ... + uint8_t mask4 = uint8_t(mask >> 24); // ... + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m256i shufmask = _mm256_set_epi64x(thintable_epi8[mask4], thintable_epi8[mask3], + thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask and so forth + shufmask = + _mm256_add_epi8(shufmask, _mm256_set_epi32(0x18181818, 0x18181818, + 0x10101010, 0x10101010, 0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m256i pruned = _mm256_shuffle_epi8(*this, shufmask); + // we still need to put the pieces back together. + // we compute the popcount of the first words: + int pop1 = BitsSetTable256mul2[mask1]; + int pop3 = BitsSetTable256mul2[mask3]; + + // then load the corresponding mask + // could be done with _mm256_loadu2_m128i but many standard libraries omit this intrinsic. + __m256i v256 = _mm256_castsi128_si256( + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8))); + __m256i compactmask = _mm256_insertf128_si256(v256, + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop3 * 8)), 1); + __m256i almostthere = _mm256_shuffle_epi8(pruned, compactmask); + // We just need to write out the result. + // This is the tricky bit that is hard to do + // if we want to return a SIMD register, since there + // is no single-instruction approach to recombine + // the two 128-bit lanes with an offset. + __m128i v128; + v128 = _mm256_castsi256_si128(almostthere); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output), v128); + v128 = _mm256_extractf128_si256(almostthere, 1); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output + 16 - count_ones(mask & 0xFFFF)), v128); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm256_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm256_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm256_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm256_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm256_testz_si256(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm256_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm256_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm256_movemask_epi8(_mm256_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 2, "Haswell kernel should use two registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+32)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint32_t mask1 = uint32_t(mask); + uint32_t mask2 = uint32_t(mask >> 32); + this->chunks[0].compress(mask1, output); + this->chunks[1].compress(mask2, output + 32 - count_ones(mask1)); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r_hi = this->chunks[1].to_bitmask(); + return r_lo | (r_hi << 32); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0] | this->chunks[1]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask, + this->chunks[1] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_SIMD_H +/* end file simdjson/haswell/simd.h */ +/* including simdjson/haswell/stringparsing_defs.h: #include "simdjson/haswell/stringparsing_defs.h" */ +/* begin file simdjson/haswell/stringparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +#define SIMDJSON_HASWELL_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast((v == '\\').to_bitmask()), // bs_bits + static_cast((v == '"').to_bitmask()), // quote_bits + }; +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +/* end file simdjson/haswell/stringparsing_defs.h */ +/* end file simdjson/haswell/begin.h */ +/* including simdjson/generic/amalgamated.h for haswell: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for haswell */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for haswell: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for haswell */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for haswell */ +/* including simdjson/generic/jsoncharutils.h for haswell: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for haswell */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for haswell */ +/* including simdjson/generic/atomparsing.h for haswell: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for haswell */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace haswell { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for haswell */ +/* including simdjson/generic/dom_parser_implementation.h for haswell: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for haswell */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace haswell +} // namespace simdjson + +namespace simdjson { +namespace haswell { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for haswell */ +/* including simdjson/generic/implementation_simdjson_result_base.h for haswell: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for haswell */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for haswell */ +/* including simdjson/generic/numberparsing.h for haswell: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for haswell */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace haswell { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for haswell */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for haswell: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for haswell */ +/* end file simdjson/generic/amalgamated.h for haswell */ +/* including simdjson/haswell/end.h: #include "simdjson/haswell/end.h" */ +/* begin file simdjson/haswell/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "haswell" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/haswell/end.h */ + +#endif // SIMDJSON_HASWELL_H +/* end file simdjson/haswell.h */ +/* including simdjson/haswell/implementation.h: #include */ +/* begin file simdjson/haswell/implementation.h */ +#ifndef SIMDJSON_HASWELL_IMPLEMENTATION_H +#define SIMDJSON_HASWELL_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_HASWELL +namespace simdjson { +namespace haswell { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "haswell", + "Intel/AMD AVX2", + internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_IMPLEMENTATION_H +/* end file simdjson/haswell/implementation.h */ + +/* including simdjson/haswell/begin.h: #include */ +/* begin file simdjson/haswell/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "haswell" */ +#define SIMDJSON_IMPLEMENTATION haswell + +/* including simdjson/haswell/base.h: #include "simdjson/haswell/base.h" */ +/* begin file simdjson/haswell/base.h */ +#ifndef SIMDJSON_HASWELL_BASE_H +#define SIMDJSON_HASWELL_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_HASWELL +namespace simdjson { +/** + * Implementation for Haswell (Intel AVX2). + */ +namespace haswell { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BASE_H +/* end file simdjson/haswell/base.h */ +/* including simdjson/haswell/intrinsics.h: #include "simdjson/haswell/intrinsics.h" */ +/* begin file simdjson/haswell/intrinsics.h */ +#ifndef SIMDJSON_HASWELL_INTRINSICS_H +#define SIMDJSON_HASWELL_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m256i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for haswell kernel."); + +#endif // SIMDJSON_HASWELL_INTRINSICS_H +/* end file simdjson/haswell/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_TARGET_REGION("avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/haswell/bitmanipulation.h: #include "simdjson/haswell/bitmanipulation.h" */ +/* begin file simdjson/haswell/bitmanipulation.h */ +#ifndef SIMDJSON_HASWELL_BITMANIPULATION_H +#define SIMDJSON_HASWELL_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmask.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMANIPULATION_H +/* end file simdjson/haswell/bitmanipulation.h */ +/* including simdjson/haswell/bitmask.h: #include "simdjson/haswell/bitmask.h" */ +/* begin file simdjson/haswell/bitmask.h */ +#ifndef SIMDJSON_HASWELL_BITMASK_H +#define SIMDJSON_HASWELL_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMASK_H +/* end file simdjson/haswell/bitmask.h */ +/* including simdjson/haswell/numberparsing_defs.h: #include "simdjson/haswell/numberparsing_defs.h" */ +/* begin file simdjson/haswell/numberparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +#define SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace haswell +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +/* end file simdjson/haswell/numberparsing_defs.h */ +/* including simdjson/haswell/simd.h: #include "simdjson/haswell/simd.h" */ +/* begin file simdjson/haswell/simd.h */ +#ifndef SIMDJSON_HASWELL_SIMD_H +#define SIMDJSON_HASWELL_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m256i value; + + // Zero constructor + simdjson_inline base() : value{__m256i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m256i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m256i&() const { return this->value; } + simdjson_inline operator __m256i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm256_andnot_si256(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m256i _value) : base>(_value) {} + + friend simdjson_really_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm256_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm256_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m256i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm256_testz_si256(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm256_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm256_setzero_si256(); } + static simdjson_inline simd8 load(const T values[32]) { + return _mm256_loadu_si256(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m256i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[32]) const { return _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm256_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm256_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm256_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint32_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in four steps, first 8 bytes and then second 8 bytes... + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // second least significant 8 bits + uint8_t mask3 = uint8_t(mask >> 16); // ... + uint8_t mask4 = uint8_t(mask >> 24); // ... + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m256i shufmask = _mm256_set_epi64x(thintable_epi8[mask4], thintable_epi8[mask3], + thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask and so forth + shufmask = + _mm256_add_epi8(shufmask, _mm256_set_epi32(0x18181818, 0x18181818, + 0x10101010, 0x10101010, 0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m256i pruned = _mm256_shuffle_epi8(*this, shufmask); + // we still need to put the pieces back together. + // we compute the popcount of the first words: + int pop1 = BitsSetTable256mul2[mask1]; + int pop3 = BitsSetTable256mul2[mask3]; + + // then load the corresponding mask + // could be done with _mm256_loadu2_m128i but many standard libraries omit this intrinsic. + __m256i v256 = _mm256_castsi128_si256( + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8))); + __m256i compactmask = _mm256_insertf128_si256(v256, + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop3 * 8)), 1); + __m256i almostthere = _mm256_shuffle_epi8(pruned, compactmask); + // We just need to write out the result. + // This is the tricky bit that is hard to do + // if we want to return a SIMD register, since there + // is no single-instruction approach to recombine + // the two 128-bit lanes with an offset. + __m128i v128; + v128 = _mm256_castsi256_si128(almostthere); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output), v128); + v128 = _mm256_extractf128_si256(almostthere, 1); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output + 16 - count_ones(mask & 0xFFFF)), v128); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm256_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm256_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm256_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm256_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm256_testz_si256(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm256_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm256_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm256_movemask_epi8(_mm256_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 2, "Haswell kernel should use two registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+32)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint32_t mask1 = uint32_t(mask); + uint32_t mask2 = uint32_t(mask >> 32); + this->chunks[0].compress(mask1, output); + this->chunks[1].compress(mask2, output + 32 - count_ones(mask1)); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r_hi = this->chunks[1].to_bitmask(); + return r_lo | (r_hi << 32); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0] | this->chunks[1]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask, + this->chunks[1] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_SIMD_H +/* end file simdjson/haswell/simd.h */ +/* including simdjson/haswell/stringparsing_defs.h: #include "simdjson/haswell/stringparsing_defs.h" */ +/* begin file simdjson/haswell/stringparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +#define SIMDJSON_HASWELL_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast((v == '\\').to_bitmask()), // bs_bits + static_cast((v == '"').to_bitmask()), // quote_bits + }; +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +/* end file simdjson/haswell/stringparsing_defs.h */ +/* end file simdjson/haswell/begin.h */ +/* including generic/amalgamated.h for haswell: #include */ +/* begin file generic/amalgamated.h for haswell */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_SRC_GENERIC_DEPENDENCIES_H) +#error generic/dependencies.h must be included before generic/amalgamated.h! +#endif + +/* including generic/base.h for haswell: #include */ +/* begin file generic/base.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +struct json_character_block; + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_BASE_H +/* end file generic/base.h for haswell */ +/* including generic/dom_parser_implementation.h for haswell: #include */ +/* begin file generic/dom_parser_implementation.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// Interface a dom parser implementation must fulfill +namespace simdjson { +namespace haswell { +namespace { + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3); +simdjson_inline bool is_ascii(const simd8x64& input); + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file generic/dom_parser_implementation.h for haswell */ +/* including generic/json_character_block.h for haswell: #include */ +/* begin file generic/json_character_block.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +struct json_character_block { + static simdjson_inline json_character_block classify(const simd::simd8x64& in); + + simdjson_inline uint64_t whitespace() const noexcept { return _whitespace; } + simdjson_inline uint64_t op() const noexcept { return _op; } + simdjson_inline uint64_t scalar() const noexcept { return ~(op() | whitespace()); } + + uint64_t _whitespace; + uint64_t _op; +}; + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H +/* end file generic/json_character_block.h for haswell */ +/* end file generic/amalgamated.h for haswell */ +/* including generic/stage1/amalgamated.h for haswell: #include */ +/* begin file generic/stage1/amalgamated.h for haswell */ +// Stuff other things depend on +/* including generic/stage1/base.h for haswell: #include */ +/* begin file generic/stage1/base.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +class bit_indexer; +template +struct buf_block_reader; +struct json_block; +class json_minifier; +class json_scanner; +struct json_string_block; +class json_string_scanner; +class json_structural_indexer; + +} // namespace stage1 + +namespace utf8_validation { +struct utf8_checker; +} // namespace utf8_validation + +using utf8_validation::utf8_checker; + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BASE_H +/* end file generic/stage1/base.h for haswell */ +/* including generic/stage1/buf_block_reader.h for haswell: #include */ +/* begin file generic/stage1/buf_block_reader.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +// Walks through a buffer in block-sized increments, loading the last part with spaces +template +struct buf_block_reader { +public: + simdjson_inline buf_block_reader(const uint8_t *_buf, size_t _len); + simdjson_inline size_t block_index(); + simdjson_inline bool has_full_block() const; + simdjson_inline const uint8_t *full_block() const; + /** + * Get the last block, padded with spaces. + * + * There will always be a last block, with at least 1 byte, unless len == 0 (in which case this + * function fills the buffer with spaces and returns 0. In particular, if len == STEP_SIZE there + * will be 0 full_blocks and 1 remainder block with STEP_SIZE bytes and no spaces for padding. + * + * @return the number of effective characters in the last block. + */ + simdjson_inline size_t get_remainder(uint8_t *dst) const; + simdjson_inline void advance(); +private: + const uint8_t *buf; + const size_t len; + const size_t lenminusstep; + size_t idx; +}; + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text_64(const uint8_t *text) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i); i++) { + buf[i] = int8_t(text[i]) < ' ' ? '_' : int8_t(text[i]); + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text(const simd8x64& in) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] < ' ') { buf[i] = '_'; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_input_text(const simd8x64& in, uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] <= ' ') { buf[i] = '_'; } + if (!(mask & (size_t(1) << i))) { buf[i] = ' '; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_mask(uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i<64; i++) { + buf[i] = (mask & (size_t(1) << i)) ? 'X' : ' '; + } + buf[64] = '\0'; + return buf; +} + +template +simdjson_inline buf_block_reader::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {} + +template +simdjson_inline size_t buf_block_reader::block_index() { return idx; } + +template +simdjson_inline bool buf_block_reader::has_full_block() const { + return idx < lenminusstep; +} + +template +simdjson_inline const uint8_t *buf_block_reader::full_block() const { + return &buf[idx]; +} + +template +simdjson_inline size_t buf_block_reader::get_remainder(uint8_t *dst) const { + if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers + std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once. + std::memcpy(dst, buf + idx, len - idx); + return len - idx; +} + +template +simdjson_inline void buf_block_reader::advance() { + idx += STEP_SIZE; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H +/* end file generic/stage1/buf_block_reader.h for haswell */ +/* including generic/stage1/json_escape_scanner.h for haswell: #include */ +/* begin file generic/stage1/json_escape_scanner.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +/** + * Scans for escape characters in JSON, taking care with multiple backslashes (\\n vs. \n). + */ +struct json_escape_scanner { + /** The actual escape characters (the backslashes themselves). */ + uint64_t next_is_escaped = 0ULL; + + struct escaped_and_escape { + /** + * Mask of escaped characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 0100100010100101000 + * n \ \ n \ \ + * ``` + */ + uint64_t escaped; + /** + * Mask of escape characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 1001000101001010001 + * \ \ \ \ \ \ \ + * ``` + */ + uint64_t escape; + }; + + /** + * Get a mask of both escape and escaped characters (the characters following a backslash). + * + * @param potential_escape A mask of the character that can escape others (but could be + * escaped itself). e.g. block.eq('\\') + */ + simdjson_really_inline escaped_and_escape next(uint64_t backslash) noexcept { + +#if !SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT + if (!backslash) { return {next_escaped_without_backslashes(), 0}; } +#endif + + // | | Mask (shows characters instead of 1's) | Depth | Instructions | + // |--------------------------------|----------------------------------------|-------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | | | + // | | ` even odd even odd odd` | | | + // | potential_escape | ` \ \\\ \\\ \\\\ \\\\ \\\` | 1 | 1 (backslash & ~first_is_escaped) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 5 | 5 (next_escape_and_terminal_code()) + // | escaped | `\ \ n \ n \ \ \ \ \ ` X | 6 | 7 (escape_and_terminal_code ^ (potential_escape | first_is_escaped)) + // | escape | ` \ \ \ \ \ \ \ \ \ \` | 6 | 8 (escape_and_terminal_code & backslash) + // | first_is_escaped | `\ ` | 7 (*) | 9 (escape >> 63) () + // (*) this is not needed until the next iteration + uint64_t escape_and_terminal_code = next_escape_and_terminal_code(backslash & ~this->next_is_escaped); + uint64_t escaped = escape_and_terminal_code ^ (backslash | this->next_is_escaped); + uint64_t escape = escape_and_terminal_code & backslash; + this->next_is_escaped = escape >> 63; + return {escaped, escape}; + } + +private: + static constexpr const uint64_t ODD_BITS = 0xAAAAAAAAAAAAAAAAULL; + + simdjson_really_inline uint64_t next_escaped_without_backslashes() noexcept { + uint64_t escaped = this->next_is_escaped; + this->next_is_escaped = 0; + return escaped; + } + + /** + * Returns a mask of the next escape characters (masking out escaped backslashes), along with + * any non-backslash escape codes. + * + * \n \\n \\\n \\\\n returns: + * \n \ \ \n \ \ + * 11 100 1011 10100 + * + * You are expected to mask out the first bit yourself if the previous block had a trailing + * escape. + * + * & the result with potential_escape to get just the escape characters. + * ^ the result with (potential_escape | first_is_escaped) to get escaped characters. + */ + static simdjson_really_inline uint64_t next_escape_and_terminal_code(uint64_t potential_escape) noexcept { + // If we were to just shift and mask out any odd bits, we'd actually get a *half* right answer: + // any even-aligned backslash runs would be correct! Odd-aligned backslash runs would be + // inverted (\\\ would be 010 instead of 101). + // + // ``` + // string: | ____\\\\_\\\\_____ | + // maybe_escaped | ODD | \ \ \ \ | + // even-aligned ^^^ ^^^^ odd-aligned + // ``` + // + // Taking that into account, our basic strategy is: + // + // 1. Use subtraction to produce a mask with 1's for even-aligned runs and 0's for + // odd-aligned runs. + // 2. XOR all odd bits, which masks out the odd bits in even-aligned runs, and brings IN the + // odd bits in odd-aligned runs. + // 3. & with backslash to clean up any stray bits. + // runs are set to 0, and then XORing with "odd": + // + // | | Mask (shows characters instead of 1's) | Instructions | + // |--------------------------------|----------------------------------------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | + // | | ` even odd even odd odd` | + // | maybe_escaped | ` n \\n \\n \\\_ \\\_ \\` X | 1 (potential_escape << 1) + // | maybe_escaped_and_odd | ` \n_ \\n _ \\\n_ _ \\\__ _\\\_ \\\` | 1 (maybe_escaped | odd) + // | even_series_codes_and_odd | ` n_\\\ _ n_ _\\\\ _ _ ` | 1 (maybe_escaped_and_odd - potential_escape) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 1 (^ odd) + // + + // Escaped characters are characters following an escape. + uint64_t maybe_escaped = potential_escape << 1; + + // To distinguish odd from even escape sequences, therefore, we turn on any *starting* + // escapes that are on an odd byte. (We actually bring in all odd bits, for speed.) + // - Odd runs of backslashes are 0000, and the code at the end ("n" in \n or \\n) is 1. + // - Odd runs of backslashes are 1111, and the code at the end ("n" in \n or \\n) is 0. + // - All other odd bytes are 1, and even bytes are 0. + uint64_t maybe_escaped_and_odd_bits = maybe_escaped | ODD_BITS; + uint64_t even_series_codes_and_odd_bits = maybe_escaped_and_odd_bits - potential_escape; + + // Now we flip all odd bytes back with xor. This: + // - Makes odd runs of backslashes go from 0000 to 1010 + // - Makes even runs of backslashes go from 1111 to 1010 + // - Sets actually-escaped codes to 1 (the n in \n and \\n: \n = 11, \\n = 100) + // - Resets all other bytes to 0 + return even_series_codes_and_odd_bits ^ ODD_BITS; + } +}; + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_escape_scanner.h for haswell */ +/* including generic/stage1/json_string_scanner.h for haswell: #include */ +/* begin file generic/stage1/json_string_scanner.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +struct json_string_block { + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_really_inline json_string_block(uint64_t escaped, uint64_t quote, uint64_t in_string) : + _escaped(escaped), _quote(quote), _in_string(in_string) {} + + // Escaped characters (characters following an escape() character) + simdjson_really_inline uint64_t escaped() const { return _escaped; } + // Real (non-backslashed) quotes + simdjson_really_inline uint64_t quote() const { return _quote; } + // Only characters inside the string (not including the quotes) + simdjson_really_inline uint64_t string_content() const { return _in_string & ~_quote; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_inside_string(uint64_t mask) const { return mask & _in_string; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_outside_string(uint64_t mask) const { return mask & ~_in_string; } + // Tail of string (everything except the start quote) + simdjson_really_inline uint64_t string_tail() const { return _in_string ^ _quote; } + + // escaped characters (backslashed--does not include the hex characters after \u) + uint64_t _escaped; + // real quotes (non-escaped ones) + uint64_t _quote; + // string characters (includes start quote but not end quote) + uint64_t _in_string; +}; + +// Scans blocks for string characters, storing the state necessary to do so +class json_string_scanner { +public: + simdjson_really_inline json_string_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_really_inline error_code finish(); + +private: + // Scans for escape characters + json_escape_scanner escape_scanner{}; + // Whether the last iteration was still inside a string (all 1's = true, all 0's = false). + uint64_t prev_in_string = 0ULL; +}; + +// +// Return a mask of all string characters plus end quotes. +// +// prev_escaped is overflow saying whether the next character is escaped. +// prev_in_string is overflow saying whether we're still in a string. +// +// Backslash sequences outside of quotes will be detected in stage 2. +// +simdjson_really_inline json_string_block json_string_scanner::next(const simd::simd8x64& in) { + const uint64_t backslash = in.eq('\\'); + const uint64_t escaped = escape_scanner.next(backslash).escaped; + const uint64_t quote = in.eq('"') & ~escaped; + + // + // prefix_xor flips on bits inside the string (and flips off the end quote). + // + // Then we xor with prev_in_string: if we were in a string already, its effect is flipped + // (characters inside strings are outside, and characters outside strings are inside). + // + const uint64_t in_string = prefix_xor(quote) ^ prev_in_string; + + // + // Check if we're still in a string at the end of the box so the next block will know + // + prev_in_string = uint64_t(static_cast(in_string) >> 63); + + // Use ^ to turn the beginning quote off, and the end quote on. + + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_string_block(escaped, quote, in_string); +} + +simdjson_really_inline error_code json_string_scanner::finish() { + if (prev_in_string) { + return UNCLOSED_STRING; + } + return SUCCESS; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_string_scanner.h for haswell */ +/* including generic/stage1/utf8_lookup4_algorithm.h for haswell: #include */ +/* begin file generic/stage1/utf8_lookup4_algorithm.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace utf8_validation { + +using namespace simd; + + simdjson_inline simd8 check_special_cases(const simd8 input, const simd8 prev1) { +// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII) +// Bit 1 = Too Long (ASCII followed by continuation) +// Bit 2 = Overlong 3-byte +// Bit 4 = Surrogate +// Bit 5 = Overlong 2-byte +// Bit 7 = Two Continuations + constexpr const uint8_t TOO_SHORT = 1<<0; // 11______ 0_______ + // 11______ 11______ + constexpr const uint8_t TOO_LONG = 1<<1; // 0_______ 10______ + constexpr const uint8_t OVERLONG_3 = 1<<2; // 11100000 100_____ + constexpr const uint8_t SURROGATE = 1<<4; // 11101101 101_____ + constexpr const uint8_t OVERLONG_2 = 1<<5; // 1100000_ 10______ + constexpr const uint8_t TWO_CONTS = 1<<7; // 10______ 10______ + constexpr const uint8_t TOO_LARGE = 1<<3; // 11110100 1001____ + // 11110100 101_____ + // 11110101 1001____ + // 11110101 101_____ + // 1111011_ 1001____ + // 1111011_ 101_____ + // 11111___ 1001____ + // 11111___ 101_____ + constexpr const uint8_t TOO_LARGE_1000 = 1<<6; + // 11110101 1000____ + // 1111011_ 1000____ + // 11111___ 1000____ + constexpr const uint8_t OVERLONG_4 = 1<<6; // 11110000 1000____ + + const simd8 byte_1_high = prev1.shr<4>().lookup_16( + // 0_______ ________ + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + // 10______ ________ + TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS, + // 1100____ ________ + TOO_SHORT | OVERLONG_2, + // 1101____ ________ + TOO_SHORT, + // 1110____ ________ + TOO_SHORT | OVERLONG_3 | SURROGATE, + // 1111____ ________ + TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4 + ); + constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 . + const simd8 byte_1_low = (prev1 & 0x0F).lookup_16( + // ____0000 ________ + CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4, + // ____0001 ________ + CARRY | OVERLONG_2, + // ____001_ ________ + CARRY, + CARRY, + + // ____0100 ________ + CARRY | TOO_LARGE, + // ____0101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____011_ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + + // ____1___ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____1101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000 + ); + const simd8 byte_2_high = input.shr<4>().lookup_16( + // ________ 0_______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + + // ________ 1000____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4, + // ________ 1001____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE, + // ________ 101_____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + + // ________ 11______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT + ); + return (byte_1_high & byte_1_low & byte_2_high); + } + simdjson_inline simd8 check_multibyte_lengths(const simd8 input, + const simd8 prev_input, const simd8 sc) { + simd8 prev2 = input.prev<2>(prev_input); + simd8 prev3 = input.prev<3>(prev_input); + simd8 must23 = simd8(must_be_2_3_continuation(prev2, prev3)); + simd8 must23_80 = must23 & uint8_t(0x80); + return must23_80 ^ sc; + } + + // + // Return nonzero if there are incomplete multibyte characters at the end of the block: + // e.g. if there is a 4-byte character, but it's 3 bytes from the end. + // + simdjson_inline simd8 is_incomplete(const simd8 input) { + // If the previous input's last 3 bytes match this, they're too short (they ended at EOF): + // ... 1111____ 111_____ 11______ +#if SIMDJSON_IMPLEMENTATION_ICELAKE + static const uint8_t max_array[64] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#else + static const uint8_t max_array[32] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#endif + const simd8 max_value(&max_array[sizeof(max_array)-sizeof(simd8)]); + return input.gt_bits(max_value); + } + + struct utf8_checker { + // If this is nonzero, there has been a UTF-8 error. + simd8 error; + // The last input we received + simd8 prev_input_block; + // Whether the last input we received was incomplete (used for ASCII fast path) + simd8 prev_incomplete; + + // + // Check whether the current bytes are valid UTF-8. + // + simdjson_inline void check_utf8_bytes(const simd8 input, const simd8 prev_input) { + // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes + // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers) + simd8 prev1 = input.prev<1>(prev_input); + simd8 sc = check_special_cases(input, prev1); + this->error |= check_multibyte_lengths(input, prev_input, sc); + } + + // The only problem that can happen at EOF is that a multibyte character is too short + // or a byte value too large in the last bytes: check_special_cases only checks for bytes + // too large in the first of two bytes. + simdjson_inline void check_eof() { + // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't + // possibly finish them. + this->error |= this->prev_incomplete; + } + + simdjson_inline void check_next_input(const simd8x64& input) { + if(simdjson_likely(is_ascii(input))) { + this->error |= this->prev_incomplete; + } else { + // you might think that a for-loop would work, but under Visual Studio, it is not good enough. + static_assert((simd8x64::NUM_CHUNKS == 1) + ||(simd8x64::NUM_CHUNKS == 2) + || (simd8x64::NUM_CHUNKS == 4), + "We support one, two or four chunks per 64-byte block."); + SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 1) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 2) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 4) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + this->check_utf8_bytes(input.chunks[2], input.chunks[1]); + this->check_utf8_bytes(input.chunks[3], input.chunks[2]); + } + this->prev_incomplete = is_incomplete(input.chunks[simd8x64::NUM_CHUNKS-1]); + this->prev_input_block = input.chunks[simd8x64::NUM_CHUNKS-1]; + } + } + // do not forget to call check_eof! + simdjson_inline error_code errors() { + return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS; + } + + }; // struct utf8_checker +} // namespace utf8_validation + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H +/* end file generic/stage1/utf8_lookup4_algorithm.h for haswell */ +/* including generic/stage1/json_scanner.h for haswell: #include */ +/* begin file generic/stage1/json_scanner.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +/** + * A block of scanned json, with information on operators and scalars. + * + * We seek to identify pseudo-structural characters. Anything that is inside + * a string must be omitted (hence & ~_string.string_tail()). + * Otherwise, pseudo-structural characters come in two forms. + * 1. We have the structural characters ([,],{,},:, comma). The + * term 'structural character' is from the JSON RFC. + * 2. We have the 'scalar pseudo-structural characters'. + * Scalars are quotes, and any character except structural characters and white space. + * + * To identify the scalar pseudo-structural characters, we must look at what comes + * before them: it must be a space, a quote or a structural characters. + * Starting with simdjson v0.3, we identify them by + * negation: we identify everything that is followed by a non-quote scalar, + * and we negate that. Whatever remains must be a 'scalar pseudo-structural character'. + */ +struct json_block { +public: + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_inline json_block(json_string_block&& string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(std::move(string)), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + simdjson_inline json_block(json_string_block string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + + /** + * The start of structurals. + * In simdjson prior to v0.3, these were called the pseudo-structural characters. + **/ + simdjson_inline uint64_t structural_start() const noexcept { return potential_structural_start() & ~_string.string_tail(); } + /** All JSON whitespace (i.e. not in a string) */ + simdjson_inline uint64_t whitespace() const noexcept { return non_quote_outside_string(_characters.whitespace()); } + + // Helpers + + /** Whether the given characters are inside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_inside_string(uint64_t mask) const noexcept { return _string.non_quote_inside_string(mask); } + /** Whether the given characters are outside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_outside_string(uint64_t mask) const noexcept { return _string.non_quote_outside_string(mask); } + + // string and escape characters + json_string_block _string; + // whitespace, structural characters ('operators'), scalars + json_character_block _characters; + // whether the previous character was a scalar + uint64_t _follows_potential_nonquote_scalar; +private: + // Potential structurals (i.e. disregarding strings) + + /** + * structural elements ([,],{,},:, comma) plus scalar starts like 123, true and "abc". + * They may reside inside a string. + **/ + simdjson_inline uint64_t potential_structural_start() const noexcept { return _characters.op() | potential_scalar_start(); } + /** + * The start of non-operator runs, like 123, true and "abc". + * It main reside inside a string. + **/ + simdjson_inline uint64_t potential_scalar_start() const noexcept { + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // Whenever it is preceded by something that is not a structural element ({,},[,],:, ") nor a white-space + // then we know that it is irrelevant structurally. + return _characters.scalar() & ~follows_potential_scalar(); + } + /** + * Whether the given character is immediately after a non-operator like 123, true. + * The characters following a quote are not included. + */ + simdjson_inline uint64_t follows_potential_scalar() const noexcept { + // _follows_potential_nonquote_scalar: is defined as marking any character that follows a character + // that is not a structural element ({,},[,],:, comma) nor a quote (") and that is not a + // white space. + // It is understood that within quoted region, anything at all could be marked (irrelevant). + return _follows_potential_nonquote_scalar; + } +}; + +/** + * Scans JSON for important bits: structural characters or 'operators', strings, and scalars. + * + * The scanner starts by calculating two distinct things: + * - string characters (taking \" into account) + * - structural characters or 'operators' ([]{},:, comma) + * and scalars (runs of non-operators like 123, true and "abc") + * + * To minimize data dependency (a key component of the scanner's speed), it finds these in parallel: + * in particular, the operator/scalar bit will find plenty of things that are actually part of + * strings. When we're done, json_block will fuse the two together by masking out tokens that are + * part of a string. + */ +class json_scanner { +public: + json_scanner() = default; + simdjson_inline json_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_inline error_code finish(); + +private: + // Whether the last character of the previous iteration is part of a scalar token + // (anything except whitespace or a structural character/'operator'). + uint64_t prev_scalar = 0ULL; + json_string_scanner string_scanner{}; +}; + + +// +// Check if the current character immediately follows a matching character. +// +// For example, this checks for quotes with backslashes in front of them: +// +// const uint64_t backslashed_quote = in.eq('"') & immediately_follows(in.eq('\'), prev_backslash); +// +simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) { + const uint64_t result = match << 1 | overflow; + overflow = match >> 63; + return result; +} + +simdjson_inline json_block json_scanner::next(const simd::simd8x64& in) { + json_string_block strings = string_scanner.next(in); + // identifies the white-space and the structural characters + json_character_block characters = json_character_block::classify(in); + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // We want follows_scalar to mark anything that follows a non-quote scalar (so letters and numbers). + // + // A terminal quote should either be followed by a structural character (comma, brace, bracket, colon) + // or nothing. However, we still want ' "a string"true ' to mark the 't' of 'true' as a potential + // pseudo-structural character just like we would if we had ' "a string" true '; otherwise we + // may need to add an extra check when parsing strings. + // + // Performance: there are many ways to skin this cat. + const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote(); + uint64_t follows_nonquote_scalar = follows(nonquote_scalar, prev_scalar); + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_block( + strings,// strings is a function-local object so either it moves or the copy is elided. + characters, + follows_nonquote_scalar + ); +} + +simdjson_inline error_code json_scanner::finish() { + return string_scanner.finish(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H +/* end file generic/stage1/json_scanner.h for haswell */ + +// All other declarations +/* including generic/stage1/find_next_document_index.h for haswell: #include */ +/* begin file generic/stage1/find_next_document_index.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +/** + * This algorithm is used to quickly identify the last structural position that + * makes up a complete document. + * + * It does this by going backwards and finding the last *document boundary* (a + * place where one value follows another without a comma between them). If the + * last document (the characters after the boundary) has an equal number of + * start and end brackets, it is considered complete. + * + * Simply put, we iterate over the structural characters, starting from + * the end. We consider that we found the end of a JSON document when the + * first element of the pair is NOT one of these characters: '{' '[' ':' ',' + * and when the second element is NOT one of these characters: '}' ']' ':' ','. + * + * This simple comparison works most of the time, but it does not cover cases + * where the batch's structural indexes contain a perfect amount of documents. + * In such a case, we do not have access to the structural index which follows + * the last document, therefore, we do not have access to the second element in + * the pair, and that means we cannot identify the last document. To fix this + * issue, we keep a count of the open and closed curly/square braces we found + * while searching for the pair. When we find a pair AND the count of open and + * closed curly/square braces is the same, we know that we just passed a + * complete document, therefore the last json buffer location is the end of the + * batch. + */ +simdjson_inline uint32_t find_next_document_index(dom_parser_implementation &parser) { + // Variant: do not count separately, just figure out depth + if(parser.n_structural_indexes == 0) { return 0; } + auto arr_cnt = 0; + auto obj_cnt = 0; + for (auto i = parser.n_structural_indexes - 1; i > 0; i--) { + auto idxb = parser.structural_indexes[i]; + switch (parser.buf[idxb]) { + case ':': + case ',': + continue; + case '}': + obj_cnt--; + continue; + case ']': + arr_cnt--; + continue; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + auto idxa = parser.structural_indexes[i - 1]; + switch (parser.buf[idxa]) { + case '{': + case '[': + case ':': + case ',': + continue; + } + // Last document is complete, so the next document will appear after! + if (!arr_cnt && !obj_cnt) { + return parser.n_structural_indexes; + } + // Last document is incomplete; mark the document at i + 1 as the next one + return i; + } + // If we made it to the end, we want to finish counting to see if we have a full document. + switch (parser.buf[parser.structural_indexes[0]]) { + case '}': + obj_cnt--; + break; + case ']': + arr_cnt--; + break; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + if (!arr_cnt && !obj_cnt) { + // We have a complete document. + return parser.n_structural_indexes; + } + return 0; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H +/* end file generic/stage1/find_next_document_index.h for haswell */ +/* including generic/stage1/json_minifier.h for haswell: #include */ +/* begin file generic/stage1/json_minifier.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +class json_minifier { +public: + template + static error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept; + +private: + simdjson_inline json_minifier(uint8_t *_dst) + : dst{_dst} + {} + template + simdjson_inline void step(const uint8_t *block_buf, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block); + simdjson_inline error_code finish(uint8_t *dst_start, size_t &dst_len); + json_scanner scanner{}; + uint8_t *dst; +}; + +simdjson_inline void json_minifier::next(const simd::simd8x64& in, const json_block& block) { + uint64_t mask = block.whitespace(); + dst += in.compress(mask, dst); +} + +simdjson_inline error_code json_minifier::finish(uint8_t *dst_start, size_t &dst_len) { + error_code error = scanner.finish(); + if (error) { dst_len = 0; return error; } + dst_len = dst - dst_start; + return SUCCESS; +} + +template<> +simdjson_inline void json_minifier::step<128>(const uint8_t *block_buf, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + simd::simd8x64 in_2(block_buf+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1); + this->next(in_2, block_2); + reader.advance(); +} + +template<> +simdjson_inline void json_minifier::step<64>(const uint8_t *block_buf, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + json_block block_1 = scanner.next(in_1); + this->next(block_buf, block_1); + reader.advance(); +} + +template +error_code json_minifier::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept { + buf_block_reader reader(buf, len); + json_minifier minifier(dst); + + // Index the first n-1 blocks + while (reader.has_full_block()) { + minifier.step(reader.full_block(), reader); + } + + // Index the last (remainder) block, padded with spaces + uint8_t block[STEP_SIZE]; + size_t remaining_bytes = reader.get_remainder(block); + if (remaining_bytes > 0) { + // We do not want to write directly to the output stream. Rather, we write + // to a local buffer (for safety). + uint8_t out_block[STEP_SIZE]; + uint8_t * const guarded_dst{minifier.dst}; + minifier.dst = out_block; + minifier.step(block, reader); + size_t to_write = minifier.dst - out_block; + // In some cases, we could be enticed to consider the padded spaces + // as part of the string. This is fine as long as we do not write more + // than we consumed. + if(to_write > remaining_bytes) { to_write = remaining_bytes; } + memcpy(guarded_dst, out_block, to_write); + minifier.dst = guarded_dst + to_write; + } + return minifier.finish(dst, dst_len); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H +/* end file generic/stage1/json_minifier.h for haswell */ +/* including generic/stage1/json_structural_indexer.h for haswell: #include */ +/* begin file generic/stage1/json_structural_indexer.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +class bit_indexer { +public: + uint32_t *tail; + + simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {} + +#if SIMDJSON_PREFER_REVERSE_BITS + /** + * ARM lacks a fast trailing zero instruction, but it has a fast + * bit reversal instruction and a fast leading zero instruction. + * Thus it may be profitable to reverse the bits (once) and then + * to rely on a sequence of instructions that call the leading + * zero instruction. + * + * Performance notes: + * The chosen routine is not optimal in terms of data dependency + * since zero_leading_bit might require two instructions. However, + * it tends to minimize the total number of instructions which is + * beneficial. + */ + simdjson_inline void write_index(uint32_t idx, uint64_t& rev_bits, int i) { + int lz = leading_zeroes(rev_bits); + this->tail[i] = static_cast(idx) + lz; + rev_bits = zero_leading_bit(rev_bits, lz); + } +#else + /** + * Under recent x64 systems, we often have both a fast trailing zero + * instruction and a fast 'clear-lower-bit' instruction so the following + * algorithm can be competitive. + */ + + simdjson_inline void write_index(uint32_t idx, uint64_t& bits, int i) { + this->tail[i] = idx + trailing_zeroes(bits); + bits = clear_lowest_bit(bits); + } +#endif // SIMDJSON_PREFER_REVERSE_BITS + + template + simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) { + write_index(idx, bits, START); + SIMDJSON_IF_CONSTEXPR (N > 1) { + write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits); + } + return START+N; + } + + template + simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) { + write_indexes(idx, bits); + SIMDJSON_IF_CONSTEXPR ((START+STEP) < END) { + if (simdjson_unlikely((START+STEP) < cnt)) { + write_indexes_stepped<(START+STEP(idx, bits, cnt); + } + } + return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP; + } + + // flatten out values in 'bits' assuming that they are are to have values of idx + // plus their position in the bitvector, and store these indexes at + // base_ptr[base] incrementing base as we go + // will potentially store extra values beyond end of valid bits, so base_ptr + // needs to be large enough to handle this + // + // If the kernel sets SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER, then it + // will provide its own version of the code. +#ifdef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + simdjson_inline void write(uint32_t idx, uint64_t bits); +#else + simdjson_inline void write(uint32_t idx, uint64_t bits) { + // In some instances, the next branch is expensive because it is mispredicted. + // Unfortunately, in other cases, + // it helps tremendously. + if (bits == 0) + return; + + int cnt = static_cast(count_ones(bits)); + +#if SIMDJSON_PREFER_REVERSE_BITS + bits = reverse_bits(bits); +#endif +#ifdef SIMDJSON_STRUCTURAL_INDEXER_STEP + static constexpr const int STEP = SIMDJSON_STRUCTURAL_INDEXER_STEP; +#else + static constexpr const int STEP = 4; +#endif + static constexpr const int STEP_UNTIL = 24; + + write_indexes_stepped<0, STEP_UNTIL, STEP>(idx, bits, cnt); + SIMDJSON_IF_CONSTEXPR (STEP_UNTIL < 64) { + if (simdjson_unlikely(STEP_UNTIL < cnt)) { + for (int i=STEP_UNTIL; itail += cnt; + } +#endif // SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +}; + +class json_structural_indexer { +public: + /** + * Find the important bits of JSON in a 128-byte chunk, and add them to structural_indexes. + * + * @param partial Setting the partial parameter to true allows the find_structural_bits to + * tolerate unclosed strings. The caller should still ensure that the input is valid UTF-8. If + * you are processing substrings, you may want to call on a function like trimmed_length_safe_utf8. + */ + template + static error_code index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept; + +private: + simdjson_inline json_structural_indexer(uint32_t *structural_indexes); + template + simdjson_inline void step(const uint8_t *block, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block, size_t idx); + simdjson_inline error_code finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial); + + json_scanner scanner{}; + utf8_checker checker{}; + bit_indexer indexer; + uint64_t prev_structurals = 0; + uint64_t unescaped_chars_error = 0; +}; + +simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {} + +// Skip the last character if it is partial +simdjson_inline size_t trim_partial_utf8(const uint8_t *buf, size_t len) { + if (simdjson_unlikely(len < 3)) { + switch (len) { + case 2: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 2 bytes left + return len; + case 1: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + return len; + case 0: + return len; + } + } + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 1 byte left + if (buf[len-3] >= 0xf0) { return len-3; } // 4-byte characters with only 3 bytes left + return len; +} + +// +// PERF NOTES: +// We pipe 2 inputs through these stages: +// 1. Load JSON into registers. This takes a long time and is highly parallelizable, so we load +// 2 inputs' worth at once so that by the time step 2 is looking for them input, it's available. +// 2. Scan the JSON for critical data: strings, scalars and operators. This is the critical path. +// The output of step 1 depends entirely on this information. These functions don't quite use +// up enough CPU: the second half of the functions is highly serial, only using 1 execution core +// at a time. The second input's scans has some dependency on the first ones finishing it, but +// they can make a lot of progress before they need that information. +// 3. Step 1 doesn't use enough capacity, so we run some extra stuff while we're waiting for that +// to finish: utf-8 checks and generating the output from the last iteration. +// +// The reason we run 2 inputs at a time, is steps 2 and 3 are *still* not enough to soak up all +// available capacity with just one input. Running 2 at a time seems to give the CPU a good enough +// workout. +// +template +error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept { + if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; } + // We guard the rest of the code so that we can assume that len > 0 throughout. + if (len == 0) { return EMPTY; } + if (is_streaming(partial)) { + len = trim_partial_utf8(buf, len); + // If you end up with an empty window after trimming + // the partial UTF-8 bytes, then chances are good that you + // have an UTF-8 formatting error. + if(len == 0) { return UTF8_ERROR; } + } + buf_block_reader reader(buf, len); + json_structural_indexer indexer(parser.structural_indexes.get()); + + // Read all but the last block + while (reader.has_full_block()) { + indexer.step(reader.full_block(), reader); + } + // Take care of the last block (will always be there unless file is empty which is + // not supposed to happen.) + uint8_t block[STEP_SIZE]; + if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; } + indexer.step(block, reader); + return indexer.finish(parser, reader.block_index(), len, partial); +} + +template<> +simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block); + simd::simd8x64 in_2(block+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1, reader.block_index()); + this->next(in_2, block_2, reader.block_index()+64); + reader.advance(); +} + +template<> +simdjson_inline void json_structural_indexer::step<64>(const uint8_t *block, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block); + json_block block_1 = scanner.next(in_1); + this->next(in_1, block_1, reader.block_index()); + reader.advance(); +} + +simdjson_inline void json_structural_indexer::next(const simd::simd8x64& in, const json_block& block, size_t idx) { + uint64_t unescaped = in.lteq(0x1F); +#if SIMDJSON_UTF8VALIDATION + checker.check_next_input(in); +#endif + indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser + prev_structurals = block.structural_start(); + unescaped_chars_error |= block.non_quote_inside_string(unescaped); +} + +simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) { + // Write out the final iteration's structurals + indexer.write(uint32_t(idx-64), prev_structurals); + error_code error = scanner.finish(); + // We deliberately break down the next expression so that it is + // human readable. + const bool should_we_exit = is_streaming(partial) ? + ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING + : (error != SUCCESS); // if partial is false, we must have SUCCESS + const bool have_unclosed_string = (error == UNCLOSED_STRING); + if (simdjson_unlikely(should_we_exit)) { return error; } + + if (unescaped_chars_error) { + return UNESCAPED_CHARS; + } + parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get()); + /*** + * The On Demand API requires special padding. + * + * This is related to https://github.com/simdjson/simdjson/issues/906 + * Basically, we want to make sure that if the parsing continues beyond the last (valid) + * structural character, it quickly stops. + * Only three structural characters can be repeated without triggering an error in JSON: [,] and }. + * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing + * continues, then it must be [,] or }. + * Suppose it is ] or }. We backtrack to the first character, what could it be that would + * not trigger an error? It could be ] or } but no, because you can't start a document that way. + * It can't be a comma, a colon or any simple value. So the only way we could continue is + * if the repeated character is [. But if so, the document must start with [. But if the document + * starts with [, it should end with ]. If we enforce that rule, then we would get + * ][[ which is invalid. + * + * This is illustrated with the test array_iterate_unclosed_error() on the following input: + * R"({ "a": [,,)" + **/ + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final + parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len); + parser.structural_indexes[parser.n_structural_indexes + 2] = 0; + parser.next_structural_index = 0; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + return EMPTY; + } + if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) { + return UNEXPECTED_ERROR; + } + if (partial == stage1_mode::streaming_partial) { + // If we have an unclosed string, then the last structural + // will be the quote and we want to make sure to omit it. + if(have_unclosed_string) { + parser.n_structural_indexes--; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; } + } + // We truncate the input to the end of the last complete document (or zero). + auto new_structural_indexes = find_next_document_index(parser); + if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) { + if(parser.structural_indexes[0] == 0) { + // If the buffer is partial and we started at index 0 but the document is + // incomplete, it's too big to parse. + return CAPACITY; + } else { + // It is possible that the document could be parsed, we just had a lot + // of white space. + parser.n_structural_indexes = 0; + return EMPTY; + } + } + + parser.n_structural_indexes = new_structural_indexes; + } else if (partial == stage1_mode::streaming_final) { + if(have_unclosed_string) { parser.n_structural_indexes--; } + // We truncate the input to the end of the last complete document (or zero). + // Because partial == stage1_mode::streaming_final, it means that we may + // silently ignore trailing garbage. Though it sounds bad, we do it + // deliberately because many people who have streams of JSON documents + // will truncate them for processing. E.g., imagine that you are uncompressing + // the data from a size file or receiving it in chunks from the network. You + // may not know where exactly the last document will be. Meanwhile the + // document_stream instances allow people to know the JSON documents they are + // parsing (see the iterator.source() method). + parser.n_structural_indexes = find_next_document_index(parser); + // We store the initial n_structural_indexes so that the client can see + // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes, + // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len, + // otherwise, it will copy some prior index. + parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes]; + // This next line is critical, do not change it unless you understand what you are + // doing. + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + // We tolerate an unclosed string at the very end of the stream. Indeed, users + // often load their data in bulk without being careful and they want us to ignore + // the trailing garbage. + return EMPTY; + } + } + checker.check_eof(); + return checker.errors(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +// Clear CUSTOM_BIT_INDEXER so other implementations can set it if they need to. +#undef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H +/* end file generic/stage1/json_structural_indexer.h for haswell */ +/* including generic/stage1/utf8_validator.h for haswell: #include */ +/* begin file generic/stage1/utf8_validator.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage1 { + +/** + * Validates that the string is actual UTF-8. + */ +template +bool generic_validate_utf8(const uint8_t * input, size_t length) { + checker c{}; + buf_block_reader<64> reader(input, length); + while (reader.has_full_block()) { + simd::simd8x64 in(reader.full_block()); + c.check_next_input(in); + reader.advance(); + } + uint8_t block[64]{}; + reader.get_remainder(block); + simd::simd8x64 in(block); + c.check_next_input(in); + reader.advance(); + c.check_eof(); + return c.errors() == error_code::SUCCESS; +} + +bool generic_validate_utf8(const char * input, size_t length) { + return generic_validate_utf8(reinterpret_cast(input),length); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H +/* end file generic/stage1/utf8_validator.h for haswell */ +/* end file generic/stage1/amalgamated.h for haswell */ +/* including generic/stage2/amalgamated.h for haswell: #include */ +/* begin file generic/stage2/amalgamated.h for haswell */ +// Stuff other things depend on +/* including generic/stage2/base.h for haswell: #include */ +/* begin file generic/stage2/base.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage2 { + +class json_iterator; +class structural_iterator; +struct tape_builder; +struct tape_writer; + +} // namespace stage2 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_BASE_H +/* end file generic/stage2/base.h for haswell */ +/* including generic/stage2/tape_writer.h for haswell: #include */ +/* begin file generic/stage2/tape_writer.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace haswell { +namespace { +namespace stage2 { + +struct tape_writer { + /** The next place to write to tape */ + uint64_t *next_tape_loc; + + /** Write a signed 64-bit value to tape. */ + simdjson_inline void append_s64(int64_t value) noexcept; + + /** Write an unsigned 64-bit value to tape. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + + /** Write a double value to tape. */ + simdjson_inline void append_double(double value) noexcept; + + /** + * Append a tape entry (an 8-bit type,and 56 bits worth of value). + */ + simdjson_inline void append(uint64_t val, internal::tape_type t) noexcept; + + /** + * Skip the current tape entry without writing. + * + * Used to skip the start of the container, since we'll come back later to fill it in when the + * container ends. + */ + simdjson_inline void skip() noexcept; + + /** + * Skip the number of tape entries necessary to write a large u64 or i64. + */ + simdjson_inline void skip_large_integer() noexcept; + + /** + * Skip the number of tape entries necessary to write a double. + */ + simdjson_inline void skip_double() noexcept; + + /** + * Write a value to a known location on tape. + * + * Used to go back and write out the start of a container after the container ends. + */ + simdjson_inline static void write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept; + +private: + /** + * Append both the tape entry, and a supplementary value following it. Used for types that need + * all 64 bits, such as double and uint64_t. + */ + template + simdjson_inline void append2(uint64_t val, T val2, internal::tape_type t) noexcept; +}; // struct tape_writer + +simdjson_inline void tape_writer::append_s64(int64_t value) noexcept { + append2(0, value, internal::tape_type::INT64); +} + +simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept { + append(0, internal::tape_type::UINT64); + *next_tape_loc = value; + next_tape_loc++; +} + +/** Write a double value to tape. */ +simdjson_inline void tape_writer::append_double(double value) noexcept { + append2(0, value, internal::tape_type::DOUBLE); +} + +simdjson_inline void tape_writer::skip() noexcept { + next_tape_loc++; +} + +simdjson_inline void tape_writer::skip_large_integer() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::skip_double() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept { + *next_tape_loc = val | ((uint64_t(char(t))) << 56); + next_tape_loc++; +} + +template +simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept { + append(val, t); + static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!"); + memcpy(next_tape_loc, &val2, sizeof(val2)); + next_tape_loc++; +} + +simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept { + tape_loc = val | ((uint64_t(char(t))) << 56); +} + +} // namespace stage2 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H +/* end file generic/stage2/tape_writer.h for haswell */ +/* including generic/stage2/logger.h for haswell: #include */ +/* begin file generic/stage2/logger.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + + +// This is for an internal-only stage 2 specific logger. +// Set LOG_ENABLED = true to log what stage 2 is doing! +namespace simdjson { +namespace haswell { +namespace { +namespace logger { + + static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + static constexpr const int LOG_EVENT_LEN = 20; + static constexpr const int LOG_BUFFER_LEN = 30; + static constexpr const int LOG_SMALL_BUFFER_LEN = 10; + static constexpr const int LOG_INDEX_LEN = 5; + + static int log_depth; // Not threadsafe. Log only. + + // Helper to turn unprintable or newline characters into spaces + static simdjson_inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } + } + + // Print the header and set up log_start + static simdjson_inline void log_start() { + if (LOG_ENABLED) { + log_depth = 0; + printf("\n"); + printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#"); + printf("|%.*s|%.*s|%.*s|%.*s|--------|\n", LOG_EVENT_LEN+2, DASHES, LOG_BUFFER_LEN+2, DASHES, LOG_SMALL_BUFFER_LEN+2, DASHES, 5+2, DASHES); + } + } + + simdjson_unused static simdjson_inline void log_string(const char *message) { + if (LOG_ENABLED) { + printf("%s\n", message); + } + } + + // Logs a single line from the stage 2 DOM parser + template + static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) { + if (LOG_ENABLED) { + printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title); + auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1; + auto next_index = structurals.next_structural; + auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast(" "); + auto next = &structurals.buf[*next_index]; + { + // Print the next N characters in the buffer. + printf("| "); + // Otherwise, print the characters starting from the buffer position. + // Print spaces for unprintable or newline characters. + for (int i=0;i */ +/* begin file generic/stage2/json_iterator.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage2 { + +class json_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + uint32_t depth{0}; + + /** + * Walk the JSON document. + * + * The visitor receives callbacks when values are encountered. All callbacks pass the iterator as + * the first parameter; some callbacks have other parameters as well: + * + * - visit_document_start() - at the beginning. + * - visit_document_end() - at the end (if things were successful). + * + * - visit_array_start() - at the start `[` of a non-empty array. + * - visit_array_end() - at the end `]` of a non-empty array. + * - visit_empty_array() - when an empty array is encountered. + * + * - visit_object_end() - at the start `]` of a non-empty object. + * - visit_object_start() - at the end `]` of a non-empty object. + * - visit_empty_object() - when an empty object is encountered. + * - visit_key(const uint8_t *key) - when a key in an object field is encountered. key is + * guaranteed to point at the first quote of the string (`"key"`). + * - visit_primitive(const uint8_t *value) - when a value is a string, number, boolean or null. + * - visit_root_primitive(iter, uint8_t *value) - when the top-level value is a string, number, boolean or null. + * + * - increment_count(iter) - each time a value is found in an array or object. + */ + template + simdjson_warn_unused simdjson_inline error_code walk_document(V &visitor) noexcept; + + /** + * Create an iterator capable of walking a JSON document. + * + * The document must have already passed through stage 1. + */ + simdjson_inline json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index); + + /** + * Look at the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *peek() const noexcept; + /** + * Advance to the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *advance() noexcept; + /** + * Get the remaining length of the document, from the start of the current token. + */ + simdjson_inline size_t remaining_len() const noexcept; + /** + * Check if we are at the end of the document. + * + * If this is true, there are no more tokens. + */ + simdjson_inline bool at_eof() const noexcept; + /** + * Check if we are at the beginning of the document. + */ + simdjson_inline bool at_beginning() const noexcept; + simdjson_inline uint8_t last_structural() const noexcept; + + /** + * Log that a value has been found. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_value(const char *type) const noexcept; + /** + * Log the start of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_start_value(const char *type) const noexcept; + /** + * Log the end of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_end_value(const char *type) const noexcept; + /** + * Log an error. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_error(const char *error) const noexcept; + + template + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(V &visitor, const uint8_t *value) noexcept; + template + simdjson_warn_unused simdjson_inline error_code visit_primitive(V &visitor, const uint8_t *value) noexcept; +}; + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept { + logger::log_start(); + + // + // Start the document + // + if (at_eof()) { return EMPTY; } + log_start_value("document"); + SIMDJSON_TRY( visitor.visit_document_start(*this) ); + + // + // Read first value + // + { + auto value = advance(); + + // Make sure the outer object or array is closed before continuing; otherwise, there are ways we + // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906 + if (!STREAMING) { + switch (*value) { + case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break; + case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break; + } + } + + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break; + } + } + goto document_end; + +// +// Object parser states +// +object_begin: + log_start_value("object"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = false; + SIMDJSON_TRY( visitor.visit_object_start(*this) ); + + { + auto key = advance(); + if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.increment_count(*this) ); + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + +object_field: + if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; } + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +object_continue: + switch (*advance()) { + case ',': + SIMDJSON_TRY( visitor.increment_count(*this) ); + { + auto key = advance(); + if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + goto object_field; + case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end; + default: log_error("No comma between object fields"); return TAPE_ERROR; + } + +scope_end: + depth--; + if (depth == 0) { goto document_end; } + if (dom_parser.is_array[depth]) { goto array_continue; } + goto object_continue; + +// +// Array parser states +// +array_begin: + log_start_value("array"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = true; + SIMDJSON_TRY( visitor.visit_array_start(*this) ); + SIMDJSON_TRY( visitor.increment_count(*this) ); + +array_value: + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +array_continue: + switch (*advance()) { + case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value; + case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end; + default: log_error("Missing comma between array values"); return TAPE_ERROR; + } + +document_end: + log_end_value("document"); + SIMDJSON_TRY( visitor.visit_document_end(*this) ); + + dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]); + + // If we didn't make it to the end, it's an error + if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) { + log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); + return TAPE_ERROR; + } + + return SUCCESS; + +} // walk_document() + +simdjson_inline json_iterator::json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { +} + +simdjson_inline const uint8_t *json_iterator::peek() const noexcept { + return &buf[*(next_structural)]; +} +simdjson_inline const uint8_t *json_iterator::advance() noexcept { + return &buf[*(next_structural++)]; +} +simdjson_inline size_t json_iterator::remaining_len() const noexcept { + return dom_parser.len - *(next_structural-1); +} + +simdjson_inline bool json_iterator::at_eof() const noexcept { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; +} +simdjson_inline bool json_iterator::at_beginning() const noexcept { + return next_structural == dom_parser.structural_indexes.get(); +} +simdjson_inline uint8_t json_iterator::last_structural() const noexcept { + return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]]; +} + +simdjson_inline void json_iterator::log_value(const char *type) const noexcept { + logger::log_line(*this, "", type, ""); +} + +simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept { + logger::log_line(*this, "+", type, ""); + if (logger::LOG_ENABLED) { logger::log_depth++; } +} + +simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept { + if (logger::LOG_ENABLED) { logger::log_depth--; } + logger::log_line(*this, "-", type, ""); +} + +simdjson_inline void json_iterator::log_error(const char *error) const noexcept { + logger::log_line(*this, "", "ERROR", error); +} + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept { + switch (*value) { + case '"': return visitor.visit_root_string(*this, value); + case 't': return visitor.visit_root_true_atom(*this, value); + case 'f': return visitor.visit_root_false_atom(*this, value); + case 'n': return visitor.visit_root_null_atom(*this, value); + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return visitor.visit_root_number(*this, value); + default: + log_error("Document starts with a non-value character"); + return TAPE_ERROR; + } +} +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept { + // Use the fact that most scalars are going to be either strings or numbers. + if(*value == '"') { + return visitor.visit_string(*this, value); + } else if (((*value - '0') < 10) || (*value == '-')) { + return visitor.visit_number(*this, value); + } + // true, false, null are uncommon. + switch (*value) { + case 't': return visitor.visit_true_atom(*this, value); + case 'f': return visitor.visit_false_atom(*this, value); + case 'n': return visitor.visit_null_atom(*this, value); + default: + log_error("Non-value found when value was expected!"); + return TAPE_ERROR; + } +} + +} // namespace stage2 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H +/* end file generic/stage2/json_iterator.h for haswell */ +/* including generic/stage2/stringparsing.h for haswell: #include */ +/* begin file generic/stage2/stringparsing.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses +// It is intended to be included multiple times and compiled multiple times + +namespace simdjson { +namespace haswell { +namespace { +/// @private +namespace stringparsing { + +// begin copypasta +// These chars yield themselves: " \ / +// b -> backspace, f -> formfeed, n -> newline, r -> cr, t -> horizontal tab +// u not handled in this table as it's complex +static const uint8_t escape_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x0. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2f, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x4. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c, 0, 0, 0, // 0x5. + 0, 0, 0x08, 0, 0, 0, 0x0c, 0, 0, 0, 0, 0, 0, 0, 0x0a, 0, // 0x6. + 0, 0, 0x0d, 0, 0x09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x7. + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +// handle a unicode codepoint +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint(const uint8_t **src_ptr, + uint8_t **dst_ptr, bool allow_replacement) { + // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD) + constexpr uint32_t substitution_code_point = 0xfffd; + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) != ((static_cast ('\\') << 8) | static_cast ('u'))) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + + // We have already checked that the high surrogate is valid and + // (code_point - 0xd800) < 1024. + // + // Check that code_point_2 is in the range 0xdc00..0xdfff + // and that code_point_2 was parsed from valid hex. + uint32_t low_bit = code_point_2 - 0xdc00; + if (low_bit >> 10) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + code_point = (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + + } + } else if (code_point >= 0xdc00 && code_point <= 0xdfff) { + // If we encounter a low surrogate (not preceded by a high surrogate) + // then we have an error. + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +// handle a unicode codepoint using the wobbly convention +// https://simonsapin.github.io/wtf-8/ +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint_wobbly(const uint8_t **src_ptr, + uint8_t **dst_ptr) { + // It is not ideal that this function is nearly identical to handle_unicode_codepoint. + // + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) == ((static_cast ('\\') << 8) | static_cast ('u'))) { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + uint32_t low_bit = code_point_2 - 0xdc00; + if ((low_bit >> 10) == 0) { + code_point = + (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + } + } + + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +/** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + */ +simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) { + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { + // It is not ideal that this function is nearly identical to parse_string. + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint_wobbly(&src, &dst)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +} // namespace stringparsing +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H +/* end file generic/stage2/stringparsing.h for haswell */ +/* including generic/stage2/structural_iterator.h for haswell: #include */ +/* begin file generic/stage2/structural_iterator.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace stage2 { + +class structural_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + + // Start a structural + simdjson_inline structural_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { + } + // Get the buffer position of the current structural character + simdjson_inline const uint8_t* current() { + return &buf[*(next_structural-1)]; + } + // Get the current structural character + simdjson_inline char current_char() { + return buf[*(next_structural-1)]; + } + // Get the next structural character without advancing + simdjson_inline char peek_next_char() { + return buf[*next_structural]; + } + simdjson_inline const uint8_t* peek() { + return &buf[*next_structural]; + } + simdjson_inline const uint8_t* advance() { + return &buf[*(next_structural++)]; + } + simdjson_inline char advance_char() { + return buf[*(next_structural++)]; + } + simdjson_inline size_t remaining_len() { + return dom_parser.len - *(next_structural-1); + } + + simdjson_inline bool at_end() { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; + } + simdjson_inline bool at_beginning() { + return next_structural == dom_parser.structural_indexes.get(); + } +}; + +} // namespace stage2 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H +/* end file generic/stage2/structural_iterator.h for haswell */ +/* including generic/stage2/tape_builder.h for haswell: #include */ +/* begin file generic/stage2/tape_builder.h for haswell */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace haswell { +namespace { +namespace stage2 { + +struct tape_builder { + template + simdjson_warn_unused static simdjson_inline error_code parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept; + + /** Called when a non-empty document starts. */ + simdjson_warn_unused simdjson_inline error_code visit_document_start(json_iterator &iter) noexcept; + /** Called when a non-empty document ends without error. */ + simdjson_warn_unused simdjson_inline error_code visit_document_end(json_iterator &iter) noexcept; + + /** Called when a non-empty array starts. */ + simdjson_warn_unused simdjson_inline error_code visit_array_start(json_iterator &iter) noexcept; + /** Called when a non-empty array ends. */ + simdjson_warn_unused simdjson_inline error_code visit_array_end(json_iterator &iter) noexcept; + /** Called when an empty array is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_array(json_iterator &iter) noexcept; + + /** Called when a non-empty object starts. */ + simdjson_warn_unused simdjson_inline error_code visit_object_start(json_iterator &iter) noexcept; + /** + * Called when a key in a field is encountered. + * + * primitive, visit_object_start, visit_empty_object, visit_array_start, or visit_empty_array + * will be called after this with the field value. + */ + simdjson_warn_unused simdjson_inline error_code visit_key(json_iterator &iter, const uint8_t *key) noexcept; + /** Called when a non-empty object ends. */ + simdjson_warn_unused simdjson_inline error_code visit_object_end(json_iterator &iter) noexcept; + /** Called when an empty object is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_object(json_iterator &iter) noexcept; + + /** + * Called when a string, number, boolean or null is found. + */ + simdjson_warn_unused simdjson_inline error_code visit_primitive(json_iterator &iter, const uint8_t *value) noexcept; + /** + * Called when a string, number, boolean or null is found at the top level of a document (i.e. + * when there is no array or object and the entire document is a single string, number, boolean or + * null. + * + * This is separate from primitive() because simdjson's normal primitive parsing routines assume + * there is at least one more token after the value, which is only true in an array or object. + */ + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_string(json_iterator &iter, const uint8_t *value, bool key = false) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_root_string(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + /** Called each time a new field or element in an array or object is found. */ + simdjson_warn_unused simdjson_inline error_code increment_count(json_iterator &iter) noexcept; + + /** Next location to write to tape */ + tape_writer tape; +private: + /** Next write location in the string buf for stage 2 parsing */ + uint8_t *current_string_buf_loc; + + simdjson_inline tape_builder(dom::document &doc) noexcept; + + simdjson_inline uint32_t next_tape_index(json_iterator &iter) const noexcept; + simdjson_inline void start_container(json_iterator &iter) noexcept; + simdjson_warn_unused simdjson_inline error_code end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_warn_unused simdjson_inline error_code empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_inline uint8_t *on_start_string(json_iterator &iter) noexcept; + simdjson_inline void on_end_string(uint8_t *dst) noexcept; +}; // struct tape_builder + +template +simdjson_warn_unused simdjson_inline error_code tape_builder::parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept { + dom_parser.doc = &doc; + json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0); + tape_builder builder(doc); + return iter.walk_document(builder); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_root_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept { + constexpr uint32_t start_tape_index = 0; + tape.append(start_tape_index, internal::tape_type::ROOT); + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept { + return visit_string(iter, key, true); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1 + return SUCCESS; +} + +simdjson_inline tape_builder::tape_builder(dom::document &doc) noexcept : tape{doc.tape.get()}, current_string_buf_loc{doc.string_buf.get()} {} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept { + iter.log_value(key ? "key" : "string"); + uint8_t *dst = on_start_string(iter); + dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid. + if (dst == nullptr) { + iter.log_error("Invalid escape in string"); + return STRING_ERROR; + } + on_end_string(dst); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept { + return visit_string(iter, value); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("number"); + return numberparsing::parse_number(value, tape); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_number(json_iterator &iter, const uint8_t *value) noexcept { + // + // We need to make a copy to make sure that the string is space terminated. + // This is not about padding the input, which should already padded up + // to len + SIMDJSON_PADDING. However, we have no control at this stage + // on how the padding was done. What if the input string was padded with nulls? + // It is quite common for an input string to have an extra null character (C string). + // We do not want to allow 9\0 (where \0 is the null character) inside a JSON + // document, but the string "9\0" by itself is fine. So we make a copy and + // pad the input with spaces when we know that there is just one input element. + // This copy is relatively expensive, but it will almost never be called in + // practice unless you are in the strange scenario where you have many JSON + // documents made of single atoms. + // + std::unique_ptrcopy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]); + if (copy.get() == nullptr) { return MEMALLOC; } + std::memcpy(copy.get(), value, iter.remaining_len()); + std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING); + error_code error = visit_number(iter, copy.get()); + return error; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value)) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +// private: + +simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept { + return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get()); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + auto start_index = next_tape_index(iter); + tape.append(start_index+2, start); + tape.append(start_index, end); + return SUCCESS; +} + +simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter); + iter.dom_parser.open_containers[iter.depth].count = 0; + tape.skip(); // We don't actually *write* the start element until the end. +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + // Write the ending tape element, pointing at the start location + const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index; + tape.append(start_tape_index, end); + // Write the start tape element, pointing at the end location (and including count) + // count can overflow if it exceeds 24 bits... so we saturate + // the convention being that a cnt of 0xffffff or more is undetermined in value (>= 0xffffff). + const uint32_t count = iter.dom_parser.open_containers[iter.depth].count; + const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count; + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start); + return SUCCESS; +} + +simdjson_inline uint8_t *tape_builder::on_start_string(json_iterator &iter) noexcept { + // we advance the point, accounting for the fact that we have a NULL termination + tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING); + return current_string_buf_loc + sizeof(uint32_t); +} + +simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept { + uint32_t str_length = uint32_t(dst - (current_string_buf_loc + sizeof(uint32_t))); + // TODO check for overflow in case someone has a crazy string (>=4GB?) + // But only add the overflow check when the document itself exceeds 4GB + // Currently unneeded because we refuse to parse docs larger or equal to 4GB. + memcpy(current_string_buf_loc, &str_length, sizeof(uint32_t)); + // NULL termination is still handy if you expect all your strings to + // be NULL terminated? It comes at a small cost + *dst = 0; + current_string_buf_loc = dst + 1; +} + +} // namespace stage2 +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H +/* end file generic/stage2/tape_builder.h for haswell */ +/* end file generic/stage2/amalgamated.h for haswell */ + +// +// Stage 1 +// + +namespace simdjson { +namespace haswell { + +simdjson_warn_unused error_code implementation::create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr& dst +) const noexcept { + dst.reset( new (std::nothrow) dom_parser_implementation() ); + if (!dst) { return MEMALLOC; } + if (auto err = dst->set_capacity(capacity)) + return err; + if (auto err = dst->set_max_depth(max_depth)) + return err; + return SUCCESS; +} + +namespace { + +using namespace simd; + +// This identifies structural characters (comma, colon, braces, brackets), +// and ASCII white-space ('\r','\n','\t',' '). +simdjson_inline json_character_block json_character_block::classify(const simd::simd8x64& in) { + // These lookups rely on the fact that anything < 127 will match the lower 4 bits, which is why + // we can't use the generic lookup_16. + const auto whitespace_table = simd8::repeat_16(' ', 100, 100, 100, 17, 100, 113, 2, 100, '\t', '\n', 112, 100, '\r', 100, 100); + + // The 6 operators (:,[]{}) have these values: + // + // , 2C + // : 3A + // [ 5B + // { 7B + // ] 5D + // } 7D + // + // If you use | 0x20 to turn [ and ] into { and }, the lower 4 bits of each character is unique. + // We exploit this, using a simd 4-bit lookup to tell us which character match against, and then + // match it (against | 0x20). + // + // To prevent recognizing other characters, everything else gets compared with 0, which cannot + // match due to the | 0x20. + // + // NOTE: Due to the | 0x20, this ALSO treats and (control characters 0C and 1A) like , + // and :. This gets caught in stage 2, which checks the actual character to ensure the right + // operators are in the right places. + const auto op_table = simd8::repeat_16( + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, ':', '{', // : = 3A, [ = 5B, { = 7B + ',', '}', 0, 0 // , = 2C, ] = 5D, } = 7D + ); + + // We compute whitespace and op separately. If later code only uses one or the + // other, given the fact that all functions are aggressively inlined, we can + // hope that useless computations will be omitted. This is namely case when + // minifying (we only need whitespace). + + const uint64_t whitespace = in.eq({ + _mm256_shuffle_epi8(whitespace_table, in.chunks[0]), + _mm256_shuffle_epi8(whitespace_table, in.chunks[1]) + }); + // Turn [ and ] into { and } + const simd8x64 curlified{ + in.chunks[0] | 0x20, + in.chunks[1] | 0x20 + }; + const uint64_t op = curlified.eq({ + _mm256_shuffle_epi8(op_table, in.chunks[0]), + _mm256_shuffle_epi8(op_table, in.chunks[1]) + }); + + return { whitespace, op }; +} + +simdjson_inline bool is_ascii(const simd8x64& input) { + return input.reduce_or().is_ascii(); +} + +simdjson_unused simdjson_inline simd8 must_be_continuation(const simd8 prev1, const simd8 prev2, const simd8 prev3) { + simd8 is_second_byte = prev1.saturating_sub(0xc0u-1); // Only 11______ will be > 0 + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_second_byte | is_third_byte | is_fourth_byte) > int8_t(0); +} + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3) { + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_third_byte | is_fourth_byte) > int8_t(0); +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +// +// Stage 2 +// + +// +// Implementation-specific overrides +// +namespace simdjson { +namespace haswell { + +simdjson_warn_unused error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept { + return haswell::stage1::json_minifier::minify<128>(buf, len, dst, dst_len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept { + this->buf = _buf; + this->len = _len; + return haswell::stage1::json_structural_indexer::index<128>(_buf, _len, *this, streaming); +} + +simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept { + return haswell::stage1::generic_validate_utf8(buf,len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool replacement_char) const noexcept { + return haswell::stringparsing::parse_string(src, dst, replacement_char); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept { + return haswell::stringparsing::parse_wobbly_string(src, dst); +} + +simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept { + auto error = stage1(_buf, _len, stage1_mode::regular); + if (error) { return error; } + return stage2(_doc); +} + +} // namespace haswell +} // namespace simdjson + +/* including simdjson/haswell/end.h: #include */ +/* begin file simdjson/haswell/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "haswell" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/haswell/end.h */ + +#endif // SIMDJSON_SRC_HASWELL_CPP +/* end file haswell.cpp */ +#endif +#if SIMDJSON_IMPLEMENTATION_ICELAKE +/* including icelake.cpp: #include */ +/* begin file icelake.cpp */ +#ifndef SIMDJSON_SRC_ICELAKE_CPP +#define SIMDJSON_SRC_ICELAKE_CPP + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* including simdjson/icelake.h: #include */ +/* begin file simdjson/icelake.h */ +#ifndef SIMDJSON_ICELAKE_H +#define SIMDJSON_ICELAKE_H + +/* including simdjson/icelake/begin.h: #include "simdjson/icelake/begin.h" */ +/* begin file simdjson/icelake/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "icelake" */ +#define SIMDJSON_IMPLEMENTATION icelake +/* including simdjson/icelake/base.h: #include "simdjson/icelake/base.h" */ +/* begin file simdjson/icelake/base.h */ +#ifndef SIMDJSON_ICELAKE_BASE_H +#define SIMDJSON_ICELAKE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_ICELAKE +namespace simdjson { +/** + * Implementation for Icelake (Intel AVX512). + */ +namespace icelake { + +class implementation; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BASE_H +/* end file simdjson/icelake/base.h */ +/* including simdjson/icelake/intrinsics.h: #include "simdjson/icelake/intrinsics.h" */ +/* begin file simdjson/icelake/intrinsics.h */ +#ifndef SIMDJSON_ICELAKE_INTRINSICS_H +#define SIMDJSON_ICELAKE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// Important: we need the AVX-512 headers: +#include +#include +#include +#include +#include +#include +#include +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m512i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for icelake"); + +#endif // SIMDJSON_ICELAKE_INTRINSICS_H +/* end file simdjson/icelake/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_TARGET_REGION("avx512f,avx512dq,avx512cd,avx512bw,avx512vbmi,avx512vbmi2,avx512vl,avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/icelake/bitmanipulation.h: #include "simdjson/icelake/bitmanipulation.h" */ +/* begin file simdjson/icelake/bitmanipulation.h */ +#ifndef SIMDJSON_ICELAKE_BITMANIPULATION_H +#define SIMDJSON_ICELAKE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMANIPULATION_H +/* end file simdjson/icelake/bitmanipulation.h */ +/* including simdjson/icelake/bitmask.h: #include "simdjson/icelake/bitmask.h" */ +/* begin file simdjson/icelake/bitmask.h */ +#ifndef SIMDJSON_ICELAKE_BITMASK_H +#define SIMDJSON_ICELAKE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMASK_H +/* end file simdjson/icelake/bitmask.h */ +/* including simdjson/icelake/simd.h: #include "simdjson/icelake/simd.h" */ +/* begin file simdjson/icelake/simd.h */ +#ifndef SIMDJSON_ICELAKE_SIMD_H +#define SIMDJSON_ICELAKE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if defined(__GNUC__) && !defined(__clang__) +#if __GNUC__ == 8 +#define SIMDJSON_GCC8 1 +#endif // __GNUC__ == 8 +#endif // defined(__GNUC__) && !defined(__clang__) + +#if SIMDJSON_GCC8 +/** + * GCC 8 fails to provide _mm512_set_epi8. We roll our own. + */ +inline __m512i _mm512_set_epi8(uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6, uint8_t a7, uint8_t a8, uint8_t a9, uint8_t a10, uint8_t a11, uint8_t a12, uint8_t a13, uint8_t a14, uint8_t a15, uint8_t a16, uint8_t a17, uint8_t a18, uint8_t a19, uint8_t a20, uint8_t a21, uint8_t a22, uint8_t a23, uint8_t a24, uint8_t a25, uint8_t a26, uint8_t a27, uint8_t a28, uint8_t a29, uint8_t a30, uint8_t a31, uint8_t a32, uint8_t a33, uint8_t a34, uint8_t a35, uint8_t a36, uint8_t a37, uint8_t a38, uint8_t a39, uint8_t a40, uint8_t a41, uint8_t a42, uint8_t a43, uint8_t a44, uint8_t a45, uint8_t a46, uint8_t a47, uint8_t a48, uint8_t a49, uint8_t a50, uint8_t a51, uint8_t a52, uint8_t a53, uint8_t a54, uint8_t a55, uint8_t a56, uint8_t a57, uint8_t a58, uint8_t a59, uint8_t a60, uint8_t a61, uint8_t a62, uint8_t a63) { + return _mm512_set_epi64(uint64_t(a7) + (uint64_t(a6) << 8) + (uint64_t(a5) << 16) + (uint64_t(a4) << 24) + (uint64_t(a3) << 32) + (uint64_t(a2) << 40) + (uint64_t(a1) << 48) + (uint64_t(a0) << 56), + uint64_t(a15) + (uint64_t(a14) << 8) + (uint64_t(a13) << 16) + (uint64_t(a12) << 24) + (uint64_t(a11) << 32) + (uint64_t(a10) << 40) + (uint64_t(a9) << 48) + (uint64_t(a8) << 56), + uint64_t(a23) + (uint64_t(a22) << 8) + (uint64_t(a21) << 16) + (uint64_t(a20) << 24) + (uint64_t(a19) << 32) + (uint64_t(a18) << 40) + (uint64_t(a17) << 48) + (uint64_t(a16) << 56), + uint64_t(a31) + (uint64_t(a30) << 8) + (uint64_t(a29) << 16) + (uint64_t(a28) << 24) + (uint64_t(a27) << 32) + (uint64_t(a26) << 40) + (uint64_t(a25) << 48) + (uint64_t(a24) << 56), + uint64_t(a39) + (uint64_t(a38) << 8) + (uint64_t(a37) << 16) + (uint64_t(a36) << 24) + (uint64_t(a35) << 32) + (uint64_t(a34) << 40) + (uint64_t(a33) << 48) + (uint64_t(a32) << 56), + uint64_t(a47) + (uint64_t(a46) << 8) + (uint64_t(a45) << 16) + (uint64_t(a44) << 24) + (uint64_t(a43) << 32) + (uint64_t(a42) << 40) + (uint64_t(a41) << 48) + (uint64_t(a40) << 56), + uint64_t(a55) + (uint64_t(a54) << 8) + (uint64_t(a53) << 16) + (uint64_t(a52) << 24) + (uint64_t(a51) << 32) + (uint64_t(a50) << 40) + (uint64_t(a49) << 48) + (uint64_t(a48) << 56), + uint64_t(a63) + (uint64_t(a62) << 8) + (uint64_t(a61) << 16) + (uint64_t(a60) << 24) + (uint64_t(a59) << 32) + (uint64_t(a58) << 40) + (uint64_t(a57) << 48) + (uint64_t(a56) << 56)); +} +#endif // SIMDJSON_GCC8 + + + +namespace simdjson { +namespace icelake { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m512i value; + + // Zero constructor + simdjson_inline base() : value{__m512i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m512i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m512i&() const { return this->value; } + simdjson_inline operator __m512i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm512_or_si512(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm512_and_si512(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm512_xor_si512(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm512_andnot_si512(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m512i _value) : base>(_value) {} + + friend simdjson_really_inline uint64_t operator==(const simd8 lhs, const simd8 rhs) { + return _mm512_cmpeq_epi8_mask(lhs, rhs); + } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + // workaround for compilers unable to figure out that 16 - N is a constant (GCC 8) + constexpr int shift = 16 - N; + return _mm512_alignr_epi8(*this, _mm512_permutex2var_epi64(prev_chunk, _mm512_set_epi64(13, 12, 11, 10, 9, 8, 7, 6), *this), shift); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm512_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m512i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + simdjson_inline bool any() const { return !!_mm512_test_epi8_mask (*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm512_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm512_setzero_si512(); } + static simdjson_inline simd8 load(const T values[64]) { + return _mm512_loadu_si512(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m512i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[64]) const { return _mm512_storeu_si512(reinterpret_cast<__m512i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm512_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm512_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm512_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint64_t mask, L * output) const { + _mm512_mask_compressstoreu_epi8 (output,~mask,*this); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31, + int8_t v32, int8_t v33, int8_t v34, int8_t v35, int8_t v36, int8_t v37, int8_t v38, int8_t v39, + int8_t v40, int8_t v41, int8_t v42, int8_t v43, int8_t v44, int8_t v45, int8_t v46, int8_t v47, + int8_t v48, int8_t v49, int8_t v50, int8_t v51, int8_t v52, int8_t v53, int8_t v54, int8_t v55, + int8_t v56, int8_t v57, int8_t v58, int8_t v59, int8_t v60, int8_t v61, int8_t v62, int8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epi8(*this, other); } + + simdjson_inline simd8 operator>(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(*this, other),_mm512_set1_epi8(uint8_t(0x80))); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(other, *this),_mm512_set1_epi8(uint8_t(0x80))); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31, + uint8_t v32, uint8_t v33, uint8_t v34, uint8_t v35, uint8_t v36, uint8_t v37, uint8_t v38, uint8_t v39, + uint8_t v40, uint8_t v41, uint8_t v42, uint8_t v43, uint8_t v44, uint8_t v45, uint8_t v46, uint8_t v47, + uint8_t v48, uint8_t v49, uint8_t v50, uint8_t v51, uint8_t v52, uint8_t v53, uint8_t v54, uint8_t v55, + uint8_t v56, uint8_t v57, uint8_t v58, uint8_t v59, uint8_t v60, uint8_t v61, uint8_t v62, uint8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm512_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm512_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline uint64_t operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline uint64_t operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return _mm512_mask_blend_epi8(*this == uint8_t(0), _mm512_set1_epi8(0), _mm512_set1_epi8(-1)); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + + simdjson_inline bool is_ascii() const { return _mm512_movepi8_mask(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { + return !_mm512_test_epi8_mask(*this, *this); + } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return !_mm512_test_epi8_mask(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm512_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm512_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline uint64_t get_bit() const { return _mm512_movepi8_mask(_mm512_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 1, "Icelake kernel should use one register per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const simd8 chunk0) : chunks{chunk0} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(mask, output); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] == mask; + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return this->chunks[0] == other.chunks[0]; + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] <= mask; + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_SIMD_H +/* end file simdjson/icelake/simd.h */ +/* including simdjson/icelake/stringparsing_defs.h: #include "simdjson/icelake/stringparsing_defs.h" */ +/* begin file simdjson/icelake/stringparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +#define SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 64; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint64_t bs_bits; + uint64_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast(v == '\\'), // bs_bits + static_cast(v == '"'), // quote_bits + }; +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +/* end file simdjson/icelake/stringparsing_defs.h */ +/* including simdjson/icelake/numberparsing_defs.h: #include "simdjson/icelake/numberparsing_defs.h" */ +/* begin file simdjson/icelake/numberparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +#define SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace numberparsing { + +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace icelake +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +/* end file simdjson/icelake/numberparsing_defs.h */ +/* end file simdjson/icelake/begin.h */ +/* including simdjson/generic/amalgamated.h for icelake: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for icelake */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for icelake: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for icelake */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for icelake */ +/* including simdjson/generic/jsoncharutils.h for icelake: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for icelake */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for icelake */ +/* including simdjson/generic/atomparsing.h for icelake: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for icelake */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace icelake { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for icelake */ +/* including simdjson/generic/dom_parser_implementation.h for icelake: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for icelake */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace icelake +} // namespace simdjson + +namespace simdjson { +namespace icelake { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for icelake */ +/* including simdjson/generic/implementation_simdjson_result_base.h for icelake: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for icelake */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for icelake */ +/* including simdjson/generic/numberparsing.h for icelake: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for icelake */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace icelake { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for icelake */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for icelake: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for icelake */ +/* end file simdjson/generic/amalgamated.h for icelake */ +/* including simdjson/icelake/end.h: #include "simdjson/icelake/end.h" */ +/* begin file simdjson/icelake/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "icelake" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/icelake/end.h */ + +#endif // SIMDJSON_ICELAKE_H +/* end file simdjson/icelake.h */ +/* including simdjson/icelake/implementation.h: #include */ +/* begin file simdjson/icelake/implementation.h */ +#ifndef SIMDJSON_ICELAKE_IMPLEMENTATION_H +#define SIMDJSON_ICELAKE_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_ICELAKE +namespace simdjson { +namespace icelake { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "icelake", + "Intel/AMD AVX512", + internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 | internal::instruction_set::AVX512F | internal::instruction_set::AVX512DQ | internal::instruction_set::AVX512CD | internal::instruction_set::AVX512BW | internal::instruction_set::AVX512VL | internal::instruction_set::AVX512VBMI2 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_IMPLEMENTATION_H +/* end file simdjson/icelake/implementation.h */ + +// defining SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER allows us to provide our own bit_indexer::write +#define SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +/* including simdjson/icelake/begin.h: #include */ +/* begin file simdjson/icelake/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "icelake" */ +#define SIMDJSON_IMPLEMENTATION icelake +/* including simdjson/icelake/base.h: #include "simdjson/icelake/base.h" */ +/* begin file simdjson/icelake/base.h */ +#ifndef SIMDJSON_ICELAKE_BASE_H +#define SIMDJSON_ICELAKE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_ICELAKE +namespace simdjson { +/** + * Implementation for Icelake (Intel AVX512). + */ +namespace icelake { + +class implementation; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BASE_H +/* end file simdjson/icelake/base.h */ +/* including simdjson/icelake/intrinsics.h: #include "simdjson/icelake/intrinsics.h" */ +/* begin file simdjson/icelake/intrinsics.h */ +#ifndef SIMDJSON_ICELAKE_INTRINSICS_H +#define SIMDJSON_ICELAKE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// Important: we need the AVX-512 headers: +#include +#include +#include +#include +#include +#include +#include +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m512i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for icelake"); + +#endif // SIMDJSON_ICELAKE_INTRINSICS_H +/* end file simdjson/icelake/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_TARGET_REGION("avx512f,avx512dq,avx512cd,avx512bw,avx512vbmi,avx512vbmi2,avx512vl,avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/icelake/bitmanipulation.h: #include "simdjson/icelake/bitmanipulation.h" */ +/* begin file simdjson/icelake/bitmanipulation.h */ +#ifndef SIMDJSON_ICELAKE_BITMANIPULATION_H +#define SIMDJSON_ICELAKE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMANIPULATION_H +/* end file simdjson/icelake/bitmanipulation.h */ +/* including simdjson/icelake/bitmask.h: #include "simdjson/icelake/bitmask.h" */ +/* begin file simdjson/icelake/bitmask.h */ +#ifndef SIMDJSON_ICELAKE_BITMASK_H +#define SIMDJSON_ICELAKE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMASK_H +/* end file simdjson/icelake/bitmask.h */ +/* including simdjson/icelake/simd.h: #include "simdjson/icelake/simd.h" */ +/* begin file simdjson/icelake/simd.h */ +#ifndef SIMDJSON_ICELAKE_SIMD_H +#define SIMDJSON_ICELAKE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if defined(__GNUC__) && !defined(__clang__) +#if __GNUC__ == 8 +#define SIMDJSON_GCC8 1 +#endif // __GNUC__ == 8 +#endif // defined(__GNUC__) && !defined(__clang__) + +#if SIMDJSON_GCC8 +/** + * GCC 8 fails to provide _mm512_set_epi8. We roll our own. + */ +inline __m512i _mm512_set_epi8(uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6, uint8_t a7, uint8_t a8, uint8_t a9, uint8_t a10, uint8_t a11, uint8_t a12, uint8_t a13, uint8_t a14, uint8_t a15, uint8_t a16, uint8_t a17, uint8_t a18, uint8_t a19, uint8_t a20, uint8_t a21, uint8_t a22, uint8_t a23, uint8_t a24, uint8_t a25, uint8_t a26, uint8_t a27, uint8_t a28, uint8_t a29, uint8_t a30, uint8_t a31, uint8_t a32, uint8_t a33, uint8_t a34, uint8_t a35, uint8_t a36, uint8_t a37, uint8_t a38, uint8_t a39, uint8_t a40, uint8_t a41, uint8_t a42, uint8_t a43, uint8_t a44, uint8_t a45, uint8_t a46, uint8_t a47, uint8_t a48, uint8_t a49, uint8_t a50, uint8_t a51, uint8_t a52, uint8_t a53, uint8_t a54, uint8_t a55, uint8_t a56, uint8_t a57, uint8_t a58, uint8_t a59, uint8_t a60, uint8_t a61, uint8_t a62, uint8_t a63) { + return _mm512_set_epi64(uint64_t(a7) + (uint64_t(a6) << 8) + (uint64_t(a5) << 16) + (uint64_t(a4) << 24) + (uint64_t(a3) << 32) + (uint64_t(a2) << 40) + (uint64_t(a1) << 48) + (uint64_t(a0) << 56), + uint64_t(a15) + (uint64_t(a14) << 8) + (uint64_t(a13) << 16) + (uint64_t(a12) << 24) + (uint64_t(a11) << 32) + (uint64_t(a10) << 40) + (uint64_t(a9) << 48) + (uint64_t(a8) << 56), + uint64_t(a23) + (uint64_t(a22) << 8) + (uint64_t(a21) << 16) + (uint64_t(a20) << 24) + (uint64_t(a19) << 32) + (uint64_t(a18) << 40) + (uint64_t(a17) << 48) + (uint64_t(a16) << 56), + uint64_t(a31) + (uint64_t(a30) << 8) + (uint64_t(a29) << 16) + (uint64_t(a28) << 24) + (uint64_t(a27) << 32) + (uint64_t(a26) << 40) + (uint64_t(a25) << 48) + (uint64_t(a24) << 56), + uint64_t(a39) + (uint64_t(a38) << 8) + (uint64_t(a37) << 16) + (uint64_t(a36) << 24) + (uint64_t(a35) << 32) + (uint64_t(a34) << 40) + (uint64_t(a33) << 48) + (uint64_t(a32) << 56), + uint64_t(a47) + (uint64_t(a46) << 8) + (uint64_t(a45) << 16) + (uint64_t(a44) << 24) + (uint64_t(a43) << 32) + (uint64_t(a42) << 40) + (uint64_t(a41) << 48) + (uint64_t(a40) << 56), + uint64_t(a55) + (uint64_t(a54) << 8) + (uint64_t(a53) << 16) + (uint64_t(a52) << 24) + (uint64_t(a51) << 32) + (uint64_t(a50) << 40) + (uint64_t(a49) << 48) + (uint64_t(a48) << 56), + uint64_t(a63) + (uint64_t(a62) << 8) + (uint64_t(a61) << 16) + (uint64_t(a60) << 24) + (uint64_t(a59) << 32) + (uint64_t(a58) << 40) + (uint64_t(a57) << 48) + (uint64_t(a56) << 56)); +} +#endif // SIMDJSON_GCC8 + + + +namespace simdjson { +namespace icelake { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m512i value; + + // Zero constructor + simdjson_inline base() : value{__m512i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m512i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m512i&() const { return this->value; } + simdjson_inline operator __m512i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm512_or_si512(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm512_and_si512(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm512_xor_si512(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm512_andnot_si512(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m512i _value) : base>(_value) {} + + friend simdjson_really_inline uint64_t operator==(const simd8 lhs, const simd8 rhs) { + return _mm512_cmpeq_epi8_mask(lhs, rhs); + } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + // workaround for compilers unable to figure out that 16 - N is a constant (GCC 8) + constexpr int shift = 16 - N; + return _mm512_alignr_epi8(*this, _mm512_permutex2var_epi64(prev_chunk, _mm512_set_epi64(13, 12, 11, 10, 9, 8, 7, 6), *this), shift); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm512_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m512i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + simdjson_inline bool any() const { return !!_mm512_test_epi8_mask (*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm512_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm512_setzero_si512(); } + static simdjson_inline simd8 load(const T values[64]) { + return _mm512_loadu_si512(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m512i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[64]) const { return _mm512_storeu_si512(reinterpret_cast<__m512i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm512_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm512_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm512_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint64_t mask, L * output) const { + _mm512_mask_compressstoreu_epi8 (output,~mask,*this); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31, + int8_t v32, int8_t v33, int8_t v34, int8_t v35, int8_t v36, int8_t v37, int8_t v38, int8_t v39, + int8_t v40, int8_t v41, int8_t v42, int8_t v43, int8_t v44, int8_t v45, int8_t v46, int8_t v47, + int8_t v48, int8_t v49, int8_t v50, int8_t v51, int8_t v52, int8_t v53, int8_t v54, int8_t v55, + int8_t v56, int8_t v57, int8_t v58, int8_t v59, int8_t v60, int8_t v61, int8_t v62, int8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epi8(*this, other); } + + simdjson_inline simd8 operator>(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(*this, other),_mm512_set1_epi8(uint8_t(0x80))); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(other, *this),_mm512_set1_epi8(uint8_t(0x80))); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31, + uint8_t v32, uint8_t v33, uint8_t v34, uint8_t v35, uint8_t v36, uint8_t v37, uint8_t v38, uint8_t v39, + uint8_t v40, uint8_t v41, uint8_t v42, uint8_t v43, uint8_t v44, uint8_t v45, uint8_t v46, uint8_t v47, + uint8_t v48, uint8_t v49, uint8_t v50, uint8_t v51, uint8_t v52, uint8_t v53, uint8_t v54, uint8_t v55, + uint8_t v56, uint8_t v57, uint8_t v58, uint8_t v59, uint8_t v60, uint8_t v61, uint8_t v62, uint8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm512_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm512_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline uint64_t operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline uint64_t operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return _mm512_mask_blend_epi8(*this == uint8_t(0), _mm512_set1_epi8(0), _mm512_set1_epi8(-1)); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + + simdjson_inline bool is_ascii() const { return _mm512_movepi8_mask(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { + return !_mm512_test_epi8_mask(*this, *this); + } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return !_mm512_test_epi8_mask(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm512_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm512_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline uint64_t get_bit() const { return _mm512_movepi8_mask(_mm512_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 1, "Icelake kernel should use one register per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const simd8 chunk0) : chunks{chunk0} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(mask, output); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] == mask; + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return this->chunks[0] == other.chunks[0]; + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] <= mask; + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_SIMD_H +/* end file simdjson/icelake/simd.h */ +/* including simdjson/icelake/stringparsing_defs.h: #include "simdjson/icelake/stringparsing_defs.h" */ +/* begin file simdjson/icelake/stringparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +#define SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 64; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint64_t bs_bits; + uint64_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast(v == '\\'), // bs_bits + static_cast(v == '"'), // quote_bits + }; +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +/* end file simdjson/icelake/stringparsing_defs.h */ +/* including simdjson/icelake/numberparsing_defs.h: #include "simdjson/icelake/numberparsing_defs.h" */ +/* begin file simdjson/icelake/numberparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +#define SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace numberparsing { + +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace icelake +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +/* end file simdjson/icelake/numberparsing_defs.h */ +/* end file simdjson/icelake/begin.h */ +/* including generic/amalgamated.h for icelake: #include */ +/* begin file generic/amalgamated.h for icelake */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_SRC_GENERIC_DEPENDENCIES_H) +#error generic/dependencies.h must be included before generic/amalgamated.h! +#endif + +/* including generic/base.h for icelake: #include */ +/* begin file generic/base.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +struct json_character_block; + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_BASE_H +/* end file generic/base.h for icelake */ +/* including generic/dom_parser_implementation.h for icelake: #include */ +/* begin file generic/dom_parser_implementation.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// Interface a dom parser implementation must fulfill +namespace simdjson { +namespace icelake { +namespace { + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3); +simdjson_inline bool is_ascii(const simd8x64& input); + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file generic/dom_parser_implementation.h for icelake */ +/* including generic/json_character_block.h for icelake: #include */ +/* begin file generic/json_character_block.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +struct json_character_block { + static simdjson_inline json_character_block classify(const simd::simd8x64& in); + + simdjson_inline uint64_t whitespace() const noexcept { return _whitespace; } + simdjson_inline uint64_t op() const noexcept { return _op; } + simdjson_inline uint64_t scalar() const noexcept { return ~(op() | whitespace()); } + + uint64_t _whitespace; + uint64_t _op; +}; + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H +/* end file generic/json_character_block.h for icelake */ +/* end file generic/amalgamated.h for icelake */ +/* including generic/stage1/amalgamated.h for icelake: #include */ +/* begin file generic/stage1/amalgamated.h for icelake */ +// Stuff other things depend on +/* including generic/stage1/base.h for icelake: #include */ +/* begin file generic/stage1/base.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +class bit_indexer; +template +struct buf_block_reader; +struct json_block; +class json_minifier; +class json_scanner; +struct json_string_block; +class json_string_scanner; +class json_structural_indexer; + +} // namespace stage1 + +namespace utf8_validation { +struct utf8_checker; +} // namespace utf8_validation + +using utf8_validation::utf8_checker; + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BASE_H +/* end file generic/stage1/base.h for icelake */ +/* including generic/stage1/buf_block_reader.h for icelake: #include */ +/* begin file generic/stage1/buf_block_reader.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +// Walks through a buffer in block-sized increments, loading the last part with spaces +template +struct buf_block_reader { +public: + simdjson_inline buf_block_reader(const uint8_t *_buf, size_t _len); + simdjson_inline size_t block_index(); + simdjson_inline bool has_full_block() const; + simdjson_inline const uint8_t *full_block() const; + /** + * Get the last block, padded with spaces. + * + * There will always be a last block, with at least 1 byte, unless len == 0 (in which case this + * function fills the buffer with spaces and returns 0. In particular, if len == STEP_SIZE there + * will be 0 full_blocks and 1 remainder block with STEP_SIZE bytes and no spaces for padding. + * + * @return the number of effective characters in the last block. + */ + simdjson_inline size_t get_remainder(uint8_t *dst) const; + simdjson_inline void advance(); +private: + const uint8_t *buf; + const size_t len; + const size_t lenminusstep; + size_t idx; +}; + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text_64(const uint8_t *text) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i); i++) { + buf[i] = int8_t(text[i]) < ' ' ? '_' : int8_t(text[i]); + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text(const simd8x64& in) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] < ' ') { buf[i] = '_'; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_input_text(const simd8x64& in, uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] <= ' ') { buf[i] = '_'; } + if (!(mask & (size_t(1) << i))) { buf[i] = ' '; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_mask(uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i<64; i++) { + buf[i] = (mask & (size_t(1) << i)) ? 'X' : ' '; + } + buf[64] = '\0'; + return buf; +} + +template +simdjson_inline buf_block_reader::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {} + +template +simdjson_inline size_t buf_block_reader::block_index() { return idx; } + +template +simdjson_inline bool buf_block_reader::has_full_block() const { + return idx < lenminusstep; +} + +template +simdjson_inline const uint8_t *buf_block_reader::full_block() const { + return &buf[idx]; +} + +template +simdjson_inline size_t buf_block_reader::get_remainder(uint8_t *dst) const { + if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers + std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once. + std::memcpy(dst, buf + idx, len - idx); + return len - idx; +} + +template +simdjson_inline void buf_block_reader::advance() { + idx += STEP_SIZE; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H +/* end file generic/stage1/buf_block_reader.h for icelake */ +/* including generic/stage1/json_escape_scanner.h for icelake: #include */ +/* begin file generic/stage1/json_escape_scanner.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +/** + * Scans for escape characters in JSON, taking care with multiple backslashes (\\n vs. \n). + */ +struct json_escape_scanner { + /** The actual escape characters (the backslashes themselves). */ + uint64_t next_is_escaped = 0ULL; + + struct escaped_and_escape { + /** + * Mask of escaped characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 0100100010100101000 + * n \ \ n \ \ + * ``` + */ + uint64_t escaped; + /** + * Mask of escape characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 1001000101001010001 + * \ \ \ \ \ \ \ + * ``` + */ + uint64_t escape; + }; + + /** + * Get a mask of both escape and escaped characters (the characters following a backslash). + * + * @param potential_escape A mask of the character that can escape others (but could be + * escaped itself). e.g. block.eq('\\') + */ + simdjson_really_inline escaped_and_escape next(uint64_t backslash) noexcept { + +#if !SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT + if (!backslash) { return {next_escaped_without_backslashes(), 0}; } +#endif + + // | | Mask (shows characters instead of 1's) | Depth | Instructions | + // |--------------------------------|----------------------------------------|-------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | | | + // | | ` even odd even odd odd` | | | + // | potential_escape | ` \ \\\ \\\ \\\\ \\\\ \\\` | 1 | 1 (backslash & ~first_is_escaped) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 5 | 5 (next_escape_and_terminal_code()) + // | escaped | `\ \ n \ n \ \ \ \ \ ` X | 6 | 7 (escape_and_terminal_code ^ (potential_escape | first_is_escaped)) + // | escape | ` \ \ \ \ \ \ \ \ \ \` | 6 | 8 (escape_and_terminal_code & backslash) + // | first_is_escaped | `\ ` | 7 (*) | 9 (escape >> 63) () + // (*) this is not needed until the next iteration + uint64_t escape_and_terminal_code = next_escape_and_terminal_code(backslash & ~this->next_is_escaped); + uint64_t escaped = escape_and_terminal_code ^ (backslash | this->next_is_escaped); + uint64_t escape = escape_and_terminal_code & backslash; + this->next_is_escaped = escape >> 63; + return {escaped, escape}; + } + +private: + static constexpr const uint64_t ODD_BITS = 0xAAAAAAAAAAAAAAAAULL; + + simdjson_really_inline uint64_t next_escaped_without_backslashes() noexcept { + uint64_t escaped = this->next_is_escaped; + this->next_is_escaped = 0; + return escaped; + } + + /** + * Returns a mask of the next escape characters (masking out escaped backslashes), along with + * any non-backslash escape codes. + * + * \n \\n \\\n \\\\n returns: + * \n \ \ \n \ \ + * 11 100 1011 10100 + * + * You are expected to mask out the first bit yourself if the previous block had a trailing + * escape. + * + * & the result with potential_escape to get just the escape characters. + * ^ the result with (potential_escape | first_is_escaped) to get escaped characters. + */ + static simdjson_really_inline uint64_t next_escape_and_terminal_code(uint64_t potential_escape) noexcept { + // If we were to just shift and mask out any odd bits, we'd actually get a *half* right answer: + // any even-aligned backslash runs would be correct! Odd-aligned backslash runs would be + // inverted (\\\ would be 010 instead of 101). + // + // ``` + // string: | ____\\\\_\\\\_____ | + // maybe_escaped | ODD | \ \ \ \ | + // even-aligned ^^^ ^^^^ odd-aligned + // ``` + // + // Taking that into account, our basic strategy is: + // + // 1. Use subtraction to produce a mask with 1's for even-aligned runs and 0's for + // odd-aligned runs. + // 2. XOR all odd bits, which masks out the odd bits in even-aligned runs, and brings IN the + // odd bits in odd-aligned runs. + // 3. & with backslash to clean up any stray bits. + // runs are set to 0, and then XORing with "odd": + // + // | | Mask (shows characters instead of 1's) | Instructions | + // |--------------------------------|----------------------------------------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | + // | | ` even odd even odd odd` | + // | maybe_escaped | ` n \\n \\n \\\_ \\\_ \\` X | 1 (potential_escape << 1) + // | maybe_escaped_and_odd | ` \n_ \\n _ \\\n_ _ \\\__ _\\\_ \\\` | 1 (maybe_escaped | odd) + // | even_series_codes_and_odd | ` n_\\\ _ n_ _\\\\ _ _ ` | 1 (maybe_escaped_and_odd - potential_escape) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 1 (^ odd) + // + + // Escaped characters are characters following an escape. + uint64_t maybe_escaped = potential_escape << 1; + + // To distinguish odd from even escape sequences, therefore, we turn on any *starting* + // escapes that are on an odd byte. (We actually bring in all odd bits, for speed.) + // - Odd runs of backslashes are 0000, and the code at the end ("n" in \n or \\n) is 1. + // - Odd runs of backslashes are 1111, and the code at the end ("n" in \n or \\n) is 0. + // - All other odd bytes are 1, and even bytes are 0. + uint64_t maybe_escaped_and_odd_bits = maybe_escaped | ODD_BITS; + uint64_t even_series_codes_and_odd_bits = maybe_escaped_and_odd_bits - potential_escape; + + // Now we flip all odd bytes back with xor. This: + // - Makes odd runs of backslashes go from 0000 to 1010 + // - Makes even runs of backslashes go from 1111 to 1010 + // - Sets actually-escaped codes to 1 (the n in \n and \\n: \n = 11, \\n = 100) + // - Resets all other bytes to 0 + return even_series_codes_and_odd_bits ^ ODD_BITS; + } +}; + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_escape_scanner.h for icelake */ +/* including generic/stage1/json_string_scanner.h for icelake: #include */ +/* begin file generic/stage1/json_string_scanner.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +struct json_string_block { + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_really_inline json_string_block(uint64_t escaped, uint64_t quote, uint64_t in_string) : + _escaped(escaped), _quote(quote), _in_string(in_string) {} + + // Escaped characters (characters following an escape() character) + simdjson_really_inline uint64_t escaped() const { return _escaped; } + // Real (non-backslashed) quotes + simdjson_really_inline uint64_t quote() const { return _quote; } + // Only characters inside the string (not including the quotes) + simdjson_really_inline uint64_t string_content() const { return _in_string & ~_quote; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_inside_string(uint64_t mask) const { return mask & _in_string; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_outside_string(uint64_t mask) const { return mask & ~_in_string; } + // Tail of string (everything except the start quote) + simdjson_really_inline uint64_t string_tail() const { return _in_string ^ _quote; } + + // escaped characters (backslashed--does not include the hex characters after \u) + uint64_t _escaped; + // real quotes (non-escaped ones) + uint64_t _quote; + // string characters (includes start quote but not end quote) + uint64_t _in_string; +}; + +// Scans blocks for string characters, storing the state necessary to do so +class json_string_scanner { +public: + simdjson_really_inline json_string_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_really_inline error_code finish(); + +private: + // Scans for escape characters + json_escape_scanner escape_scanner{}; + // Whether the last iteration was still inside a string (all 1's = true, all 0's = false). + uint64_t prev_in_string = 0ULL; +}; + +// +// Return a mask of all string characters plus end quotes. +// +// prev_escaped is overflow saying whether the next character is escaped. +// prev_in_string is overflow saying whether we're still in a string. +// +// Backslash sequences outside of quotes will be detected in stage 2. +// +simdjson_really_inline json_string_block json_string_scanner::next(const simd::simd8x64& in) { + const uint64_t backslash = in.eq('\\'); + const uint64_t escaped = escape_scanner.next(backslash).escaped; + const uint64_t quote = in.eq('"') & ~escaped; + + // + // prefix_xor flips on bits inside the string (and flips off the end quote). + // + // Then we xor with prev_in_string: if we were in a string already, its effect is flipped + // (characters inside strings are outside, and characters outside strings are inside). + // + const uint64_t in_string = prefix_xor(quote) ^ prev_in_string; + + // + // Check if we're still in a string at the end of the box so the next block will know + // + prev_in_string = uint64_t(static_cast(in_string) >> 63); + + // Use ^ to turn the beginning quote off, and the end quote on. + + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_string_block(escaped, quote, in_string); +} + +simdjson_really_inline error_code json_string_scanner::finish() { + if (prev_in_string) { + return UNCLOSED_STRING; + } + return SUCCESS; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_string_scanner.h for icelake */ +/* including generic/stage1/utf8_lookup4_algorithm.h for icelake: #include */ +/* begin file generic/stage1/utf8_lookup4_algorithm.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace utf8_validation { + +using namespace simd; + + simdjson_inline simd8 check_special_cases(const simd8 input, const simd8 prev1) { +// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII) +// Bit 1 = Too Long (ASCII followed by continuation) +// Bit 2 = Overlong 3-byte +// Bit 4 = Surrogate +// Bit 5 = Overlong 2-byte +// Bit 7 = Two Continuations + constexpr const uint8_t TOO_SHORT = 1<<0; // 11______ 0_______ + // 11______ 11______ + constexpr const uint8_t TOO_LONG = 1<<1; // 0_______ 10______ + constexpr const uint8_t OVERLONG_3 = 1<<2; // 11100000 100_____ + constexpr const uint8_t SURROGATE = 1<<4; // 11101101 101_____ + constexpr const uint8_t OVERLONG_2 = 1<<5; // 1100000_ 10______ + constexpr const uint8_t TWO_CONTS = 1<<7; // 10______ 10______ + constexpr const uint8_t TOO_LARGE = 1<<3; // 11110100 1001____ + // 11110100 101_____ + // 11110101 1001____ + // 11110101 101_____ + // 1111011_ 1001____ + // 1111011_ 101_____ + // 11111___ 1001____ + // 11111___ 101_____ + constexpr const uint8_t TOO_LARGE_1000 = 1<<6; + // 11110101 1000____ + // 1111011_ 1000____ + // 11111___ 1000____ + constexpr const uint8_t OVERLONG_4 = 1<<6; // 11110000 1000____ + + const simd8 byte_1_high = prev1.shr<4>().lookup_16( + // 0_______ ________ + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + // 10______ ________ + TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS, + // 1100____ ________ + TOO_SHORT | OVERLONG_2, + // 1101____ ________ + TOO_SHORT, + // 1110____ ________ + TOO_SHORT | OVERLONG_3 | SURROGATE, + // 1111____ ________ + TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4 + ); + constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 . + const simd8 byte_1_low = (prev1 & 0x0F).lookup_16( + // ____0000 ________ + CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4, + // ____0001 ________ + CARRY | OVERLONG_2, + // ____001_ ________ + CARRY, + CARRY, + + // ____0100 ________ + CARRY | TOO_LARGE, + // ____0101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____011_ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + + // ____1___ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____1101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000 + ); + const simd8 byte_2_high = input.shr<4>().lookup_16( + // ________ 0_______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + + // ________ 1000____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4, + // ________ 1001____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE, + // ________ 101_____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + + // ________ 11______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT + ); + return (byte_1_high & byte_1_low & byte_2_high); + } + simdjson_inline simd8 check_multibyte_lengths(const simd8 input, + const simd8 prev_input, const simd8 sc) { + simd8 prev2 = input.prev<2>(prev_input); + simd8 prev3 = input.prev<3>(prev_input); + simd8 must23 = simd8(must_be_2_3_continuation(prev2, prev3)); + simd8 must23_80 = must23 & uint8_t(0x80); + return must23_80 ^ sc; + } + + // + // Return nonzero if there are incomplete multibyte characters at the end of the block: + // e.g. if there is a 4-byte character, but it's 3 bytes from the end. + // + simdjson_inline simd8 is_incomplete(const simd8 input) { + // If the previous input's last 3 bytes match this, they're too short (they ended at EOF): + // ... 1111____ 111_____ 11______ +#if SIMDJSON_IMPLEMENTATION_ICELAKE + static const uint8_t max_array[64] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#else + static const uint8_t max_array[32] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#endif + const simd8 max_value(&max_array[sizeof(max_array)-sizeof(simd8)]); + return input.gt_bits(max_value); + } + + struct utf8_checker { + // If this is nonzero, there has been a UTF-8 error. + simd8 error; + // The last input we received + simd8 prev_input_block; + // Whether the last input we received was incomplete (used for ASCII fast path) + simd8 prev_incomplete; + + // + // Check whether the current bytes are valid UTF-8. + // + simdjson_inline void check_utf8_bytes(const simd8 input, const simd8 prev_input) { + // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes + // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers) + simd8 prev1 = input.prev<1>(prev_input); + simd8 sc = check_special_cases(input, prev1); + this->error |= check_multibyte_lengths(input, prev_input, sc); + } + + // The only problem that can happen at EOF is that a multibyte character is too short + // or a byte value too large in the last bytes: check_special_cases only checks for bytes + // too large in the first of two bytes. + simdjson_inline void check_eof() { + // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't + // possibly finish them. + this->error |= this->prev_incomplete; + } + + simdjson_inline void check_next_input(const simd8x64& input) { + if(simdjson_likely(is_ascii(input))) { + this->error |= this->prev_incomplete; + } else { + // you might think that a for-loop would work, but under Visual Studio, it is not good enough. + static_assert((simd8x64::NUM_CHUNKS == 1) + ||(simd8x64::NUM_CHUNKS == 2) + || (simd8x64::NUM_CHUNKS == 4), + "We support one, two or four chunks per 64-byte block."); + SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 1) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 2) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 4) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + this->check_utf8_bytes(input.chunks[2], input.chunks[1]); + this->check_utf8_bytes(input.chunks[3], input.chunks[2]); + } + this->prev_incomplete = is_incomplete(input.chunks[simd8x64::NUM_CHUNKS-1]); + this->prev_input_block = input.chunks[simd8x64::NUM_CHUNKS-1]; + } + } + // do not forget to call check_eof! + simdjson_inline error_code errors() { + return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS; + } + + }; // struct utf8_checker +} // namespace utf8_validation + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H +/* end file generic/stage1/utf8_lookup4_algorithm.h for icelake */ +/* including generic/stage1/json_scanner.h for icelake: #include */ +/* begin file generic/stage1/json_scanner.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +/** + * A block of scanned json, with information on operators and scalars. + * + * We seek to identify pseudo-structural characters. Anything that is inside + * a string must be omitted (hence & ~_string.string_tail()). + * Otherwise, pseudo-structural characters come in two forms. + * 1. We have the structural characters ([,],{,},:, comma). The + * term 'structural character' is from the JSON RFC. + * 2. We have the 'scalar pseudo-structural characters'. + * Scalars are quotes, and any character except structural characters and white space. + * + * To identify the scalar pseudo-structural characters, we must look at what comes + * before them: it must be a space, a quote or a structural characters. + * Starting with simdjson v0.3, we identify them by + * negation: we identify everything that is followed by a non-quote scalar, + * and we negate that. Whatever remains must be a 'scalar pseudo-structural character'. + */ +struct json_block { +public: + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_inline json_block(json_string_block&& string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(std::move(string)), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + simdjson_inline json_block(json_string_block string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + + /** + * The start of structurals. + * In simdjson prior to v0.3, these were called the pseudo-structural characters. + **/ + simdjson_inline uint64_t structural_start() const noexcept { return potential_structural_start() & ~_string.string_tail(); } + /** All JSON whitespace (i.e. not in a string) */ + simdjson_inline uint64_t whitespace() const noexcept { return non_quote_outside_string(_characters.whitespace()); } + + // Helpers + + /** Whether the given characters are inside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_inside_string(uint64_t mask) const noexcept { return _string.non_quote_inside_string(mask); } + /** Whether the given characters are outside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_outside_string(uint64_t mask) const noexcept { return _string.non_quote_outside_string(mask); } + + // string and escape characters + json_string_block _string; + // whitespace, structural characters ('operators'), scalars + json_character_block _characters; + // whether the previous character was a scalar + uint64_t _follows_potential_nonquote_scalar; +private: + // Potential structurals (i.e. disregarding strings) + + /** + * structural elements ([,],{,},:, comma) plus scalar starts like 123, true and "abc". + * They may reside inside a string. + **/ + simdjson_inline uint64_t potential_structural_start() const noexcept { return _characters.op() | potential_scalar_start(); } + /** + * The start of non-operator runs, like 123, true and "abc". + * It main reside inside a string. + **/ + simdjson_inline uint64_t potential_scalar_start() const noexcept { + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // Whenever it is preceded by something that is not a structural element ({,},[,],:, ") nor a white-space + // then we know that it is irrelevant structurally. + return _characters.scalar() & ~follows_potential_scalar(); + } + /** + * Whether the given character is immediately after a non-operator like 123, true. + * The characters following a quote are not included. + */ + simdjson_inline uint64_t follows_potential_scalar() const noexcept { + // _follows_potential_nonquote_scalar: is defined as marking any character that follows a character + // that is not a structural element ({,},[,],:, comma) nor a quote (") and that is not a + // white space. + // It is understood that within quoted region, anything at all could be marked (irrelevant). + return _follows_potential_nonquote_scalar; + } +}; + +/** + * Scans JSON for important bits: structural characters or 'operators', strings, and scalars. + * + * The scanner starts by calculating two distinct things: + * - string characters (taking \" into account) + * - structural characters or 'operators' ([]{},:, comma) + * and scalars (runs of non-operators like 123, true and "abc") + * + * To minimize data dependency (a key component of the scanner's speed), it finds these in parallel: + * in particular, the operator/scalar bit will find plenty of things that are actually part of + * strings. When we're done, json_block will fuse the two together by masking out tokens that are + * part of a string. + */ +class json_scanner { +public: + json_scanner() = default; + simdjson_inline json_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_inline error_code finish(); + +private: + // Whether the last character of the previous iteration is part of a scalar token + // (anything except whitespace or a structural character/'operator'). + uint64_t prev_scalar = 0ULL; + json_string_scanner string_scanner{}; +}; + + +// +// Check if the current character immediately follows a matching character. +// +// For example, this checks for quotes with backslashes in front of them: +// +// const uint64_t backslashed_quote = in.eq('"') & immediately_follows(in.eq('\'), prev_backslash); +// +simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) { + const uint64_t result = match << 1 | overflow; + overflow = match >> 63; + return result; +} + +simdjson_inline json_block json_scanner::next(const simd::simd8x64& in) { + json_string_block strings = string_scanner.next(in); + // identifies the white-space and the structural characters + json_character_block characters = json_character_block::classify(in); + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // We want follows_scalar to mark anything that follows a non-quote scalar (so letters and numbers). + // + // A terminal quote should either be followed by a structural character (comma, brace, bracket, colon) + // or nothing. However, we still want ' "a string"true ' to mark the 't' of 'true' as a potential + // pseudo-structural character just like we would if we had ' "a string" true '; otherwise we + // may need to add an extra check when parsing strings. + // + // Performance: there are many ways to skin this cat. + const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote(); + uint64_t follows_nonquote_scalar = follows(nonquote_scalar, prev_scalar); + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_block( + strings,// strings is a function-local object so either it moves or the copy is elided. + characters, + follows_nonquote_scalar + ); +} + +simdjson_inline error_code json_scanner::finish() { + return string_scanner.finish(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H +/* end file generic/stage1/json_scanner.h for icelake */ + +// All other declarations +/* including generic/stage1/find_next_document_index.h for icelake: #include */ +/* begin file generic/stage1/find_next_document_index.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +/** + * This algorithm is used to quickly identify the last structural position that + * makes up a complete document. + * + * It does this by going backwards and finding the last *document boundary* (a + * place where one value follows another without a comma between them). If the + * last document (the characters after the boundary) has an equal number of + * start and end brackets, it is considered complete. + * + * Simply put, we iterate over the structural characters, starting from + * the end. We consider that we found the end of a JSON document when the + * first element of the pair is NOT one of these characters: '{' '[' ':' ',' + * and when the second element is NOT one of these characters: '}' ']' ':' ','. + * + * This simple comparison works most of the time, but it does not cover cases + * where the batch's structural indexes contain a perfect amount of documents. + * In such a case, we do not have access to the structural index which follows + * the last document, therefore, we do not have access to the second element in + * the pair, and that means we cannot identify the last document. To fix this + * issue, we keep a count of the open and closed curly/square braces we found + * while searching for the pair. When we find a pair AND the count of open and + * closed curly/square braces is the same, we know that we just passed a + * complete document, therefore the last json buffer location is the end of the + * batch. + */ +simdjson_inline uint32_t find_next_document_index(dom_parser_implementation &parser) { + // Variant: do not count separately, just figure out depth + if(parser.n_structural_indexes == 0) { return 0; } + auto arr_cnt = 0; + auto obj_cnt = 0; + for (auto i = parser.n_structural_indexes - 1; i > 0; i--) { + auto idxb = parser.structural_indexes[i]; + switch (parser.buf[idxb]) { + case ':': + case ',': + continue; + case '}': + obj_cnt--; + continue; + case ']': + arr_cnt--; + continue; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + auto idxa = parser.structural_indexes[i - 1]; + switch (parser.buf[idxa]) { + case '{': + case '[': + case ':': + case ',': + continue; + } + // Last document is complete, so the next document will appear after! + if (!arr_cnt && !obj_cnt) { + return parser.n_structural_indexes; + } + // Last document is incomplete; mark the document at i + 1 as the next one + return i; + } + // If we made it to the end, we want to finish counting to see if we have a full document. + switch (parser.buf[parser.structural_indexes[0]]) { + case '}': + obj_cnt--; + break; + case ']': + arr_cnt--; + break; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + if (!arr_cnt && !obj_cnt) { + // We have a complete document. + return parser.n_structural_indexes; + } + return 0; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H +/* end file generic/stage1/find_next_document_index.h for icelake */ +/* including generic/stage1/json_minifier.h for icelake: #include */ +/* begin file generic/stage1/json_minifier.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +class json_minifier { +public: + template + static error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept; + +private: + simdjson_inline json_minifier(uint8_t *_dst) + : dst{_dst} + {} + template + simdjson_inline void step(const uint8_t *block_buf, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block); + simdjson_inline error_code finish(uint8_t *dst_start, size_t &dst_len); + json_scanner scanner{}; + uint8_t *dst; +}; + +simdjson_inline void json_minifier::next(const simd::simd8x64& in, const json_block& block) { + uint64_t mask = block.whitespace(); + dst += in.compress(mask, dst); +} + +simdjson_inline error_code json_minifier::finish(uint8_t *dst_start, size_t &dst_len) { + error_code error = scanner.finish(); + if (error) { dst_len = 0; return error; } + dst_len = dst - dst_start; + return SUCCESS; +} + +template<> +simdjson_inline void json_minifier::step<128>(const uint8_t *block_buf, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + simd::simd8x64 in_2(block_buf+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1); + this->next(in_2, block_2); + reader.advance(); +} + +template<> +simdjson_inline void json_minifier::step<64>(const uint8_t *block_buf, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + json_block block_1 = scanner.next(in_1); + this->next(block_buf, block_1); + reader.advance(); +} + +template +error_code json_minifier::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept { + buf_block_reader reader(buf, len); + json_minifier minifier(dst); + + // Index the first n-1 blocks + while (reader.has_full_block()) { + minifier.step(reader.full_block(), reader); + } + + // Index the last (remainder) block, padded with spaces + uint8_t block[STEP_SIZE]; + size_t remaining_bytes = reader.get_remainder(block); + if (remaining_bytes > 0) { + // We do not want to write directly to the output stream. Rather, we write + // to a local buffer (for safety). + uint8_t out_block[STEP_SIZE]; + uint8_t * const guarded_dst{minifier.dst}; + minifier.dst = out_block; + minifier.step(block, reader); + size_t to_write = minifier.dst - out_block; + // In some cases, we could be enticed to consider the padded spaces + // as part of the string. This is fine as long as we do not write more + // than we consumed. + if(to_write > remaining_bytes) { to_write = remaining_bytes; } + memcpy(guarded_dst, out_block, to_write); + minifier.dst = guarded_dst + to_write; + } + return minifier.finish(dst, dst_len); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H +/* end file generic/stage1/json_minifier.h for icelake */ +/* including generic/stage1/json_structural_indexer.h for icelake: #include */ +/* begin file generic/stage1/json_structural_indexer.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +class bit_indexer { +public: + uint32_t *tail; + + simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {} + +#if SIMDJSON_PREFER_REVERSE_BITS + /** + * ARM lacks a fast trailing zero instruction, but it has a fast + * bit reversal instruction and a fast leading zero instruction. + * Thus it may be profitable to reverse the bits (once) and then + * to rely on a sequence of instructions that call the leading + * zero instruction. + * + * Performance notes: + * The chosen routine is not optimal in terms of data dependency + * since zero_leading_bit might require two instructions. However, + * it tends to minimize the total number of instructions which is + * beneficial. + */ + simdjson_inline void write_index(uint32_t idx, uint64_t& rev_bits, int i) { + int lz = leading_zeroes(rev_bits); + this->tail[i] = static_cast(idx) + lz; + rev_bits = zero_leading_bit(rev_bits, lz); + } +#else + /** + * Under recent x64 systems, we often have both a fast trailing zero + * instruction and a fast 'clear-lower-bit' instruction so the following + * algorithm can be competitive. + */ + + simdjson_inline void write_index(uint32_t idx, uint64_t& bits, int i) { + this->tail[i] = idx + trailing_zeroes(bits); + bits = clear_lowest_bit(bits); + } +#endif // SIMDJSON_PREFER_REVERSE_BITS + + template + simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) { + write_index(idx, bits, START); + SIMDJSON_IF_CONSTEXPR (N > 1) { + write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits); + } + return START+N; + } + + template + simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) { + write_indexes(idx, bits); + SIMDJSON_IF_CONSTEXPR ((START+STEP) < END) { + if (simdjson_unlikely((START+STEP) < cnt)) { + write_indexes_stepped<(START+STEP(idx, bits, cnt); + } + } + return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP; + } + + // flatten out values in 'bits' assuming that they are are to have values of idx + // plus their position in the bitvector, and store these indexes at + // base_ptr[base] incrementing base as we go + // will potentially store extra values beyond end of valid bits, so base_ptr + // needs to be large enough to handle this + // + // If the kernel sets SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER, then it + // will provide its own version of the code. +#ifdef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + simdjson_inline void write(uint32_t idx, uint64_t bits); +#else + simdjson_inline void write(uint32_t idx, uint64_t bits) { + // In some instances, the next branch is expensive because it is mispredicted. + // Unfortunately, in other cases, + // it helps tremendously. + if (bits == 0) + return; + + int cnt = static_cast(count_ones(bits)); + +#if SIMDJSON_PREFER_REVERSE_BITS + bits = reverse_bits(bits); +#endif +#ifdef SIMDJSON_STRUCTURAL_INDEXER_STEP + static constexpr const int STEP = SIMDJSON_STRUCTURAL_INDEXER_STEP; +#else + static constexpr const int STEP = 4; +#endif + static constexpr const int STEP_UNTIL = 24; + + write_indexes_stepped<0, STEP_UNTIL, STEP>(idx, bits, cnt); + SIMDJSON_IF_CONSTEXPR (STEP_UNTIL < 64) { + if (simdjson_unlikely(STEP_UNTIL < cnt)) { + for (int i=STEP_UNTIL; itail += cnt; + } +#endif // SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +}; + +class json_structural_indexer { +public: + /** + * Find the important bits of JSON in a 128-byte chunk, and add them to structural_indexes. + * + * @param partial Setting the partial parameter to true allows the find_structural_bits to + * tolerate unclosed strings. The caller should still ensure that the input is valid UTF-8. If + * you are processing substrings, you may want to call on a function like trimmed_length_safe_utf8. + */ + template + static error_code index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept; + +private: + simdjson_inline json_structural_indexer(uint32_t *structural_indexes); + template + simdjson_inline void step(const uint8_t *block, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block, size_t idx); + simdjson_inline error_code finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial); + + json_scanner scanner{}; + utf8_checker checker{}; + bit_indexer indexer; + uint64_t prev_structurals = 0; + uint64_t unescaped_chars_error = 0; +}; + +simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {} + +// Skip the last character if it is partial +simdjson_inline size_t trim_partial_utf8(const uint8_t *buf, size_t len) { + if (simdjson_unlikely(len < 3)) { + switch (len) { + case 2: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 2 bytes left + return len; + case 1: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + return len; + case 0: + return len; + } + } + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 1 byte left + if (buf[len-3] >= 0xf0) { return len-3; } // 4-byte characters with only 3 bytes left + return len; +} + +// +// PERF NOTES: +// We pipe 2 inputs through these stages: +// 1. Load JSON into registers. This takes a long time and is highly parallelizable, so we load +// 2 inputs' worth at once so that by the time step 2 is looking for them input, it's available. +// 2. Scan the JSON for critical data: strings, scalars and operators. This is the critical path. +// The output of step 1 depends entirely on this information. These functions don't quite use +// up enough CPU: the second half of the functions is highly serial, only using 1 execution core +// at a time. The second input's scans has some dependency on the first ones finishing it, but +// they can make a lot of progress before they need that information. +// 3. Step 1 doesn't use enough capacity, so we run some extra stuff while we're waiting for that +// to finish: utf-8 checks and generating the output from the last iteration. +// +// The reason we run 2 inputs at a time, is steps 2 and 3 are *still* not enough to soak up all +// available capacity with just one input. Running 2 at a time seems to give the CPU a good enough +// workout. +// +template +error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept { + if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; } + // We guard the rest of the code so that we can assume that len > 0 throughout. + if (len == 0) { return EMPTY; } + if (is_streaming(partial)) { + len = trim_partial_utf8(buf, len); + // If you end up with an empty window after trimming + // the partial UTF-8 bytes, then chances are good that you + // have an UTF-8 formatting error. + if(len == 0) { return UTF8_ERROR; } + } + buf_block_reader reader(buf, len); + json_structural_indexer indexer(parser.structural_indexes.get()); + + // Read all but the last block + while (reader.has_full_block()) { + indexer.step(reader.full_block(), reader); + } + // Take care of the last block (will always be there unless file is empty which is + // not supposed to happen.) + uint8_t block[STEP_SIZE]; + if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; } + indexer.step(block, reader); + return indexer.finish(parser, reader.block_index(), len, partial); +} + +template<> +simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block); + simd::simd8x64 in_2(block+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1, reader.block_index()); + this->next(in_2, block_2, reader.block_index()+64); + reader.advance(); +} + +template<> +simdjson_inline void json_structural_indexer::step<64>(const uint8_t *block, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block); + json_block block_1 = scanner.next(in_1); + this->next(in_1, block_1, reader.block_index()); + reader.advance(); +} + +simdjson_inline void json_structural_indexer::next(const simd::simd8x64& in, const json_block& block, size_t idx) { + uint64_t unescaped = in.lteq(0x1F); +#if SIMDJSON_UTF8VALIDATION + checker.check_next_input(in); +#endif + indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser + prev_structurals = block.structural_start(); + unescaped_chars_error |= block.non_quote_inside_string(unescaped); +} + +simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) { + // Write out the final iteration's structurals + indexer.write(uint32_t(idx-64), prev_structurals); + error_code error = scanner.finish(); + // We deliberately break down the next expression so that it is + // human readable. + const bool should_we_exit = is_streaming(partial) ? + ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING + : (error != SUCCESS); // if partial is false, we must have SUCCESS + const bool have_unclosed_string = (error == UNCLOSED_STRING); + if (simdjson_unlikely(should_we_exit)) { return error; } + + if (unescaped_chars_error) { + return UNESCAPED_CHARS; + } + parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get()); + /*** + * The On Demand API requires special padding. + * + * This is related to https://github.com/simdjson/simdjson/issues/906 + * Basically, we want to make sure that if the parsing continues beyond the last (valid) + * structural character, it quickly stops. + * Only three structural characters can be repeated without triggering an error in JSON: [,] and }. + * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing + * continues, then it must be [,] or }. + * Suppose it is ] or }. We backtrack to the first character, what could it be that would + * not trigger an error? It could be ] or } but no, because you can't start a document that way. + * It can't be a comma, a colon or any simple value. So the only way we could continue is + * if the repeated character is [. But if so, the document must start with [. But if the document + * starts with [, it should end with ]. If we enforce that rule, then we would get + * ][[ which is invalid. + * + * This is illustrated with the test array_iterate_unclosed_error() on the following input: + * R"({ "a": [,,)" + **/ + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final + parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len); + parser.structural_indexes[parser.n_structural_indexes + 2] = 0; + parser.next_structural_index = 0; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + return EMPTY; + } + if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) { + return UNEXPECTED_ERROR; + } + if (partial == stage1_mode::streaming_partial) { + // If we have an unclosed string, then the last structural + // will be the quote and we want to make sure to omit it. + if(have_unclosed_string) { + parser.n_structural_indexes--; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; } + } + // We truncate the input to the end of the last complete document (or zero). + auto new_structural_indexes = find_next_document_index(parser); + if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) { + if(parser.structural_indexes[0] == 0) { + // If the buffer is partial and we started at index 0 but the document is + // incomplete, it's too big to parse. + return CAPACITY; + } else { + // It is possible that the document could be parsed, we just had a lot + // of white space. + parser.n_structural_indexes = 0; + return EMPTY; + } + } + + parser.n_structural_indexes = new_structural_indexes; + } else if (partial == stage1_mode::streaming_final) { + if(have_unclosed_string) { parser.n_structural_indexes--; } + // We truncate the input to the end of the last complete document (or zero). + // Because partial == stage1_mode::streaming_final, it means that we may + // silently ignore trailing garbage. Though it sounds bad, we do it + // deliberately because many people who have streams of JSON documents + // will truncate them for processing. E.g., imagine that you are uncompressing + // the data from a size file or receiving it in chunks from the network. You + // may not know where exactly the last document will be. Meanwhile the + // document_stream instances allow people to know the JSON documents they are + // parsing (see the iterator.source() method). + parser.n_structural_indexes = find_next_document_index(parser); + // We store the initial n_structural_indexes so that the client can see + // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes, + // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len, + // otherwise, it will copy some prior index. + parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes]; + // This next line is critical, do not change it unless you understand what you are + // doing. + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + // We tolerate an unclosed string at the very end of the stream. Indeed, users + // often load their data in bulk without being careful and they want us to ignore + // the trailing garbage. + return EMPTY; + } + } + checker.check_eof(); + return checker.errors(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +// Clear CUSTOM_BIT_INDEXER so other implementations can set it if they need to. +#undef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H +/* end file generic/stage1/json_structural_indexer.h for icelake */ +/* including generic/stage1/utf8_validator.h for icelake: #include */ +/* begin file generic/stage1/utf8_validator.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage1 { + +/** + * Validates that the string is actual UTF-8. + */ +template +bool generic_validate_utf8(const uint8_t * input, size_t length) { + checker c{}; + buf_block_reader<64> reader(input, length); + while (reader.has_full_block()) { + simd::simd8x64 in(reader.full_block()); + c.check_next_input(in); + reader.advance(); + } + uint8_t block[64]{}; + reader.get_remainder(block); + simd::simd8x64 in(block); + c.check_next_input(in); + reader.advance(); + c.check_eof(); + return c.errors() == error_code::SUCCESS; +} + +bool generic_validate_utf8(const char * input, size_t length) { + return generic_validate_utf8(reinterpret_cast(input),length); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H +/* end file generic/stage1/utf8_validator.h for icelake */ +/* end file generic/stage1/amalgamated.h for icelake */ +/* including generic/stage2/amalgamated.h for icelake: #include */ +/* begin file generic/stage2/amalgamated.h for icelake */ +// Stuff other things depend on +/* including generic/stage2/base.h for icelake: #include */ +/* begin file generic/stage2/base.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage2 { + +class json_iterator; +class structural_iterator; +struct tape_builder; +struct tape_writer; + +} // namespace stage2 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_BASE_H +/* end file generic/stage2/base.h for icelake */ +/* including generic/stage2/tape_writer.h for icelake: #include */ +/* begin file generic/stage2/tape_writer.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace icelake { +namespace { +namespace stage2 { + +struct tape_writer { + /** The next place to write to tape */ + uint64_t *next_tape_loc; + + /** Write a signed 64-bit value to tape. */ + simdjson_inline void append_s64(int64_t value) noexcept; + + /** Write an unsigned 64-bit value to tape. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + + /** Write a double value to tape. */ + simdjson_inline void append_double(double value) noexcept; + + /** + * Append a tape entry (an 8-bit type,and 56 bits worth of value). + */ + simdjson_inline void append(uint64_t val, internal::tape_type t) noexcept; + + /** + * Skip the current tape entry without writing. + * + * Used to skip the start of the container, since we'll come back later to fill it in when the + * container ends. + */ + simdjson_inline void skip() noexcept; + + /** + * Skip the number of tape entries necessary to write a large u64 or i64. + */ + simdjson_inline void skip_large_integer() noexcept; + + /** + * Skip the number of tape entries necessary to write a double. + */ + simdjson_inline void skip_double() noexcept; + + /** + * Write a value to a known location on tape. + * + * Used to go back and write out the start of a container after the container ends. + */ + simdjson_inline static void write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept; + +private: + /** + * Append both the tape entry, and a supplementary value following it. Used for types that need + * all 64 bits, such as double and uint64_t. + */ + template + simdjson_inline void append2(uint64_t val, T val2, internal::tape_type t) noexcept; +}; // struct tape_writer + +simdjson_inline void tape_writer::append_s64(int64_t value) noexcept { + append2(0, value, internal::tape_type::INT64); +} + +simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept { + append(0, internal::tape_type::UINT64); + *next_tape_loc = value; + next_tape_loc++; +} + +/** Write a double value to tape. */ +simdjson_inline void tape_writer::append_double(double value) noexcept { + append2(0, value, internal::tape_type::DOUBLE); +} + +simdjson_inline void tape_writer::skip() noexcept { + next_tape_loc++; +} + +simdjson_inline void tape_writer::skip_large_integer() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::skip_double() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept { + *next_tape_loc = val | ((uint64_t(char(t))) << 56); + next_tape_loc++; +} + +template +simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept { + append(val, t); + static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!"); + memcpy(next_tape_loc, &val2, sizeof(val2)); + next_tape_loc++; +} + +simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept { + tape_loc = val | ((uint64_t(char(t))) << 56); +} + +} // namespace stage2 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H +/* end file generic/stage2/tape_writer.h for icelake */ +/* including generic/stage2/logger.h for icelake: #include */ +/* begin file generic/stage2/logger.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + + +// This is for an internal-only stage 2 specific logger. +// Set LOG_ENABLED = true to log what stage 2 is doing! +namespace simdjson { +namespace icelake { +namespace { +namespace logger { + + static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + static constexpr const int LOG_EVENT_LEN = 20; + static constexpr const int LOG_BUFFER_LEN = 30; + static constexpr const int LOG_SMALL_BUFFER_LEN = 10; + static constexpr const int LOG_INDEX_LEN = 5; + + static int log_depth; // Not threadsafe. Log only. + + // Helper to turn unprintable or newline characters into spaces + static simdjson_inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } + } + + // Print the header and set up log_start + static simdjson_inline void log_start() { + if (LOG_ENABLED) { + log_depth = 0; + printf("\n"); + printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#"); + printf("|%.*s|%.*s|%.*s|%.*s|--------|\n", LOG_EVENT_LEN+2, DASHES, LOG_BUFFER_LEN+2, DASHES, LOG_SMALL_BUFFER_LEN+2, DASHES, 5+2, DASHES); + } + } + + simdjson_unused static simdjson_inline void log_string(const char *message) { + if (LOG_ENABLED) { + printf("%s\n", message); + } + } + + // Logs a single line from the stage 2 DOM parser + template + static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) { + if (LOG_ENABLED) { + printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title); + auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1; + auto next_index = structurals.next_structural; + auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast(" "); + auto next = &structurals.buf[*next_index]; + { + // Print the next N characters in the buffer. + printf("| "); + // Otherwise, print the characters starting from the buffer position. + // Print spaces for unprintable or newline characters. + for (int i=0;i */ +/* begin file generic/stage2/json_iterator.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage2 { + +class json_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + uint32_t depth{0}; + + /** + * Walk the JSON document. + * + * The visitor receives callbacks when values are encountered. All callbacks pass the iterator as + * the first parameter; some callbacks have other parameters as well: + * + * - visit_document_start() - at the beginning. + * - visit_document_end() - at the end (if things were successful). + * + * - visit_array_start() - at the start `[` of a non-empty array. + * - visit_array_end() - at the end `]` of a non-empty array. + * - visit_empty_array() - when an empty array is encountered. + * + * - visit_object_end() - at the start `]` of a non-empty object. + * - visit_object_start() - at the end `]` of a non-empty object. + * - visit_empty_object() - when an empty object is encountered. + * - visit_key(const uint8_t *key) - when a key in an object field is encountered. key is + * guaranteed to point at the first quote of the string (`"key"`). + * - visit_primitive(const uint8_t *value) - when a value is a string, number, boolean or null. + * - visit_root_primitive(iter, uint8_t *value) - when the top-level value is a string, number, boolean or null. + * + * - increment_count(iter) - each time a value is found in an array or object. + */ + template + simdjson_warn_unused simdjson_inline error_code walk_document(V &visitor) noexcept; + + /** + * Create an iterator capable of walking a JSON document. + * + * The document must have already passed through stage 1. + */ + simdjson_inline json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index); + + /** + * Look at the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *peek() const noexcept; + /** + * Advance to the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *advance() noexcept; + /** + * Get the remaining length of the document, from the start of the current token. + */ + simdjson_inline size_t remaining_len() const noexcept; + /** + * Check if we are at the end of the document. + * + * If this is true, there are no more tokens. + */ + simdjson_inline bool at_eof() const noexcept; + /** + * Check if we are at the beginning of the document. + */ + simdjson_inline bool at_beginning() const noexcept; + simdjson_inline uint8_t last_structural() const noexcept; + + /** + * Log that a value has been found. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_value(const char *type) const noexcept; + /** + * Log the start of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_start_value(const char *type) const noexcept; + /** + * Log the end of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_end_value(const char *type) const noexcept; + /** + * Log an error. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_error(const char *error) const noexcept; + + template + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(V &visitor, const uint8_t *value) noexcept; + template + simdjson_warn_unused simdjson_inline error_code visit_primitive(V &visitor, const uint8_t *value) noexcept; +}; + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept { + logger::log_start(); + + // + // Start the document + // + if (at_eof()) { return EMPTY; } + log_start_value("document"); + SIMDJSON_TRY( visitor.visit_document_start(*this) ); + + // + // Read first value + // + { + auto value = advance(); + + // Make sure the outer object or array is closed before continuing; otherwise, there are ways we + // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906 + if (!STREAMING) { + switch (*value) { + case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break; + case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break; + } + } + + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break; + } + } + goto document_end; + +// +// Object parser states +// +object_begin: + log_start_value("object"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = false; + SIMDJSON_TRY( visitor.visit_object_start(*this) ); + + { + auto key = advance(); + if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.increment_count(*this) ); + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + +object_field: + if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; } + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +object_continue: + switch (*advance()) { + case ',': + SIMDJSON_TRY( visitor.increment_count(*this) ); + { + auto key = advance(); + if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + goto object_field; + case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end; + default: log_error("No comma between object fields"); return TAPE_ERROR; + } + +scope_end: + depth--; + if (depth == 0) { goto document_end; } + if (dom_parser.is_array[depth]) { goto array_continue; } + goto object_continue; + +// +// Array parser states +// +array_begin: + log_start_value("array"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = true; + SIMDJSON_TRY( visitor.visit_array_start(*this) ); + SIMDJSON_TRY( visitor.increment_count(*this) ); + +array_value: + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +array_continue: + switch (*advance()) { + case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value; + case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end; + default: log_error("Missing comma between array values"); return TAPE_ERROR; + } + +document_end: + log_end_value("document"); + SIMDJSON_TRY( visitor.visit_document_end(*this) ); + + dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]); + + // If we didn't make it to the end, it's an error + if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) { + log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); + return TAPE_ERROR; + } + + return SUCCESS; + +} // walk_document() + +simdjson_inline json_iterator::json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { +} + +simdjson_inline const uint8_t *json_iterator::peek() const noexcept { + return &buf[*(next_structural)]; +} +simdjson_inline const uint8_t *json_iterator::advance() noexcept { + return &buf[*(next_structural++)]; +} +simdjson_inline size_t json_iterator::remaining_len() const noexcept { + return dom_parser.len - *(next_structural-1); +} + +simdjson_inline bool json_iterator::at_eof() const noexcept { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; +} +simdjson_inline bool json_iterator::at_beginning() const noexcept { + return next_structural == dom_parser.structural_indexes.get(); +} +simdjson_inline uint8_t json_iterator::last_structural() const noexcept { + return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]]; +} + +simdjson_inline void json_iterator::log_value(const char *type) const noexcept { + logger::log_line(*this, "", type, ""); +} + +simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept { + logger::log_line(*this, "+", type, ""); + if (logger::LOG_ENABLED) { logger::log_depth++; } +} + +simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept { + if (logger::LOG_ENABLED) { logger::log_depth--; } + logger::log_line(*this, "-", type, ""); +} + +simdjson_inline void json_iterator::log_error(const char *error) const noexcept { + logger::log_line(*this, "", "ERROR", error); +} + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept { + switch (*value) { + case '"': return visitor.visit_root_string(*this, value); + case 't': return visitor.visit_root_true_atom(*this, value); + case 'f': return visitor.visit_root_false_atom(*this, value); + case 'n': return visitor.visit_root_null_atom(*this, value); + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return visitor.visit_root_number(*this, value); + default: + log_error("Document starts with a non-value character"); + return TAPE_ERROR; + } +} +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept { + // Use the fact that most scalars are going to be either strings or numbers. + if(*value == '"') { + return visitor.visit_string(*this, value); + } else if (((*value - '0') < 10) || (*value == '-')) { + return visitor.visit_number(*this, value); + } + // true, false, null are uncommon. + switch (*value) { + case 't': return visitor.visit_true_atom(*this, value); + case 'f': return visitor.visit_false_atom(*this, value); + case 'n': return visitor.visit_null_atom(*this, value); + default: + log_error("Non-value found when value was expected!"); + return TAPE_ERROR; + } +} + +} // namespace stage2 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H +/* end file generic/stage2/json_iterator.h for icelake */ +/* including generic/stage2/stringparsing.h for icelake: #include */ +/* begin file generic/stage2/stringparsing.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses +// It is intended to be included multiple times and compiled multiple times + +namespace simdjson { +namespace icelake { +namespace { +/// @private +namespace stringparsing { + +// begin copypasta +// These chars yield themselves: " \ / +// b -> backspace, f -> formfeed, n -> newline, r -> cr, t -> horizontal tab +// u not handled in this table as it's complex +static const uint8_t escape_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x0. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2f, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x4. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c, 0, 0, 0, // 0x5. + 0, 0, 0x08, 0, 0, 0, 0x0c, 0, 0, 0, 0, 0, 0, 0, 0x0a, 0, // 0x6. + 0, 0, 0x0d, 0, 0x09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x7. + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +// handle a unicode codepoint +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint(const uint8_t **src_ptr, + uint8_t **dst_ptr, bool allow_replacement) { + // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD) + constexpr uint32_t substitution_code_point = 0xfffd; + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) != ((static_cast ('\\') << 8) | static_cast ('u'))) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + + // We have already checked that the high surrogate is valid and + // (code_point - 0xd800) < 1024. + // + // Check that code_point_2 is in the range 0xdc00..0xdfff + // and that code_point_2 was parsed from valid hex. + uint32_t low_bit = code_point_2 - 0xdc00; + if (low_bit >> 10) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + code_point = (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + + } + } else if (code_point >= 0xdc00 && code_point <= 0xdfff) { + // If we encounter a low surrogate (not preceded by a high surrogate) + // then we have an error. + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +// handle a unicode codepoint using the wobbly convention +// https://simonsapin.github.io/wtf-8/ +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint_wobbly(const uint8_t **src_ptr, + uint8_t **dst_ptr) { + // It is not ideal that this function is nearly identical to handle_unicode_codepoint. + // + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) == ((static_cast ('\\') << 8) | static_cast ('u'))) { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + uint32_t low_bit = code_point_2 - 0xdc00; + if ((low_bit >> 10) == 0) { + code_point = + (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + } + } + + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +/** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + */ +simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) { + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { + // It is not ideal that this function is nearly identical to parse_string. + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint_wobbly(&src, &dst)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +} // namespace stringparsing +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H +/* end file generic/stage2/stringparsing.h for icelake */ +/* including generic/stage2/structural_iterator.h for icelake: #include */ +/* begin file generic/stage2/structural_iterator.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace stage2 { + +class structural_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + + // Start a structural + simdjson_inline structural_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { + } + // Get the buffer position of the current structural character + simdjson_inline const uint8_t* current() { + return &buf[*(next_structural-1)]; + } + // Get the current structural character + simdjson_inline char current_char() { + return buf[*(next_structural-1)]; + } + // Get the next structural character without advancing + simdjson_inline char peek_next_char() { + return buf[*next_structural]; + } + simdjson_inline const uint8_t* peek() { + return &buf[*next_structural]; + } + simdjson_inline const uint8_t* advance() { + return &buf[*(next_structural++)]; + } + simdjson_inline char advance_char() { + return buf[*(next_structural++)]; + } + simdjson_inline size_t remaining_len() { + return dom_parser.len - *(next_structural-1); + } + + simdjson_inline bool at_end() { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; + } + simdjson_inline bool at_beginning() { + return next_structural == dom_parser.structural_indexes.get(); + } +}; + +} // namespace stage2 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H +/* end file generic/stage2/structural_iterator.h for icelake */ +/* including generic/stage2/tape_builder.h for icelake: #include */ +/* begin file generic/stage2/tape_builder.h for icelake */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace icelake { +namespace { +namespace stage2 { + +struct tape_builder { + template + simdjson_warn_unused static simdjson_inline error_code parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept; + + /** Called when a non-empty document starts. */ + simdjson_warn_unused simdjson_inline error_code visit_document_start(json_iterator &iter) noexcept; + /** Called when a non-empty document ends without error. */ + simdjson_warn_unused simdjson_inline error_code visit_document_end(json_iterator &iter) noexcept; + + /** Called when a non-empty array starts. */ + simdjson_warn_unused simdjson_inline error_code visit_array_start(json_iterator &iter) noexcept; + /** Called when a non-empty array ends. */ + simdjson_warn_unused simdjson_inline error_code visit_array_end(json_iterator &iter) noexcept; + /** Called when an empty array is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_array(json_iterator &iter) noexcept; + + /** Called when a non-empty object starts. */ + simdjson_warn_unused simdjson_inline error_code visit_object_start(json_iterator &iter) noexcept; + /** + * Called when a key in a field is encountered. + * + * primitive, visit_object_start, visit_empty_object, visit_array_start, or visit_empty_array + * will be called after this with the field value. + */ + simdjson_warn_unused simdjson_inline error_code visit_key(json_iterator &iter, const uint8_t *key) noexcept; + /** Called when a non-empty object ends. */ + simdjson_warn_unused simdjson_inline error_code visit_object_end(json_iterator &iter) noexcept; + /** Called when an empty object is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_object(json_iterator &iter) noexcept; + + /** + * Called when a string, number, boolean or null is found. + */ + simdjson_warn_unused simdjson_inline error_code visit_primitive(json_iterator &iter, const uint8_t *value) noexcept; + /** + * Called when a string, number, boolean or null is found at the top level of a document (i.e. + * when there is no array or object and the entire document is a single string, number, boolean or + * null. + * + * This is separate from primitive() because simdjson's normal primitive parsing routines assume + * there is at least one more token after the value, which is only true in an array or object. + */ + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_string(json_iterator &iter, const uint8_t *value, bool key = false) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_root_string(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + /** Called each time a new field or element in an array or object is found. */ + simdjson_warn_unused simdjson_inline error_code increment_count(json_iterator &iter) noexcept; + + /** Next location to write to tape */ + tape_writer tape; +private: + /** Next write location in the string buf for stage 2 parsing */ + uint8_t *current_string_buf_loc; + + simdjson_inline tape_builder(dom::document &doc) noexcept; + + simdjson_inline uint32_t next_tape_index(json_iterator &iter) const noexcept; + simdjson_inline void start_container(json_iterator &iter) noexcept; + simdjson_warn_unused simdjson_inline error_code end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_warn_unused simdjson_inline error_code empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_inline uint8_t *on_start_string(json_iterator &iter) noexcept; + simdjson_inline void on_end_string(uint8_t *dst) noexcept; +}; // struct tape_builder + +template +simdjson_warn_unused simdjson_inline error_code tape_builder::parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept { + dom_parser.doc = &doc; + json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0); + tape_builder builder(doc); + return iter.walk_document(builder); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_root_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept { + constexpr uint32_t start_tape_index = 0; + tape.append(start_tape_index, internal::tape_type::ROOT); + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept { + return visit_string(iter, key, true); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1 + return SUCCESS; +} + +simdjson_inline tape_builder::tape_builder(dom::document &doc) noexcept : tape{doc.tape.get()}, current_string_buf_loc{doc.string_buf.get()} {} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept { + iter.log_value(key ? "key" : "string"); + uint8_t *dst = on_start_string(iter); + dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid. + if (dst == nullptr) { + iter.log_error("Invalid escape in string"); + return STRING_ERROR; + } + on_end_string(dst); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept { + return visit_string(iter, value); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("number"); + return numberparsing::parse_number(value, tape); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_number(json_iterator &iter, const uint8_t *value) noexcept { + // + // We need to make a copy to make sure that the string is space terminated. + // This is not about padding the input, which should already padded up + // to len + SIMDJSON_PADDING. However, we have no control at this stage + // on how the padding was done. What if the input string was padded with nulls? + // It is quite common for an input string to have an extra null character (C string). + // We do not want to allow 9\0 (where \0 is the null character) inside a JSON + // document, but the string "9\0" by itself is fine. So we make a copy and + // pad the input with spaces when we know that there is just one input element. + // This copy is relatively expensive, but it will almost never be called in + // practice unless you are in the strange scenario where you have many JSON + // documents made of single atoms. + // + std::unique_ptrcopy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]); + if (copy.get() == nullptr) { return MEMALLOC; } + std::memcpy(copy.get(), value, iter.remaining_len()); + std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING); + error_code error = visit_number(iter, copy.get()); + return error; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value)) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +// private: + +simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept { + return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get()); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + auto start_index = next_tape_index(iter); + tape.append(start_index+2, start); + tape.append(start_index, end); + return SUCCESS; +} + +simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter); + iter.dom_parser.open_containers[iter.depth].count = 0; + tape.skip(); // We don't actually *write* the start element until the end. +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + // Write the ending tape element, pointing at the start location + const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index; + tape.append(start_tape_index, end); + // Write the start tape element, pointing at the end location (and including count) + // count can overflow if it exceeds 24 bits... so we saturate + // the convention being that a cnt of 0xffffff or more is undetermined in value (>= 0xffffff). + const uint32_t count = iter.dom_parser.open_containers[iter.depth].count; + const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count; + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start); + return SUCCESS; +} + +simdjson_inline uint8_t *tape_builder::on_start_string(json_iterator &iter) noexcept { + // we advance the point, accounting for the fact that we have a NULL termination + tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING); + return current_string_buf_loc + sizeof(uint32_t); +} + +simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept { + uint32_t str_length = uint32_t(dst - (current_string_buf_loc + sizeof(uint32_t))); + // TODO check for overflow in case someone has a crazy string (>=4GB?) + // But only add the overflow check when the document itself exceeds 4GB + // Currently unneeded because we refuse to parse docs larger or equal to 4GB. + memcpy(current_string_buf_loc, &str_length, sizeof(uint32_t)); + // NULL termination is still handy if you expect all your strings to + // be NULL terminated? It comes at a small cost + *dst = 0; + current_string_buf_loc = dst + 1; +} + +} // namespace stage2 +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H +/* end file generic/stage2/tape_builder.h for icelake */ +/* end file generic/stage2/amalgamated.h for icelake */ + +#undef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +// +// Stage 1 +// + +namespace simdjson { +namespace icelake { + +simdjson_warn_unused error_code implementation::create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr& dst +) const noexcept { + dst.reset( new (std::nothrow) dom_parser_implementation() ); + if (!dst) { return MEMALLOC; } + if (auto err = dst->set_capacity(capacity)) + return err; + if (auto err = dst->set_max_depth(max_depth)) + return err; + return SUCCESS; +} + +namespace { + +using namespace simd; + +// This identifies structural characters (comma, colon, braces, brackets), +// and ASCII white-space ('\r','\n','\t',' '). +simdjson_inline json_character_block json_character_block::classify(const simd::simd8x64& in) { + // These lookups rely on the fact that anything < 127 will match the lower 4 bits, which is why + // we can't use the generic lookup_16. + const auto whitespace_table = simd8::repeat_16(' ', 100, 100, 100, 17, 100, 113, 2, 100, '\t', '\n', 112, 100, '\r', 100, 100); + + // The 6 operators (:,[]{}) have these values: + // + // , 2C + // : 3A + // [ 5B + // { 7B + // ] 5D + // } 7D + // + // If you use | 0x20 to turn [ and ] into { and }, the lower 4 bits of each character is unique. + // We exploit this, using a simd 4-bit lookup to tell us which character match against, and then + // match it (against | 0x20). + // + // To prevent recognizing other characters, everything else gets compared with 0, which cannot + // match due to the | 0x20. + // + // NOTE: Due to the | 0x20, this ALSO treats and (control characters 0C and 1A) like , + // and :. This gets caught in stage 2, which checks the actual character to ensure the right + // operators are in the right places. + const auto op_table = simd8::repeat_16( + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, ':', '{', // : = 3A, [ = 5B, { = 7B + ',', '}', 0, 0 // , = 2C, ] = 5D, } = 7D + ); + + // We compute whitespace and op separately. If later code only uses one or the + // other, given the fact that all functions are aggressively inlined, we can + // hope that useless computations will be omitted. This is namely case when + // minifying (we only need whitespace). + + const uint64_t whitespace = in.eq({ + _mm512_shuffle_epi8(whitespace_table, in.chunks[0]) + }); + // Turn [ and ] into { and } + const simd8x64 curlified{ + in.chunks[0] | 0x20 + }; + const uint64_t op = curlified.eq({ + _mm512_shuffle_epi8(op_table, in.chunks[0]) + }); + + return { whitespace, op }; +} + +simdjson_inline bool is_ascii(const simd8x64& input) { + return input.reduce_or().is_ascii(); +} + +simdjson_unused simdjson_inline simd8 must_be_continuation(const simd8 prev1, const simd8 prev2, const simd8 prev3) { + simd8 is_second_byte = prev1.saturating_sub(0xc0u-1); // Only 11______ will be > 0 + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_second_byte | is_third_byte | is_fourth_byte) > int8_t(0); +} + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3) { + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_third_byte | is_fourth_byte) > int8_t(0); +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +/** + * We provide a custom version of bit_indexer::write using + * naked intrinsics. + * TODO: make this code more elegant. + */ +// Under GCC 12, the intrinsic _mm512_extracti32x4_epi32 may generate 'maybe uninitialized'. +// as a workaround, we disable warnings within the following function. +SIMDJSON_PUSH_DISABLE_ALL_WARNINGS +namespace simdjson { namespace icelake { namespace { namespace stage1 { +simdjson_inline void bit_indexer::write(uint32_t idx, uint64_t bits) { + // In some instances, the next branch is expensive because it is mispredicted. + // Unfortunately, in other cases, + // it helps tremendously. + if (bits == 0) { return; } + + const __m512i indexes = _mm512_maskz_compress_epi8(bits, _mm512_set_epi32( + 0x3f3e3d3c, 0x3b3a3938, 0x37363534, 0x33323130, + 0x2f2e2d2c, 0x2b2a2928, 0x27262524, 0x23222120, + 0x1f1e1d1c, 0x1b1a1918, 0x17161514, 0x13121110, + 0x0f0e0d0c, 0x0b0a0908, 0x07060504, 0x03020100 + )); + const __m512i start_index = _mm512_set1_epi32(idx); + + const auto count = count_ones(bits); + __m512i t0 = _mm512_cvtepu8_epi32(_mm512_castsi512_si128(indexes)); + _mm512_storeu_si512(this->tail, _mm512_add_epi32(t0, start_index)); + + if(count > 16) { + const __m512i t1 = _mm512_cvtepu8_epi32(_mm512_extracti32x4_epi32(indexes, 1)); + _mm512_storeu_si512(this->tail + 16, _mm512_add_epi32(t1, start_index)); + if(count > 32) { + const __m512i t2 = _mm512_cvtepu8_epi32(_mm512_extracti32x4_epi32(indexes, 2)); + _mm512_storeu_si512(this->tail + 32, _mm512_add_epi32(t2, start_index)); + if(count > 48) { + const __m512i t3 = _mm512_cvtepu8_epi32(_mm512_extracti32x4_epi32(indexes, 3)); + _mm512_storeu_si512(this->tail + 48, _mm512_add_epi32(t3, start_index)); + } + } + } + this->tail += count; +} +}}}} +SIMDJSON_POP_DISABLE_WARNINGS + +// +// Stage 2 +// + +// +// Implementation-specific overrides +// +namespace simdjson { +namespace icelake { + +simdjson_warn_unused error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept { + return icelake::stage1::json_minifier::minify<128>(buf, len, dst, dst_len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept { + this->buf = _buf; + this->len = _len; + return icelake::stage1::json_structural_indexer::index<128>(_buf, _len, *this, streaming); +} + +simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept { + return icelake::stage1::generic_validate_utf8(buf,len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool replacement_char) const noexcept { + return icelake::stringparsing::parse_string(src, dst, replacement_char); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept { + return icelake::stringparsing::parse_wobbly_string(src, dst); +} + +simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept { + auto error = stage1(_buf, _len, stage1_mode::regular); + if (error) { return error; } + return stage2(_doc); +} + +} // namespace icelake +} // namespace simdjson + +/* including simdjson/icelake/end.h: #include */ +/* begin file simdjson/icelake/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "icelake" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/icelake/end.h */ + +#endif // SIMDJSON_SRC_ICELAKE_CPP +/* end file icelake.cpp */ +#endif +#if SIMDJSON_IMPLEMENTATION_PPC64 +/* including ppc64.cpp: #include */ +/* begin file ppc64.cpp */ +#ifndef SIMDJSON_SRC_PPC64_CPP +#define SIMDJSON_SRC_PPC64_CPP + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* including simdjson/ppc64.h: #include */ +/* begin file simdjson/ppc64.h */ +#ifndef SIMDJSON_PPC64_H +#define SIMDJSON_PPC64_H + +/* including simdjson/ppc64/begin.h: #include "simdjson/ppc64/begin.h" */ +/* begin file simdjson/ppc64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "ppc64" */ +#define SIMDJSON_IMPLEMENTATION ppc64 +/* including simdjson/ppc64/base.h: #include "simdjson/ppc64/base.h" */ +/* begin file simdjson/ppc64/base.h */ +#ifndef SIMDJSON_PPC64_BASE_H +#define SIMDJSON_PPC64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for ALTIVEC (PPC64). + */ +namespace ppc64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BASE_H +/* end file simdjson/ppc64/base.h */ +/* including simdjson/ppc64/intrinsics.h: #include "simdjson/ppc64/intrinsics.h" */ +/* begin file simdjson/ppc64/intrinsics.h */ +#ifndef SIMDJSON_PPC64_INTRINSICS_H +#define SIMDJSON_PPC64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +// These are defined by altivec.h in GCC toolchain, it is safe to undef them. +#ifdef bool +#undef bool +#endif + +#ifdef vector +#undef vector +#endif + +static_assert(sizeof(__vector unsigned char) <= simdjson::SIMDJSON_PADDING, "insufficient padding for ppc64"); + +#endif // SIMDJSON_PPC64_INTRINSICS_H +/* end file simdjson/ppc64/intrinsics.h */ +/* including simdjson/ppc64/bitmanipulation.h: #include "simdjson/ppc64/bitmanipulation.h" */ +/* begin file simdjson/ppc64/bitmanipulation.h */ +#ifndef SIMDJSON_PPC64_BITMANIPULATION_H +#define SIMDJSON_PPC64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num - 1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline int count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num); // Visual Studio wants two underscores +} +#else +simdjson_inline int count_ones(uint64_t input_num) { + return __builtin_popcountll(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BITMANIPULATION_H +/* end file simdjson/ppc64/bitmanipulation.h */ +/* including simdjson/ppc64/bitmask.h: #include "simdjson/ppc64/bitmask.h" */ +/* begin file simdjson/ppc64/bitmask.h */ +#ifndef SIMDJSON_PPC64_BITMASK_H +#define SIMDJSON_PPC64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is +// encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + // You can use the version below, however gcc sometimes miscompiles + // vec_pmsum_be, it happens somewhere around between 8 and 9th version. + // The performance boost was not noticeable, falling back to a usual + // implementation. + // __vector unsigned long long all_ones = {~0ull, ~0ull}; + // __vector unsigned long long mask = {bitmask, 0}; + // // Clang and GCC return different values for pmsum for ull so cast it to one. + // // Generally it is not specified by ALTIVEC ISA what is returned by + // // vec_pmsum_be. + // #if defined(__LITTLE_ENDIAN__) + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[0]); + // #else + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[1]); + // #endif + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif +/* end file simdjson/ppc64/bitmask.h */ +/* including simdjson/ppc64/numberparsing_defs.h: #include "simdjson/ppc64/numberparsing_defs.h" */ +/* begin file simdjson/ppc64/numberparsing_defs.h */ +#ifndef SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +#define SIMDJSON_PPC64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if defined(__linux__) +#include +#elif defined(__FreeBSD__) +#include +#endif + +namespace simdjson { +namespace ppc64 { +namespace numberparsing { + +// we don't have appropriate instructions, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); +#ifdef __BIG_ENDIAN__ +#if defined(__linux__) + val = bswap_64(val); +#elif defined(__FreeBSD__) + val = bswap64(val); +#endif +#endif + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace ppc64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +/* end file simdjson/ppc64/numberparsing_defs.h */ +/* including simdjson/ppc64/simd.h: #include "simdjson/ppc64/simd.h" */ +/* begin file simdjson/ppc64/simd.h */ +#ifndef SIMDJSON_PPC64_SIMD_H +#define SIMDJSON_PPC64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +namespace simd { + +using __m128i = __vector unsigned char; + +template struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i &() const { + return this->value; + } + simdjson_inline operator __m128i &() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { + return vec_or(this->value, (__m128i)other); + } + simdjson_inline Child operator&(const Child other) const { + return vec_and(this->value, (__m128i)other); + } + simdjson_inline Child operator^(const Child other) const { + return vec_xor(this->value, (__m128i)other); + } + simdjson_inline Child bit_andnot(const Child other) const { + return vec_andc(this->value, (__m128i)other); + } + simdjson_inline Child &operator|=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast | other; + return *this_cast; + } + simdjson_inline Child &operator&=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast & other; + return *this_cast; + } + simdjson_inline Child &operator^=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast ^ other; + return *this_cast; + } +}; + +template > +struct base8 : base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { + return (__m128i)vec_cmpeq(lhs.value, (__m128i)rhs); + } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(simd8 prev_chunk) const { + __m128i chunk = this->value; +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve(this->value); + prev_chunk = (__m128i)vec_reve((__m128i)prev_chunk); +#endif + chunk = (__m128i)vec_sld((__m128i)prev_chunk, (__m128i)chunk, 16 - N); +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve((__m128i)chunk); +#endif + return chunk; + } +}; + +// SIMD byte mask type (returned by things like eq and gt) +template <> struct simd8 : base8 { + static simdjson_inline simd8 splat(bool _value) { + return (__m128i)vec_splats((unsigned char)(-(!!_value))); + } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) + : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) + : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { + __vector unsigned long long result; + const __m128i perm_mask = {0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40, + 0x38, 0x30, 0x28, 0x20, 0x18, 0x10, 0x08, 0x00}; + + result = ((__vector unsigned long long)vec_vbpermq((__m128i)this->value, + (__m128i)perm_mask)); +#ifdef __LITTLE_ENDIAN__ + return static_cast(result[1]); +#else + return static_cast(result[0]); +#endif + } + simdjson_inline bool any() const { + return !vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline simd8 operator~() const { + return this->value ^ (__m128i)splat(true); + } +}; + +template struct base8_numeric : base8 { + static simdjson_inline simd8 splat(T value) { + (void)value; + return (__m128i)vec_splats(value); + } + static simdjson_inline simd8 zero() { return splat(0); } + static simdjson_inline simd8 load(const T values[16]) { + return (__m128i)(vec_vsx_ld(0, reinterpret_cast(values))); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16(T v0, T v1, T v2, T v3, T v4, + T v5, T v6, T v7, T v8, T v9, + T v10, T v11, T v12, T v13, + T v14, T v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, + v14, v15); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) + : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { + vec_vsx_st(this->value, 0, reinterpret_cast<__m128i *>(dst)); + } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { + return (__m128i)((__m128i)this->value + (__m128i)other); + } + simdjson_inline simd8 operator-(const simd8 other) const { + return (__m128i)((__m128i)this->value - (__m128i)other); + } + simdjson_inline simd8 &operator+=(const simd8 other) { + *this = *this + other; + return *static_cast *>(this); + } + simdjson_inline simd8 &operator-=(const simd8 other) { + *this = *this - other; + return *static_cast *>(this); + } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior + // for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return (__m128i)vec_perm((__m128i)lookup_table, (__m128i)lookup_table, this->value); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted + // as a bitset). Passing a 0 value for mask would be equivalent to writing out + // every byte to output. Only the first 16 - count_ones(mask) bytes of the + // result are significant but 16 bytes get written. Design consideration: it + // seems like a function with the signature simd8 compress(uint32_t mask) + // would be sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L *output) const { + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + using internal::thintable_epi8; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. +#ifdef __LITTLE_ENDIAN__ + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask1], thintable_epi8[mask2]}; +#else + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask2], thintable_epi8[mask1]}; + shufmask = (__m128i)vec_reve((__m128i)shufmask); +#endif + // we increment by 0x08 the second half of the mask + shufmask = ((__m128i)shufmask) + + ((__m128i)(__vector int){0, 0, 0x08080808, 0x08080808}); + + // this is the version "nearly pruned" + __m128i pruned = vec_perm(this->value, this->value, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + vec_vsx_ld(0, reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = vec_perm(pruned, (__m128i)vec_splats(0), compactmask); + vec_vsx_st(answer, 0, reinterpret_cast<__m128i *>(output)); + } + + template + simdjson_inline simd8 + lookup_16(L replace0, L replace1, L replace2, L replace3, L replace4, + L replace5, L replace6, L replace7, L replace8, L replace9, + L replace10, L replace11, L replace12, L replace13, L replace14, + L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, replace4, replace5, replace6, + replace7, replace8, replace9, replace10, replace11, replace12, + replace13, replace14, replace15)); + } +}; + +// Signed bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8(int8_t v0, int8_t v1, int8_t v2, int8_t v3, + int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) + : simd8((__m128i)(__vector signed char){v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, + v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, + int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Order-sensitive comparisons + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return (__m128i)vec_cmpgt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return (__m128i)vec_cmplt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } +}; + +// Unsigned bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline + simd8(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, + uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, + uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15) + : simd8((__m128i){v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, + uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, + uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, + uint8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Saturated math + simdjson_inline simd8 + saturating_add(const simd8 other) const { + return (__m128i)vec_adds(this->value, (__m128i)other); + } + simdjson_inline simd8 + saturating_sub(const simd8 other) const { + return (__m128i)vec_subs(this->value, (__m128i)other); + } + + // Order-specific operations + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max(this->value, (__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min(this->value, (__m128i)other); + } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + gt_bits(const simd8 other) const { + return this->saturating_sub(other); + } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + lt_bits(const simd8 other) const { + return other.saturating_sub(*this); + } + simdjson_inline simd8 + operator<=(const simd8 other) const { + return other.max_val(*this) == other; + } + simdjson_inline simd8 + operator>=(const simd8 other) const { + return other.min_val(*this) == other; + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { + return (__m128i)vec_cmpeq(this->value, (__m128i)vec_splats(uint8_t(0))); + } + simdjson_inline simd8 bits_not_set(simd8 bits) const { + return (*this & bits).bits_not_set(); + } + simdjson_inline simd8 any_bits_set() const { + return ~this->bits_not_set(); + } + simdjson_inline simd8 any_bits_set(simd8 bits) const { + return ~this->bits_not_set(bits); + } + simdjson_inline bool bits_not_set_anywhere() const { + return vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere() const { + return !bits_not_set_anywhere(); + } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { + return vec_all_eq(vec_and(this->value, (__m128i)bits), + (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { + return !bits_not_set_anywhere(bits); + } + template simdjson_inline simd8 shr() const { + return simd8( + (__m128i)vec_sr(this->value, (__m128i)vec_splat_u8(N))); + } + template simdjson_inline simd8 shl() const { + return simd8( + (__m128i)vec_sl(this->value, (__m128i)vec_splat_u8(N))); + } +}; + +template struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, + "PPC64 kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64 &o) = delete; // no copy allowed + simd8x64 & + operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, + const simd8 chunk2, const simd8 chunk3) + : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) + : chunks{simd8::load(ptr), simd8::load(ptr + 16), + simd8::load(ptr + 32), simd8::load(ptr + 48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr + sizeof(simd8) * 0); + this->chunks[1].store(ptr + sizeof(simd8) * 1); + this->chunks[2].store(ptr + sizeof(simd8) * 2); + this->chunks[3].store(ptr + sizeof(simd8) * 3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | + (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T *output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), + output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), + output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), + output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r1 = this->chunks[1].to_bitmask(); + uint64_t r2 = this->chunks[2].to_bitmask(); + uint64_t r3 = this->chunks[3].to_bitmask(); + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] == mask, this->chunks[1] == mask, + this->chunks[2] == mask, this->chunks[3] == mask) + .to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64(this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3]) + .to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] <= mask, this->chunks[1] <= mask, + this->chunks[2] <= mask, this->chunks[3] <= mask) + .to_bitmask(); + } +}; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_SIMD_INPUT_H +/* end file simdjson/ppc64/simd.h */ +/* including simdjson/ppc64/stringparsing_defs.h: #include "simdjson/ppc64/stringparsing_defs.h" */ +/* begin file simdjson/ppc64/stringparsing_defs.h */ +#ifndef SIMDJSON_PPC64_STRINGPARSING_DEFS_H +#define SIMDJSON_PPC64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/simd.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote + copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { + return ((bs_bits - 1) & quote_bits) != 0; + } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { + return trailing_zeroes(quote_bits); + } + simdjson_inline int backslash_index() { + return trailing_zeroes(bs_bits); + } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote +backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), + "backslash and quote finder must process fewer than " + "SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on + // PPC; therefore, we smash them together into a 64-byte mask and get the + // bitmask from there. + uint64_t bs_and_quote = + simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_STRINGPARSING_DEFS_H +/* end file simdjson/ppc64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/ppc64/begin.h */ +/* including simdjson/generic/amalgamated.h for ppc64: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for ppc64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for ppc64: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for ppc64 */ +/* including simdjson/generic/jsoncharutils.h for ppc64: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for ppc64 */ +/* including simdjson/generic/atomparsing.h for ppc64: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for ppc64 */ +/* including simdjson/generic/dom_parser_implementation.h for ppc64: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { +namespace ppc64 { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for ppc64 */ +/* including simdjson/generic/implementation_simdjson_result_base.h for ppc64: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for ppc64 */ +/* including simdjson/generic/numberparsing.h for ppc64: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace ppc64 { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for ppc64 */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for ppc64: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for ppc64 */ +/* end file simdjson/generic/amalgamated.h for ppc64 */ +/* including simdjson/ppc64/end.h: #include "simdjson/ppc64/end.h" */ +/* begin file simdjson/ppc64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "ppc64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/ppc64/end.h */ + +#endif // SIMDJSON_PPC64_H +/* end file simdjson/ppc64.h */ +/* including simdjson/ppc64/implementation.h: #include */ +/* begin file simdjson/ppc64/implementation.h */ +#ifndef SIMDJSON_PPC64_IMPLEMENTATION_H +#define SIMDJSON_PPC64_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +/** + * Implementation for ALTIVEC (PPC64). + */ +namespace ppc64 { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() + : simdjson::implementation("ppc64", "PPC64 ALTIVEC", + internal::instruction_set::ALTIVEC) {} + + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, size_t max_length, + std::unique_ptr &dst) + const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, + uint8_t *dst, + size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, + size_t len) const noexcept final; +}; + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_IMPLEMENTATION_H +/* end file simdjson/ppc64/implementation.h */ + +/* including simdjson/ppc64/begin.h: #include */ +/* begin file simdjson/ppc64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "ppc64" */ +#define SIMDJSON_IMPLEMENTATION ppc64 +/* including simdjson/ppc64/base.h: #include "simdjson/ppc64/base.h" */ +/* begin file simdjson/ppc64/base.h */ +#ifndef SIMDJSON_PPC64_BASE_H +#define SIMDJSON_PPC64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for ALTIVEC (PPC64). + */ +namespace ppc64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BASE_H +/* end file simdjson/ppc64/base.h */ +/* including simdjson/ppc64/intrinsics.h: #include "simdjson/ppc64/intrinsics.h" */ +/* begin file simdjson/ppc64/intrinsics.h */ +#ifndef SIMDJSON_PPC64_INTRINSICS_H +#define SIMDJSON_PPC64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +// These are defined by altivec.h in GCC toolchain, it is safe to undef them. +#ifdef bool +#undef bool +#endif + +#ifdef vector +#undef vector +#endif + +static_assert(sizeof(__vector unsigned char) <= simdjson::SIMDJSON_PADDING, "insufficient padding for ppc64"); + +#endif // SIMDJSON_PPC64_INTRINSICS_H +/* end file simdjson/ppc64/intrinsics.h */ +/* including simdjson/ppc64/bitmanipulation.h: #include "simdjson/ppc64/bitmanipulation.h" */ +/* begin file simdjson/ppc64/bitmanipulation.h */ +#ifndef SIMDJSON_PPC64_BITMANIPULATION_H +#define SIMDJSON_PPC64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num - 1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline int count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num); // Visual Studio wants two underscores +} +#else +simdjson_inline int count_ones(uint64_t input_num) { + return __builtin_popcountll(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BITMANIPULATION_H +/* end file simdjson/ppc64/bitmanipulation.h */ +/* including simdjson/ppc64/bitmask.h: #include "simdjson/ppc64/bitmask.h" */ +/* begin file simdjson/ppc64/bitmask.h */ +#ifndef SIMDJSON_PPC64_BITMASK_H +#define SIMDJSON_PPC64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is +// encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + // You can use the version below, however gcc sometimes miscompiles + // vec_pmsum_be, it happens somewhere around between 8 and 9th version. + // The performance boost was not noticeable, falling back to a usual + // implementation. + // __vector unsigned long long all_ones = {~0ull, ~0ull}; + // __vector unsigned long long mask = {bitmask, 0}; + // // Clang and GCC return different values for pmsum for ull so cast it to one. + // // Generally it is not specified by ALTIVEC ISA what is returned by + // // vec_pmsum_be. + // #if defined(__LITTLE_ENDIAN__) + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[0]); + // #else + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[1]); + // #endif + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif +/* end file simdjson/ppc64/bitmask.h */ +/* including simdjson/ppc64/numberparsing_defs.h: #include "simdjson/ppc64/numberparsing_defs.h" */ +/* begin file simdjson/ppc64/numberparsing_defs.h */ +#ifndef SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +#define SIMDJSON_PPC64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if defined(__linux__) +#include +#elif defined(__FreeBSD__) +#include +#endif + +namespace simdjson { +namespace ppc64 { +namespace numberparsing { + +// we don't have appropriate instructions, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); +#ifdef __BIG_ENDIAN__ +#if defined(__linux__) + val = bswap_64(val); +#elif defined(__FreeBSD__) + val = bswap64(val); +#endif +#endif + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace ppc64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +/* end file simdjson/ppc64/numberparsing_defs.h */ +/* including simdjson/ppc64/simd.h: #include "simdjson/ppc64/simd.h" */ +/* begin file simdjson/ppc64/simd.h */ +#ifndef SIMDJSON_PPC64_SIMD_H +#define SIMDJSON_PPC64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +namespace simd { + +using __m128i = __vector unsigned char; + +template struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i &() const { + return this->value; + } + simdjson_inline operator __m128i &() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { + return vec_or(this->value, (__m128i)other); + } + simdjson_inline Child operator&(const Child other) const { + return vec_and(this->value, (__m128i)other); + } + simdjson_inline Child operator^(const Child other) const { + return vec_xor(this->value, (__m128i)other); + } + simdjson_inline Child bit_andnot(const Child other) const { + return vec_andc(this->value, (__m128i)other); + } + simdjson_inline Child &operator|=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast | other; + return *this_cast; + } + simdjson_inline Child &operator&=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast & other; + return *this_cast; + } + simdjson_inline Child &operator^=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast ^ other; + return *this_cast; + } +}; + +template > +struct base8 : base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { + return (__m128i)vec_cmpeq(lhs.value, (__m128i)rhs); + } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(simd8 prev_chunk) const { + __m128i chunk = this->value; +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve(this->value); + prev_chunk = (__m128i)vec_reve((__m128i)prev_chunk); +#endif + chunk = (__m128i)vec_sld((__m128i)prev_chunk, (__m128i)chunk, 16 - N); +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve((__m128i)chunk); +#endif + return chunk; + } +}; + +// SIMD byte mask type (returned by things like eq and gt) +template <> struct simd8 : base8 { + static simdjson_inline simd8 splat(bool _value) { + return (__m128i)vec_splats((unsigned char)(-(!!_value))); + } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) + : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) + : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { + __vector unsigned long long result; + const __m128i perm_mask = {0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40, + 0x38, 0x30, 0x28, 0x20, 0x18, 0x10, 0x08, 0x00}; + + result = ((__vector unsigned long long)vec_vbpermq((__m128i)this->value, + (__m128i)perm_mask)); +#ifdef __LITTLE_ENDIAN__ + return static_cast(result[1]); +#else + return static_cast(result[0]); +#endif + } + simdjson_inline bool any() const { + return !vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline simd8 operator~() const { + return this->value ^ (__m128i)splat(true); + } +}; + +template struct base8_numeric : base8 { + static simdjson_inline simd8 splat(T value) { + (void)value; + return (__m128i)vec_splats(value); + } + static simdjson_inline simd8 zero() { return splat(0); } + static simdjson_inline simd8 load(const T values[16]) { + return (__m128i)(vec_vsx_ld(0, reinterpret_cast(values))); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16(T v0, T v1, T v2, T v3, T v4, + T v5, T v6, T v7, T v8, T v9, + T v10, T v11, T v12, T v13, + T v14, T v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, + v14, v15); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) + : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { + vec_vsx_st(this->value, 0, reinterpret_cast<__m128i *>(dst)); + } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { + return (__m128i)((__m128i)this->value + (__m128i)other); + } + simdjson_inline simd8 operator-(const simd8 other) const { + return (__m128i)((__m128i)this->value - (__m128i)other); + } + simdjson_inline simd8 &operator+=(const simd8 other) { + *this = *this + other; + return *static_cast *>(this); + } + simdjson_inline simd8 &operator-=(const simd8 other) { + *this = *this - other; + return *static_cast *>(this); + } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior + // for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return (__m128i)vec_perm((__m128i)lookup_table, (__m128i)lookup_table, this->value); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted + // as a bitset). Passing a 0 value for mask would be equivalent to writing out + // every byte to output. Only the first 16 - count_ones(mask) bytes of the + // result are significant but 16 bytes get written. Design consideration: it + // seems like a function with the signature simd8 compress(uint32_t mask) + // would be sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L *output) const { + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + using internal::thintable_epi8; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. +#ifdef __LITTLE_ENDIAN__ + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask1], thintable_epi8[mask2]}; +#else + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask2], thintable_epi8[mask1]}; + shufmask = (__m128i)vec_reve((__m128i)shufmask); +#endif + // we increment by 0x08 the second half of the mask + shufmask = ((__m128i)shufmask) + + ((__m128i)(__vector int){0, 0, 0x08080808, 0x08080808}); + + // this is the version "nearly pruned" + __m128i pruned = vec_perm(this->value, this->value, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + vec_vsx_ld(0, reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = vec_perm(pruned, (__m128i)vec_splats(0), compactmask); + vec_vsx_st(answer, 0, reinterpret_cast<__m128i *>(output)); + } + + template + simdjson_inline simd8 + lookup_16(L replace0, L replace1, L replace2, L replace3, L replace4, + L replace5, L replace6, L replace7, L replace8, L replace9, + L replace10, L replace11, L replace12, L replace13, L replace14, + L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, replace4, replace5, replace6, + replace7, replace8, replace9, replace10, replace11, replace12, + replace13, replace14, replace15)); + } +}; + +// Signed bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8(int8_t v0, int8_t v1, int8_t v2, int8_t v3, + int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) + : simd8((__m128i)(__vector signed char){v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, + v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, + int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Order-sensitive comparisons + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return (__m128i)vec_cmpgt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return (__m128i)vec_cmplt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } +}; + +// Unsigned bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline + simd8(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, + uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, + uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15) + : simd8((__m128i){v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, + uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, + uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, + uint8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Saturated math + simdjson_inline simd8 + saturating_add(const simd8 other) const { + return (__m128i)vec_adds(this->value, (__m128i)other); + } + simdjson_inline simd8 + saturating_sub(const simd8 other) const { + return (__m128i)vec_subs(this->value, (__m128i)other); + } + + // Order-specific operations + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max(this->value, (__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min(this->value, (__m128i)other); + } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + gt_bits(const simd8 other) const { + return this->saturating_sub(other); + } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + lt_bits(const simd8 other) const { + return other.saturating_sub(*this); + } + simdjson_inline simd8 + operator<=(const simd8 other) const { + return other.max_val(*this) == other; + } + simdjson_inline simd8 + operator>=(const simd8 other) const { + return other.min_val(*this) == other; + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { + return (__m128i)vec_cmpeq(this->value, (__m128i)vec_splats(uint8_t(0))); + } + simdjson_inline simd8 bits_not_set(simd8 bits) const { + return (*this & bits).bits_not_set(); + } + simdjson_inline simd8 any_bits_set() const { + return ~this->bits_not_set(); + } + simdjson_inline simd8 any_bits_set(simd8 bits) const { + return ~this->bits_not_set(bits); + } + simdjson_inline bool bits_not_set_anywhere() const { + return vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere() const { + return !bits_not_set_anywhere(); + } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { + return vec_all_eq(vec_and(this->value, (__m128i)bits), + (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { + return !bits_not_set_anywhere(bits); + } + template simdjson_inline simd8 shr() const { + return simd8( + (__m128i)vec_sr(this->value, (__m128i)vec_splat_u8(N))); + } + template simdjson_inline simd8 shl() const { + return simd8( + (__m128i)vec_sl(this->value, (__m128i)vec_splat_u8(N))); + } +}; + +template struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, + "PPC64 kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64 &o) = delete; // no copy allowed + simd8x64 & + operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, + const simd8 chunk2, const simd8 chunk3) + : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) + : chunks{simd8::load(ptr), simd8::load(ptr + 16), + simd8::load(ptr + 32), simd8::load(ptr + 48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr + sizeof(simd8) * 0); + this->chunks[1].store(ptr + sizeof(simd8) * 1); + this->chunks[2].store(ptr + sizeof(simd8) * 2); + this->chunks[3].store(ptr + sizeof(simd8) * 3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | + (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T *output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), + output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), + output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), + output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r1 = this->chunks[1].to_bitmask(); + uint64_t r2 = this->chunks[2].to_bitmask(); + uint64_t r3 = this->chunks[3].to_bitmask(); + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] == mask, this->chunks[1] == mask, + this->chunks[2] == mask, this->chunks[3] == mask) + .to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64(this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3]) + .to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] <= mask, this->chunks[1] <= mask, + this->chunks[2] <= mask, this->chunks[3] <= mask) + .to_bitmask(); + } +}; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_SIMD_INPUT_H +/* end file simdjson/ppc64/simd.h */ +/* including simdjson/ppc64/stringparsing_defs.h: #include "simdjson/ppc64/stringparsing_defs.h" */ +/* begin file simdjson/ppc64/stringparsing_defs.h */ +#ifndef SIMDJSON_PPC64_STRINGPARSING_DEFS_H +#define SIMDJSON_PPC64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/simd.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote + copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { + return ((bs_bits - 1) & quote_bits) != 0; + } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { + return trailing_zeroes(quote_bits); + } + simdjson_inline int backslash_index() { + return trailing_zeroes(bs_bits); + } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote +backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), + "backslash and quote finder must process fewer than " + "SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on + // PPC; therefore, we smash them together into a 64-byte mask and get the + // bitmask from there. + uint64_t bs_and_quote = + simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_STRINGPARSING_DEFS_H +/* end file simdjson/ppc64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/ppc64/begin.h */ +/* including generic/amalgamated.h for ppc64: #include */ +/* begin file generic/amalgamated.h for ppc64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_SRC_GENERIC_DEPENDENCIES_H) +#error generic/dependencies.h must be included before generic/amalgamated.h! +#endif + +/* including generic/base.h for ppc64: #include */ +/* begin file generic/base.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +struct json_character_block; + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_BASE_H +/* end file generic/base.h for ppc64 */ +/* including generic/dom_parser_implementation.h for ppc64: #include */ +/* begin file generic/dom_parser_implementation.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// Interface a dom parser implementation must fulfill +namespace simdjson { +namespace ppc64 { +namespace { + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3); +simdjson_inline bool is_ascii(const simd8x64& input); + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file generic/dom_parser_implementation.h for ppc64 */ +/* including generic/json_character_block.h for ppc64: #include */ +/* begin file generic/json_character_block.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +struct json_character_block { + static simdjson_inline json_character_block classify(const simd::simd8x64& in); + + simdjson_inline uint64_t whitespace() const noexcept { return _whitespace; } + simdjson_inline uint64_t op() const noexcept { return _op; } + simdjson_inline uint64_t scalar() const noexcept { return ~(op() | whitespace()); } + + uint64_t _whitespace; + uint64_t _op; +}; + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H +/* end file generic/json_character_block.h for ppc64 */ +/* end file generic/amalgamated.h for ppc64 */ +/* including generic/stage1/amalgamated.h for ppc64: #include */ +/* begin file generic/stage1/amalgamated.h for ppc64 */ +// Stuff other things depend on +/* including generic/stage1/base.h for ppc64: #include */ +/* begin file generic/stage1/base.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +class bit_indexer; +template +struct buf_block_reader; +struct json_block; +class json_minifier; +class json_scanner; +struct json_string_block; +class json_string_scanner; +class json_structural_indexer; + +} // namespace stage1 + +namespace utf8_validation { +struct utf8_checker; +} // namespace utf8_validation + +using utf8_validation::utf8_checker; + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BASE_H +/* end file generic/stage1/base.h for ppc64 */ +/* including generic/stage1/buf_block_reader.h for ppc64: #include */ +/* begin file generic/stage1/buf_block_reader.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +// Walks through a buffer in block-sized increments, loading the last part with spaces +template +struct buf_block_reader { +public: + simdjson_inline buf_block_reader(const uint8_t *_buf, size_t _len); + simdjson_inline size_t block_index(); + simdjson_inline bool has_full_block() const; + simdjson_inline const uint8_t *full_block() const; + /** + * Get the last block, padded with spaces. + * + * There will always be a last block, with at least 1 byte, unless len == 0 (in which case this + * function fills the buffer with spaces and returns 0. In particular, if len == STEP_SIZE there + * will be 0 full_blocks and 1 remainder block with STEP_SIZE bytes and no spaces for padding. + * + * @return the number of effective characters in the last block. + */ + simdjson_inline size_t get_remainder(uint8_t *dst) const; + simdjson_inline void advance(); +private: + const uint8_t *buf; + const size_t len; + const size_t lenminusstep; + size_t idx; +}; + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text_64(const uint8_t *text) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i); i++) { + buf[i] = int8_t(text[i]) < ' ' ? '_' : int8_t(text[i]); + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text(const simd8x64& in) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] < ' ') { buf[i] = '_'; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_input_text(const simd8x64& in, uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] <= ' ') { buf[i] = '_'; } + if (!(mask & (size_t(1) << i))) { buf[i] = ' '; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_mask(uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i<64; i++) { + buf[i] = (mask & (size_t(1) << i)) ? 'X' : ' '; + } + buf[64] = '\0'; + return buf; +} + +template +simdjson_inline buf_block_reader::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {} + +template +simdjson_inline size_t buf_block_reader::block_index() { return idx; } + +template +simdjson_inline bool buf_block_reader::has_full_block() const { + return idx < lenminusstep; +} + +template +simdjson_inline const uint8_t *buf_block_reader::full_block() const { + return &buf[idx]; +} + +template +simdjson_inline size_t buf_block_reader::get_remainder(uint8_t *dst) const { + if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers + std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once. + std::memcpy(dst, buf + idx, len - idx); + return len - idx; +} + +template +simdjson_inline void buf_block_reader::advance() { + idx += STEP_SIZE; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H +/* end file generic/stage1/buf_block_reader.h for ppc64 */ +/* including generic/stage1/json_escape_scanner.h for ppc64: #include */ +/* begin file generic/stage1/json_escape_scanner.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +/** + * Scans for escape characters in JSON, taking care with multiple backslashes (\\n vs. \n). + */ +struct json_escape_scanner { + /** The actual escape characters (the backslashes themselves). */ + uint64_t next_is_escaped = 0ULL; + + struct escaped_and_escape { + /** + * Mask of escaped characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 0100100010100101000 + * n \ \ n \ \ + * ``` + */ + uint64_t escaped; + /** + * Mask of escape characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 1001000101001010001 + * \ \ \ \ \ \ \ + * ``` + */ + uint64_t escape; + }; + + /** + * Get a mask of both escape and escaped characters (the characters following a backslash). + * + * @param potential_escape A mask of the character that can escape others (but could be + * escaped itself). e.g. block.eq('\\') + */ + simdjson_really_inline escaped_and_escape next(uint64_t backslash) noexcept { + +#if !SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT + if (!backslash) { return {next_escaped_without_backslashes(), 0}; } +#endif + + // | | Mask (shows characters instead of 1's) | Depth | Instructions | + // |--------------------------------|----------------------------------------|-------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | | | + // | | ` even odd even odd odd` | | | + // | potential_escape | ` \ \\\ \\\ \\\\ \\\\ \\\` | 1 | 1 (backslash & ~first_is_escaped) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 5 | 5 (next_escape_and_terminal_code()) + // | escaped | `\ \ n \ n \ \ \ \ \ ` X | 6 | 7 (escape_and_terminal_code ^ (potential_escape | first_is_escaped)) + // | escape | ` \ \ \ \ \ \ \ \ \ \` | 6 | 8 (escape_and_terminal_code & backslash) + // | first_is_escaped | `\ ` | 7 (*) | 9 (escape >> 63) () + // (*) this is not needed until the next iteration + uint64_t escape_and_terminal_code = next_escape_and_terminal_code(backslash & ~this->next_is_escaped); + uint64_t escaped = escape_and_terminal_code ^ (backslash | this->next_is_escaped); + uint64_t escape = escape_and_terminal_code & backslash; + this->next_is_escaped = escape >> 63; + return {escaped, escape}; + } + +private: + static constexpr const uint64_t ODD_BITS = 0xAAAAAAAAAAAAAAAAULL; + + simdjson_really_inline uint64_t next_escaped_without_backslashes() noexcept { + uint64_t escaped = this->next_is_escaped; + this->next_is_escaped = 0; + return escaped; + } + + /** + * Returns a mask of the next escape characters (masking out escaped backslashes), along with + * any non-backslash escape codes. + * + * \n \\n \\\n \\\\n returns: + * \n \ \ \n \ \ + * 11 100 1011 10100 + * + * You are expected to mask out the first bit yourself if the previous block had a trailing + * escape. + * + * & the result with potential_escape to get just the escape characters. + * ^ the result with (potential_escape | first_is_escaped) to get escaped characters. + */ + static simdjson_really_inline uint64_t next_escape_and_terminal_code(uint64_t potential_escape) noexcept { + // If we were to just shift and mask out any odd bits, we'd actually get a *half* right answer: + // any even-aligned backslash runs would be correct! Odd-aligned backslash runs would be + // inverted (\\\ would be 010 instead of 101). + // + // ``` + // string: | ____\\\\_\\\\_____ | + // maybe_escaped | ODD | \ \ \ \ | + // even-aligned ^^^ ^^^^ odd-aligned + // ``` + // + // Taking that into account, our basic strategy is: + // + // 1. Use subtraction to produce a mask with 1's for even-aligned runs and 0's for + // odd-aligned runs. + // 2. XOR all odd bits, which masks out the odd bits in even-aligned runs, and brings IN the + // odd bits in odd-aligned runs. + // 3. & with backslash to clean up any stray bits. + // runs are set to 0, and then XORing with "odd": + // + // | | Mask (shows characters instead of 1's) | Instructions | + // |--------------------------------|----------------------------------------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | + // | | ` even odd even odd odd` | + // | maybe_escaped | ` n \\n \\n \\\_ \\\_ \\` X | 1 (potential_escape << 1) + // | maybe_escaped_and_odd | ` \n_ \\n _ \\\n_ _ \\\__ _\\\_ \\\` | 1 (maybe_escaped | odd) + // | even_series_codes_and_odd | ` n_\\\ _ n_ _\\\\ _ _ ` | 1 (maybe_escaped_and_odd - potential_escape) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 1 (^ odd) + // + + // Escaped characters are characters following an escape. + uint64_t maybe_escaped = potential_escape << 1; + + // To distinguish odd from even escape sequences, therefore, we turn on any *starting* + // escapes that are on an odd byte. (We actually bring in all odd bits, for speed.) + // - Odd runs of backslashes are 0000, and the code at the end ("n" in \n or \\n) is 1. + // - Odd runs of backslashes are 1111, and the code at the end ("n" in \n or \\n) is 0. + // - All other odd bytes are 1, and even bytes are 0. + uint64_t maybe_escaped_and_odd_bits = maybe_escaped | ODD_BITS; + uint64_t even_series_codes_and_odd_bits = maybe_escaped_and_odd_bits - potential_escape; + + // Now we flip all odd bytes back with xor. This: + // - Makes odd runs of backslashes go from 0000 to 1010 + // - Makes even runs of backslashes go from 1111 to 1010 + // - Sets actually-escaped codes to 1 (the n in \n and \\n: \n = 11, \\n = 100) + // - Resets all other bytes to 0 + return even_series_codes_and_odd_bits ^ ODD_BITS; + } +}; + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_escape_scanner.h for ppc64 */ +/* including generic/stage1/json_string_scanner.h for ppc64: #include */ +/* begin file generic/stage1/json_string_scanner.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +struct json_string_block { + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_really_inline json_string_block(uint64_t escaped, uint64_t quote, uint64_t in_string) : + _escaped(escaped), _quote(quote), _in_string(in_string) {} + + // Escaped characters (characters following an escape() character) + simdjson_really_inline uint64_t escaped() const { return _escaped; } + // Real (non-backslashed) quotes + simdjson_really_inline uint64_t quote() const { return _quote; } + // Only characters inside the string (not including the quotes) + simdjson_really_inline uint64_t string_content() const { return _in_string & ~_quote; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_inside_string(uint64_t mask) const { return mask & _in_string; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_outside_string(uint64_t mask) const { return mask & ~_in_string; } + // Tail of string (everything except the start quote) + simdjson_really_inline uint64_t string_tail() const { return _in_string ^ _quote; } + + // escaped characters (backslashed--does not include the hex characters after \u) + uint64_t _escaped; + // real quotes (non-escaped ones) + uint64_t _quote; + // string characters (includes start quote but not end quote) + uint64_t _in_string; +}; + +// Scans blocks for string characters, storing the state necessary to do so +class json_string_scanner { +public: + simdjson_really_inline json_string_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_really_inline error_code finish(); + +private: + // Scans for escape characters + json_escape_scanner escape_scanner{}; + // Whether the last iteration was still inside a string (all 1's = true, all 0's = false). + uint64_t prev_in_string = 0ULL; +}; + +// +// Return a mask of all string characters plus end quotes. +// +// prev_escaped is overflow saying whether the next character is escaped. +// prev_in_string is overflow saying whether we're still in a string. +// +// Backslash sequences outside of quotes will be detected in stage 2. +// +simdjson_really_inline json_string_block json_string_scanner::next(const simd::simd8x64& in) { + const uint64_t backslash = in.eq('\\'); + const uint64_t escaped = escape_scanner.next(backslash).escaped; + const uint64_t quote = in.eq('"') & ~escaped; + + // + // prefix_xor flips on bits inside the string (and flips off the end quote). + // + // Then we xor with prev_in_string: if we were in a string already, its effect is flipped + // (characters inside strings are outside, and characters outside strings are inside). + // + const uint64_t in_string = prefix_xor(quote) ^ prev_in_string; + + // + // Check if we're still in a string at the end of the box so the next block will know + // + prev_in_string = uint64_t(static_cast(in_string) >> 63); + + // Use ^ to turn the beginning quote off, and the end quote on. + + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_string_block(escaped, quote, in_string); +} + +simdjson_really_inline error_code json_string_scanner::finish() { + if (prev_in_string) { + return UNCLOSED_STRING; + } + return SUCCESS; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_string_scanner.h for ppc64 */ +/* including generic/stage1/utf8_lookup4_algorithm.h for ppc64: #include */ +/* begin file generic/stage1/utf8_lookup4_algorithm.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace utf8_validation { + +using namespace simd; + + simdjson_inline simd8 check_special_cases(const simd8 input, const simd8 prev1) { +// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII) +// Bit 1 = Too Long (ASCII followed by continuation) +// Bit 2 = Overlong 3-byte +// Bit 4 = Surrogate +// Bit 5 = Overlong 2-byte +// Bit 7 = Two Continuations + constexpr const uint8_t TOO_SHORT = 1<<0; // 11______ 0_______ + // 11______ 11______ + constexpr const uint8_t TOO_LONG = 1<<1; // 0_______ 10______ + constexpr const uint8_t OVERLONG_3 = 1<<2; // 11100000 100_____ + constexpr const uint8_t SURROGATE = 1<<4; // 11101101 101_____ + constexpr const uint8_t OVERLONG_2 = 1<<5; // 1100000_ 10______ + constexpr const uint8_t TWO_CONTS = 1<<7; // 10______ 10______ + constexpr const uint8_t TOO_LARGE = 1<<3; // 11110100 1001____ + // 11110100 101_____ + // 11110101 1001____ + // 11110101 101_____ + // 1111011_ 1001____ + // 1111011_ 101_____ + // 11111___ 1001____ + // 11111___ 101_____ + constexpr const uint8_t TOO_LARGE_1000 = 1<<6; + // 11110101 1000____ + // 1111011_ 1000____ + // 11111___ 1000____ + constexpr const uint8_t OVERLONG_4 = 1<<6; // 11110000 1000____ + + const simd8 byte_1_high = prev1.shr<4>().lookup_16( + // 0_______ ________ + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + // 10______ ________ + TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS, + // 1100____ ________ + TOO_SHORT | OVERLONG_2, + // 1101____ ________ + TOO_SHORT, + // 1110____ ________ + TOO_SHORT | OVERLONG_3 | SURROGATE, + // 1111____ ________ + TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4 + ); + constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 . + const simd8 byte_1_low = (prev1 & 0x0F).lookup_16( + // ____0000 ________ + CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4, + // ____0001 ________ + CARRY | OVERLONG_2, + // ____001_ ________ + CARRY, + CARRY, + + // ____0100 ________ + CARRY | TOO_LARGE, + // ____0101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____011_ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + + // ____1___ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____1101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000 + ); + const simd8 byte_2_high = input.shr<4>().lookup_16( + // ________ 0_______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + + // ________ 1000____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4, + // ________ 1001____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE, + // ________ 101_____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + + // ________ 11______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT + ); + return (byte_1_high & byte_1_low & byte_2_high); + } + simdjson_inline simd8 check_multibyte_lengths(const simd8 input, + const simd8 prev_input, const simd8 sc) { + simd8 prev2 = input.prev<2>(prev_input); + simd8 prev3 = input.prev<3>(prev_input); + simd8 must23 = simd8(must_be_2_3_continuation(prev2, prev3)); + simd8 must23_80 = must23 & uint8_t(0x80); + return must23_80 ^ sc; + } + + // + // Return nonzero if there are incomplete multibyte characters at the end of the block: + // e.g. if there is a 4-byte character, but it's 3 bytes from the end. + // + simdjson_inline simd8 is_incomplete(const simd8 input) { + // If the previous input's last 3 bytes match this, they're too short (they ended at EOF): + // ... 1111____ 111_____ 11______ +#if SIMDJSON_IMPLEMENTATION_ICELAKE + static const uint8_t max_array[64] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#else + static const uint8_t max_array[32] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#endif + const simd8 max_value(&max_array[sizeof(max_array)-sizeof(simd8)]); + return input.gt_bits(max_value); + } + + struct utf8_checker { + // If this is nonzero, there has been a UTF-8 error. + simd8 error; + // The last input we received + simd8 prev_input_block; + // Whether the last input we received was incomplete (used for ASCII fast path) + simd8 prev_incomplete; + + // + // Check whether the current bytes are valid UTF-8. + // + simdjson_inline void check_utf8_bytes(const simd8 input, const simd8 prev_input) { + // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes + // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers) + simd8 prev1 = input.prev<1>(prev_input); + simd8 sc = check_special_cases(input, prev1); + this->error |= check_multibyte_lengths(input, prev_input, sc); + } + + // The only problem that can happen at EOF is that a multibyte character is too short + // or a byte value too large in the last bytes: check_special_cases only checks for bytes + // too large in the first of two bytes. + simdjson_inline void check_eof() { + // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't + // possibly finish them. + this->error |= this->prev_incomplete; + } + + simdjson_inline void check_next_input(const simd8x64& input) { + if(simdjson_likely(is_ascii(input))) { + this->error |= this->prev_incomplete; + } else { + // you might think that a for-loop would work, but under Visual Studio, it is not good enough. + static_assert((simd8x64::NUM_CHUNKS == 1) + ||(simd8x64::NUM_CHUNKS == 2) + || (simd8x64::NUM_CHUNKS == 4), + "We support one, two or four chunks per 64-byte block."); + SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 1) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 2) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 4) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + this->check_utf8_bytes(input.chunks[2], input.chunks[1]); + this->check_utf8_bytes(input.chunks[3], input.chunks[2]); + } + this->prev_incomplete = is_incomplete(input.chunks[simd8x64::NUM_CHUNKS-1]); + this->prev_input_block = input.chunks[simd8x64::NUM_CHUNKS-1]; + } + } + // do not forget to call check_eof! + simdjson_inline error_code errors() { + return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS; + } + + }; // struct utf8_checker +} // namespace utf8_validation + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H +/* end file generic/stage1/utf8_lookup4_algorithm.h for ppc64 */ +/* including generic/stage1/json_scanner.h for ppc64: #include */ +/* begin file generic/stage1/json_scanner.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +/** + * A block of scanned json, with information on operators and scalars. + * + * We seek to identify pseudo-structural characters. Anything that is inside + * a string must be omitted (hence & ~_string.string_tail()). + * Otherwise, pseudo-structural characters come in two forms. + * 1. We have the structural characters ([,],{,},:, comma). The + * term 'structural character' is from the JSON RFC. + * 2. We have the 'scalar pseudo-structural characters'. + * Scalars are quotes, and any character except structural characters and white space. + * + * To identify the scalar pseudo-structural characters, we must look at what comes + * before them: it must be a space, a quote or a structural characters. + * Starting with simdjson v0.3, we identify them by + * negation: we identify everything that is followed by a non-quote scalar, + * and we negate that. Whatever remains must be a 'scalar pseudo-structural character'. + */ +struct json_block { +public: + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_inline json_block(json_string_block&& string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(std::move(string)), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + simdjson_inline json_block(json_string_block string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + + /** + * The start of structurals. + * In simdjson prior to v0.3, these were called the pseudo-structural characters. + **/ + simdjson_inline uint64_t structural_start() const noexcept { return potential_structural_start() & ~_string.string_tail(); } + /** All JSON whitespace (i.e. not in a string) */ + simdjson_inline uint64_t whitespace() const noexcept { return non_quote_outside_string(_characters.whitespace()); } + + // Helpers + + /** Whether the given characters are inside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_inside_string(uint64_t mask) const noexcept { return _string.non_quote_inside_string(mask); } + /** Whether the given characters are outside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_outside_string(uint64_t mask) const noexcept { return _string.non_quote_outside_string(mask); } + + // string and escape characters + json_string_block _string; + // whitespace, structural characters ('operators'), scalars + json_character_block _characters; + // whether the previous character was a scalar + uint64_t _follows_potential_nonquote_scalar; +private: + // Potential structurals (i.e. disregarding strings) + + /** + * structural elements ([,],{,},:, comma) plus scalar starts like 123, true and "abc". + * They may reside inside a string. + **/ + simdjson_inline uint64_t potential_structural_start() const noexcept { return _characters.op() | potential_scalar_start(); } + /** + * The start of non-operator runs, like 123, true and "abc". + * It main reside inside a string. + **/ + simdjson_inline uint64_t potential_scalar_start() const noexcept { + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // Whenever it is preceded by something that is not a structural element ({,},[,],:, ") nor a white-space + // then we know that it is irrelevant structurally. + return _characters.scalar() & ~follows_potential_scalar(); + } + /** + * Whether the given character is immediately after a non-operator like 123, true. + * The characters following a quote are not included. + */ + simdjson_inline uint64_t follows_potential_scalar() const noexcept { + // _follows_potential_nonquote_scalar: is defined as marking any character that follows a character + // that is not a structural element ({,},[,],:, comma) nor a quote (") and that is not a + // white space. + // It is understood that within quoted region, anything at all could be marked (irrelevant). + return _follows_potential_nonquote_scalar; + } +}; + +/** + * Scans JSON for important bits: structural characters or 'operators', strings, and scalars. + * + * The scanner starts by calculating two distinct things: + * - string characters (taking \" into account) + * - structural characters or 'operators' ([]{},:, comma) + * and scalars (runs of non-operators like 123, true and "abc") + * + * To minimize data dependency (a key component of the scanner's speed), it finds these in parallel: + * in particular, the operator/scalar bit will find plenty of things that are actually part of + * strings. When we're done, json_block will fuse the two together by masking out tokens that are + * part of a string. + */ +class json_scanner { +public: + json_scanner() = default; + simdjson_inline json_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_inline error_code finish(); + +private: + // Whether the last character of the previous iteration is part of a scalar token + // (anything except whitespace or a structural character/'operator'). + uint64_t prev_scalar = 0ULL; + json_string_scanner string_scanner{}; +}; + + +// +// Check if the current character immediately follows a matching character. +// +// For example, this checks for quotes with backslashes in front of them: +// +// const uint64_t backslashed_quote = in.eq('"') & immediately_follows(in.eq('\'), prev_backslash); +// +simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) { + const uint64_t result = match << 1 | overflow; + overflow = match >> 63; + return result; +} + +simdjson_inline json_block json_scanner::next(const simd::simd8x64& in) { + json_string_block strings = string_scanner.next(in); + // identifies the white-space and the structural characters + json_character_block characters = json_character_block::classify(in); + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // We want follows_scalar to mark anything that follows a non-quote scalar (so letters and numbers). + // + // A terminal quote should either be followed by a structural character (comma, brace, bracket, colon) + // or nothing. However, we still want ' "a string"true ' to mark the 't' of 'true' as a potential + // pseudo-structural character just like we would if we had ' "a string" true '; otherwise we + // may need to add an extra check when parsing strings. + // + // Performance: there are many ways to skin this cat. + const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote(); + uint64_t follows_nonquote_scalar = follows(nonquote_scalar, prev_scalar); + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_block( + strings,// strings is a function-local object so either it moves or the copy is elided. + characters, + follows_nonquote_scalar + ); +} + +simdjson_inline error_code json_scanner::finish() { + return string_scanner.finish(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H +/* end file generic/stage1/json_scanner.h for ppc64 */ + +// All other declarations +/* including generic/stage1/find_next_document_index.h for ppc64: #include */ +/* begin file generic/stage1/find_next_document_index.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +/** + * This algorithm is used to quickly identify the last structural position that + * makes up a complete document. + * + * It does this by going backwards and finding the last *document boundary* (a + * place where one value follows another without a comma between them). If the + * last document (the characters after the boundary) has an equal number of + * start and end brackets, it is considered complete. + * + * Simply put, we iterate over the structural characters, starting from + * the end. We consider that we found the end of a JSON document when the + * first element of the pair is NOT one of these characters: '{' '[' ':' ',' + * and when the second element is NOT one of these characters: '}' ']' ':' ','. + * + * This simple comparison works most of the time, but it does not cover cases + * where the batch's structural indexes contain a perfect amount of documents. + * In such a case, we do not have access to the structural index which follows + * the last document, therefore, we do not have access to the second element in + * the pair, and that means we cannot identify the last document. To fix this + * issue, we keep a count of the open and closed curly/square braces we found + * while searching for the pair. When we find a pair AND the count of open and + * closed curly/square braces is the same, we know that we just passed a + * complete document, therefore the last json buffer location is the end of the + * batch. + */ +simdjson_inline uint32_t find_next_document_index(dom_parser_implementation &parser) { + // Variant: do not count separately, just figure out depth + if(parser.n_structural_indexes == 0) { return 0; } + auto arr_cnt = 0; + auto obj_cnt = 0; + for (auto i = parser.n_structural_indexes - 1; i > 0; i--) { + auto idxb = parser.structural_indexes[i]; + switch (parser.buf[idxb]) { + case ':': + case ',': + continue; + case '}': + obj_cnt--; + continue; + case ']': + arr_cnt--; + continue; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + auto idxa = parser.structural_indexes[i - 1]; + switch (parser.buf[idxa]) { + case '{': + case '[': + case ':': + case ',': + continue; + } + // Last document is complete, so the next document will appear after! + if (!arr_cnt && !obj_cnt) { + return parser.n_structural_indexes; + } + // Last document is incomplete; mark the document at i + 1 as the next one + return i; + } + // If we made it to the end, we want to finish counting to see if we have a full document. + switch (parser.buf[parser.structural_indexes[0]]) { + case '}': + obj_cnt--; + break; + case ']': + arr_cnt--; + break; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + if (!arr_cnt && !obj_cnt) { + // We have a complete document. + return parser.n_structural_indexes; + } + return 0; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H +/* end file generic/stage1/find_next_document_index.h for ppc64 */ +/* including generic/stage1/json_minifier.h for ppc64: #include */ +/* begin file generic/stage1/json_minifier.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +class json_minifier { +public: + template + static error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept; + +private: + simdjson_inline json_minifier(uint8_t *_dst) + : dst{_dst} + {} + template + simdjson_inline void step(const uint8_t *block_buf, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block); + simdjson_inline error_code finish(uint8_t *dst_start, size_t &dst_len); + json_scanner scanner{}; + uint8_t *dst; +}; + +simdjson_inline void json_minifier::next(const simd::simd8x64& in, const json_block& block) { + uint64_t mask = block.whitespace(); + dst += in.compress(mask, dst); +} + +simdjson_inline error_code json_minifier::finish(uint8_t *dst_start, size_t &dst_len) { + error_code error = scanner.finish(); + if (error) { dst_len = 0; return error; } + dst_len = dst - dst_start; + return SUCCESS; +} + +template<> +simdjson_inline void json_minifier::step<128>(const uint8_t *block_buf, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + simd::simd8x64 in_2(block_buf+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1); + this->next(in_2, block_2); + reader.advance(); +} + +template<> +simdjson_inline void json_minifier::step<64>(const uint8_t *block_buf, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + json_block block_1 = scanner.next(in_1); + this->next(block_buf, block_1); + reader.advance(); +} + +template +error_code json_minifier::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept { + buf_block_reader reader(buf, len); + json_minifier minifier(dst); + + // Index the first n-1 blocks + while (reader.has_full_block()) { + minifier.step(reader.full_block(), reader); + } + + // Index the last (remainder) block, padded with spaces + uint8_t block[STEP_SIZE]; + size_t remaining_bytes = reader.get_remainder(block); + if (remaining_bytes > 0) { + // We do not want to write directly to the output stream. Rather, we write + // to a local buffer (for safety). + uint8_t out_block[STEP_SIZE]; + uint8_t * const guarded_dst{minifier.dst}; + minifier.dst = out_block; + minifier.step(block, reader); + size_t to_write = minifier.dst - out_block; + // In some cases, we could be enticed to consider the padded spaces + // as part of the string. This is fine as long as we do not write more + // than we consumed. + if(to_write > remaining_bytes) { to_write = remaining_bytes; } + memcpy(guarded_dst, out_block, to_write); + minifier.dst = guarded_dst + to_write; + } + return minifier.finish(dst, dst_len); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H +/* end file generic/stage1/json_minifier.h for ppc64 */ +/* including generic/stage1/json_structural_indexer.h for ppc64: #include */ +/* begin file generic/stage1/json_structural_indexer.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +class bit_indexer { +public: + uint32_t *tail; + + simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {} + +#if SIMDJSON_PREFER_REVERSE_BITS + /** + * ARM lacks a fast trailing zero instruction, but it has a fast + * bit reversal instruction and a fast leading zero instruction. + * Thus it may be profitable to reverse the bits (once) and then + * to rely on a sequence of instructions that call the leading + * zero instruction. + * + * Performance notes: + * The chosen routine is not optimal in terms of data dependency + * since zero_leading_bit might require two instructions. However, + * it tends to minimize the total number of instructions which is + * beneficial. + */ + simdjson_inline void write_index(uint32_t idx, uint64_t& rev_bits, int i) { + int lz = leading_zeroes(rev_bits); + this->tail[i] = static_cast(idx) + lz; + rev_bits = zero_leading_bit(rev_bits, lz); + } +#else + /** + * Under recent x64 systems, we often have both a fast trailing zero + * instruction and a fast 'clear-lower-bit' instruction so the following + * algorithm can be competitive. + */ + + simdjson_inline void write_index(uint32_t idx, uint64_t& bits, int i) { + this->tail[i] = idx + trailing_zeroes(bits); + bits = clear_lowest_bit(bits); + } +#endif // SIMDJSON_PREFER_REVERSE_BITS + + template + simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) { + write_index(idx, bits, START); + SIMDJSON_IF_CONSTEXPR (N > 1) { + write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits); + } + return START+N; + } + + template + simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) { + write_indexes(idx, bits); + SIMDJSON_IF_CONSTEXPR ((START+STEP) < END) { + if (simdjson_unlikely((START+STEP) < cnt)) { + write_indexes_stepped<(START+STEP(idx, bits, cnt); + } + } + return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP; + } + + // flatten out values in 'bits' assuming that they are are to have values of idx + // plus their position in the bitvector, and store these indexes at + // base_ptr[base] incrementing base as we go + // will potentially store extra values beyond end of valid bits, so base_ptr + // needs to be large enough to handle this + // + // If the kernel sets SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER, then it + // will provide its own version of the code. +#ifdef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + simdjson_inline void write(uint32_t idx, uint64_t bits); +#else + simdjson_inline void write(uint32_t idx, uint64_t bits) { + // In some instances, the next branch is expensive because it is mispredicted. + // Unfortunately, in other cases, + // it helps tremendously. + if (bits == 0) + return; + + int cnt = static_cast(count_ones(bits)); + +#if SIMDJSON_PREFER_REVERSE_BITS + bits = reverse_bits(bits); +#endif +#ifdef SIMDJSON_STRUCTURAL_INDEXER_STEP + static constexpr const int STEP = SIMDJSON_STRUCTURAL_INDEXER_STEP; +#else + static constexpr const int STEP = 4; +#endif + static constexpr const int STEP_UNTIL = 24; + + write_indexes_stepped<0, STEP_UNTIL, STEP>(idx, bits, cnt); + SIMDJSON_IF_CONSTEXPR (STEP_UNTIL < 64) { + if (simdjson_unlikely(STEP_UNTIL < cnt)) { + for (int i=STEP_UNTIL; itail += cnt; + } +#endif // SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +}; + +class json_structural_indexer { +public: + /** + * Find the important bits of JSON in a 128-byte chunk, and add them to structural_indexes. + * + * @param partial Setting the partial parameter to true allows the find_structural_bits to + * tolerate unclosed strings. The caller should still ensure that the input is valid UTF-8. If + * you are processing substrings, you may want to call on a function like trimmed_length_safe_utf8. + */ + template + static error_code index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept; + +private: + simdjson_inline json_structural_indexer(uint32_t *structural_indexes); + template + simdjson_inline void step(const uint8_t *block, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block, size_t idx); + simdjson_inline error_code finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial); + + json_scanner scanner{}; + utf8_checker checker{}; + bit_indexer indexer; + uint64_t prev_structurals = 0; + uint64_t unescaped_chars_error = 0; +}; + +simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {} + +// Skip the last character if it is partial +simdjson_inline size_t trim_partial_utf8(const uint8_t *buf, size_t len) { + if (simdjson_unlikely(len < 3)) { + switch (len) { + case 2: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 2 bytes left + return len; + case 1: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + return len; + case 0: + return len; + } + } + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 1 byte left + if (buf[len-3] >= 0xf0) { return len-3; } // 4-byte characters with only 3 bytes left + return len; +} + +// +// PERF NOTES: +// We pipe 2 inputs through these stages: +// 1. Load JSON into registers. This takes a long time and is highly parallelizable, so we load +// 2 inputs' worth at once so that by the time step 2 is looking for them input, it's available. +// 2. Scan the JSON for critical data: strings, scalars and operators. This is the critical path. +// The output of step 1 depends entirely on this information. These functions don't quite use +// up enough CPU: the second half of the functions is highly serial, only using 1 execution core +// at a time. The second input's scans has some dependency on the first ones finishing it, but +// they can make a lot of progress before they need that information. +// 3. Step 1 doesn't use enough capacity, so we run some extra stuff while we're waiting for that +// to finish: utf-8 checks and generating the output from the last iteration. +// +// The reason we run 2 inputs at a time, is steps 2 and 3 are *still* not enough to soak up all +// available capacity with just one input. Running 2 at a time seems to give the CPU a good enough +// workout. +// +template +error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept { + if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; } + // We guard the rest of the code so that we can assume that len > 0 throughout. + if (len == 0) { return EMPTY; } + if (is_streaming(partial)) { + len = trim_partial_utf8(buf, len); + // If you end up with an empty window after trimming + // the partial UTF-8 bytes, then chances are good that you + // have an UTF-8 formatting error. + if(len == 0) { return UTF8_ERROR; } + } + buf_block_reader reader(buf, len); + json_structural_indexer indexer(parser.structural_indexes.get()); + + // Read all but the last block + while (reader.has_full_block()) { + indexer.step(reader.full_block(), reader); + } + // Take care of the last block (will always be there unless file is empty which is + // not supposed to happen.) + uint8_t block[STEP_SIZE]; + if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; } + indexer.step(block, reader); + return indexer.finish(parser, reader.block_index(), len, partial); +} + +template<> +simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block); + simd::simd8x64 in_2(block+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1, reader.block_index()); + this->next(in_2, block_2, reader.block_index()+64); + reader.advance(); +} + +template<> +simdjson_inline void json_structural_indexer::step<64>(const uint8_t *block, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block); + json_block block_1 = scanner.next(in_1); + this->next(in_1, block_1, reader.block_index()); + reader.advance(); +} + +simdjson_inline void json_structural_indexer::next(const simd::simd8x64& in, const json_block& block, size_t idx) { + uint64_t unescaped = in.lteq(0x1F); +#if SIMDJSON_UTF8VALIDATION + checker.check_next_input(in); +#endif + indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser + prev_structurals = block.structural_start(); + unescaped_chars_error |= block.non_quote_inside_string(unescaped); +} + +simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) { + // Write out the final iteration's structurals + indexer.write(uint32_t(idx-64), prev_structurals); + error_code error = scanner.finish(); + // We deliberately break down the next expression so that it is + // human readable. + const bool should_we_exit = is_streaming(partial) ? + ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING + : (error != SUCCESS); // if partial is false, we must have SUCCESS + const bool have_unclosed_string = (error == UNCLOSED_STRING); + if (simdjson_unlikely(should_we_exit)) { return error; } + + if (unescaped_chars_error) { + return UNESCAPED_CHARS; + } + parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get()); + /*** + * The On Demand API requires special padding. + * + * This is related to https://github.com/simdjson/simdjson/issues/906 + * Basically, we want to make sure that if the parsing continues beyond the last (valid) + * structural character, it quickly stops. + * Only three structural characters can be repeated without triggering an error in JSON: [,] and }. + * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing + * continues, then it must be [,] or }. + * Suppose it is ] or }. We backtrack to the first character, what could it be that would + * not trigger an error? It could be ] or } but no, because you can't start a document that way. + * It can't be a comma, a colon or any simple value. So the only way we could continue is + * if the repeated character is [. But if so, the document must start with [. But if the document + * starts with [, it should end with ]. If we enforce that rule, then we would get + * ][[ which is invalid. + * + * This is illustrated with the test array_iterate_unclosed_error() on the following input: + * R"({ "a": [,,)" + **/ + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final + parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len); + parser.structural_indexes[parser.n_structural_indexes + 2] = 0; + parser.next_structural_index = 0; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + return EMPTY; + } + if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) { + return UNEXPECTED_ERROR; + } + if (partial == stage1_mode::streaming_partial) { + // If we have an unclosed string, then the last structural + // will be the quote and we want to make sure to omit it. + if(have_unclosed_string) { + parser.n_structural_indexes--; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; } + } + // We truncate the input to the end of the last complete document (or zero). + auto new_structural_indexes = find_next_document_index(parser); + if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) { + if(parser.structural_indexes[0] == 0) { + // If the buffer is partial and we started at index 0 but the document is + // incomplete, it's too big to parse. + return CAPACITY; + } else { + // It is possible that the document could be parsed, we just had a lot + // of white space. + parser.n_structural_indexes = 0; + return EMPTY; + } + } + + parser.n_structural_indexes = new_structural_indexes; + } else if (partial == stage1_mode::streaming_final) { + if(have_unclosed_string) { parser.n_structural_indexes--; } + // We truncate the input to the end of the last complete document (or zero). + // Because partial == stage1_mode::streaming_final, it means that we may + // silently ignore trailing garbage. Though it sounds bad, we do it + // deliberately because many people who have streams of JSON documents + // will truncate them for processing. E.g., imagine that you are uncompressing + // the data from a size file or receiving it in chunks from the network. You + // may not know where exactly the last document will be. Meanwhile the + // document_stream instances allow people to know the JSON documents they are + // parsing (see the iterator.source() method). + parser.n_structural_indexes = find_next_document_index(parser); + // We store the initial n_structural_indexes so that the client can see + // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes, + // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len, + // otherwise, it will copy some prior index. + parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes]; + // This next line is critical, do not change it unless you understand what you are + // doing. + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + // We tolerate an unclosed string at the very end of the stream. Indeed, users + // often load their data in bulk without being careful and they want us to ignore + // the trailing garbage. + return EMPTY; + } + } + checker.check_eof(); + return checker.errors(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +// Clear CUSTOM_BIT_INDEXER so other implementations can set it if they need to. +#undef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H +/* end file generic/stage1/json_structural_indexer.h for ppc64 */ +/* including generic/stage1/utf8_validator.h for ppc64: #include */ +/* begin file generic/stage1/utf8_validator.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage1 { + +/** + * Validates that the string is actual UTF-8. + */ +template +bool generic_validate_utf8(const uint8_t * input, size_t length) { + checker c{}; + buf_block_reader<64> reader(input, length); + while (reader.has_full_block()) { + simd::simd8x64 in(reader.full_block()); + c.check_next_input(in); + reader.advance(); + } + uint8_t block[64]{}; + reader.get_remainder(block); + simd::simd8x64 in(block); + c.check_next_input(in); + reader.advance(); + c.check_eof(); + return c.errors() == error_code::SUCCESS; +} + +bool generic_validate_utf8(const char * input, size_t length) { + return generic_validate_utf8(reinterpret_cast(input),length); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H +/* end file generic/stage1/utf8_validator.h for ppc64 */ +/* end file generic/stage1/amalgamated.h for ppc64 */ +/* including generic/stage2/amalgamated.h for ppc64: #include */ +/* begin file generic/stage2/amalgamated.h for ppc64 */ +// Stuff other things depend on +/* including generic/stage2/base.h for ppc64: #include */ +/* begin file generic/stage2/base.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage2 { + +class json_iterator; +class structural_iterator; +struct tape_builder; +struct tape_writer; + +} // namespace stage2 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_BASE_H +/* end file generic/stage2/base.h for ppc64 */ +/* including generic/stage2/tape_writer.h for ppc64: #include */ +/* begin file generic/stage2/tape_writer.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage2 { + +struct tape_writer { + /** The next place to write to tape */ + uint64_t *next_tape_loc; + + /** Write a signed 64-bit value to tape. */ + simdjson_inline void append_s64(int64_t value) noexcept; + + /** Write an unsigned 64-bit value to tape. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + + /** Write a double value to tape. */ + simdjson_inline void append_double(double value) noexcept; + + /** + * Append a tape entry (an 8-bit type,and 56 bits worth of value). + */ + simdjson_inline void append(uint64_t val, internal::tape_type t) noexcept; + + /** + * Skip the current tape entry without writing. + * + * Used to skip the start of the container, since we'll come back later to fill it in when the + * container ends. + */ + simdjson_inline void skip() noexcept; + + /** + * Skip the number of tape entries necessary to write a large u64 or i64. + */ + simdjson_inline void skip_large_integer() noexcept; + + /** + * Skip the number of tape entries necessary to write a double. + */ + simdjson_inline void skip_double() noexcept; + + /** + * Write a value to a known location on tape. + * + * Used to go back and write out the start of a container after the container ends. + */ + simdjson_inline static void write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept; + +private: + /** + * Append both the tape entry, and a supplementary value following it. Used for types that need + * all 64 bits, such as double and uint64_t. + */ + template + simdjson_inline void append2(uint64_t val, T val2, internal::tape_type t) noexcept; +}; // struct tape_writer + +simdjson_inline void tape_writer::append_s64(int64_t value) noexcept { + append2(0, value, internal::tape_type::INT64); +} + +simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept { + append(0, internal::tape_type::UINT64); + *next_tape_loc = value; + next_tape_loc++; +} + +/** Write a double value to tape. */ +simdjson_inline void tape_writer::append_double(double value) noexcept { + append2(0, value, internal::tape_type::DOUBLE); +} + +simdjson_inline void tape_writer::skip() noexcept { + next_tape_loc++; +} + +simdjson_inline void tape_writer::skip_large_integer() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::skip_double() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept { + *next_tape_loc = val | ((uint64_t(char(t))) << 56); + next_tape_loc++; +} + +template +simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept { + append(val, t); + static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!"); + memcpy(next_tape_loc, &val2, sizeof(val2)); + next_tape_loc++; +} + +simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept { + tape_loc = val | ((uint64_t(char(t))) << 56); +} + +} // namespace stage2 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H +/* end file generic/stage2/tape_writer.h for ppc64 */ +/* including generic/stage2/logger.h for ppc64: #include */ +/* begin file generic/stage2/logger.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + + +// This is for an internal-only stage 2 specific logger. +// Set LOG_ENABLED = true to log what stage 2 is doing! +namespace simdjson { +namespace ppc64 { +namespace { +namespace logger { + + static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + static constexpr const int LOG_EVENT_LEN = 20; + static constexpr const int LOG_BUFFER_LEN = 30; + static constexpr const int LOG_SMALL_BUFFER_LEN = 10; + static constexpr const int LOG_INDEX_LEN = 5; + + static int log_depth; // Not threadsafe. Log only. + + // Helper to turn unprintable or newline characters into spaces + static simdjson_inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } + } + + // Print the header and set up log_start + static simdjson_inline void log_start() { + if (LOG_ENABLED) { + log_depth = 0; + printf("\n"); + printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#"); + printf("|%.*s|%.*s|%.*s|%.*s|--------|\n", LOG_EVENT_LEN+2, DASHES, LOG_BUFFER_LEN+2, DASHES, LOG_SMALL_BUFFER_LEN+2, DASHES, 5+2, DASHES); + } + } + + simdjson_unused static simdjson_inline void log_string(const char *message) { + if (LOG_ENABLED) { + printf("%s\n", message); + } + } + + // Logs a single line from the stage 2 DOM parser + template + static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) { + if (LOG_ENABLED) { + printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title); + auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1; + auto next_index = structurals.next_structural; + auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast(" "); + auto next = &structurals.buf[*next_index]; + { + // Print the next N characters in the buffer. + printf("| "); + // Otherwise, print the characters starting from the buffer position. + // Print spaces for unprintable or newline characters. + for (int i=0;i */ +/* begin file generic/stage2/json_iterator.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage2 { + +class json_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + uint32_t depth{0}; + + /** + * Walk the JSON document. + * + * The visitor receives callbacks when values are encountered. All callbacks pass the iterator as + * the first parameter; some callbacks have other parameters as well: + * + * - visit_document_start() - at the beginning. + * - visit_document_end() - at the end (if things were successful). + * + * - visit_array_start() - at the start `[` of a non-empty array. + * - visit_array_end() - at the end `]` of a non-empty array. + * - visit_empty_array() - when an empty array is encountered. + * + * - visit_object_end() - at the start `]` of a non-empty object. + * - visit_object_start() - at the end `]` of a non-empty object. + * - visit_empty_object() - when an empty object is encountered. + * - visit_key(const uint8_t *key) - when a key in an object field is encountered. key is + * guaranteed to point at the first quote of the string (`"key"`). + * - visit_primitive(const uint8_t *value) - when a value is a string, number, boolean or null. + * - visit_root_primitive(iter, uint8_t *value) - when the top-level value is a string, number, boolean or null. + * + * - increment_count(iter) - each time a value is found in an array or object. + */ + template + simdjson_warn_unused simdjson_inline error_code walk_document(V &visitor) noexcept; + + /** + * Create an iterator capable of walking a JSON document. + * + * The document must have already passed through stage 1. + */ + simdjson_inline json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index); + + /** + * Look at the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *peek() const noexcept; + /** + * Advance to the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *advance() noexcept; + /** + * Get the remaining length of the document, from the start of the current token. + */ + simdjson_inline size_t remaining_len() const noexcept; + /** + * Check if we are at the end of the document. + * + * If this is true, there are no more tokens. + */ + simdjson_inline bool at_eof() const noexcept; + /** + * Check if we are at the beginning of the document. + */ + simdjson_inline bool at_beginning() const noexcept; + simdjson_inline uint8_t last_structural() const noexcept; + + /** + * Log that a value has been found. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_value(const char *type) const noexcept; + /** + * Log the start of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_start_value(const char *type) const noexcept; + /** + * Log the end of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_end_value(const char *type) const noexcept; + /** + * Log an error. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_error(const char *error) const noexcept; + + template + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(V &visitor, const uint8_t *value) noexcept; + template + simdjson_warn_unused simdjson_inline error_code visit_primitive(V &visitor, const uint8_t *value) noexcept; +}; + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept { + logger::log_start(); + + // + // Start the document + // + if (at_eof()) { return EMPTY; } + log_start_value("document"); + SIMDJSON_TRY( visitor.visit_document_start(*this) ); + + // + // Read first value + // + { + auto value = advance(); + + // Make sure the outer object or array is closed before continuing; otherwise, there are ways we + // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906 + if (!STREAMING) { + switch (*value) { + case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break; + case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break; + } + } + + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break; + } + } + goto document_end; + +// +// Object parser states +// +object_begin: + log_start_value("object"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = false; + SIMDJSON_TRY( visitor.visit_object_start(*this) ); + + { + auto key = advance(); + if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.increment_count(*this) ); + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + +object_field: + if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; } + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +object_continue: + switch (*advance()) { + case ',': + SIMDJSON_TRY( visitor.increment_count(*this) ); + { + auto key = advance(); + if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + goto object_field; + case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end; + default: log_error("No comma between object fields"); return TAPE_ERROR; + } + +scope_end: + depth--; + if (depth == 0) { goto document_end; } + if (dom_parser.is_array[depth]) { goto array_continue; } + goto object_continue; + +// +// Array parser states +// +array_begin: + log_start_value("array"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = true; + SIMDJSON_TRY( visitor.visit_array_start(*this) ); + SIMDJSON_TRY( visitor.increment_count(*this) ); + +array_value: + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +array_continue: + switch (*advance()) { + case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value; + case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end; + default: log_error("Missing comma between array values"); return TAPE_ERROR; + } + +document_end: + log_end_value("document"); + SIMDJSON_TRY( visitor.visit_document_end(*this) ); + + dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]); + + // If we didn't make it to the end, it's an error + if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) { + log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); + return TAPE_ERROR; + } + + return SUCCESS; + +} // walk_document() + +simdjson_inline json_iterator::json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { +} + +simdjson_inline const uint8_t *json_iterator::peek() const noexcept { + return &buf[*(next_structural)]; +} +simdjson_inline const uint8_t *json_iterator::advance() noexcept { + return &buf[*(next_structural++)]; +} +simdjson_inline size_t json_iterator::remaining_len() const noexcept { + return dom_parser.len - *(next_structural-1); +} + +simdjson_inline bool json_iterator::at_eof() const noexcept { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; +} +simdjson_inline bool json_iterator::at_beginning() const noexcept { + return next_structural == dom_parser.structural_indexes.get(); +} +simdjson_inline uint8_t json_iterator::last_structural() const noexcept { + return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]]; +} + +simdjson_inline void json_iterator::log_value(const char *type) const noexcept { + logger::log_line(*this, "", type, ""); +} + +simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept { + logger::log_line(*this, "+", type, ""); + if (logger::LOG_ENABLED) { logger::log_depth++; } +} + +simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept { + if (logger::LOG_ENABLED) { logger::log_depth--; } + logger::log_line(*this, "-", type, ""); +} + +simdjson_inline void json_iterator::log_error(const char *error) const noexcept { + logger::log_line(*this, "", "ERROR", error); +} + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept { + switch (*value) { + case '"': return visitor.visit_root_string(*this, value); + case 't': return visitor.visit_root_true_atom(*this, value); + case 'f': return visitor.visit_root_false_atom(*this, value); + case 'n': return visitor.visit_root_null_atom(*this, value); + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return visitor.visit_root_number(*this, value); + default: + log_error("Document starts with a non-value character"); + return TAPE_ERROR; + } +} +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept { + // Use the fact that most scalars are going to be either strings or numbers. + if(*value == '"') { + return visitor.visit_string(*this, value); + } else if (((*value - '0') < 10) || (*value == '-')) { + return visitor.visit_number(*this, value); + } + // true, false, null are uncommon. + switch (*value) { + case 't': return visitor.visit_true_atom(*this, value); + case 'f': return visitor.visit_false_atom(*this, value); + case 'n': return visitor.visit_null_atom(*this, value); + default: + log_error("Non-value found when value was expected!"); + return TAPE_ERROR; + } +} + +} // namespace stage2 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H +/* end file generic/stage2/json_iterator.h for ppc64 */ +/* including generic/stage2/stringparsing.h for ppc64: #include */ +/* begin file generic/stage2/stringparsing.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses +// It is intended to be included multiple times and compiled multiple times + +namespace simdjson { +namespace ppc64 { +namespace { +/// @private +namespace stringparsing { + +// begin copypasta +// These chars yield themselves: " \ / +// b -> backspace, f -> formfeed, n -> newline, r -> cr, t -> horizontal tab +// u not handled in this table as it's complex +static const uint8_t escape_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x0. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2f, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x4. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c, 0, 0, 0, // 0x5. + 0, 0, 0x08, 0, 0, 0, 0x0c, 0, 0, 0, 0, 0, 0, 0, 0x0a, 0, // 0x6. + 0, 0, 0x0d, 0, 0x09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x7. + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +// handle a unicode codepoint +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint(const uint8_t **src_ptr, + uint8_t **dst_ptr, bool allow_replacement) { + // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD) + constexpr uint32_t substitution_code_point = 0xfffd; + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) != ((static_cast ('\\') << 8) | static_cast ('u'))) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + + // We have already checked that the high surrogate is valid and + // (code_point - 0xd800) < 1024. + // + // Check that code_point_2 is in the range 0xdc00..0xdfff + // and that code_point_2 was parsed from valid hex. + uint32_t low_bit = code_point_2 - 0xdc00; + if (low_bit >> 10) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + code_point = (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + + } + } else if (code_point >= 0xdc00 && code_point <= 0xdfff) { + // If we encounter a low surrogate (not preceded by a high surrogate) + // then we have an error. + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +// handle a unicode codepoint using the wobbly convention +// https://simonsapin.github.io/wtf-8/ +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint_wobbly(const uint8_t **src_ptr, + uint8_t **dst_ptr) { + // It is not ideal that this function is nearly identical to handle_unicode_codepoint. + // + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) == ((static_cast ('\\') << 8) | static_cast ('u'))) { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + uint32_t low_bit = code_point_2 - 0xdc00; + if ((low_bit >> 10) == 0) { + code_point = + (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + } + } + + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +/** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + */ +simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) { + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { + // It is not ideal that this function is nearly identical to parse_string. + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint_wobbly(&src, &dst)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +} // namespace stringparsing +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H +/* end file generic/stage2/stringparsing.h for ppc64 */ +/* including generic/stage2/structural_iterator.h for ppc64: #include */ +/* begin file generic/stage2/structural_iterator.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage2 { + +class structural_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + + // Start a structural + simdjson_inline structural_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { + } + // Get the buffer position of the current structural character + simdjson_inline const uint8_t* current() { + return &buf[*(next_structural-1)]; + } + // Get the current structural character + simdjson_inline char current_char() { + return buf[*(next_structural-1)]; + } + // Get the next structural character without advancing + simdjson_inline char peek_next_char() { + return buf[*next_structural]; + } + simdjson_inline const uint8_t* peek() { + return &buf[*next_structural]; + } + simdjson_inline const uint8_t* advance() { + return &buf[*(next_structural++)]; + } + simdjson_inline char advance_char() { + return buf[*(next_structural++)]; + } + simdjson_inline size_t remaining_len() { + return dom_parser.len - *(next_structural-1); + } + + simdjson_inline bool at_end() { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; + } + simdjson_inline bool at_beginning() { + return next_structural == dom_parser.structural_indexes.get(); + } +}; + +} // namespace stage2 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H +/* end file generic/stage2/structural_iterator.h for ppc64 */ +/* including generic/stage2/tape_builder.h for ppc64: #include */ +/* begin file generic/stage2/tape_builder.h for ppc64 */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace ppc64 { +namespace { +namespace stage2 { + +struct tape_builder { + template + simdjson_warn_unused static simdjson_inline error_code parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept; + + /** Called when a non-empty document starts. */ + simdjson_warn_unused simdjson_inline error_code visit_document_start(json_iterator &iter) noexcept; + /** Called when a non-empty document ends without error. */ + simdjson_warn_unused simdjson_inline error_code visit_document_end(json_iterator &iter) noexcept; + + /** Called when a non-empty array starts. */ + simdjson_warn_unused simdjson_inline error_code visit_array_start(json_iterator &iter) noexcept; + /** Called when a non-empty array ends. */ + simdjson_warn_unused simdjson_inline error_code visit_array_end(json_iterator &iter) noexcept; + /** Called when an empty array is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_array(json_iterator &iter) noexcept; + + /** Called when a non-empty object starts. */ + simdjson_warn_unused simdjson_inline error_code visit_object_start(json_iterator &iter) noexcept; + /** + * Called when a key in a field is encountered. + * + * primitive, visit_object_start, visit_empty_object, visit_array_start, or visit_empty_array + * will be called after this with the field value. + */ + simdjson_warn_unused simdjson_inline error_code visit_key(json_iterator &iter, const uint8_t *key) noexcept; + /** Called when a non-empty object ends. */ + simdjson_warn_unused simdjson_inline error_code visit_object_end(json_iterator &iter) noexcept; + /** Called when an empty object is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_object(json_iterator &iter) noexcept; + + /** + * Called when a string, number, boolean or null is found. + */ + simdjson_warn_unused simdjson_inline error_code visit_primitive(json_iterator &iter, const uint8_t *value) noexcept; + /** + * Called when a string, number, boolean or null is found at the top level of a document (i.e. + * when there is no array or object and the entire document is a single string, number, boolean or + * null. + * + * This is separate from primitive() because simdjson's normal primitive parsing routines assume + * there is at least one more token after the value, which is only true in an array or object. + */ + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_string(json_iterator &iter, const uint8_t *value, bool key = false) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_root_string(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + /** Called each time a new field or element in an array or object is found. */ + simdjson_warn_unused simdjson_inline error_code increment_count(json_iterator &iter) noexcept; + + /** Next location to write to tape */ + tape_writer tape; +private: + /** Next write location in the string buf for stage 2 parsing */ + uint8_t *current_string_buf_loc; + + simdjson_inline tape_builder(dom::document &doc) noexcept; + + simdjson_inline uint32_t next_tape_index(json_iterator &iter) const noexcept; + simdjson_inline void start_container(json_iterator &iter) noexcept; + simdjson_warn_unused simdjson_inline error_code end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_warn_unused simdjson_inline error_code empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_inline uint8_t *on_start_string(json_iterator &iter) noexcept; + simdjson_inline void on_end_string(uint8_t *dst) noexcept; +}; // struct tape_builder + +template +simdjson_warn_unused simdjson_inline error_code tape_builder::parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept { + dom_parser.doc = &doc; + json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0); + tape_builder builder(doc); + return iter.walk_document(builder); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_root_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept { + constexpr uint32_t start_tape_index = 0; + tape.append(start_tape_index, internal::tape_type::ROOT); + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept { + return visit_string(iter, key, true); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1 + return SUCCESS; +} + +simdjson_inline tape_builder::tape_builder(dom::document &doc) noexcept : tape{doc.tape.get()}, current_string_buf_loc{doc.string_buf.get()} {} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept { + iter.log_value(key ? "key" : "string"); + uint8_t *dst = on_start_string(iter); + dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid. + if (dst == nullptr) { + iter.log_error("Invalid escape in string"); + return STRING_ERROR; + } + on_end_string(dst); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept { + return visit_string(iter, value); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("number"); + return numberparsing::parse_number(value, tape); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_number(json_iterator &iter, const uint8_t *value) noexcept { + // + // We need to make a copy to make sure that the string is space terminated. + // This is not about padding the input, which should already padded up + // to len + SIMDJSON_PADDING. However, we have no control at this stage + // on how the padding was done. What if the input string was padded with nulls? + // It is quite common for an input string to have an extra null character (C string). + // We do not want to allow 9\0 (where \0 is the null character) inside a JSON + // document, but the string "9\0" by itself is fine. So we make a copy and + // pad the input with spaces when we know that there is just one input element. + // This copy is relatively expensive, but it will almost never be called in + // practice unless you are in the strange scenario where you have many JSON + // documents made of single atoms. + // + std::unique_ptrcopy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]); + if (copy.get() == nullptr) { return MEMALLOC; } + std::memcpy(copy.get(), value, iter.remaining_len()); + std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING); + error_code error = visit_number(iter, copy.get()); + return error; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value)) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +// private: + +simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept { + return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get()); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + auto start_index = next_tape_index(iter); + tape.append(start_index+2, start); + tape.append(start_index, end); + return SUCCESS; +} + +simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter); + iter.dom_parser.open_containers[iter.depth].count = 0; + tape.skip(); // We don't actually *write* the start element until the end. +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + // Write the ending tape element, pointing at the start location + const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index; + tape.append(start_tape_index, end); + // Write the start tape element, pointing at the end location (and including count) + // count can overflow if it exceeds 24 bits... so we saturate + // the convention being that a cnt of 0xffffff or more is undetermined in value (>= 0xffffff). + const uint32_t count = iter.dom_parser.open_containers[iter.depth].count; + const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count; + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start); + return SUCCESS; +} + +simdjson_inline uint8_t *tape_builder::on_start_string(json_iterator &iter) noexcept { + // we advance the point, accounting for the fact that we have a NULL termination + tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING); + return current_string_buf_loc + sizeof(uint32_t); +} + +simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept { + uint32_t str_length = uint32_t(dst - (current_string_buf_loc + sizeof(uint32_t))); + // TODO check for overflow in case someone has a crazy string (>=4GB?) + // But only add the overflow check when the document itself exceeds 4GB + // Currently unneeded because we refuse to parse docs larger or equal to 4GB. + memcpy(current_string_buf_loc, &str_length, sizeof(uint32_t)); + // NULL termination is still handy if you expect all your strings to + // be NULL terminated? It comes at a small cost + *dst = 0; + current_string_buf_loc = dst + 1; +} + +} // namespace stage2 +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H +/* end file generic/stage2/tape_builder.h for ppc64 */ +/* end file generic/stage2/amalgamated.h for ppc64 */ + +// +// Stage 1 +// +namespace simdjson { +namespace ppc64 { + +simdjson_warn_unused error_code implementation::create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr& dst +) const noexcept { + dst.reset( new (std::nothrow) dom_parser_implementation() ); + if (!dst) { return MEMALLOC; } + if (auto err = dst->set_capacity(capacity)) + return err; + if (auto err = dst->set_max_depth(max_depth)) + return err; + return SUCCESS; +} + +namespace { + +using namespace simd; + +simdjson_inline json_character_block json_character_block::classify(const simd::simd8x64& in) { + const simd8 table1(16, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 1, 2, 9, 0, 0); + const simd8 table2(8, 0, 18, 4, 0, 1, 0, 1, 0, 0, 0, 3, 2, 1, 0, 0); + + simd8x64 v( + (in.chunks[0] & 0xf).lookup_16(table1) & (in.chunks[0].shr<4>()).lookup_16(table2), + (in.chunks[1] & 0xf).lookup_16(table1) & (in.chunks[1].shr<4>()).lookup_16(table2), + (in.chunks[2] & 0xf).lookup_16(table1) & (in.chunks[2].shr<4>()).lookup_16(table2), + (in.chunks[3] & 0xf).lookup_16(table1) & (in.chunks[3].shr<4>()).lookup_16(table2) + ); + + uint64_t op = simd8x64( + v.chunks[0].any_bits_set(0x7), + v.chunks[1].any_bits_set(0x7), + v.chunks[2].any_bits_set(0x7), + v.chunks[3].any_bits_set(0x7) + ).to_bitmask(); + + uint64_t whitespace = simd8x64( + v.chunks[0].any_bits_set(0x18), + v.chunks[1].any_bits_set(0x18), + v.chunks[2].any_bits_set(0x18), + v.chunks[3].any_bits_set(0x18) + ).to_bitmask(); + + return { whitespace, op }; +} + +simdjson_inline bool is_ascii(const simd8x64& input) { + // careful: 0x80 is not ascii. + return input.reduce_or().saturating_sub(0x7fu).bits_not_set_anywhere(); +} + +simdjson_unused simdjson_inline simd8 must_be_continuation(const simd8 prev1, const simd8 prev2, const simd8 prev3) { + simd8 is_second_byte = prev1.saturating_sub(0xc0u-1); // Only 11______ will be > 0 + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_second_byte | is_third_byte | is_fourth_byte) > int8_t(0); +} + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3) { + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_third_byte | is_fourth_byte) > int8_t(0); +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +// +// Stage 2 +// + +// +// Implementation-specific overrides +// +namespace simdjson { +namespace ppc64 { + +simdjson_warn_unused error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept { + return ppc64::stage1::json_minifier::minify<64>(buf, len, dst, dst_len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept { + this->buf = _buf; + this->len = _len; + return ppc64::stage1::json_structural_indexer::index<64>(buf, len, *this, streaming); +} + +simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept { + return ppc64::stage1::generic_validate_utf8(buf,len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool replacement_char) const noexcept { + return ppc64::stringparsing::parse_string(src, dst, replacement_char); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept { + return ppc64::stringparsing::parse_wobbly_string(src, dst); +} + +simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept { + auto error = stage1(_buf, _len, stage1_mode::regular); + if (error) { return error; } + return stage2(_doc); +} + +} // namespace ppc64 +} // namespace simdjson + +/* including simdjson/ppc64/end.h: #include */ +/* begin file simdjson/ppc64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "ppc64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/ppc64/end.h */ + +#endif // SIMDJSON_SRC_PPC64_CPP +/* end file ppc64.cpp */ +#endif +#if SIMDJSON_IMPLEMENTATION_WESTMERE +/* including westmere.cpp: #include */ +/* begin file westmere.cpp */ +#ifndef SIMDJSON_SRC_WESTMERE_CPP +#define SIMDJSON_SRC_WESTMERE_CPP + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* including simdjson/westmere.h: #include */ +/* begin file simdjson/westmere.h */ +#ifndef SIMDJSON_WESTMERE_H +#define SIMDJSON_WESTMERE_H + +/* including simdjson/westmere/begin.h: #include "simdjson/westmere/begin.h" */ +/* begin file simdjson/westmere/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "westmere" */ +#define SIMDJSON_IMPLEMENTATION westmere +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_TARGET_REGION("sse4.2,pclmul,popcnt") +#endif + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/bitmask.h: #include "simdjson/westmere/bitmask.h" */ +/* begin file simdjson/westmere/bitmask.h */ +#ifndef SIMDJSON_WESTMERE_BITMASK_H +#define SIMDJSON_WESTMERE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processing supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMASK_H +/* end file simdjson/westmere/bitmask.h */ +/* including simdjson/westmere/numberparsing_defs.h: #include "simdjson/westmere/numberparsing_defs.h" */ +/* begin file simdjson/westmere/numberparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +#define SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H + +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace westmere +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +/* end file simdjson/westmere/numberparsing_defs.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ +/* including simdjson/westmere/stringparsing_defs.h: #include "simdjson/westmere/stringparsing_defs.h" */ +/* begin file simdjson/westmere/stringparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +#define SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ + +namespace simdjson { +namespace westmere { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + 16); + v0.store(dst); + v1.store(dst + 16); + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +/* end file simdjson/westmere/stringparsing_defs.h */ +/* end file simdjson/westmere/begin.h */ +/* including simdjson/generic/amalgamated.h for westmere: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for westmere */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for westmere: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for westmere */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for westmere */ +/* including simdjson/generic/jsoncharutils.h for westmere: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for westmere */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for westmere */ +/* including simdjson/generic/atomparsing.h for westmere: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for westmere */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace westmere { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for westmere */ +/* including simdjson/generic/dom_parser_implementation.h for westmere: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for westmere */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace westmere +} // namespace simdjson + +namespace simdjson { +namespace westmere { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for westmere */ +/* including simdjson/generic/implementation_simdjson_result_base.h for westmere: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for westmere */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for westmere */ +/* including simdjson/generic/numberparsing.h for westmere: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for westmere */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace westmere { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for westmere */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for westmere: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for westmere */ +/* end file simdjson/generic/amalgamated.h for westmere */ +/* including simdjson/westmere/end.h: #include "simdjson/westmere/end.h" */ +/* begin file simdjson/westmere/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "westmere" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/westmere/end.h */ + +#endif // SIMDJSON_WESTMERE_H +/* end file simdjson/westmere.h */ +/* including simdjson/westmere/implementation.h: #include */ +/* begin file simdjson/westmere/implementation.h */ +#ifndef SIMDJSON_WESTMERE_IMPLEMENTATION_H +#define SIMDJSON_WESTMERE_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +namespace westmere { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation("westmere", "Intel/AMD SSE4.2", internal::instruction_set::SSE42 | internal::instruction_set::PCLMULQDQ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_IMPLEMENTATION_H +/* end file simdjson/westmere/implementation.h */ + +/* including simdjson/westmere/begin.h: #include */ +/* begin file simdjson/westmere/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "westmere" */ +#define SIMDJSON_IMPLEMENTATION westmere +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_TARGET_REGION("sse4.2,pclmul,popcnt") +#endif + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/bitmask.h: #include "simdjson/westmere/bitmask.h" */ +/* begin file simdjson/westmere/bitmask.h */ +#ifndef SIMDJSON_WESTMERE_BITMASK_H +#define SIMDJSON_WESTMERE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processing supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMASK_H +/* end file simdjson/westmere/bitmask.h */ +/* including simdjson/westmere/numberparsing_defs.h: #include "simdjson/westmere/numberparsing_defs.h" */ +/* begin file simdjson/westmere/numberparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +#define SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H + +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace westmere +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +/* end file simdjson/westmere/numberparsing_defs.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ +/* including simdjson/westmere/stringparsing_defs.h: #include "simdjson/westmere/stringparsing_defs.h" */ +/* begin file simdjson/westmere/stringparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +#define SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ + +namespace simdjson { +namespace westmere { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + 16); + v0.store(dst); + v1.store(dst + 16); + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +/* end file simdjson/westmere/stringparsing_defs.h */ +/* end file simdjson/westmere/begin.h */ +/* including generic/amalgamated.h for westmere: #include */ +/* begin file generic/amalgamated.h for westmere */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_SRC_GENERIC_DEPENDENCIES_H) +#error generic/dependencies.h must be included before generic/amalgamated.h! +#endif + +/* including generic/base.h for westmere: #include */ +/* begin file generic/base.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +struct json_character_block; + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_BASE_H +/* end file generic/base.h for westmere */ +/* including generic/dom_parser_implementation.h for westmere: #include */ +/* begin file generic/dom_parser_implementation.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// Interface a dom parser implementation must fulfill +namespace simdjson { +namespace westmere { +namespace { + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3); +simdjson_inline bool is_ascii(const simd8x64& input); + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file generic/dom_parser_implementation.h for westmere */ +/* including generic/json_character_block.h for westmere: #include */ +/* begin file generic/json_character_block.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +struct json_character_block { + static simdjson_inline json_character_block classify(const simd::simd8x64& in); + + simdjson_inline uint64_t whitespace() const noexcept { return _whitespace; } + simdjson_inline uint64_t op() const noexcept { return _op; } + simdjson_inline uint64_t scalar() const noexcept { return ~(op() | whitespace()); } + + uint64_t _whitespace; + uint64_t _op; +}; + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_JSON_CHARACTER_BLOCK_H +/* end file generic/json_character_block.h for westmere */ +/* end file generic/amalgamated.h for westmere */ +/* including generic/stage1/amalgamated.h for westmere: #include */ +/* begin file generic/stage1/amalgamated.h for westmere */ +// Stuff other things depend on +/* including generic/stage1/base.h for westmere: #include */ +/* begin file generic/stage1/base.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +class bit_indexer; +template +struct buf_block_reader; +struct json_block; +class json_minifier; +class json_scanner; +struct json_string_block; +class json_string_scanner; +class json_structural_indexer; + +} // namespace stage1 + +namespace utf8_validation { +struct utf8_checker; +} // namespace utf8_validation + +using utf8_validation::utf8_checker; + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BASE_H +/* end file generic/stage1/base.h for westmere */ +/* including generic/stage1/buf_block_reader.h for westmere: #include */ +/* begin file generic/stage1/buf_block_reader.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +// Walks through a buffer in block-sized increments, loading the last part with spaces +template +struct buf_block_reader { +public: + simdjson_inline buf_block_reader(const uint8_t *_buf, size_t _len); + simdjson_inline size_t block_index(); + simdjson_inline bool has_full_block() const; + simdjson_inline const uint8_t *full_block() const; + /** + * Get the last block, padded with spaces. + * + * There will always be a last block, with at least 1 byte, unless len == 0 (in which case this + * function fills the buffer with spaces and returns 0. In particular, if len == STEP_SIZE there + * will be 0 full_blocks and 1 remainder block with STEP_SIZE bytes and no spaces for padding. + * + * @return the number of effective characters in the last block. + */ + simdjson_inline size_t get_remainder(uint8_t *dst) const; + simdjson_inline void advance(); +private: + const uint8_t *buf; + const size_t len; + const size_t lenminusstep; + size_t idx; +}; + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text_64(const uint8_t *text) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i); i++) { + buf[i] = int8_t(text[i]) < ' ' ? '_' : int8_t(text[i]); + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +// Routines to print masks and text for debugging bitmask operations +simdjson_unused static char * format_input_text(const simd8x64& in) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] < ' ') { buf[i] = '_'; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_input_text(const simd8x64& in, uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + in.store(reinterpret_cast(buf)); + for (size_t i=0; i); i++) { + if (buf[i] <= ' ') { buf[i] = '_'; } + if (!(mask & (size_t(1) << i))) { buf[i] = ' '; } + } + buf[sizeof(simd8x64)] = '\0'; + return buf; +} + +simdjson_unused static char * format_mask(uint64_t mask) { + static char buf[sizeof(simd8x64) + 1]; + for (size_t i=0; i<64; i++) { + buf[i] = (mask & (size_t(1) << i)) ? 'X' : ' '; + } + buf[64] = '\0'; + return buf; +} + +template +simdjson_inline buf_block_reader::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {} + +template +simdjson_inline size_t buf_block_reader::block_index() { return idx; } + +template +simdjson_inline bool buf_block_reader::has_full_block() const { + return idx < lenminusstep; +} + +template +simdjson_inline const uint8_t *buf_block_reader::full_block() const { + return &buf[idx]; +} + +template +simdjson_inline size_t buf_block_reader::get_remainder(uint8_t *dst) const { + if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers + std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once. + std::memcpy(dst, buf + idx, len - idx); + return len - idx; +} + +template +simdjson_inline void buf_block_reader::advance() { + idx += STEP_SIZE; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_BUF_BLOCK_READER_H +/* end file generic/stage1/buf_block_reader.h for westmere */ +/* including generic/stage1/json_escape_scanner.h for westmere: #include */ +/* begin file generic/stage1/json_escape_scanner.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_ESCAPE_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +/** + * Scans for escape characters in JSON, taking care with multiple backslashes (\\n vs. \n). + */ +struct json_escape_scanner { + /** The actual escape characters (the backslashes themselves). */ + uint64_t next_is_escaped = 0ULL; + + struct escaped_and_escape { + /** + * Mask of escaped characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 0100100010100101000 + * n \ \ n \ \ + * ``` + */ + uint64_t escaped; + /** + * Mask of escape characters. + * + * ``` + * \n \\n \\\n \\\\n \ + * 1001000101001010001 + * \ \ \ \ \ \ \ + * ``` + */ + uint64_t escape; + }; + + /** + * Get a mask of both escape and escaped characters (the characters following a backslash). + * + * @param potential_escape A mask of the character that can escape others (but could be + * escaped itself). e.g. block.eq('\\') + */ + simdjson_really_inline escaped_and_escape next(uint64_t backslash) noexcept { + +#if !SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT + if (!backslash) { return {next_escaped_without_backslashes(), 0}; } +#endif + + // | | Mask (shows characters instead of 1's) | Depth | Instructions | + // |--------------------------------|----------------------------------------|-------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | | | + // | | ` even odd even odd odd` | | | + // | potential_escape | ` \ \\\ \\\ \\\\ \\\\ \\\` | 1 | 1 (backslash & ~first_is_escaped) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 5 | 5 (next_escape_and_terminal_code()) + // | escaped | `\ \ n \ n \ \ \ \ \ ` X | 6 | 7 (escape_and_terminal_code ^ (potential_escape | first_is_escaped)) + // | escape | ` \ \ \ \ \ \ \ \ \ \` | 6 | 8 (escape_and_terminal_code & backslash) + // | first_is_escaped | `\ ` | 7 (*) | 9 (escape >> 63) () + // (*) this is not needed until the next iteration + uint64_t escape_and_terminal_code = next_escape_and_terminal_code(backslash & ~this->next_is_escaped); + uint64_t escaped = escape_and_terminal_code ^ (backslash | this->next_is_escaped); + uint64_t escape = escape_and_terminal_code & backslash; + this->next_is_escaped = escape >> 63; + return {escaped, escape}; + } + +private: + static constexpr const uint64_t ODD_BITS = 0xAAAAAAAAAAAAAAAAULL; + + simdjson_really_inline uint64_t next_escaped_without_backslashes() noexcept { + uint64_t escaped = this->next_is_escaped; + this->next_is_escaped = 0; + return escaped; + } + + /** + * Returns a mask of the next escape characters (masking out escaped backslashes), along with + * any non-backslash escape codes. + * + * \n \\n \\\n \\\\n returns: + * \n \ \ \n \ \ + * 11 100 1011 10100 + * + * You are expected to mask out the first bit yourself if the previous block had a trailing + * escape. + * + * & the result with potential_escape to get just the escape characters. + * ^ the result with (potential_escape | first_is_escaped) to get escaped characters. + */ + static simdjson_really_inline uint64_t next_escape_and_terminal_code(uint64_t potential_escape) noexcept { + // If we were to just shift and mask out any odd bits, we'd actually get a *half* right answer: + // any even-aligned backslash runs would be correct! Odd-aligned backslash runs would be + // inverted (\\\ would be 010 instead of 101). + // + // ``` + // string: | ____\\\\_\\\\_____ | + // maybe_escaped | ODD | \ \ \ \ | + // even-aligned ^^^ ^^^^ odd-aligned + // ``` + // + // Taking that into account, our basic strategy is: + // + // 1. Use subtraction to produce a mask with 1's for even-aligned runs and 0's for + // odd-aligned runs. + // 2. XOR all odd bits, which masks out the odd bits in even-aligned runs, and brings IN the + // odd bits in odd-aligned runs. + // 3. & with backslash to clean up any stray bits. + // runs are set to 0, and then XORing with "odd": + // + // | | Mask (shows characters instead of 1's) | Instructions | + // |--------------------------------|----------------------------------------|---------------------| + // | string | `\\n_\\\n___\\\n___\\\\___\\\\__\\\` | + // | | ` even odd even odd odd` | + // | maybe_escaped | ` n \\n \\n \\\_ \\\_ \\` X | 1 (potential_escape << 1) + // | maybe_escaped_and_odd | ` \n_ \\n _ \\\n_ _ \\\__ _\\\_ \\\` | 1 (maybe_escaped | odd) + // | even_series_codes_and_odd | ` n_\\\ _ n_ _\\\\ _ _ ` | 1 (maybe_escaped_and_odd - potential_escape) + // | escape_and_terminal_code | ` \n \ \n \ \n \ \ \ \ \ \` | 1 (^ odd) + // + + // Escaped characters are characters following an escape. + uint64_t maybe_escaped = potential_escape << 1; + + // To distinguish odd from even escape sequences, therefore, we turn on any *starting* + // escapes that are on an odd byte. (We actually bring in all odd bits, for speed.) + // - Odd runs of backslashes are 0000, and the code at the end ("n" in \n or \\n) is 1. + // - Odd runs of backslashes are 1111, and the code at the end ("n" in \n or \\n) is 0. + // - All other odd bytes are 1, and even bytes are 0. + uint64_t maybe_escaped_and_odd_bits = maybe_escaped | ODD_BITS; + uint64_t even_series_codes_and_odd_bits = maybe_escaped_and_odd_bits - potential_escape; + + // Now we flip all odd bytes back with xor. This: + // - Makes odd runs of backslashes go from 0000 to 1010 + // - Makes even runs of backslashes go from 1111 to 1010 + // - Sets actually-escaped codes to 1 (the n in \n and \\n: \n = 11, \\n = 100) + // - Resets all other bytes to 0 + return even_series_codes_and_odd_bits ^ ODD_BITS; + } +}; + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_escape_scanner.h for westmere */ +/* including generic/stage1/json_string_scanner.h for westmere: #include */ +/* begin file generic/stage1/json_string_scanner.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +struct json_string_block { + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_really_inline json_string_block(uint64_t escaped, uint64_t quote, uint64_t in_string) : + _escaped(escaped), _quote(quote), _in_string(in_string) {} + + // Escaped characters (characters following an escape() character) + simdjson_really_inline uint64_t escaped() const { return _escaped; } + // Real (non-backslashed) quotes + simdjson_really_inline uint64_t quote() const { return _quote; } + // Only characters inside the string (not including the quotes) + simdjson_really_inline uint64_t string_content() const { return _in_string & ~_quote; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_inside_string(uint64_t mask) const { return mask & _in_string; } + // Return a mask of whether the given characters are inside a string (only works on non-quotes) + simdjson_really_inline uint64_t non_quote_outside_string(uint64_t mask) const { return mask & ~_in_string; } + // Tail of string (everything except the start quote) + simdjson_really_inline uint64_t string_tail() const { return _in_string ^ _quote; } + + // escaped characters (backslashed--does not include the hex characters after \u) + uint64_t _escaped; + // real quotes (non-escaped ones) + uint64_t _quote; + // string characters (includes start quote but not end quote) + uint64_t _in_string; +}; + +// Scans blocks for string characters, storing the state necessary to do so +class json_string_scanner { +public: + simdjson_really_inline json_string_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_really_inline error_code finish(); + +private: + // Scans for escape characters + json_escape_scanner escape_scanner{}; + // Whether the last iteration was still inside a string (all 1's = true, all 0's = false). + uint64_t prev_in_string = 0ULL; +}; + +// +// Return a mask of all string characters plus end quotes. +// +// prev_escaped is overflow saying whether the next character is escaped. +// prev_in_string is overflow saying whether we're still in a string. +// +// Backslash sequences outside of quotes will be detected in stage 2. +// +simdjson_really_inline json_string_block json_string_scanner::next(const simd::simd8x64& in) { + const uint64_t backslash = in.eq('\\'); + const uint64_t escaped = escape_scanner.next(backslash).escaped; + const uint64_t quote = in.eq('"') & ~escaped; + + // + // prefix_xor flips on bits inside the string (and flips off the end quote). + // + // Then we xor with prev_in_string: if we were in a string already, its effect is flipped + // (characters inside strings are outside, and characters outside strings are inside). + // + const uint64_t in_string = prefix_xor(quote) ^ prev_in_string; + + // + // Check if we're still in a string at the end of the box so the next block will know + // + prev_in_string = uint64_t(static_cast(in_string) >> 63); + + // Use ^ to turn the beginning quote off, and the end quote on. + + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_string_block(escaped, quote, in_string); +} + +simdjson_really_inline error_code json_string_scanner::finish() { + if (prev_in_string) { + return UNCLOSED_STRING; + } + return SUCCESS; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRING_SCANNER_H +/* end file generic/stage1/json_string_scanner.h for westmere */ +/* including generic/stage1/utf8_lookup4_algorithm.h for westmere: #include */ +/* begin file generic/stage1/utf8_lookup4_algorithm.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace utf8_validation { + +using namespace simd; + + simdjson_inline simd8 check_special_cases(const simd8 input, const simd8 prev1) { +// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII) +// Bit 1 = Too Long (ASCII followed by continuation) +// Bit 2 = Overlong 3-byte +// Bit 4 = Surrogate +// Bit 5 = Overlong 2-byte +// Bit 7 = Two Continuations + constexpr const uint8_t TOO_SHORT = 1<<0; // 11______ 0_______ + // 11______ 11______ + constexpr const uint8_t TOO_LONG = 1<<1; // 0_______ 10______ + constexpr const uint8_t OVERLONG_3 = 1<<2; // 11100000 100_____ + constexpr const uint8_t SURROGATE = 1<<4; // 11101101 101_____ + constexpr const uint8_t OVERLONG_2 = 1<<5; // 1100000_ 10______ + constexpr const uint8_t TWO_CONTS = 1<<7; // 10______ 10______ + constexpr const uint8_t TOO_LARGE = 1<<3; // 11110100 1001____ + // 11110100 101_____ + // 11110101 1001____ + // 11110101 101_____ + // 1111011_ 1001____ + // 1111011_ 101_____ + // 11111___ 1001____ + // 11111___ 101_____ + constexpr const uint8_t TOO_LARGE_1000 = 1<<6; + // 11110101 1000____ + // 1111011_ 1000____ + // 11111___ 1000____ + constexpr const uint8_t OVERLONG_4 = 1<<6; // 11110000 1000____ + + const simd8 byte_1_high = prev1.shr<4>().lookup_16( + // 0_______ ________ + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, + // 10______ ________ + TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS, + // 1100____ ________ + TOO_SHORT | OVERLONG_2, + // 1101____ ________ + TOO_SHORT, + // 1110____ ________ + TOO_SHORT | OVERLONG_3 | SURROGATE, + // 1111____ ________ + TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4 + ); + constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 . + const simd8 byte_1_low = (prev1 & 0x0F).lookup_16( + // ____0000 ________ + CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4, + // ____0001 ________ + CARRY | OVERLONG_2, + // ____001_ ________ + CARRY, + CARRY, + + // ____0100 ________ + CARRY | TOO_LARGE, + // ____0101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____011_ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + + // ____1___ ________ + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000, + // ____1101 ________ + CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE, + CARRY | TOO_LARGE | TOO_LARGE_1000, + CARRY | TOO_LARGE | TOO_LARGE_1000 + ); + const simd8 byte_2_high = input.shr<4>().lookup_16( + // ________ 0_______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT, + + // ________ 1000____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4, + // ________ 1001____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE, + // ________ 101_____ + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE | TOO_LARGE, + + // ________ 11______ + TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT + ); + return (byte_1_high & byte_1_low & byte_2_high); + } + simdjson_inline simd8 check_multibyte_lengths(const simd8 input, + const simd8 prev_input, const simd8 sc) { + simd8 prev2 = input.prev<2>(prev_input); + simd8 prev3 = input.prev<3>(prev_input); + simd8 must23 = simd8(must_be_2_3_continuation(prev2, prev3)); + simd8 must23_80 = must23 & uint8_t(0x80); + return must23_80 ^ sc; + } + + // + // Return nonzero if there are incomplete multibyte characters at the end of the block: + // e.g. if there is a 4-byte character, but it's 3 bytes from the end. + // + simdjson_inline simd8 is_incomplete(const simd8 input) { + // If the previous input's last 3 bytes match this, they're too short (they ended at EOF): + // ... 1111____ 111_____ 11______ +#if SIMDJSON_IMPLEMENTATION_ICELAKE + static const uint8_t max_array[64] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#else + static const uint8_t max_array[32] = { + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1 + }; +#endif + const simd8 max_value(&max_array[sizeof(max_array)-sizeof(simd8)]); + return input.gt_bits(max_value); + } + + struct utf8_checker { + // If this is nonzero, there has been a UTF-8 error. + simd8 error; + // The last input we received + simd8 prev_input_block; + // Whether the last input we received was incomplete (used for ASCII fast path) + simd8 prev_incomplete; + + // + // Check whether the current bytes are valid UTF-8. + // + simdjson_inline void check_utf8_bytes(const simd8 input, const simd8 prev_input) { + // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes + // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers) + simd8 prev1 = input.prev<1>(prev_input); + simd8 sc = check_special_cases(input, prev1); + this->error |= check_multibyte_lengths(input, prev_input, sc); + } + + // The only problem that can happen at EOF is that a multibyte character is too short + // or a byte value too large in the last bytes: check_special_cases only checks for bytes + // too large in the first of two bytes. + simdjson_inline void check_eof() { + // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't + // possibly finish them. + this->error |= this->prev_incomplete; + } + + simdjson_inline void check_next_input(const simd8x64& input) { + if(simdjson_likely(is_ascii(input))) { + this->error |= this->prev_incomplete; + } else { + // you might think that a for-loop would work, but under Visual Studio, it is not good enough. + static_assert((simd8x64::NUM_CHUNKS == 1) + ||(simd8x64::NUM_CHUNKS == 2) + || (simd8x64::NUM_CHUNKS == 4), + "We support one, two or four chunks per 64-byte block."); + SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 1) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 2) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + } else SIMDJSON_IF_CONSTEXPR (simd8x64::NUM_CHUNKS == 4) { + this->check_utf8_bytes(input.chunks[0], this->prev_input_block); + this->check_utf8_bytes(input.chunks[1], input.chunks[0]); + this->check_utf8_bytes(input.chunks[2], input.chunks[1]); + this->check_utf8_bytes(input.chunks[3], input.chunks[2]); + } + this->prev_incomplete = is_incomplete(input.chunks[simd8x64::NUM_CHUNKS-1]); + this->prev_input_block = input.chunks[simd8x64::NUM_CHUNKS-1]; + } + } + // do not forget to call check_eof! + simdjson_inline error_code errors() { + return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS; + } + + }; // struct utf8_checker +} // namespace utf8_validation + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_LOOKUP4_ALGORITHM_H +/* end file generic/stage1/utf8_lookup4_algorithm.h for westmere */ +/* including generic/stage1/json_scanner.h for westmere: #include */ +/* begin file generic/stage1/json_scanner.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +/** + * A block of scanned json, with information on operators and scalars. + * + * We seek to identify pseudo-structural characters. Anything that is inside + * a string must be omitted (hence & ~_string.string_tail()). + * Otherwise, pseudo-structural characters come in two forms. + * 1. We have the structural characters ([,],{,},:, comma). The + * term 'structural character' is from the JSON RFC. + * 2. We have the 'scalar pseudo-structural characters'. + * Scalars are quotes, and any character except structural characters and white space. + * + * To identify the scalar pseudo-structural characters, we must look at what comes + * before them: it must be a space, a quote or a structural characters. + * Starting with simdjson v0.3, we identify them by + * negation: we identify everything that is followed by a non-quote scalar, + * and we negate that. Whatever remains must be a 'scalar pseudo-structural character'. + */ +struct json_block { +public: + // We spell out the constructors in the hope of resolving inlining issues with Visual Studio 2017 + simdjson_inline json_block(json_string_block&& string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(std::move(string)), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + simdjson_inline json_block(json_string_block string, json_character_block characters, uint64_t follows_potential_nonquote_scalar) : + _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {} + + /** + * The start of structurals. + * In simdjson prior to v0.3, these were called the pseudo-structural characters. + **/ + simdjson_inline uint64_t structural_start() const noexcept { return potential_structural_start() & ~_string.string_tail(); } + /** All JSON whitespace (i.e. not in a string) */ + simdjson_inline uint64_t whitespace() const noexcept { return non_quote_outside_string(_characters.whitespace()); } + + // Helpers + + /** Whether the given characters are inside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_inside_string(uint64_t mask) const noexcept { return _string.non_quote_inside_string(mask); } + /** Whether the given characters are outside a string (only works on non-quotes) */ + simdjson_inline uint64_t non_quote_outside_string(uint64_t mask) const noexcept { return _string.non_quote_outside_string(mask); } + + // string and escape characters + json_string_block _string; + // whitespace, structural characters ('operators'), scalars + json_character_block _characters; + // whether the previous character was a scalar + uint64_t _follows_potential_nonquote_scalar; +private: + // Potential structurals (i.e. disregarding strings) + + /** + * structural elements ([,],{,},:, comma) plus scalar starts like 123, true and "abc". + * They may reside inside a string. + **/ + simdjson_inline uint64_t potential_structural_start() const noexcept { return _characters.op() | potential_scalar_start(); } + /** + * The start of non-operator runs, like 123, true and "abc". + * It main reside inside a string. + **/ + simdjson_inline uint64_t potential_scalar_start() const noexcept { + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // Whenever it is preceded by something that is not a structural element ({,},[,],:, ") nor a white-space + // then we know that it is irrelevant structurally. + return _characters.scalar() & ~follows_potential_scalar(); + } + /** + * Whether the given character is immediately after a non-operator like 123, true. + * The characters following a quote are not included. + */ + simdjson_inline uint64_t follows_potential_scalar() const noexcept { + // _follows_potential_nonquote_scalar: is defined as marking any character that follows a character + // that is not a structural element ({,},[,],:, comma) nor a quote (") and that is not a + // white space. + // It is understood that within quoted region, anything at all could be marked (irrelevant). + return _follows_potential_nonquote_scalar; + } +}; + +/** + * Scans JSON for important bits: structural characters or 'operators', strings, and scalars. + * + * The scanner starts by calculating two distinct things: + * - string characters (taking \" into account) + * - structural characters or 'operators' ([]{},:, comma) + * and scalars (runs of non-operators like 123, true and "abc") + * + * To minimize data dependency (a key component of the scanner's speed), it finds these in parallel: + * in particular, the operator/scalar bit will find plenty of things that are actually part of + * strings. When we're done, json_block will fuse the two together by masking out tokens that are + * part of a string. + */ +class json_scanner { +public: + json_scanner() = default; + simdjson_inline json_block next(const simd::simd8x64& in); + // Returns either UNCLOSED_STRING or SUCCESS + simdjson_inline error_code finish(); + +private: + // Whether the last character of the previous iteration is part of a scalar token + // (anything except whitespace or a structural character/'operator'). + uint64_t prev_scalar = 0ULL; + json_string_scanner string_scanner{}; +}; + + +// +// Check if the current character immediately follows a matching character. +// +// For example, this checks for quotes with backslashes in front of them: +// +// const uint64_t backslashed_quote = in.eq('"') & immediately_follows(in.eq('\'), prev_backslash); +// +simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) { + const uint64_t result = match << 1 | overflow; + overflow = match >> 63; + return result; +} + +simdjson_inline json_block json_scanner::next(const simd::simd8x64& in) { + json_string_block strings = string_scanner.next(in); + // identifies the white-space and the structural characters + json_character_block characters = json_character_block::classify(in); + // The term "scalar" refers to anything except structural characters and white space + // (so letters, numbers, quotes). + // We want follows_scalar to mark anything that follows a non-quote scalar (so letters and numbers). + // + // A terminal quote should either be followed by a structural character (comma, brace, bracket, colon) + // or nothing. However, we still want ' "a string"true ' to mark the 't' of 'true' as a potential + // pseudo-structural character just like we would if we had ' "a string" true '; otherwise we + // may need to add an extra check when parsing strings. + // + // Performance: there are many ways to skin this cat. + const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote(); + uint64_t follows_nonquote_scalar = follows(nonquote_scalar, prev_scalar); + // We are returning a function-local object so either we get a move constructor + // or we get copy elision. + return json_block( + strings,// strings is a function-local object so either it moves or the copy is elided. + characters, + follows_nonquote_scalar + ); +} + +simdjson_inline error_code json_scanner::finish() { + return string_scanner.finish(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_SCANNER_H +/* end file generic/stage1/json_scanner.h for westmere */ + +// All other declarations +/* including generic/stage1/find_next_document_index.h for westmere: #include */ +/* begin file generic/stage1/find_next_document_index.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +/** + * This algorithm is used to quickly identify the last structural position that + * makes up a complete document. + * + * It does this by going backwards and finding the last *document boundary* (a + * place where one value follows another without a comma between them). If the + * last document (the characters after the boundary) has an equal number of + * start and end brackets, it is considered complete. + * + * Simply put, we iterate over the structural characters, starting from + * the end. We consider that we found the end of a JSON document when the + * first element of the pair is NOT one of these characters: '{' '[' ':' ',' + * and when the second element is NOT one of these characters: '}' ']' ':' ','. + * + * This simple comparison works most of the time, but it does not cover cases + * where the batch's structural indexes contain a perfect amount of documents. + * In such a case, we do not have access to the structural index which follows + * the last document, therefore, we do not have access to the second element in + * the pair, and that means we cannot identify the last document. To fix this + * issue, we keep a count of the open and closed curly/square braces we found + * while searching for the pair. When we find a pair AND the count of open and + * closed curly/square braces is the same, we know that we just passed a + * complete document, therefore the last json buffer location is the end of the + * batch. + */ +simdjson_inline uint32_t find_next_document_index(dom_parser_implementation &parser) { + // Variant: do not count separately, just figure out depth + if(parser.n_structural_indexes == 0) { return 0; } + auto arr_cnt = 0; + auto obj_cnt = 0; + for (auto i = parser.n_structural_indexes - 1; i > 0; i--) { + auto idxb = parser.structural_indexes[i]; + switch (parser.buf[idxb]) { + case ':': + case ',': + continue; + case '}': + obj_cnt--; + continue; + case ']': + arr_cnt--; + continue; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + auto idxa = parser.structural_indexes[i - 1]; + switch (parser.buf[idxa]) { + case '{': + case '[': + case ':': + case ',': + continue; + } + // Last document is complete, so the next document will appear after! + if (!arr_cnt && !obj_cnt) { + return parser.n_structural_indexes; + } + // Last document is incomplete; mark the document at i + 1 as the next one + return i; + } + // If we made it to the end, we want to finish counting to see if we have a full document. + switch (parser.buf[parser.structural_indexes[0]]) { + case '}': + obj_cnt--; + break; + case ']': + arr_cnt--; + break; + case '{': + obj_cnt++; + break; + case '[': + arr_cnt++; + break; + } + if (!arr_cnt && !obj_cnt) { + // We have a complete document. + return parser.n_structural_indexes; + } + return 0; +} + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_FIND_NEXT_DOCUMENT_INDEX_H +/* end file generic/stage1/find_next_document_index.h for westmere */ +/* including generic/stage1/json_minifier.h for westmere: #include */ +/* begin file generic/stage1/json_minifier.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +class json_minifier { +public: + template + static error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept; + +private: + simdjson_inline json_minifier(uint8_t *_dst) + : dst{_dst} + {} + template + simdjson_inline void step(const uint8_t *block_buf, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block); + simdjson_inline error_code finish(uint8_t *dst_start, size_t &dst_len); + json_scanner scanner{}; + uint8_t *dst; +}; + +simdjson_inline void json_minifier::next(const simd::simd8x64& in, const json_block& block) { + uint64_t mask = block.whitespace(); + dst += in.compress(mask, dst); +} + +simdjson_inline error_code json_minifier::finish(uint8_t *dst_start, size_t &dst_len) { + error_code error = scanner.finish(); + if (error) { dst_len = 0; return error; } + dst_len = dst - dst_start; + return SUCCESS; +} + +template<> +simdjson_inline void json_minifier::step<128>(const uint8_t *block_buf, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + simd::simd8x64 in_2(block_buf+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1); + this->next(in_2, block_2); + reader.advance(); +} + +template<> +simdjson_inline void json_minifier::step<64>(const uint8_t *block_buf, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block_buf); + json_block block_1 = scanner.next(in_1); + this->next(block_buf, block_1); + reader.advance(); +} + +template +error_code json_minifier::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) noexcept { + buf_block_reader reader(buf, len); + json_minifier minifier(dst); + + // Index the first n-1 blocks + while (reader.has_full_block()) { + minifier.step(reader.full_block(), reader); + } + + // Index the last (remainder) block, padded with spaces + uint8_t block[STEP_SIZE]; + size_t remaining_bytes = reader.get_remainder(block); + if (remaining_bytes > 0) { + // We do not want to write directly to the output stream. Rather, we write + // to a local buffer (for safety). + uint8_t out_block[STEP_SIZE]; + uint8_t * const guarded_dst{minifier.dst}; + minifier.dst = out_block; + minifier.step(block, reader); + size_t to_write = minifier.dst - out_block; + // In some cases, we could be enticed to consider the padded spaces + // as part of the string. This is fine as long as we do not write more + // than we consumed. + if(to_write > remaining_bytes) { to_write = remaining_bytes; } + memcpy(guarded_dst, out_block, to_write); + minifier.dst = guarded_dst + to_write; + } + return minifier.finish(dst, dst_len); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_MINIFIER_H +/* end file generic/stage1/json_minifier.h for westmere */ +/* including generic/stage1/json_structural_indexer.h for westmere: #include */ +/* begin file generic/stage1/json_structural_indexer.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses in stage1 +// It is intended to be included multiple times and compiled multiple times +// We assume the file in which it is included already includes +// "simdjson/stage1.h" (this simplifies amalgation) + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +class bit_indexer { +public: + uint32_t *tail; + + simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {} + +#if SIMDJSON_PREFER_REVERSE_BITS + /** + * ARM lacks a fast trailing zero instruction, but it has a fast + * bit reversal instruction and a fast leading zero instruction. + * Thus it may be profitable to reverse the bits (once) and then + * to rely on a sequence of instructions that call the leading + * zero instruction. + * + * Performance notes: + * The chosen routine is not optimal in terms of data dependency + * since zero_leading_bit might require two instructions. However, + * it tends to minimize the total number of instructions which is + * beneficial. + */ + simdjson_inline void write_index(uint32_t idx, uint64_t& rev_bits, int i) { + int lz = leading_zeroes(rev_bits); + this->tail[i] = static_cast(idx) + lz; + rev_bits = zero_leading_bit(rev_bits, lz); + } +#else + /** + * Under recent x64 systems, we often have both a fast trailing zero + * instruction and a fast 'clear-lower-bit' instruction so the following + * algorithm can be competitive. + */ + + simdjson_inline void write_index(uint32_t idx, uint64_t& bits, int i) { + this->tail[i] = idx + trailing_zeroes(bits); + bits = clear_lowest_bit(bits); + } +#endif // SIMDJSON_PREFER_REVERSE_BITS + + template + simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) { + write_index(idx, bits, START); + SIMDJSON_IF_CONSTEXPR (N > 1) { + write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits); + } + return START+N; + } + + template + simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) { + write_indexes(idx, bits); + SIMDJSON_IF_CONSTEXPR ((START+STEP) < END) { + if (simdjson_unlikely((START+STEP) < cnt)) { + write_indexes_stepped<(START+STEP(idx, bits, cnt); + } + } + return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP; + } + + // flatten out values in 'bits' assuming that they are are to have values of idx + // plus their position in the bitvector, and store these indexes at + // base_ptr[base] incrementing base as we go + // will potentially store extra values beyond end of valid bits, so base_ptr + // needs to be large enough to handle this + // + // If the kernel sets SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER, then it + // will provide its own version of the code. +#ifdef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + simdjson_inline void write(uint32_t idx, uint64_t bits); +#else + simdjson_inline void write(uint32_t idx, uint64_t bits) { + // In some instances, the next branch is expensive because it is mispredicted. + // Unfortunately, in other cases, + // it helps tremendously. + if (bits == 0) + return; + + int cnt = static_cast(count_ones(bits)); + +#if SIMDJSON_PREFER_REVERSE_BITS + bits = reverse_bits(bits); +#endif +#ifdef SIMDJSON_STRUCTURAL_INDEXER_STEP + static constexpr const int STEP = SIMDJSON_STRUCTURAL_INDEXER_STEP; +#else + static constexpr const int STEP = 4; +#endif + static constexpr const int STEP_UNTIL = 24; + + write_indexes_stepped<0, STEP_UNTIL, STEP>(idx, bits, cnt); + SIMDJSON_IF_CONSTEXPR (STEP_UNTIL < 64) { + if (simdjson_unlikely(STEP_UNTIL < cnt)) { + for (int i=STEP_UNTIL; itail += cnt; + } +#endif // SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +}; + +class json_structural_indexer { +public: + /** + * Find the important bits of JSON in a 128-byte chunk, and add them to structural_indexes. + * + * @param partial Setting the partial parameter to true allows the find_structural_bits to + * tolerate unclosed strings. The caller should still ensure that the input is valid UTF-8. If + * you are processing substrings, you may want to call on a function like trimmed_length_safe_utf8. + */ + template + static error_code index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept; + +private: + simdjson_inline json_structural_indexer(uint32_t *structural_indexes); + template + simdjson_inline void step(const uint8_t *block, buf_block_reader &reader) noexcept; + simdjson_inline void next(const simd::simd8x64& in, const json_block& block, size_t idx); + simdjson_inline error_code finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial); + + json_scanner scanner{}; + utf8_checker checker{}; + bit_indexer indexer; + uint64_t prev_structurals = 0; + uint64_t unescaped_chars_error = 0; +}; + +simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {} + +// Skip the last character if it is partial +simdjson_inline size_t trim_partial_utf8(const uint8_t *buf, size_t len) { + if (simdjson_unlikely(len < 3)) { + switch (len) { + case 2: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 2 bytes left + return len; + case 1: + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + return len; + case 0: + return len; + } + } + if (buf[len-1] >= 0xc0) { return len-1; } // 2-, 3- and 4-byte characters with only 1 byte left + if (buf[len-2] >= 0xe0) { return len-2; } // 3- and 4-byte characters with only 1 byte left + if (buf[len-3] >= 0xf0) { return len-3; } // 4-byte characters with only 3 bytes left + return len; +} + +// +// PERF NOTES: +// We pipe 2 inputs through these stages: +// 1. Load JSON into registers. This takes a long time and is highly parallelizable, so we load +// 2 inputs' worth at once so that by the time step 2 is looking for them input, it's available. +// 2. Scan the JSON for critical data: strings, scalars and operators. This is the critical path. +// The output of step 1 depends entirely on this information. These functions don't quite use +// up enough CPU: the second half of the functions is highly serial, only using 1 execution core +// at a time. The second input's scans has some dependency on the first ones finishing it, but +// they can make a lot of progress before they need that information. +// 3. Step 1 doesn't use enough capacity, so we run some extra stuff while we're waiting for that +// to finish: utf-8 checks and generating the output from the last iteration. +// +// The reason we run 2 inputs at a time, is steps 2 and 3 are *still* not enough to soak up all +// available capacity with just one input. Running 2 at a time seems to give the CPU a good enough +// workout. +// +template +error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept { + if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; } + // We guard the rest of the code so that we can assume that len > 0 throughout. + if (len == 0) { return EMPTY; } + if (is_streaming(partial)) { + len = trim_partial_utf8(buf, len); + // If you end up with an empty window after trimming + // the partial UTF-8 bytes, then chances are good that you + // have an UTF-8 formatting error. + if(len == 0) { return UTF8_ERROR; } + } + buf_block_reader reader(buf, len); + json_structural_indexer indexer(parser.structural_indexes.get()); + + // Read all but the last block + while (reader.has_full_block()) { + indexer.step(reader.full_block(), reader); + } + // Take care of the last block (will always be there unless file is empty which is + // not supposed to happen.) + uint8_t block[STEP_SIZE]; + if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; } + indexer.step(block, reader); + return indexer.finish(parser, reader.block_index(), len, partial); +} + +template<> +simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept { + simd::simd8x64 in_1(block); + simd::simd8x64 in_2(block+64); + json_block block_1 = scanner.next(in_1); + json_block block_2 = scanner.next(in_2); + this->next(in_1, block_1, reader.block_index()); + this->next(in_2, block_2, reader.block_index()+64); + reader.advance(); +} + +template<> +simdjson_inline void json_structural_indexer::step<64>(const uint8_t *block, buf_block_reader<64> &reader) noexcept { + simd::simd8x64 in_1(block); + json_block block_1 = scanner.next(in_1); + this->next(in_1, block_1, reader.block_index()); + reader.advance(); +} + +simdjson_inline void json_structural_indexer::next(const simd::simd8x64& in, const json_block& block, size_t idx) { + uint64_t unescaped = in.lteq(0x1F); +#if SIMDJSON_UTF8VALIDATION + checker.check_next_input(in); +#endif + indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser + prev_structurals = block.structural_start(); + unescaped_chars_error |= block.non_quote_inside_string(unescaped); +} + +simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) { + // Write out the final iteration's structurals + indexer.write(uint32_t(idx-64), prev_structurals); + error_code error = scanner.finish(); + // We deliberately break down the next expression so that it is + // human readable. + const bool should_we_exit = is_streaming(partial) ? + ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING + : (error != SUCCESS); // if partial is false, we must have SUCCESS + const bool have_unclosed_string = (error == UNCLOSED_STRING); + if (simdjson_unlikely(should_we_exit)) { return error; } + + if (unescaped_chars_error) { + return UNESCAPED_CHARS; + } + parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get()); + /*** + * The On Demand API requires special padding. + * + * This is related to https://github.com/simdjson/simdjson/issues/906 + * Basically, we want to make sure that if the parsing continues beyond the last (valid) + * structural character, it quickly stops. + * Only three structural characters can be repeated without triggering an error in JSON: [,] and }. + * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing + * continues, then it must be [,] or }. + * Suppose it is ] or }. We backtrack to the first character, what could it be that would + * not trigger an error? It could be ] or } but no, because you can't start a document that way. + * It can't be a comma, a colon or any simple value. So the only way we could continue is + * if the repeated character is [. But if so, the document must start with [. But if the document + * starts with [, it should end with ]. If we enforce that rule, then we would get + * ][[ which is invalid. + * + * This is illustrated with the test array_iterate_unclosed_error() on the following input: + * R"({ "a": [,,)" + **/ + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final + parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len); + parser.structural_indexes[parser.n_structural_indexes + 2] = 0; + parser.next_structural_index = 0; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + return EMPTY; + } + if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) { + return UNEXPECTED_ERROR; + } + if (partial == stage1_mode::streaming_partial) { + // If we have an unclosed string, then the last structural + // will be the quote and we want to make sure to omit it. + if(have_unclosed_string) { + parser.n_structural_indexes--; + // a valid JSON file cannot have zero structural indexes - we should have found something + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; } + } + // We truncate the input to the end of the last complete document (or zero). + auto new_structural_indexes = find_next_document_index(parser); + if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) { + if(parser.structural_indexes[0] == 0) { + // If the buffer is partial and we started at index 0 but the document is + // incomplete, it's too big to parse. + return CAPACITY; + } else { + // It is possible that the document could be parsed, we just had a lot + // of white space. + parser.n_structural_indexes = 0; + return EMPTY; + } + } + + parser.n_structural_indexes = new_structural_indexes; + } else if (partial == stage1_mode::streaming_final) { + if(have_unclosed_string) { parser.n_structural_indexes--; } + // We truncate the input to the end of the last complete document (or zero). + // Because partial == stage1_mode::streaming_final, it means that we may + // silently ignore trailing garbage. Though it sounds bad, we do it + // deliberately because many people who have streams of JSON documents + // will truncate them for processing. E.g., imagine that you are uncompressing + // the data from a size file or receiving it in chunks from the network. You + // may not know where exactly the last document will be. Meanwhile the + // document_stream instances allow people to know the JSON documents they are + // parsing (see the iterator.source() method). + parser.n_structural_indexes = find_next_document_index(parser); + // We store the initial n_structural_indexes so that the client can see + // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes, + // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len, + // otherwise, it will copy some prior index. + parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes]; + // This next line is critical, do not change it unless you understand what you are + // doing. + parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); + if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { + // We tolerate an unclosed string at the very end of the stream. Indeed, users + // often load their data in bulk without being careful and they want us to ignore + // the trailing garbage. + return EMPTY; + } + } + checker.check_eof(); + return checker.errors(); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +// Clear CUSTOM_BIT_INDEXER so other implementations can set it if they need to. +#undef SIMDJSON_GENERIC_JSON_STRUCTURAL_INDEXER_CUSTOM_BIT_INDEXER + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_JSON_STRUCTURAL_INDEXER_H +/* end file generic/stage1/json_structural_indexer.h for westmere */ +/* including generic/stage1/utf8_validator.h for westmere: #include */ +/* begin file generic/stage1/utf8_validator.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage1 { + +/** + * Validates that the string is actual UTF-8. + */ +template +bool generic_validate_utf8(const uint8_t * input, size_t length) { + checker c{}; + buf_block_reader<64> reader(input, length); + while (reader.has_full_block()) { + simd::simd8x64 in(reader.full_block()); + c.check_next_input(in); + reader.advance(); + } + uint8_t block[64]{}; + reader.get_remainder(block); + simd::simd8x64 in(block); + c.check_next_input(in); + reader.advance(); + c.check_eof(); + return c.errors() == error_code::SUCCESS; +} + +bool generic_validate_utf8(const char * input, size_t length) { + return generic_validate_utf8(reinterpret_cast(input),length); +} + +} // namespace stage1 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE1_UTF8_VALIDATOR_H +/* end file generic/stage1/utf8_validator.h for westmere */ +/* end file generic/stage1/amalgamated.h for westmere */ +/* including generic/stage2/amalgamated.h for westmere: #include */ +/* begin file generic/stage2/amalgamated.h for westmere */ +// Stuff other things depend on +/* including generic/stage2/base.h for westmere: #include */ +/* begin file generic/stage2/base.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_BASE_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage2 { + +class json_iterator; +class structural_iterator; +struct tape_builder; +struct tape_writer; + +} // namespace stage2 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_BASE_H +/* end file generic/stage2/base.h for westmere */ +/* including generic/stage2/tape_writer.h for westmere: #include */ +/* begin file generic/stage2/tape_writer.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace westmere { +namespace { +namespace stage2 { + +struct tape_writer { + /** The next place to write to tape */ + uint64_t *next_tape_loc; + + /** Write a signed 64-bit value to tape. */ + simdjson_inline void append_s64(int64_t value) noexcept; + + /** Write an unsigned 64-bit value to tape. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + + /** Write a double value to tape. */ + simdjson_inline void append_double(double value) noexcept; + + /** + * Append a tape entry (an 8-bit type,and 56 bits worth of value). + */ + simdjson_inline void append(uint64_t val, internal::tape_type t) noexcept; + + /** + * Skip the current tape entry without writing. + * + * Used to skip the start of the container, since we'll come back later to fill it in when the + * container ends. + */ + simdjson_inline void skip() noexcept; + + /** + * Skip the number of tape entries necessary to write a large u64 or i64. + */ + simdjson_inline void skip_large_integer() noexcept; + + /** + * Skip the number of tape entries necessary to write a double. + */ + simdjson_inline void skip_double() noexcept; + + /** + * Write a value to a known location on tape. + * + * Used to go back and write out the start of a container after the container ends. + */ + simdjson_inline static void write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept; + +private: + /** + * Append both the tape entry, and a supplementary value following it. Used for types that need + * all 64 bits, such as double and uint64_t. + */ + template + simdjson_inline void append2(uint64_t val, T val2, internal::tape_type t) noexcept; +}; // struct tape_writer + +simdjson_inline void tape_writer::append_s64(int64_t value) noexcept { + append2(0, value, internal::tape_type::INT64); +} + +simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept { + append(0, internal::tape_type::UINT64); + *next_tape_loc = value; + next_tape_loc++; +} + +/** Write a double value to tape. */ +simdjson_inline void tape_writer::append_double(double value) noexcept { + append2(0, value, internal::tape_type::DOUBLE); +} + +simdjson_inline void tape_writer::skip() noexcept { + next_tape_loc++; +} + +simdjson_inline void tape_writer::skip_large_integer() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::skip_double() noexcept { + next_tape_loc += 2; +} + +simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept { + *next_tape_loc = val | ((uint64_t(char(t))) << 56); + next_tape_loc++; +} + +template +simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept { + append(val, t); + static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!"); + memcpy(next_tape_loc, &val2, sizeof(val2)); + next_tape_loc++; +} + +simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept { + tape_loc = val | ((uint64_t(char(t))) << 56); +} + +} // namespace stage2 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_WRITER_H +/* end file generic/stage2/tape_writer.h for westmere */ +/* including generic/stage2/logger.h for westmere: #include */ +/* begin file generic/stage2/logger.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_LOGGER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + + +// This is for an internal-only stage 2 specific logger. +// Set LOG_ENABLED = true to log what stage 2 is doing! +namespace simdjson { +namespace westmere { +namespace { +namespace logger { + + static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + static constexpr const int LOG_EVENT_LEN = 20; + static constexpr const int LOG_BUFFER_LEN = 30; + static constexpr const int LOG_SMALL_BUFFER_LEN = 10; + static constexpr const int LOG_INDEX_LEN = 5; + + static int log_depth; // Not threadsafe. Log only. + + // Helper to turn unprintable or newline characters into spaces + static simdjson_inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } + } + + // Print the header and set up log_start + static simdjson_inline void log_start() { + if (LOG_ENABLED) { + log_depth = 0; + printf("\n"); + printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#"); + printf("|%.*s|%.*s|%.*s|%.*s|--------|\n", LOG_EVENT_LEN+2, DASHES, LOG_BUFFER_LEN+2, DASHES, LOG_SMALL_BUFFER_LEN+2, DASHES, 5+2, DASHES); + } + } + + simdjson_unused static simdjson_inline void log_string(const char *message) { + if (LOG_ENABLED) { + printf("%s\n", message); + } + } + + // Logs a single line from the stage 2 DOM parser + template + static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) { + if (LOG_ENABLED) { + printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title); + auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1; + auto next_index = structurals.next_structural; + auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast(" "); + auto next = &structurals.buf[*next_index]; + { + // Print the next N characters in the buffer. + printf("| "); + // Otherwise, print the characters starting from the buffer position. + // Print spaces for unprintable or newline characters. + for (int i=0;i */ +/* begin file generic/stage2/json_iterator.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage2 { + +class json_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + uint32_t depth{0}; + + /** + * Walk the JSON document. + * + * The visitor receives callbacks when values are encountered. All callbacks pass the iterator as + * the first parameter; some callbacks have other parameters as well: + * + * - visit_document_start() - at the beginning. + * - visit_document_end() - at the end (if things were successful). + * + * - visit_array_start() - at the start `[` of a non-empty array. + * - visit_array_end() - at the end `]` of a non-empty array. + * - visit_empty_array() - when an empty array is encountered. + * + * - visit_object_end() - at the start `]` of a non-empty object. + * - visit_object_start() - at the end `]` of a non-empty object. + * - visit_empty_object() - when an empty object is encountered. + * - visit_key(const uint8_t *key) - when a key in an object field is encountered. key is + * guaranteed to point at the first quote of the string (`"key"`). + * - visit_primitive(const uint8_t *value) - when a value is a string, number, boolean or null. + * - visit_root_primitive(iter, uint8_t *value) - when the top-level value is a string, number, boolean or null. + * + * - increment_count(iter) - each time a value is found in an array or object. + */ + template + simdjson_warn_unused simdjson_inline error_code walk_document(V &visitor) noexcept; + + /** + * Create an iterator capable of walking a JSON document. + * + * The document must have already passed through stage 1. + */ + simdjson_inline json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index); + + /** + * Look at the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *peek() const noexcept; + /** + * Advance to the next token. + * + * Tokens can be strings, numbers, booleans, null, or operators (`[{]},:`)). + * + * They may include invalid JSON as well (such as `1.2.3` or `ture`). + */ + simdjson_inline const uint8_t *advance() noexcept; + /** + * Get the remaining length of the document, from the start of the current token. + */ + simdjson_inline size_t remaining_len() const noexcept; + /** + * Check if we are at the end of the document. + * + * If this is true, there are no more tokens. + */ + simdjson_inline bool at_eof() const noexcept; + /** + * Check if we are at the beginning of the document. + */ + simdjson_inline bool at_beginning() const noexcept; + simdjson_inline uint8_t last_structural() const noexcept; + + /** + * Log that a value has been found. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_value(const char *type) const noexcept; + /** + * Log the start of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_start_value(const char *type) const noexcept; + /** + * Log the end of a multipart value. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_end_value(const char *type) const noexcept; + /** + * Log an error. + * + * Set LOG_ENABLED=true in logger.h to see logging. + */ + simdjson_inline void log_error(const char *error) const noexcept; + + template + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(V &visitor, const uint8_t *value) noexcept; + template + simdjson_warn_unused simdjson_inline error_code visit_primitive(V &visitor, const uint8_t *value) noexcept; +}; + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept { + logger::log_start(); + + // + // Start the document + // + if (at_eof()) { return EMPTY; } + log_start_value("document"); + SIMDJSON_TRY( visitor.visit_document_start(*this) ); + + // + // Read first value + // + { + auto value = advance(); + + // Make sure the outer object or array is closed before continuing; otherwise, there are ways we + // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906 + if (!STREAMING) { + switch (*value) { + case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break; + case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break; + } + } + + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break; + } + } + goto document_end; + +// +// Object parser states +// +object_begin: + log_start_value("object"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = false; + SIMDJSON_TRY( visitor.visit_object_start(*this) ); + + { + auto key = advance(); + if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.increment_count(*this) ); + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + +object_field: + if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; } + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +object_continue: + switch (*advance()) { + case ',': + SIMDJSON_TRY( visitor.increment_count(*this) ); + { + auto key = advance(); + if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; } + SIMDJSON_TRY( visitor.visit_key(*this, key) ); + } + goto object_field; + case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end; + default: log_error("No comma between object fields"); return TAPE_ERROR; + } + +scope_end: + depth--; + if (depth == 0) { goto document_end; } + if (dom_parser.is_array[depth]) { goto array_continue; } + goto object_continue; + +// +// Array parser states +// +array_begin: + log_start_value("array"); + depth++; + if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; } + dom_parser.is_array[depth] = true; + SIMDJSON_TRY( visitor.visit_array_start(*this) ); + SIMDJSON_TRY( visitor.increment_count(*this) ); + +array_value: + { + auto value = advance(); + switch (*value) { + case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin; + case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin; + default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break; + } + } + +array_continue: + switch (*advance()) { + case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value; + case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end; + default: log_error("Missing comma between array values"); return TAPE_ERROR; + } + +document_end: + log_end_value("document"); + SIMDJSON_TRY( visitor.visit_document_end(*this) ); + + dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]); + + // If we didn't make it to the end, it's an error + if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) { + log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); + return TAPE_ERROR; + } + + return SUCCESS; + +} // walk_document() + +simdjson_inline json_iterator::json_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { +} + +simdjson_inline const uint8_t *json_iterator::peek() const noexcept { + return &buf[*(next_structural)]; +} +simdjson_inline const uint8_t *json_iterator::advance() noexcept { + return &buf[*(next_structural++)]; +} +simdjson_inline size_t json_iterator::remaining_len() const noexcept { + return dom_parser.len - *(next_structural-1); +} + +simdjson_inline bool json_iterator::at_eof() const noexcept { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; +} +simdjson_inline bool json_iterator::at_beginning() const noexcept { + return next_structural == dom_parser.structural_indexes.get(); +} +simdjson_inline uint8_t json_iterator::last_structural() const noexcept { + return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]]; +} + +simdjson_inline void json_iterator::log_value(const char *type) const noexcept { + logger::log_line(*this, "", type, ""); +} + +simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept { + logger::log_line(*this, "+", type, ""); + if (logger::LOG_ENABLED) { logger::log_depth++; } +} + +simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept { + if (logger::LOG_ENABLED) { logger::log_depth--; } + logger::log_line(*this, "-", type, ""); +} + +simdjson_inline void json_iterator::log_error(const char *error) const noexcept { + logger::log_line(*this, "", "ERROR", error); +} + +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept { + switch (*value) { + case '"': return visitor.visit_root_string(*this, value); + case 't': return visitor.visit_root_true_atom(*this, value); + case 'f': return visitor.visit_root_false_atom(*this, value); + case 'n': return visitor.visit_root_null_atom(*this, value); + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return visitor.visit_root_number(*this, value); + default: + log_error("Document starts with a non-value character"); + return TAPE_ERROR; + } +} +template +simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept { + // Use the fact that most scalars are going to be either strings or numbers. + if(*value == '"') { + return visitor.visit_string(*this, value); + } else if (((*value - '0') < 10) || (*value == '-')) { + return visitor.visit_number(*this, value); + } + // true, false, null are uncommon. + switch (*value) { + case 't': return visitor.visit_true_atom(*this, value); + case 'f': return visitor.visit_false_atom(*this, value); + case 'n': return visitor.visit_null_atom(*this, value); + default: + log_error("Non-value found when value was expected!"); + return TAPE_ERROR; + } +} + +} // namespace stage2 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_JSON_ITERATOR_H +/* end file generic/stage2/json_iterator.h for westmere */ +/* including generic/stage2/stringparsing.h for westmere: #include */ +/* begin file generic/stage2/stringparsing.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This file contains the common code every implementation uses +// It is intended to be included multiple times and compiled multiple times + +namespace simdjson { +namespace westmere { +namespace { +/// @private +namespace stringparsing { + +// begin copypasta +// These chars yield themselves: " \ / +// b -> backspace, f -> formfeed, n -> newline, r -> cr, t -> horizontal tab +// u not handled in this table as it's complex +static const uint8_t escape_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x0. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2f, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x4. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c, 0, 0, 0, // 0x5. + 0, 0, 0x08, 0, 0, 0, 0x0c, 0, 0, 0, 0, 0, 0, 0, 0x0a, 0, // 0x6. + 0, 0, 0x0d, 0, 0x09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x7. + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +// handle a unicode codepoint +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint(const uint8_t **src_ptr, + uint8_t **dst_ptr, bool allow_replacement) { + // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD) + constexpr uint32_t substitution_code_point = 0xfffd; + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) != ((static_cast ('\\') << 8) | static_cast ('u'))) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + + // We have already checked that the high surrogate is valid and + // (code_point - 0xd800) < 1024. + // + // Check that code_point_2 is in the range 0xdc00..0xdfff + // and that code_point_2 was parsed from valid hex. + uint32_t low_bit = code_point_2 - 0xdc00; + if (low_bit >> 10) { + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } else { + code_point = (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + + } + } else if (code_point >= 0xdc00 && code_point <= 0xdfff) { + // If we encounter a low surrogate (not preceded by a high surrogate) + // then we have an error. + if(!allow_replacement) { return false; } + code_point = substitution_code_point; + } + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +// handle a unicode codepoint using the wobbly convention +// https://simonsapin.github.io/wtf-8/ +// write appropriate values into dest +// src will advance 6 bytes or 12 bytes +// dest will advance a variable amount (return via pointer) +// return true if the unicode codepoint was valid +// We work in little-endian then swap at write time +simdjson_warn_unused +simdjson_inline bool handle_unicode_codepoint_wobbly(const uint8_t **src_ptr, + uint8_t **dst_ptr) { + // It is not ideal that this function is nearly identical to handle_unicode_codepoint. + // + // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the + // conversion isn't valid; we defer the check for this to inside the + // multilingual plane check + uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2); + *src_ptr += 6; + // If we found a high surrogate, we must + // check for low surrogate for characters + // outside the Basic + // Multilingual Plane. + if (code_point >= 0xd800 && code_point < 0xdc00) { + const uint8_t *src_data = *src_ptr; + /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */ + if (((src_data[0] << 8) | src_data[1]) == ((static_cast ('\\') << 8) | static_cast ('u'))) { + uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2); + uint32_t low_bit = code_point_2 - 0xdc00; + if ((low_bit >> 10) == 0) { + code_point = + (((code_point - 0xd800) << 10) | low_bit) + 0x10000; + *src_ptr += 6; + } + } + } + + size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr); + *dst_ptr += offset; + return offset > 0; +} + + +/** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + */ +simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) { + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { + // It is not ideal that this function is nearly identical to parse_string. + while (1) { + // Copy the next n bytes, and find the backslash and quote in them. + auto bs_quote = backslash_and_quote::copy_and_find(src, dst); + // If the next thing is the end quote, copy and return + if (bs_quote.has_quote_first()) { + // we encountered quotes first. Move dst to point to quotes and exit + return dst + bs_quote.quote_index(); + } + if (bs_quote.has_backslash()) { + /* find out where the backspace is */ + auto bs_dist = bs_quote.backslash_index(); + uint8_t escape_char = src[bs_dist + 1]; + /* we encountered backslash first. Handle backslash */ + if (escape_char == 'u') { + /* move src/dst up to the start; they will be further adjusted + within the unicode codepoint handling code. */ + src += bs_dist; + dst += bs_dist; + if (!handle_unicode_codepoint_wobbly(&src, &dst)) { + return nullptr; + } + } else { + /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and + * write bs_dist+1 characters to output + * note this may reach beyond the part of the buffer we've actually + * seen. I think this is ok */ + uint8_t escape_result = escape_map[escape_char]; + if (escape_result == 0u) { + return nullptr; /* bogus escape value is an error */ + } + dst[bs_dist] = escape_result; + src += bs_dist + 2; + dst += bs_dist + 1; + } + } else { + /* they are the same. Since they can't co-occur, it means we + * encountered neither. */ + src += backslash_and_quote::BYTES_PROCESSED; + dst += backslash_and_quote::BYTES_PROCESSED; + } + } + /* can't be reached */ + return nullptr; +} + +} // namespace stringparsing +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRINGPARSING_H +/* end file generic/stage2/stringparsing.h for westmere */ +/* including generic/stage2/structural_iterator.h for westmere: #include */ +/* begin file generic/stage2/structural_iterator.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace stage2 { + +class structural_iterator { +public: + const uint8_t* const buf; + uint32_t *next_structural; + dom_parser_implementation &dom_parser; + + // Start a structural + simdjson_inline structural_iterator(dom_parser_implementation &_dom_parser, size_t start_structural_index) + : buf{_dom_parser.buf}, + next_structural{&_dom_parser.structural_indexes[start_structural_index]}, + dom_parser{_dom_parser} { + } + // Get the buffer position of the current structural character + simdjson_inline const uint8_t* current() { + return &buf[*(next_structural-1)]; + } + // Get the current structural character + simdjson_inline char current_char() { + return buf[*(next_structural-1)]; + } + // Get the next structural character without advancing + simdjson_inline char peek_next_char() { + return buf[*next_structural]; + } + simdjson_inline const uint8_t* peek() { + return &buf[*next_structural]; + } + simdjson_inline const uint8_t* advance() { + return &buf[*(next_structural++)]; + } + simdjson_inline char advance_char() { + return buf[*(next_structural++)]; + } + simdjson_inline size_t remaining_len() { + return dom_parser.len - *(next_structural-1); + } + + simdjson_inline bool at_end() { + return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes]; + } + simdjson_inline bool at_beginning() { + return next_structural == dom_parser.structural_indexes.get(); + } +}; + +} // namespace stage2 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_STRUCTURAL_ITERATOR_H +/* end file generic/stage2/structural_iterator.h for westmere */ +/* including generic/stage2/tape_builder.h for westmere: #include */ +/* begin file generic/stage2/tape_builder.h for westmere */ +#ifndef SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #include */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace westmere { +namespace { +namespace stage2 { + +struct tape_builder { + template + simdjson_warn_unused static simdjson_inline error_code parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept; + + /** Called when a non-empty document starts. */ + simdjson_warn_unused simdjson_inline error_code visit_document_start(json_iterator &iter) noexcept; + /** Called when a non-empty document ends without error. */ + simdjson_warn_unused simdjson_inline error_code visit_document_end(json_iterator &iter) noexcept; + + /** Called when a non-empty array starts. */ + simdjson_warn_unused simdjson_inline error_code visit_array_start(json_iterator &iter) noexcept; + /** Called when a non-empty array ends. */ + simdjson_warn_unused simdjson_inline error_code visit_array_end(json_iterator &iter) noexcept; + /** Called when an empty array is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_array(json_iterator &iter) noexcept; + + /** Called when a non-empty object starts. */ + simdjson_warn_unused simdjson_inline error_code visit_object_start(json_iterator &iter) noexcept; + /** + * Called when a key in a field is encountered. + * + * primitive, visit_object_start, visit_empty_object, visit_array_start, or visit_empty_array + * will be called after this with the field value. + */ + simdjson_warn_unused simdjson_inline error_code visit_key(json_iterator &iter, const uint8_t *key) noexcept; + /** Called when a non-empty object ends. */ + simdjson_warn_unused simdjson_inline error_code visit_object_end(json_iterator &iter) noexcept; + /** Called when an empty object is found. */ + simdjson_warn_unused simdjson_inline error_code visit_empty_object(json_iterator &iter) noexcept; + + /** + * Called when a string, number, boolean or null is found. + */ + simdjson_warn_unused simdjson_inline error_code visit_primitive(json_iterator &iter, const uint8_t *value) noexcept; + /** + * Called when a string, number, boolean or null is found at the top level of a document (i.e. + * when there is no array or object and the entire document is a single string, number, boolean or + * null. + * + * This is separate from primitive() because simdjson's normal primitive parsing routines assume + * there is at least one more token after the value, which is only true in an array or object. + */ + simdjson_warn_unused simdjson_inline error_code visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_string(json_iterator &iter, const uint8_t *value, bool key = false) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + simdjson_warn_unused simdjson_inline error_code visit_root_string(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_number(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept; + simdjson_warn_unused simdjson_inline error_code visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept; + + /** Called each time a new field or element in an array or object is found. */ + simdjson_warn_unused simdjson_inline error_code increment_count(json_iterator &iter) noexcept; + + /** Next location to write to tape */ + tape_writer tape; +private: + /** Next write location in the string buf for stage 2 parsing */ + uint8_t *current_string_buf_loc; + + simdjson_inline tape_builder(dom::document &doc) noexcept; + + simdjson_inline uint32_t next_tape_index(json_iterator &iter) const noexcept; + simdjson_inline void start_container(json_iterator &iter) noexcept; + simdjson_warn_unused simdjson_inline error_code end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_warn_unused simdjson_inline error_code empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept; + simdjson_inline uint8_t *on_start_string(json_iterator &iter) noexcept; + simdjson_inline void on_end_string(uint8_t *dst) noexcept; +}; // struct tape_builder + +template +simdjson_warn_unused simdjson_inline error_code tape_builder::parse_document( + dom_parser_implementation &dom_parser, + dom::document &doc) noexcept { + dom_parser.doc = &doc; + json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0); + tape_builder builder(doc); + return iter.walk_document(builder); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_root_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept { + return iter.visit_primitive(*this, value); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept { + return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept { + start_container(iter); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept { + return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY); +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept { + constexpr uint32_t start_tape_index = 0; + tape.append(start_tape_index, internal::tape_type::ROOT); + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT); + return SUCCESS; +} +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept { + return visit_string(iter, key, true); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1 + return SUCCESS; +} + +simdjson_inline tape_builder::tape_builder(dom::document &doc) noexcept : tape{doc.tape.get()}, current_string_buf_loc{doc.string_buf.get()} {} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept { + iter.log_value(key ? "key" : "string"); + uint8_t *dst = on_start_string(iter); + dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid. + if (dst == nullptr) { + iter.log_error("Invalid escape in string"); + return STRING_ERROR; + } + on_end_string(dst); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept { + return visit_string(iter, value); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("number"); + return numberparsing::parse_number(value, tape); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_number(json_iterator &iter, const uint8_t *value) noexcept { + // + // We need to make a copy to make sure that the string is space terminated. + // This is not about padding the input, which should already padded up + // to len + SIMDJSON_PADDING. However, we have no control at this stage + // on how the padding was done. What if the input string was padded with nulls? + // It is quite common for an input string to have an extra null character (C string). + // We do not want to allow 9\0 (where \0 is the null character) inside a JSON + // document, but the string "9\0" by itself is fine. So we make a copy and + // pad the input with spaces when we know that there is just one input element. + // This copy is relatively expensive, but it will almost never be called in + // practice unless you are in the strange scenario where you have many JSON + // documents made of single atoms. + // + std::unique_ptrcopy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]); + if (copy.get() == nullptr) { return MEMALLOC; } + std::memcpy(copy.get(), value, iter.remaining_len()); + std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING); + error_code error = visit_number(iter, copy.get()); + return error; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("true"); + if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; } + tape.append(0, internal::tape_type::TRUE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value)) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("false"); + if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; } + tape.append(0, internal::tape_type::FALSE_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept { + iter.log_value("null"); + if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; } + tape.append(0, internal::tape_type::NULL_VALUE); + return SUCCESS; +} + +// private: + +simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept { + return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get()); +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + auto start_index = next_tape_index(iter); + tape.append(start_index+2, start); + tape.append(start_index, end); + return SUCCESS; +} + +simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept { + iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter); + iter.dom_parser.open_containers[iter.depth].count = 0; + tape.skip(); // We don't actually *write* the start element until the end. +} + +simdjson_warn_unused simdjson_inline error_code tape_builder::end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept { + // Write the ending tape element, pointing at the start location + const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index; + tape.append(start_tape_index, end); + // Write the start tape element, pointing at the end location (and including count) + // count can overflow if it exceeds 24 bits... so we saturate + // the convention being that a cnt of 0xffffff or more is undetermined in value (>= 0xffffff). + const uint32_t count = iter.dom_parser.open_containers[iter.depth].count; + const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count; + tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start); + return SUCCESS; +} + +simdjson_inline uint8_t *tape_builder::on_start_string(json_iterator &iter) noexcept { + // we advance the point, accounting for the fact that we have a NULL termination + tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING); + return current_string_buf_loc + sizeof(uint32_t); +} + +simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept { + uint32_t str_length = uint32_t(dst - (current_string_buf_loc + sizeof(uint32_t))); + // TODO check for overflow in case someone has a crazy string (>=4GB?) + // But only add the overflow check when the document itself exceeds 4GB + // Currently unneeded because we refuse to parse docs larger or equal to 4GB. + memcpy(current_string_buf_loc, &str_length, sizeof(uint32_t)); + // NULL termination is still handy if you expect all your strings to + // be NULL terminated? It comes at a small cost + *dst = 0; + current_string_buf_loc = dst + 1; +} + +} // namespace stage2 +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_SRC_GENERIC_STAGE2_TAPE_BUILDER_H +/* end file generic/stage2/tape_builder.h for westmere */ +/* end file generic/stage2/amalgamated.h for westmere */ + +// +// Stage 1 +// + +namespace simdjson { +namespace westmere { + +simdjson_warn_unused error_code implementation::create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr& dst +) const noexcept { + dst.reset( new (std::nothrow) dom_parser_implementation() ); + if (!dst) { return MEMALLOC; } + if (auto err = dst->set_capacity(capacity)) + return err; + if (auto err = dst->set_max_depth(max_depth)) + return err; + return SUCCESS; +} + +namespace { + +using namespace simd; + +simdjson_inline json_character_block json_character_block::classify(const simd::simd8x64& in) { + // These lookups rely on the fact that anything < 127 will match the lower 4 bits, which is why + // we can't use the generic lookup_16. + auto whitespace_table = simd8::repeat_16(' ', 100, 100, 100, 17, 100, 113, 2, 100, '\t', '\n', 112, 100, '\r', 100, 100); + + // The 6 operators (:,[]{}) have these values: + // + // , 2C + // : 3A + // [ 5B + // { 7B + // ] 5D + // } 7D + // + // If you use | 0x20 to turn [ and ] into { and }, the lower 4 bits of each character is unique. + // We exploit this, using a simd 4-bit lookup to tell us which character match against, and then + // match it (against | 0x20). + // + // To prevent recognizing other characters, everything else gets compared with 0, which cannot + // match due to the | 0x20. + // + // NOTE: Due to the | 0x20, this ALSO treats and (control characters 0C and 1A) like , + // and :. This gets caught in stage 2, which checks the actual character to ensure the right + // operators are in the right places. + const auto op_table = simd8::repeat_16( + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, ':', '{', // : = 3A, [ = 5B, { = 7B + ',', '}', 0, 0 // , = 2C, ] = 5D, } = 7D + ); + + // We compute whitespace and op separately. If the code later only use one or the + // other, given the fact that all functions are aggressively inlined, we can + // hope that useless computations will be omitted. This is namely case when + // minifying (we only need whitespace). + + + const uint64_t whitespace = in.eq({ + _mm_shuffle_epi8(whitespace_table, in.chunks[0]), + _mm_shuffle_epi8(whitespace_table, in.chunks[1]), + _mm_shuffle_epi8(whitespace_table, in.chunks[2]), + _mm_shuffle_epi8(whitespace_table, in.chunks[3]) + }); + // Turn [ and ] into { and } + const simd8x64 curlified{ + in.chunks[0] | 0x20, + in.chunks[1] | 0x20, + in.chunks[2] | 0x20, + in.chunks[3] | 0x20 + }; + const uint64_t op = curlified.eq({ + _mm_shuffle_epi8(op_table, in.chunks[0]), + _mm_shuffle_epi8(op_table, in.chunks[1]), + _mm_shuffle_epi8(op_table, in.chunks[2]), + _mm_shuffle_epi8(op_table, in.chunks[3]) + }); + return { whitespace, op }; +} + +simdjson_inline bool is_ascii(const simd8x64& input) { + return input.reduce_or().is_ascii(); +} + +simdjson_unused simdjson_inline simd8 must_be_continuation(const simd8 prev1, const simd8 prev2, const simd8 prev3) { + simd8 is_second_byte = prev1.saturating_sub(0xc0u-1); // Only 11______ will be > 0 + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_second_byte | is_third_byte | is_fourth_byte) > int8_t(0); +} + +simdjson_inline simd8 must_be_2_3_continuation(const simd8 prev2, const simd8 prev3) { + simd8 is_third_byte = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0 + simd8 is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0 + // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine. + return simd8(is_third_byte | is_fourth_byte) > int8_t(0); +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +// +// Stage 2 +// + +// +// Implementation-specific overrides +// + +namespace simdjson { +namespace westmere { + +simdjson_warn_unused error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept { + return westmere::stage1::json_minifier::minify<64>(buf, len, dst, dst_len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept { + this->buf = _buf; + this->len = _len; + return westmere::stage1::json_structural_indexer::index<64>(_buf, _len, *this, streaming); +} + +simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept { + return westmere::stage1::generic_validate_utf8(buf,len); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept { + return stage2::tape_builder::parse_document(*this, _doc); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool replacement_char) const noexcept { + return westmere::stringparsing::parse_string(src, dst, replacement_char); +} + +simdjson_warn_unused uint8_t *dom_parser_implementation::parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept { + return westmere::stringparsing::parse_wobbly_string(src, dst); +} + +simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept { + auto error = stage1(_buf, _len, stage1_mode::regular); + if (error) { return error; } + return stage2(_doc); +} + +} // namespace westmere +} // namespace simdjson + +/* including simdjson/westmere/end.h: #include */ +/* begin file simdjson/westmere/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "westmere" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/westmere/end.h */ + +#endif // SIMDJSON_SRC_WESTMERE_CPP +/* end file westmere.cpp */ +#endif + +/* undefining SIMDJSON_CONDITIONAL_INCLUDE */ +#undef SIMDJSON_CONDITIONAL_INCLUDE + +SIMDJSON_POP_DISABLE_UNUSED_WARNINGS + +/* end file simdjson.cpp */ diff --git a/deps/simdjson/simdjson.gyp b/deps/simdjson/simdjson.gyp new file mode 100644 index 00000000000000..5c5707a7de2899 --- /dev/null +++ b/deps/simdjson/simdjson.gyp @@ -0,0 +1,20 @@ +{ + 'variables': { + 'simdjson_sources': [ + 'simdjson.cpp', + ] + }, + 'targets': [ + { + 'target_name': 'simdjson', + 'type': 'static_library', + 'include_dirs': ['.'], + 'direct_dependent_settings': { + 'include_dirs': ['.'], + }, + 'sources': [ + '<@(simdjson_sources)', + ], + }, + ] +} diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h new file mode 100644 index 00000000000000..25e255066b0a54 --- /dev/null +++ b/deps/simdjson/simdjson.h @@ -0,0 +1,88489 @@ +/* auto-generated on 2023-10-30 12:51:02 -0400. Do not edit! */ +/* including simdjson.h: */ +/* begin file simdjson.h */ +#ifndef SIMDJSON_H +#define SIMDJSON_H + +/** + * @mainpage + * + * Check the [README.md](https://github.com/simdjson/simdjson/blob/master/README.md#simdjson--parsing-gigabytes-of-json-per-second). + * + * Sample code. See https://github.com/simdjson/simdjson/blob/master/doc/basics.md for more examples. + + #include "simdjson.h" + + int main(void) { + // load from `twitter.json` file: + simdjson::dom::parser parser; + simdjson::dom::element tweets = parser.load("twitter.json"); + std::cout << tweets["search_metadata"]["count"] << " results." << std::endl; + + // Parse and iterate through an array of objects + auto abstract_json = R"( [ + { "12345" : {"a":12.34, "b":56.78, "c": 9998877} }, + { "12545" : {"a":11.44, "b":12.78, "c": 11111111} } + ] )"_padded; + + for (simdjson::dom::object obj : parser.parse(abstract_json)) { + for(const auto key_value : obj) { + cout << "key: " << key_value.key << " : "; + simdjson::dom::object innerobj = key_value.value; + cout << "a: " << double(innerobj["a"]) << ", "; + cout << "b: " << double(innerobj["b"]) << ", "; + cout << "c: " << int64_t(innerobj["c"]) << endl; + } + } + } + */ + +/* including simdjson/common_defs.h: #include "simdjson/common_defs.h" */ +/* begin file simdjson/common_defs.h */ +#ifndef SIMDJSON_COMMON_DEFS_H +#define SIMDJSON_COMMON_DEFS_H + +#include +/* including simdjson/compiler_check.h: #include "simdjson/compiler_check.h" */ +/* begin file simdjson/compiler_check.h */ +#ifndef SIMDJSON_COMPILER_CHECK_H +#define SIMDJSON_COMPILER_CHECK_H + +#ifndef __cplusplus +#error simdjson requires a C++ compiler +#endif + +#ifndef SIMDJSON_CPLUSPLUS +#if defined(_MSVC_LANG) && !defined(__clang__) +#define SIMDJSON_CPLUSPLUS (_MSC_VER == 1900 ? 201103L : _MSVC_LANG) +#else +#define SIMDJSON_CPLUSPLUS __cplusplus +#endif +#endif + +// C++ 17 +#if !defined(SIMDJSON_CPLUSPLUS17) && (SIMDJSON_CPLUSPLUS >= 201703L) +#define SIMDJSON_CPLUSPLUS17 1 +#endif + +// C++ 14 +#if !defined(SIMDJSON_CPLUSPLUS14) && (SIMDJSON_CPLUSPLUS >= 201402L) +#define SIMDJSON_CPLUSPLUS14 1 +#endif + +// C++ 11 +#if !defined(SIMDJSON_CPLUSPLUS11) && (SIMDJSON_CPLUSPLUS >= 201103L) +#define SIMDJSON_CPLUSPLUS11 1 +#endif + +#ifndef SIMDJSON_CPLUSPLUS11 +#error simdjson requires a compiler compliant with the C++11 standard +#endif + +#ifndef SIMDJSON_IF_CONSTEXPR +#if SIMDJSON_CPLUSPLUS17 +#define SIMDJSON_IF_CONSTEXPR if constexpr +#else +#define SIMDJSON_IF_CONSTEXPR if +#endif +#endif + +#endif // SIMDJSON_COMPILER_CHECK_H +/* end file simdjson/compiler_check.h */ +/* including simdjson/portability.h: #include "simdjson/portability.h" */ +/* begin file simdjson/portability.h */ +#ifndef SIMDJSON_PORTABILITY_H +#define SIMDJSON_PORTABILITY_H + +#include +#include +#include +#include +#include +#ifndef _WIN32 +// strcasecmp, strncasecmp +#include +#endif + +#ifdef _MSC_VER +#define SIMDJSON_VISUAL_STUDIO 1 +/** + * We want to differentiate carefully between + * clang under visual studio and regular visual + * studio. + * + * Under clang for Windows, we enable: + * * target pragmas so that part and only part of the + * code gets compiled for advanced instructions. + * + */ +#ifdef __clang__ +// clang under visual studio +#define SIMDJSON_CLANG_VISUAL_STUDIO 1 +#else +// just regular visual studio (best guess) +#define SIMDJSON_REGULAR_VISUAL_STUDIO 1 +#endif // __clang__ +#endif // _MSC_VER + +#if defined(__x86_64__) || defined(_M_AMD64) +#define SIMDJSON_IS_X86_64 1 +#elif defined(__aarch64__) || defined(_M_ARM64) +#define SIMDJSON_IS_ARM64 1 +#elif defined(__PPC64__) || defined(_M_PPC64) +#if defined(__ALTIVEC__) +#define SIMDJSON_IS_PPC64_VMX 1 +#endif // defined(__ALTIVEC__) +#else +#define SIMDJSON_IS_32BITS 1 + +#if defined(_M_IX86) || defined(__i386__) +#define SIMDJSON_IS_X86_32BITS 1 +#elif defined(__arm__) || defined(_M_ARM) +#define SIMDJSON_IS_ARM_32BITS 1 +#elif defined(__PPC__) || defined(_M_PPC) +#define SIMDJSON_IS_PPC_32BITS 1 +#endif + +#endif // defined(__x86_64__) || defined(_M_AMD64) +#ifndef SIMDJSON_IS_32BITS +#define SIMDJSON_IS_32BITS 0 +#endif + +#if SIMDJSON_IS_32BITS +#ifndef SIMDJSON_NO_PORTABILITY_WARNING +// In the future, we should allow programmers +// to get warning. +#endif // SIMDJSON_NO_PORTABILITY_WARNING +#endif // SIMDJSON_IS_32BITS + +#define SIMDJSON_CAT_IMPLEMENTATION_(a,...) a ## __VA_ARGS__ +#define SIMDJSON_CAT(a,...) SIMDJSON_CAT_IMPLEMENTATION_(a, __VA_ARGS__) + +#define SIMDJSON_STRINGIFY_IMPLEMENTATION_(a,...) #a SIMDJSON_STRINGIFY(__VA_ARGS__) +#define SIMDJSON_STRINGIFY(a,...) SIMDJSON_CAT_IMPLEMENTATION_(a, __VA_ARGS__) + +// this is almost standard? +#undef SIMDJSON_STRINGIFY_IMPLEMENTATION_ +#undef SIMDJSON_STRINGIFY +#define SIMDJSON_STRINGIFY_IMPLEMENTATION_(a) #a +#define SIMDJSON_STRINGIFY(a) SIMDJSON_STRINGIFY_IMPLEMENTATION_(a) + +// Our fast kernels require 64-bit systems. +// +// On 32-bit x86, we lack 64-bit popcnt, lzcnt, blsr instructions. +// Furthermore, the number of SIMD registers is reduced. +// +// On 32-bit ARM, we would have smaller registers. +// +// The simdjson users should still have the fallback kernel. It is +// slower, but it should run everywhere. + +// +// Enable valid runtime implementations, and select SIMDJSON_BUILTIN_IMPLEMENTATION +// + +// We are going to use runtime dispatch. +#if SIMDJSON_IS_X86_64 +#ifdef __clang__ +// clang does not have GCC push pop +// warning: clang attribute push can't be used within a namespace in clang up +// til 8.0 so SIMDJSON_TARGET_REGION and SIMDJSON_UNTARGET_REGION must be *outside* of a +// namespace. +#define SIMDJSON_TARGET_REGION(T) \ + _Pragma(SIMDJSON_STRINGIFY( \ + clang attribute push(__attribute__((target(T))), apply_to = function))) +#define SIMDJSON_UNTARGET_REGION _Pragma("clang attribute pop") +#elif defined(__GNUC__) +// GCC is easier +#define SIMDJSON_TARGET_REGION(T) \ + _Pragma("GCC push_options") _Pragma(SIMDJSON_STRINGIFY(GCC target(T))) +#define SIMDJSON_UNTARGET_REGION _Pragma("GCC pop_options") +#endif // clang then gcc + +#endif // x86 + +// Default target region macros don't do anything. +#ifndef SIMDJSON_TARGET_REGION +#define SIMDJSON_TARGET_REGION(T) +#define SIMDJSON_UNTARGET_REGION +#endif + +// Is threading enabled? +#if defined(_REENTRANT) || defined(_MT) +#ifndef SIMDJSON_THREADS_ENABLED +#define SIMDJSON_THREADS_ENABLED +#endif +#endif + +// workaround for large stack sizes under -O0. +// https://github.com/simdjson/simdjson/issues/691 +#ifdef __APPLE__ +#ifndef __OPTIMIZE__ +// Apple systems have small stack sizes in secondary threads. +// Lack of compiler optimization may generate high stack usage. +// Users may want to disable threads for safety, but only when +// in debug mode which we detect by the fact that the __OPTIMIZE__ +// macro is not defined. +#undef SIMDJSON_THREADS_ENABLED +#endif +#endif + + +#if defined(__clang__) +#define SIMDJSON_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined"))) +#elif defined(__GNUC__) +#define SIMDJSON_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined)) +#else +#define SIMDJSON_NO_SANITIZE_UNDEFINED +#endif + + +#if defined(__clang__) || defined(__GNUC__) +#if defined(__has_feature) +# if __has_feature(memory_sanitizer) +#define SIMDJSON_NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory"))) +# endif // if __has_feature(memory_sanitizer) +#endif // defined(__has_feature) +#endif +// make sure it is defined as 'nothing' if it is unapplicable. +#ifndef SIMDJSON_NO_SANITIZE_MEMORY +#define SIMDJSON_NO_SANITIZE_MEMORY +#endif + +#if SIMDJSON_VISUAL_STUDIO +// This is one case where we do not distinguish between +// regular visual studio and clang under visual studio. +// clang under Windows has _stricmp (like visual studio) but not strcasecmp (as clang normally has) +#define simdjson_strcasecmp _stricmp +#define simdjson_strncasecmp _strnicmp +#else +// The strcasecmp, strncasecmp, and strcasestr functions do not work with multibyte strings (e.g. UTF-8). +// So they are only useful for ASCII in our context. +// https://www.gnu.org/software/libunistring/manual/libunistring.html#char-_002a-strings +#define simdjson_strcasecmp strcasecmp +#define simdjson_strncasecmp strncasecmp +#endif + +#if defined(NDEBUG) || defined(__OPTIMIZE__) || (defined(_MSC_VER) && !defined(_DEBUG)) +// If NDEBUG is set, or __OPTIMIZE__ is set, or we are under MSVC in release mode, +// then do away with asserts and use __assume. +#if SIMDJSON_VISUAL_STUDIO +#define SIMDJSON_UNREACHABLE() __assume(0) +#define SIMDJSON_ASSUME(COND) __assume(COND) +#else +#define SIMDJSON_UNREACHABLE() __builtin_unreachable(); +#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0) +#endif + +#else // defined(NDEBUG) || defined(__OPTIMIZE__) || (defined(_MSC_VER) && !defined(_DEBUG)) +// This should only ever be enabled in debug mode. +#define SIMDJSON_UNREACHABLE() assert(0); +#define SIMDJSON_ASSUME(COND) assert(COND) + +#endif + +#endif // SIMDJSON_PORTABILITY_H +/* end file simdjson/portability.h */ + +namespace simdjson { +namespace internal { +/** + * @private + * Our own implementation of the C++17 to_chars function. + * Defined in src/to_chars + */ +char *to_chars(char *first, const char *last, double value); +/** + * @private + * A number parsing routine. + * Defined in src/from_chars + */ +double from_chars(const char *first) noexcept; +double from_chars(const char *first, const char* end) noexcept; +} + +#ifndef SIMDJSON_EXCEPTIONS +#if __cpp_exceptions +#define SIMDJSON_EXCEPTIONS 1 +#else +#define SIMDJSON_EXCEPTIONS 0 +#endif +#endif + +} // namespace simdjson + +#if defined(__GNUC__) + // Marks a block with a name so that MCA analysis can see it. + #define SIMDJSON_BEGIN_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-BEGIN " #name); + #define SIMDJSON_END_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-END " #name); + #define SIMDJSON_DEBUG_BLOCK(name, block) BEGIN_DEBUG_BLOCK(name); block; END_DEBUG_BLOCK(name); +#else + #define SIMDJSON_BEGIN_DEBUG_BLOCK(name) + #define SIMDJSON_END_DEBUG_BLOCK(name) + #define SIMDJSON_DEBUG_BLOCK(name, block) +#endif + +// Align to N-byte boundary +#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1)) +#define SIMDJSON_ROUNDDOWN_N(a, n) ((a) & ~((n)-1)) + +#define SIMDJSON_ISALIGNED_N(ptr, n) (((uintptr_t)(ptr) & ((n)-1)) == 0) + +#if SIMDJSON_REGULAR_VISUAL_STUDIO + + #define simdjson_really_inline __forceinline + #define simdjson_never_inline __declspec(noinline) + + #define simdjson_unused + #define simdjson_warn_unused + + #ifndef simdjson_likely + #define simdjson_likely(x) x + #endif + #ifndef simdjson_unlikely + #define simdjson_unlikely(x) x + #endif + + #define SIMDJSON_PUSH_DISABLE_WARNINGS __pragma(warning( push )) + #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS __pragma(warning( push, 0 )) + #define SIMDJSON_DISABLE_VS_WARNING(WARNING_NUMBER) __pragma(warning( disable : WARNING_NUMBER )) + // Get rid of Intellisense-only warnings (Code Analysis) + // Though __has_include is C++17, it is supported in Visual Studio 2017 or better (_MSC_VER>=1910). + #ifdef __has_include + #if __has_include() + #include + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS) + #endif + #endif + + #ifndef SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #endif + + #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_VS_WARNING(4996) + #define SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING + #define SIMDJSON_POP_DISABLE_WARNINGS __pragma(warning( pop )) + + #define SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS + #define SIMDJSON_POP_DISABLE_UNUSED_WARNINGS + +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + + #define simdjson_really_inline inline __attribute__((always_inline)) + #define simdjson_never_inline inline __attribute__((noinline)) + + #define simdjson_unused __attribute__((unused)) + #define simdjson_warn_unused __attribute__((warn_unused_result)) + + #ifndef simdjson_likely + #define simdjson_likely(x) __builtin_expect(!!(x), 1) + #endif + #ifndef simdjson_unlikely + #define simdjson_unlikely(x) __builtin_expect(!!(x), 0) + #endif + + #define SIMDJSON_PUSH_DISABLE_WARNINGS _Pragma("GCC diagnostic push") + // gcc doesn't seem to disable all warnings with all and extra, add warnings here as necessary + // We do it separately for clang since it has different warnings. + #ifdef __clang__ + // clang is missing -Wmaybe-uninitialized. + #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS SIMDJSON_PUSH_DISABLE_WARNINGS \ + SIMDJSON_DISABLE_GCC_WARNING(-Weffc++) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wall) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wconversion) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wextra) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wattributes) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wimplicit-fallthrough) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wnon-virtual-dtor) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wreturn-type) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wshadow) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-parameter) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable) + #else // __clang__ + #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS SIMDJSON_PUSH_DISABLE_WARNINGS \ + SIMDJSON_DISABLE_GCC_WARNING(-Weffc++) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wall) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wconversion) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wextra) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wattributes) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wimplicit-fallthrough) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wnon-virtual-dtor) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wreturn-type) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wshadow) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-parameter) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wmaybe-uninitialized) \ + SIMDJSON_DISABLE_GCC_WARNING(-Wformat-security) + #endif // __clang__ + + #define SIMDJSON_PRAGMA(P) _Pragma(#P) + #define SIMDJSON_DISABLE_GCC_WARNING(WARNING) SIMDJSON_PRAGMA(GCC diagnostic ignored #WARNING) + #if SIMDJSON_CLANG_VISUAL_STUDIO + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) + #else + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #endif + #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wdeprecated-declarations) + #define SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wstrict-overflow) + #define SIMDJSON_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop") + + #define SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS SIMDJSON_PUSH_DISABLE_WARNINGS \ + SIMDJSON_DISABLE_GCC_WARNING(-Wunused) + #define SIMDJSON_POP_DISABLE_UNUSED_WARNINGS SIMDJSON_POP_DISABLE_WARNINGS + + + +#endif // MSC_VER + +#if defined(simdjson_inline) + // Prefer the user's definition of simdjson_inline; don't define it ourselves. +#elif defined(__GNUC__) && !defined(__OPTIMIZE__) + // If optimizations are disabled, forcing inlining can lead to significant + // code bloat and high compile times. Don't use simdjson_really_inline for + // unoptimized builds. + #define simdjson_inline inline +#else + // Force inlining for most simdjson functions. + #define simdjson_inline simdjson_really_inline +#endif + +#if SIMDJSON_VISUAL_STUDIO + /** + * Windows users need to do some extra work when building + * or using a dynamic library (DLL). When building, we need + * to set SIMDJSON_DLLIMPORTEXPORT to __declspec(dllexport). + * When *using* the DLL, the user needs to set + * SIMDJSON_DLLIMPORTEXPORT __declspec(dllimport). + * + * Static libraries not need require such work. + * + * It does not matter here whether you are using + * the regular visual studio or clang under visual + * studio, you still need to handle these issues. + * + * Non-Windows systems do not have this complexity. + */ + #if SIMDJSON_BUILDING_WINDOWS_DYNAMIC_LIBRARY + // We set SIMDJSON_BUILDING_WINDOWS_DYNAMIC_LIBRARY when we build a DLL under Windows. + // It should never happen that both SIMDJSON_BUILDING_WINDOWS_DYNAMIC_LIBRARY and + // SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY are set. + #define SIMDJSON_DLLIMPORTEXPORT __declspec(dllexport) + #elif SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY + // Windows user who call a dynamic library should set SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY to 1. + #define SIMDJSON_DLLIMPORTEXPORT __declspec(dllimport) + #else + // We assume by default static linkage + #define SIMDJSON_DLLIMPORTEXPORT + #endif + +/** + * Workaround for the vcpkg package manager. Only vcpkg should + * ever touch the next line. The SIMDJSON_USING_LIBRARY macro is otherwise unused. + */ +#if SIMDJSON_USING_LIBRARY +#define SIMDJSON_DLLIMPORTEXPORT __declspec(dllimport) +#endif +/** + * End of workaround for the vcpkg package manager. + */ +#else + #define SIMDJSON_DLLIMPORTEXPORT +#endif + +// C++17 requires string_view. +#if SIMDJSON_CPLUSPLUS17 +#define SIMDJSON_HAS_STRING_VIEW +#include // by the standard, this has to be safe. +#endif + +// This macro (__cpp_lib_string_view) has to be defined +// for C++17 and better, but if it is otherwise defined, +// we are going to assume that string_view is available +// even if we do not have C++17 support. +#ifdef __cpp_lib_string_view +#define SIMDJSON_HAS_STRING_VIEW +#endif + +// Some systems have string_view even if we do not have C++17 support, +// and even if __cpp_lib_string_view is undefined, it is the case +// with Apple clang version 11. +// We must handle it. *This is important.* +#ifndef SIMDJSON_HAS_STRING_VIEW +#if defined __has_include +// do not combine the next #if with the previous one (unsafe) +#if __has_include () +// now it is safe to trigger the include +#include // though the file is there, it does not follow that we got the implementation +#if defined(_LIBCPP_STRING_VIEW) +// Ah! So we under libc++ which under its Library Fundamentals Technical Specification, which preceded C++17, +// included string_view. +// This means that we have string_view *even though* we may not have C++17. +#define SIMDJSON_HAS_STRING_VIEW +#endif // _LIBCPP_STRING_VIEW +#endif // __has_include () +#endif // defined __has_include +#endif // def SIMDJSON_HAS_STRING_VIEW +// end of complicated but important routine to try to detect string_view. + +// +// Backfill std::string_view using nonstd::string_view on systems where +// we expect that string_view is missing. Important: if we get this wrong, +// we will end up with two string_view definitions and potential trouble. +// That is why we work so hard above to avoid it. +// +#ifndef SIMDJSON_HAS_STRING_VIEW +SIMDJSON_PUSH_DISABLE_ALL_WARNINGS +/* including simdjson/nonstd/string_view.hpp: #include "simdjson/nonstd/string_view.hpp" */ +/* begin file simdjson/nonstd/string_view.hpp */ +// Copyright 2017-2020 by Martin Moene +// +// string-view lite, a C++17-like string_view for C++98 and later. +// For more information see https://github.com/martinmoene/string-view-lite +// +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#pragma once + +#ifndef NONSTD_SV_LITE_H_INCLUDED +#define NONSTD_SV_LITE_H_INCLUDED + +#define string_view_lite_MAJOR 1 +#define string_view_lite_MINOR 7 +#define string_view_lite_PATCH 0 + +#define string_view_lite_VERSION nssv_STRINGIFY(string_view_lite_MAJOR) "." nssv_STRINGIFY(string_view_lite_MINOR) "." nssv_STRINGIFY(string_view_lite_PATCH) + +#define nssv_STRINGIFY( x ) nssv_STRINGIFY_( x ) +#define nssv_STRINGIFY_( x ) #x + +// string-view lite configuration: + +#define nssv_STRING_VIEW_DEFAULT 0 +#define nssv_STRING_VIEW_NONSTD 1 +#define nssv_STRING_VIEW_STD 2 + +// tweak header support: + +#ifdef __has_include +# if __has_include() +# include +# endif +#define nssv_HAVE_TWEAK_HEADER 1 +#else +#define nssv_HAVE_TWEAK_HEADER 0 +//# pragma message("string_view.hpp: Note: Tweak header not supported.") +#endif + +// string_view selection and configuration: + +#if !defined( nssv_CONFIG_SELECT_STRING_VIEW ) +# define nssv_CONFIG_SELECT_STRING_VIEW ( nssv_HAVE_STD_STRING_VIEW ? nssv_STRING_VIEW_STD : nssv_STRING_VIEW_NONSTD ) +#endif + +#ifndef nssv_CONFIG_STD_SV_OPERATOR +# define nssv_CONFIG_STD_SV_OPERATOR 0 +#endif + +#ifndef nssv_CONFIG_USR_SV_OPERATOR +# define nssv_CONFIG_USR_SV_OPERATOR 1 +#endif + +#ifdef nssv_CONFIG_CONVERSION_STD_STRING +# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS nssv_CONFIG_CONVERSION_STD_STRING +# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS nssv_CONFIG_CONVERSION_STD_STRING +#endif + +#ifndef nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS +# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS 1 +#endif + +#ifndef nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS +# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS 1 +#endif + +#ifndef nssv_CONFIG_NO_STREAM_INSERTION +# define nssv_CONFIG_NO_STREAM_INSERTION 0 +#endif + +// Control presence of exception handling (try and auto discover): + +#ifndef nssv_CONFIG_NO_EXCEPTIONS +# if defined(_MSC_VER) +# include // for _HAS_EXCEPTIONS +# endif +# if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || (_HAS_EXCEPTIONS) +# define nssv_CONFIG_NO_EXCEPTIONS 0 +# else +# define nssv_CONFIG_NO_EXCEPTIONS 1 +# endif +#endif + +// C++ language version detection (C++23 is speculative): +// Note: VC14.0/1900 (VS2015) lacks too much from C++14. + +#ifndef nssv_CPLUSPLUS +# if defined(_MSVC_LANG ) && !defined(__clang__) +# define nssv_CPLUSPLUS (_MSC_VER == 1900 ? 201103L : _MSVC_LANG ) +# else +# define nssv_CPLUSPLUS __cplusplus +# endif +#endif + +#define nssv_CPP98_OR_GREATER ( nssv_CPLUSPLUS >= 199711L ) +#define nssv_CPP11_OR_GREATER ( nssv_CPLUSPLUS >= 201103L ) +#define nssv_CPP11_OR_GREATER_ ( nssv_CPLUSPLUS >= 201103L ) +#define nssv_CPP14_OR_GREATER ( nssv_CPLUSPLUS >= 201402L ) +#define nssv_CPP17_OR_GREATER ( nssv_CPLUSPLUS >= 201703L ) +#define nssv_CPP20_OR_GREATER ( nssv_CPLUSPLUS >= 202002L ) +#define nssv_CPP23_OR_GREATER ( nssv_CPLUSPLUS >= 202300L ) + +// use C++17 std::string_view if available and requested: + +#if nssv_CPP17_OR_GREATER && defined(__has_include ) +# if __has_include( ) +# define nssv_HAVE_STD_STRING_VIEW 1 +# else +# define nssv_HAVE_STD_STRING_VIEW 0 +# endif +#else +# define nssv_HAVE_STD_STRING_VIEW 0 +#endif + +#define nssv_USES_STD_STRING_VIEW ( (nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_STD) || ((nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_DEFAULT) && nssv_HAVE_STD_STRING_VIEW) ) + +#define nssv_HAVE_STARTS_WITH ( nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW ) +#define nssv_HAVE_ENDS_WITH nssv_HAVE_STARTS_WITH + +// +// Use C++17 std::string_view: +// + +#if nssv_USES_STD_STRING_VIEW + +#include + +// Extensions for std::string: + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { + +template< class CharT, class Traits, class Allocator = std::allocator > +std::basic_string +to_string( std::basic_string_view v, Allocator const & a = Allocator() ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +template< class CharT, class Traits, class Allocator > +std::basic_string_view +to_string_view( std::basic_string const & s ) +{ + return std::basic_string_view( s.data(), s.size() ); +} + +// Literal operators sv and _sv: + +#if nssv_CONFIG_STD_SV_OPERATOR + +using namespace std::literals::string_view_literals; + +#endif + +#if nssv_CONFIG_USR_SV_OPERATOR + +inline namespace literals { +inline namespace string_view_literals { + + +constexpr std::string_view operator "" _sv( const char* str, size_t len ) noexcept // (1) +{ + return std::string_view{ str, len }; +} + +constexpr std::u16string_view operator "" _sv( const char16_t* str, size_t len ) noexcept // (2) +{ + return std::u16string_view{ str, len }; +} + +constexpr std::u32string_view operator "" _sv( const char32_t* str, size_t len ) noexcept // (3) +{ + return std::u32string_view{ str, len }; +} + +constexpr std::wstring_view operator "" _sv( const wchar_t* str, size_t len ) noexcept // (4) +{ + return std::wstring_view{ str, len }; +} + +}} // namespace literals::string_view_literals + +#endif // nssv_CONFIG_USR_SV_OPERATOR + +} // namespace nonstd + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { + +using std::string_view; +using std::wstring_view; +using std::u16string_view; +using std::u32string_view; +using std::basic_string_view; + +// literal "sv" and "_sv", see above + +using std::operator==; +using std::operator!=; +using std::operator<; +using std::operator<=; +using std::operator>; +using std::operator>=; + +using std::operator<<; + +} // namespace nonstd + +#else // nssv_HAVE_STD_STRING_VIEW + +// +// Before C++17: use string_view lite: +// + +// Compiler versions: +// +// MSVC++ 6.0 _MSC_VER == 1200 nssv_COMPILER_MSVC_VERSION == 60 (Visual Studio 6.0) +// MSVC++ 7.0 _MSC_VER == 1300 nssv_COMPILER_MSVC_VERSION == 70 (Visual Studio .NET 2002) +// MSVC++ 7.1 _MSC_VER == 1310 nssv_COMPILER_MSVC_VERSION == 71 (Visual Studio .NET 2003) +// MSVC++ 8.0 _MSC_VER == 1400 nssv_COMPILER_MSVC_VERSION == 80 (Visual Studio 2005) +// MSVC++ 9.0 _MSC_VER == 1500 nssv_COMPILER_MSVC_VERSION == 90 (Visual Studio 2008) +// MSVC++ 10.0 _MSC_VER == 1600 nssv_COMPILER_MSVC_VERSION == 100 (Visual Studio 2010) +// MSVC++ 11.0 _MSC_VER == 1700 nssv_COMPILER_MSVC_VERSION == 110 (Visual Studio 2012) +// MSVC++ 12.0 _MSC_VER == 1800 nssv_COMPILER_MSVC_VERSION == 120 (Visual Studio 2013) +// MSVC++ 14.0 _MSC_VER == 1900 nssv_COMPILER_MSVC_VERSION == 140 (Visual Studio 2015) +// MSVC++ 14.1 _MSC_VER >= 1910 nssv_COMPILER_MSVC_VERSION == 141 (Visual Studio 2017) +// MSVC++ 14.2 _MSC_VER >= 1920 nssv_COMPILER_MSVC_VERSION == 142 (Visual Studio 2019) + +#if defined(_MSC_VER ) && !defined(__clang__) +# define nssv_COMPILER_MSVC_VER (_MSC_VER ) +# define nssv_COMPILER_MSVC_VERSION (_MSC_VER / 10 - 10 * ( 5 + (_MSC_VER < 1900 ) ) ) +#else +# define nssv_COMPILER_MSVC_VER 0 +# define nssv_COMPILER_MSVC_VERSION 0 +#endif + +#define nssv_COMPILER_VERSION( major, minor, patch ) ( 10 * ( 10 * (major) + (minor) ) + (patch) ) + +#if defined( __apple_build_version__ ) +# define nssv_COMPILER_APPLECLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) +# define nssv_COMPILER_CLANG_VERSION 0 +#elif defined( __clang__ ) +# define nssv_COMPILER_APPLECLANG_VERSION 0 +# define nssv_COMPILER_CLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) +#else +# define nssv_COMPILER_APPLECLANG_VERSION 0 +# define nssv_COMPILER_CLANG_VERSION 0 +#endif + +#if defined(__GNUC__) && !defined(__clang__) +# define nssv_COMPILER_GNUC_VERSION nssv_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#else +# define nssv_COMPILER_GNUC_VERSION 0 +#endif + +// half-open range [lo..hi): +#define nssv_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) ) + +// Presence of language and library features: + +#ifdef _HAS_CPP0X +# define nssv_HAS_CPP0X _HAS_CPP0X +#else +# define nssv_HAS_CPP0X 0 +#endif + +// Unless defined otherwise below, consider VC14 as C++11 for variant-lite: + +#if nssv_COMPILER_MSVC_VER >= 1900 +# undef nssv_CPP11_OR_GREATER +# define nssv_CPP11_OR_GREATER 1 +#endif + +#define nssv_CPP11_90 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500) +#define nssv_CPP11_100 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600) +#define nssv_CPP11_110 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700) +#define nssv_CPP11_120 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800) +#define nssv_CPP11_140 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900) +#define nssv_CPP11_141 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910) + +#define nssv_CPP14_000 (nssv_CPP14_OR_GREATER) +#define nssv_CPP17_000 (nssv_CPP17_OR_GREATER) + +// Presence of C++11 language features: + +#define nssv_HAVE_CONSTEXPR_11 nssv_CPP11_140 +#define nssv_HAVE_EXPLICIT_CONVERSION nssv_CPP11_140 +#define nssv_HAVE_INLINE_NAMESPACE nssv_CPP11_140 +#define nssv_HAVE_IS_DEFAULT nssv_CPP11_140 +#define nssv_HAVE_IS_DELETE nssv_CPP11_140 +#define nssv_HAVE_NOEXCEPT nssv_CPP11_140 +#define nssv_HAVE_NULLPTR nssv_CPP11_100 +#define nssv_HAVE_REF_QUALIFIER nssv_CPP11_140 +#define nssv_HAVE_UNICODE_LITERALS nssv_CPP11_140 +#define nssv_HAVE_USER_DEFINED_LITERALS nssv_CPP11_140 +#define nssv_HAVE_WCHAR16_T nssv_CPP11_100 +#define nssv_HAVE_WCHAR32_T nssv_CPP11_100 + +#if ! ( ( nssv_CPP11_OR_GREATER && nssv_COMPILER_CLANG_VERSION ) || nssv_BETWEEN( nssv_COMPILER_CLANG_VERSION, 300, 400 ) ) +# define nssv_HAVE_STD_DEFINED_LITERALS nssv_CPP11_140 +#else +# define nssv_HAVE_STD_DEFINED_LITERALS 0 +#endif + +// Presence of C++14 language features: + +#define nssv_HAVE_CONSTEXPR_14 nssv_CPP14_000 + +// Presence of C++17 language features: + +#define nssv_HAVE_NODISCARD nssv_CPP17_000 + +// Presence of C++ library features: + +#define nssv_HAVE_STD_HASH nssv_CPP11_120 + +// Presence of compiler intrinsics: + +// Providing char-type specializations for compare() and length() that +// use compiler intrinsics can improve compile- and run-time performance. +// +// The challenge is in using the right combinations of builtin availability +// and its constexpr-ness. +// +// | compiler | __builtin_memcmp (constexpr) | memcmp (constexpr) | +// |----------|------------------------------|---------------------| +// | clang | 4.0 (>= 4.0 ) | any (? ) | +// | clang-a | 9.0 (>= 9.0 ) | any (? ) | +// | gcc | any (constexpr) | any (? ) | +// | msvc | >= 14.2 C++17 (>= 14.2 ) | any (? ) | + +#define nssv_HAVE_BUILTIN_VER ( (nssv_CPP17_000 && nssv_COMPILER_MSVC_VERSION >= 142) || nssv_COMPILER_GNUC_VERSION > 0 || nssv_COMPILER_CLANG_VERSION >= 400 || nssv_COMPILER_APPLECLANG_VERSION >= 900 ) +#define nssv_HAVE_BUILTIN_CE ( nssv_HAVE_BUILTIN_VER ) + +#define nssv_HAVE_BUILTIN_MEMCMP ( (nssv_HAVE_CONSTEXPR_14 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_14 ) +#define nssv_HAVE_BUILTIN_STRLEN ( (nssv_HAVE_CONSTEXPR_11 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_11 ) + +#ifdef __has_builtin +# define nssv_HAVE_BUILTIN( x ) __has_builtin( x ) +#else +# define nssv_HAVE_BUILTIN( x ) 0 +#endif + +#if nssv_HAVE_BUILTIN(__builtin_memcmp) || nssv_HAVE_BUILTIN_VER +# define nssv_BUILTIN_MEMCMP __builtin_memcmp +#else +# define nssv_BUILTIN_MEMCMP memcmp +#endif + +#if nssv_HAVE_BUILTIN(__builtin_strlen) || nssv_HAVE_BUILTIN_VER +# define nssv_BUILTIN_STRLEN __builtin_strlen +#else +# define nssv_BUILTIN_STRLEN strlen +#endif + +// C++ feature usage: + +#if nssv_HAVE_CONSTEXPR_11 +# define nssv_constexpr constexpr +#else +# define nssv_constexpr /*constexpr*/ +#endif + +#if nssv_HAVE_CONSTEXPR_14 +# define nssv_constexpr14 constexpr +#else +# define nssv_constexpr14 /*constexpr*/ +#endif + +#if nssv_HAVE_EXPLICIT_CONVERSION +# define nssv_explicit explicit +#else +# define nssv_explicit /*explicit*/ +#endif + +#if nssv_HAVE_INLINE_NAMESPACE +# define nssv_inline_ns inline +#else +# define nssv_inline_ns /*inline*/ +#endif + +#if nssv_HAVE_NOEXCEPT +# define nssv_noexcept noexcept +#else +# define nssv_noexcept /*noexcept*/ +#endif + +//#if nssv_HAVE_REF_QUALIFIER +//# define nssv_ref_qual & +//# define nssv_refref_qual && +//#else +//# define nssv_ref_qual /*&*/ +//# define nssv_refref_qual /*&&*/ +//#endif + +#if nssv_HAVE_NULLPTR +# define nssv_nullptr nullptr +#else +# define nssv_nullptr NULL +#endif + +#if nssv_HAVE_NODISCARD +# define nssv_nodiscard [[nodiscard]] +#else +# define nssv_nodiscard /*[[nodiscard]]*/ +#endif + +// Additional includes: + +#include +#include +#include +#include +#include // std::char_traits<> + +#if ! nssv_CONFIG_NO_STREAM_INSERTION +# include +#endif + +#if ! nssv_CONFIG_NO_EXCEPTIONS +# include +#endif + +#if nssv_CPP11_OR_GREATER +# include +#endif + +// Clang, GNUC, MSVC warning suppression macros: + +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wreserved-user-defined-literal" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wuser-defined-literals" +#elif defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wliteral-suffix" +#endif // __clang__ + +#if nssv_COMPILER_MSVC_VERSION >= 140 +# define nssv_SUPPRESS_MSGSL_WARNING(expr) [[gsl::suppress(expr)]] +# define nssv_SUPPRESS_MSVC_WARNING(code, descr) __pragma(warning(suppress: code) ) +# define nssv_DISABLE_MSVC_WARNINGS(codes) __pragma(warning(push)) __pragma(warning(disable: codes)) +#else +# define nssv_SUPPRESS_MSGSL_WARNING(expr) +# define nssv_SUPPRESS_MSVC_WARNING(code, descr) +# define nssv_DISABLE_MSVC_WARNINGS(codes) +#endif + +#if defined(__clang__) +# define nssv_RESTORE_WARNINGS() _Pragma("clang diagnostic pop") +#elif defined(__GNUC__) +# define nssv_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop") +#elif nssv_COMPILER_MSVC_VERSION >= 140 +# define nssv_RESTORE_WARNINGS() __pragma(warning(pop )) +#else +# define nssv_RESTORE_WARNINGS() +#endif + +// Suppress the following MSVC (GSL) warnings: +// - C4455, non-gsl : 'operator ""sv': literal suffix identifiers that do not +// start with an underscore are reserved +// - C26472, gsl::t.1 : don't use a static_cast for arithmetic conversions; +// use brace initialization, gsl::narrow_cast or gsl::narow +// - C26481: gsl::b.1 : don't use pointer arithmetic. Use span instead + +nssv_DISABLE_MSVC_WARNINGS( 4455 26481 26472 ) +//nssv_DISABLE_CLANG_WARNINGS( "-Wuser-defined-literals" ) +//nssv_DISABLE_GNUC_WARNINGS( -Wliteral-suffix ) + +namespace nonstd { namespace sv_lite { + +// +// basic_string_view declaration: +// + +template +< + class CharT, + class Traits = std::char_traits +> +class basic_string_view; + +namespace detail { + +// support constexpr comparison in C++14; +// for C++17 and later, use provided traits: + +template< typename CharT > +inline nssv_constexpr14 int compare( CharT const * s1, CharT const * s2, std::size_t count ) +{ + while ( count-- != 0 ) + { + if ( *s1 < *s2 ) return -1; + if ( *s1 > *s2 ) return +1; + ++s1; ++s2; + } + return 0; +} + +#if nssv_HAVE_BUILTIN_MEMCMP + +// specialization of compare() for char, see also generic compare() above: + +inline nssv_constexpr14 int compare( char const * s1, char const * s2, std::size_t count ) +{ + return nssv_BUILTIN_MEMCMP( s1, s2, count ); +} + +#endif + +#if nssv_HAVE_BUILTIN_STRLEN + +// specialization of length() for char, see also generic length() further below: + +inline nssv_constexpr std::size_t length( char const * s ) +{ + return nssv_BUILTIN_STRLEN( s ); +} + +#endif + +#if defined(__OPTIMIZE__) + +// gcc, clang provide __OPTIMIZE__ +// Expect tail call optimization to make length() non-recursive: + +template< typename CharT > +inline nssv_constexpr std::size_t length( CharT * s, std::size_t result = 0 ) +{ + return *s == '\0' ? result : length( s + 1, result + 1 ); +} + +#else // OPTIMIZE + +// non-recursive: + +template< typename CharT > +inline nssv_constexpr14 std::size_t length( CharT * s ) +{ + std::size_t result = 0; + while ( *s++ != '\0' ) + { + ++result; + } + return result; +} + +#endif // OPTIMIZE + +#if nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER +#if defined(__OPTIMIZE__) + +// gcc, clang provide __OPTIMIZE__ +// Expect tail call optimization to make search() non-recursive: + +template< class CharT, class Traits = std::char_traits > +constexpr const CharT* search( basic_string_view haystack, basic_string_view needle ) +{ + return haystack.starts_with( needle ) ? haystack.begin() : + haystack.empty() ? haystack.end() : search( haystack.substr(1), needle ); +} + +#else // OPTIMIZE + +// non-recursive: + +template< class CharT, class Traits = std::char_traits > +constexpr const CharT* search( basic_string_view haystack, basic_string_view needle ) +{ + return std::search( haystack.begin(), haystack.end(), needle.begin(), needle.end() ); +} + +#endif // OPTIMIZE +#endif // nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER + +} // namespace detail + +// +// basic_string_view: +// + +template +< + class CharT, + class Traits /* = std::char_traits */ +> +class basic_string_view +{ +public: + // Member types: + + typedef Traits traits_type; + typedef CharT value_type; + + typedef CharT * pointer; + typedef CharT const * const_pointer; + typedef CharT & reference; + typedef CharT const & const_reference; + + typedef const_pointer iterator; + typedef const_pointer const_iterator; + typedef std::reverse_iterator< const_iterator > reverse_iterator; + typedef std::reverse_iterator< const_iterator > const_reverse_iterator; + + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + // 24.4.2.1 Construction and assignment: + + nssv_constexpr basic_string_view() nssv_noexcept + : data_( nssv_nullptr ) + , size_( 0 ) + {} + +#if nssv_CPP11_OR_GREATER + nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept = default; +#else + nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept + : data_( other.data_) + , size_( other.size_) + {} +#endif + + nssv_constexpr basic_string_view( CharT const * s, size_type count ) nssv_noexcept // non-standard noexcept + : data_( s ) + , size_( count ) + {} + + nssv_constexpr basic_string_view( CharT const * s) nssv_noexcept // non-standard noexcept + : data_( s ) +#if nssv_CPP17_OR_GREATER + , size_( Traits::length(s) ) +#elif nssv_CPP11_OR_GREATER + , size_( detail::length(s) ) +#else + , size_( Traits::length(s) ) +#endif + {} + +#if nssv_HAVE_NULLPTR +# if nssv_HAVE_IS_DELETE + nssv_constexpr basic_string_view( std::nullptr_t ) nssv_noexcept = delete; +# else + private: nssv_constexpr basic_string_view( std::nullptr_t ) nssv_noexcept; public: +# endif +#endif + + // Assignment: + +#if nssv_CPP11_OR_GREATER + nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept = default; +#else + nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept + { + data_ = other.data_; + size_ = other.size_; + return *this; + } +#endif + + // 24.4.2.2 Iterator support: + + nssv_constexpr const_iterator begin() const nssv_noexcept { return data_; } + nssv_constexpr const_iterator end() const nssv_noexcept { return data_ + size_; } + + nssv_constexpr const_iterator cbegin() const nssv_noexcept { return begin(); } + nssv_constexpr const_iterator cend() const nssv_noexcept { return end(); } + + nssv_constexpr const_reverse_iterator rbegin() const nssv_noexcept { return const_reverse_iterator( end() ); } + nssv_constexpr const_reverse_iterator rend() const nssv_noexcept { return const_reverse_iterator( begin() ); } + + nssv_constexpr const_reverse_iterator crbegin() const nssv_noexcept { return rbegin(); } + nssv_constexpr const_reverse_iterator crend() const nssv_noexcept { return rend(); } + + // 24.4.2.3 Capacity: + + nssv_constexpr size_type size() const nssv_noexcept { return size_; } + nssv_constexpr size_type length() const nssv_noexcept { return size_; } + nssv_constexpr size_type max_size() const nssv_noexcept { return (std::numeric_limits< size_type >::max)(); } + + // since C++20 + nssv_nodiscard nssv_constexpr bool empty() const nssv_noexcept + { + return 0 == size_; + } + + // 24.4.2.4 Element access: + + nssv_constexpr const_reference operator[]( size_type pos ) const + { + return data_at( pos ); + } + + nssv_constexpr14 const_reference at( size_type pos ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos < size() ); +#else + if ( pos >= size() ) + { + throw std::out_of_range("nonstd::string_view::at()"); + } +#endif + return data_at( pos ); + } + + nssv_constexpr const_reference front() const { return data_at( 0 ); } + nssv_constexpr const_reference back() const { return data_at( size() - 1 ); } + + nssv_constexpr const_pointer data() const nssv_noexcept { return data_; } + + // 24.4.2.5 Modifiers: + + nssv_constexpr14 void remove_prefix( size_type n ) + { + assert( n <= size() ); + data_ += n; + size_ -= n; + } + + nssv_constexpr14 void remove_suffix( size_type n ) + { + assert( n <= size() ); + size_ -= n; + } + + nssv_constexpr14 void swap( basic_string_view & other ) nssv_noexcept + { + const basic_string_view tmp(other); + other = *this; + *this = tmp; + } + + // 24.4.2.6 String operations: + + size_type copy( CharT * dest, size_type n, size_type pos = 0 ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos <= size() ); +#else + if ( pos > size() ) + { + throw std::out_of_range("nonstd::string_view::copy()"); + } +#endif + const size_type rlen = (std::min)( n, size() - pos ); + + (void) Traits::copy( dest, data() + pos, rlen ); + + return rlen; + } + + nssv_constexpr14 basic_string_view substr( size_type pos = 0, size_type n = npos ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos <= size() ); +#else + if ( pos > size() ) + { + throw std::out_of_range("nonstd::string_view::substr()"); + } +#endif + return basic_string_view( data() + pos, (std::min)( n, size() - pos ) ); + } + + // compare(), 6x: + + nssv_constexpr14 int compare( basic_string_view other ) const nssv_noexcept // (1) + { +#if nssv_CPP17_OR_GREATER + if ( const int result = Traits::compare( data(), other.data(), (std::min)( size(), other.size() ) ) ) +#else + if ( const int result = detail::compare( data(), other.data(), (std::min)( size(), other.size() ) ) ) +#endif + { + return result; + } + + return size() == other.size() ? 0 : size() < other.size() ? -1 : 1; + } + + nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other ) const // (2) + { + return substr( pos1, n1 ).compare( other ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other, size_type pos2, size_type n2 ) const // (3) + { + return substr( pos1, n1 ).compare( other.substr( pos2, n2 ) ); + } + + nssv_constexpr int compare( CharT const * s ) const // (4) + { + return compare( basic_string_view( s ) ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s ) const // (5) + { + return substr( pos1, n1 ).compare( basic_string_view( s ) ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s, size_type n2 ) const // (6) + { + return substr( pos1, n1 ).compare( basic_string_view( s, n2 ) ); + } + + // 24.4.2.7 Searching: + + // starts_with(), 3x, since C++20: + + nssv_constexpr bool starts_with( basic_string_view v ) const nssv_noexcept // (1) + { + return size() >= v.size() && compare( 0, v.size(), v ) == 0; + } + + nssv_constexpr bool starts_with( CharT c ) const nssv_noexcept // (2) + { + return starts_with( basic_string_view( &c, 1 ) ); + } + + nssv_constexpr bool starts_with( CharT const * s ) const // (3) + { + return starts_with( basic_string_view( s ) ); + } + + // ends_with(), 3x, since C++20: + + nssv_constexpr bool ends_with( basic_string_view v ) const nssv_noexcept // (1) + { + return size() >= v.size() && compare( size() - v.size(), npos, v ) == 0; + } + + nssv_constexpr bool ends_with( CharT c ) const nssv_noexcept // (2) + { + return ends_with( basic_string_view( &c, 1 ) ); + } + + nssv_constexpr bool ends_with( CharT const * s ) const // (3) + { + return ends_with( basic_string_view( s ) ); + } + + // find(), 4x: + + nssv_constexpr size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return assert( v.size() == 0 || v.data() != nssv_nullptr ) + , pos >= size() + ? npos : to_pos( +#if nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER + detail::search( substr(pos), v ) +#else + std::search( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) +#endif + ); + } + + nssv_constexpr size_type find( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find( CharT const * s, size_type pos, size_type n ) const // (3) + { + return find( basic_string_view( s, n ), pos ); + } + + nssv_constexpr size_type find( CharT const * s, size_type pos = 0 ) const // (4) + { + return find( basic_string_view( s ), pos ); + } + + // rfind(), 4x: + + nssv_constexpr14 size_type rfind( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + if ( size() < v.size() ) + { + return npos; + } + + if ( v.empty() ) + { + return (std::min)( size(), pos ); + } + + const_iterator last = cbegin() + (std::min)( size() - v.size(), pos ) + v.size(); + const_iterator result = std::find_end( cbegin(), last, v.cbegin(), v.cend(), Traits::eq ); + + return result != last ? size_type( result - cbegin() ) : npos; + } + + nssv_constexpr14 size_type rfind( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return rfind( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr14 size_type rfind( CharT const * s, size_type pos, size_type n ) const // (3) + { + return rfind( basic_string_view( s, n ), pos ); + } + + nssv_constexpr14 size_type rfind( CharT const * s, size_type pos = npos ) const // (4) + { + return rfind( basic_string_view( s ), pos ); + } + + // find_first_of(), 4x: + + nssv_constexpr size_type find_first_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return pos >= size() + ? npos + : to_pos( std::find_first_of( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) ); + } + + nssv_constexpr size_type find_first_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find_first_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_first_of( CharT const * s, size_type pos, size_type n ) const // (3) + { + return find_first_of( basic_string_view( s, n ), pos ); + } + + nssv_constexpr size_type find_first_of( CharT const * s, size_type pos = 0 ) const // (4) + { + return find_first_of( basic_string_view( s ), pos ); + } + + // find_last_of(), 4x: + + nssv_constexpr size_type find_last_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + return empty() + ? npos + : pos >= size() + ? find_last_of( v, size() - 1 ) + : to_pos( std::find_first_of( const_reverse_iterator( cbegin() + pos + 1 ), crend(), v.cbegin(), v.cend(), Traits::eq ) ); + } + + nssv_constexpr size_type find_last_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return find_last_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_last_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_last_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_last_of( CharT const * s, size_type pos = npos ) const // (4) + { + return find_last_of( basic_string_view( s ), pos ); + } + + // find_first_not_of(), 4x: + + nssv_constexpr size_type find_first_not_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return pos >= size() + ? npos + : to_pos( std::find_if( cbegin() + pos, cend(), not_in_view( v ) ) ); + } + + nssv_constexpr size_type find_first_not_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find_first_not_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_first_not_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos = 0 ) const // (4) + { + return find_first_not_of( basic_string_view( s ), pos ); + } + + // find_last_not_of(), 4x: + + nssv_constexpr size_type find_last_not_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + return empty() + ? npos + : pos >= size() + ? find_last_not_of( v, size() - 1 ) + : to_pos( std::find_if( const_reverse_iterator( cbegin() + pos + 1 ), crend(), not_in_view( v ) ) ); + } + + nssv_constexpr size_type find_last_not_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return find_last_not_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_last_not_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos = npos ) const // (4) + { + return find_last_not_of( basic_string_view( s ), pos ); + } + + // Constants: + +#if nssv_CPP17_OR_GREATER + static nssv_constexpr size_type npos = size_type(-1); +#elif nssv_CPP11_OR_GREATER + enum : size_type { npos = size_type(-1) }; +#else + enum { npos = size_type(-1) }; +#endif + +private: + struct not_in_view + { + const basic_string_view v; + + nssv_constexpr explicit not_in_view( basic_string_view v_ ) : v( v_ ) {} + + nssv_constexpr bool operator()( CharT c ) const + { + return npos == v.find_first_of( c ); + } + }; + + nssv_constexpr size_type to_pos( const_iterator it ) const + { + return it == cend() ? npos : size_type( it - cbegin() ); + } + + nssv_constexpr size_type to_pos( const_reverse_iterator it ) const + { + return it == crend() ? npos : size_type( crend() - it - 1 ); + } + + nssv_constexpr const_reference data_at( size_type pos ) const + { +#if nssv_BETWEEN( nssv_COMPILER_GNUC_VERSION, 1, 500 ) + return data_[pos]; +#else + return assert( pos < size() ), data_[pos]; +#endif + } + +private: + const_pointer data_; + size_type size_; + +public: +#if nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS + + template< class Allocator > + basic_string_view( std::basic_string const & s ) nssv_noexcept + : data_( s.data() ) + , size_( s.size() ) + {} + +#if nssv_HAVE_EXPLICIT_CONVERSION + + template< class Allocator > + explicit operator std::basic_string() const + { + return to_string( Allocator() ); + } + +#endif // nssv_HAVE_EXPLICIT_CONVERSION + +#if nssv_CPP11_OR_GREATER + + template< class Allocator = std::allocator > + std::basic_string + to_string( Allocator const & a = Allocator() ) const + { + return std::basic_string( begin(), end(), a ); + } + +#else + + std::basic_string + to_string() const + { + return std::basic_string( begin(), end() ); + } + + template< class Allocator > + std::basic_string + to_string( Allocator const & a ) const + { + return std::basic_string( begin(), end(), a ); + } + +#endif // nssv_CPP11_OR_GREATER + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS +}; + +// +// Non-member functions: +// + +// 24.4.3 Non-member comparison functions: +// lexicographically compare two string views (function template): + +template< class CharT, class Traits > +nssv_constexpr bool operator== ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator!= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits > +nssv_constexpr bool operator< ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator<= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator> ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits > +nssv_constexpr bool operator>= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +// Let S be basic_string_view, and sv be an instance of S. +// Implementations shall provide sufficient additional overloads marked +// constexpr and noexcept so that an object t with an implicit conversion +// to S can be compared according to Table 67. + +#if ! nssv_CPP11_OR_GREATER || nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 100, 141 ) + +// accommodate for older compilers: + +// == + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.size() == detail::length( rhs ) && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return detail::length( lhs ) == rhs.size() && rhs.compare( lhs ) == 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator==( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +// != + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits> +nssv_constexpr bool operator!=( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +// < + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) > 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) > 0; } + +// <= + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) >= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator<=( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) >= 0; } + +// > + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) < 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) < 0; } + +// >= + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + basic_string_view lhs, + CharT const * rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + CharT const * lhs, + basic_string_view rhs ) nssv_noexcept +{ return rhs.compare( lhs ) <= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + basic_string_view lhs, + std::basic_string rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +template< class CharT, class Traits> +nssv_constexpr bool operator>=( + std::basic_string rhs, + basic_string_view lhs ) nssv_noexcept +{ return rhs.compare( lhs ) <= 0; } + +#else // newer compilers: + +#define nssv_BASIC_STRING_VIEW_I(T,U) typename std::decay< basic_string_view >::type + +#if defined(_MSC_VER) // issue 40 +# define nssv_MSVC_ORDER(x) , int=x +#else +# define nssv_MSVC_ORDER(x) /*, int=x*/ +#endif + +// == + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator==( + basic_string_view lhs, + nssv_BASIC_STRING_VIEW_I(CharT, Traits) rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator==( + nssv_BASIC_STRING_VIEW_I(CharT, Traits) lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +// != + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator!= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator!= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return !( lhs == rhs ); } + +// < + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator< ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator< ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0; } + +// <= + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator<= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator<= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0; } + +// > + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator> ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator> ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0; } + +// >= + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator>= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator>= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0; } + +#undef nssv_MSVC_ORDER +#undef nssv_BASIC_STRING_VIEW_I + +#endif // compiler-dependent approach to comparisons + +// 24.4.4 Inserters and extractors: + +#if ! nssv_CONFIG_NO_STREAM_INSERTION + +namespace detail { + +template< class Stream > +void write_padding( Stream & os, std::streamsize n ) +{ + for ( std::streamsize i = 0; i < n; ++i ) + os.rdbuf()->sputc( os.fill() ); +} + +template< class Stream, class View > +Stream & write_to_stream( Stream & os, View const & sv ) +{ + typename Stream::sentry sentry( os ); + + if ( !sentry ) + return os; + + const std::streamsize length = static_cast( sv.length() ); + + // Whether, and how, to pad: + const bool pad = ( length < os.width() ); + const bool left_pad = pad && ( os.flags() & std::ios_base::adjustfield ) == std::ios_base::right; + + if ( left_pad ) + write_padding( os, os.width() - length ); + + // Write span characters: + os.rdbuf()->sputn( sv.begin(), length ); + + if ( pad && !left_pad ) + write_padding( os, os.width() - length ); + + // Reset output stream width: + os.width( 0 ); + + return os; +} + +} // namespace detail + +template< class CharT, class Traits > +std::basic_ostream & +operator<<( + std::basic_ostream& os, + basic_string_view sv ) +{ + return detail::write_to_stream( os, sv ); +} + +#endif // nssv_CONFIG_NO_STREAM_INSERTION + +// Several typedefs for common character types are provided: + +typedef basic_string_view string_view; +typedef basic_string_view wstring_view; +#if nssv_HAVE_WCHAR16_T +typedef basic_string_view u16string_view; +typedef basic_string_view u32string_view; +#endif + +}} // namespace nonstd::sv_lite + +// +// 24.4.6 Suffix for basic_string_view literals: +// + +#if nssv_HAVE_USER_DEFINED_LITERALS + +namespace nonstd { +nssv_inline_ns namespace literals { +nssv_inline_ns namespace string_view_literals { + +#if nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS + +nssv_constexpr nonstd::sv_lite::string_view operator "" sv( const char* str, size_t len ) nssv_noexcept // (1) +{ + return nonstd::sv_lite::string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u16string_view operator "" sv( const char16_t* str, size_t len ) nssv_noexcept // (2) +{ + return nonstd::sv_lite::u16string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u32string_view operator "" sv( const char32_t* str, size_t len ) nssv_noexcept // (3) +{ + return nonstd::sv_lite::u32string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::wstring_view operator "" sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) +{ + return nonstd::sv_lite::wstring_view{ str, len }; +} + +#endif // nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS + +#if nssv_CONFIG_USR_SV_OPERATOR + +nssv_constexpr nonstd::sv_lite::string_view operator "" _sv( const char* str, size_t len ) nssv_noexcept // (1) +{ + return nonstd::sv_lite::string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u16string_view operator "" _sv( const char16_t* str, size_t len ) nssv_noexcept // (2) +{ + return nonstd::sv_lite::u16string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u32string_view operator "" _sv( const char32_t* str, size_t len ) nssv_noexcept // (3) +{ + return nonstd::sv_lite::u32string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::wstring_view operator "" _sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) +{ + return nonstd::sv_lite::wstring_view{ str, len }; +} + +#endif // nssv_CONFIG_USR_SV_OPERATOR + +}}} // namespace nonstd::literals::string_view_literals + +#endif + +// +// Extensions for std::string: +// + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { +namespace sv_lite { + +// Exclude MSVC 14 (19.00): it yields ambiguous to_string(): + +#if nssv_CPP11_OR_GREATER && nssv_COMPILER_MSVC_VERSION != 140 + +template< class CharT, class Traits, class Allocator = std::allocator > +std::basic_string +to_string( basic_string_view v, Allocator const & a = Allocator() ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +#else + +template< class CharT, class Traits > +std::basic_string +to_string( basic_string_view v ) +{ + return std::basic_string( v.begin(), v.end() ); +} + +template< class CharT, class Traits, class Allocator > +std::basic_string +to_string( basic_string_view v, Allocator const & a ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +#endif // nssv_CPP11_OR_GREATER + +template< class CharT, class Traits, class Allocator > +basic_string_view +to_string_view( std::basic_string const & s ) +{ + return basic_string_view( s.data(), s.size() ); +} + +}} // namespace nonstd::sv_lite + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +// +// make types and algorithms available in namespace nonstd: +// + +namespace nonstd { + +using sv_lite::basic_string_view; +using sv_lite::string_view; +using sv_lite::wstring_view; + +#if nssv_HAVE_WCHAR16_T +using sv_lite::u16string_view; +#endif +#if nssv_HAVE_WCHAR32_T +using sv_lite::u32string_view; +#endif + +// literal "sv" + +using sv_lite::operator==; +using sv_lite::operator!=; +using sv_lite::operator<; +using sv_lite::operator<=; +using sv_lite::operator>; +using sv_lite::operator>=; + +#if ! nssv_CONFIG_NO_STREAM_INSERTION +using sv_lite::operator<<; +#endif + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS +using sv_lite::to_string; +using sv_lite::to_string_view; +#endif + +} // namespace nonstd + +// 24.4.5 Hash support (C++11): + +// Note: The hash value of a string view object is equal to the hash value of +// the corresponding string object. + +#if nssv_HAVE_STD_HASH + +#include + +namespace std { + +template<> +struct hash< nonstd::string_view > +{ +public: + std::size_t operator()( nonstd::string_view v ) const nssv_noexcept + { + return std::hash()( std::string( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::wstring_view > +{ +public: + std::size_t operator()( nonstd::wstring_view v ) const nssv_noexcept + { + return std::hash()( std::wstring( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::u16string_view > +{ +public: + std::size_t operator()( nonstd::u16string_view v ) const nssv_noexcept + { + return std::hash()( std::u16string( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::u32string_view > +{ +public: + std::size_t operator()( nonstd::u32string_view v ) const nssv_noexcept + { + return std::hash()( std::u32string( v.data(), v.size() ) ); + } +}; + +} // namespace std + +#endif // nssv_HAVE_STD_HASH + +nssv_RESTORE_WARNINGS() + +#endif // nssv_HAVE_STD_STRING_VIEW +#endif // NONSTD_SV_LITE_H_INCLUDED +/* end file simdjson/nonstd/string_view.hpp */ +SIMDJSON_POP_DISABLE_WARNINGS + +namespace std { + using string_view = nonstd::string_view; +} +#endif // SIMDJSON_HAS_STRING_VIEW +#undef SIMDJSON_HAS_STRING_VIEW // We are not going to need this macro anymore. + +/// If EXPR is an error, returns it. +#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } } + +// Unless the programmer has already set SIMDJSON_DEVELOPMENT_CHECKS, +// we want to set it under debug builds. We detect a debug build +// under Visual Studio when the _DEBUG macro is set. Under the other +// compilers, we use the fact that they define __OPTIMIZE__ whenever +// they allow optimizations. +// It is possible that this could miss some cases where SIMDJSON_DEVELOPMENT_CHECKS +// is helpful, but the programmer can set the macro SIMDJSON_DEVELOPMENT_CHECKS. +// It could also wrongly set SIMDJSON_DEVELOPMENT_CHECKS (e.g., if the programmer +// sets _DEBUG in a release build under Visual Studio, or if some compiler fails to +// set the __OPTIMIZE__ macro). +#ifndef SIMDJSON_DEVELOPMENT_CHECKS +#ifdef _MSC_VER +// Visual Studio seems to set _DEBUG for debug builds. +#ifdef _DEBUG +#define SIMDJSON_DEVELOPMENT_CHECKS 1 +#endif // _DEBUG +#else // _MSC_VER +// All other compilers appear to set __OPTIMIZE__ to a positive integer +// when the compiler is optimizing. +#ifndef __OPTIMIZE__ +#define SIMDJSON_DEVELOPMENT_CHECKS 1 +#endif // __OPTIMIZE__ +#endif // _MSC_VER +#endif // SIMDJSON_DEVELOPMENT_CHECKS + +// The SIMDJSON_CHECK_EOF macro is a feature flag for the "don't require padding" +// feature. + +#if SIMDJSON_CPLUSPLUS17 +// if we have C++, then fallthrough is a default attribute +# define simdjson_fallthrough [[fallthrough]] +// check if we have __attribute__ support +#elif defined(__has_attribute) +// check if we have the __fallthrough__ attribute +#if __has_attribute(__fallthrough__) +// we are good to go: +# define simdjson_fallthrough __attribute__((__fallthrough__)) +#endif // __has_attribute(__fallthrough__) +#endif // SIMDJSON_CPLUSPLUS17 +// on some systems, we simply do not have support for fallthrough, so use a default: +#ifndef simdjson_fallthrough +# define simdjson_fallthrough do {} while (0) /* fallthrough */ +#endif // simdjson_fallthrough + +#if SIMDJSON_DEVELOPMENT_CHECKS +#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { assert ((expr)); } while (0) +#else +#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0) +#endif + +#ifndef SIMDJSON_UTF8VALIDATION +#define SIMDJSON_UTF8VALIDATION 1 +#endif + +#ifdef __has_include +// How do we detect that a compiler supports vbmi2? +// For sure if the following header is found, we are ok? +#if __has_include() +#define SIMDJSON_COMPILER_SUPPORTS_VBMI2 1 +#endif +#endif + +#ifdef _MSC_VER +#if _MSC_VER >= 1920 +// Visual Studio 2019 and up support VBMI2 under x64 even if the header +// avx512vbmi2intrin.h is not found. +#define SIMDJSON_COMPILER_SUPPORTS_VBMI2 1 +#endif +#endif + +// By default, we allow AVX512. +#ifndef SIMDJSON_AVX512_ALLOWED +#define SIMDJSON_AVX512_ALLOWED 1 +#endif + +#endif // SIMDJSON_COMMON_DEFS_H +/* end file simdjson/common_defs.h */ + +// This provides the public API for simdjson. +// DOM and ondemand are amalgamated separately, in simdjson.h +/* including simdjson/simdjson_version.h: #include "simdjson/simdjson_version.h" */ +/* begin file simdjson/simdjson_version.h */ +// /include/simdjson/simdjson_version.h automatically generated by release.py, +// do not change by hand +#ifndef SIMDJSON_SIMDJSON_VERSION_H +#define SIMDJSON_SIMDJSON_VERSION_H + +/** The version of simdjson being used (major.minor.revision) */ +#define SIMDJSON_VERSION "3.6.0" + +namespace simdjson { +enum { + /** + * The major version (MAJOR.minor.revision) of simdjson being used. + */ + SIMDJSON_VERSION_MAJOR = 3, + /** + * The minor version (major.MINOR.revision) of simdjson being used. + */ + SIMDJSON_VERSION_MINOR = 6, + /** + * The revision (major.minor.REVISION) of simdjson being used. + */ + SIMDJSON_VERSION_REVISION = 0 +}; +} // namespace simdjson + +#endif // SIMDJSON_SIMDJSON_VERSION_H +/* end file simdjson/simdjson_version.h */ + +/* including simdjson/base.h: #include "simdjson/base.h" */ +/* begin file simdjson/base.h */ +/** + * @file Base declarations for all simdjson headers + * @private + */ +#ifndef SIMDJSON_BASE_H +#define SIMDJSON_BASE_H + +/* skipped duplicate #include "simdjson/common_defs.h" */ +/* skipped duplicate #include "simdjson/compiler_check.h" */ +/* including simdjson/error.h: #include "simdjson/error.h" */ +/* begin file simdjson/error.h */ +#ifndef SIMDJSON_ERROR_H +#define SIMDJSON_ERROR_H + +/* skipped duplicate #include "simdjson/base.h" */ + +#include +#include + +namespace simdjson { + +/** + * All possible errors returned by simdjson. These error codes are subject to change + * and not all simdjson kernel returns the same error code given the same input: it is not + * well defined which error a given input should produce. + * + * Only SUCCESS evaluates to false as a Boolean. All other error codes will evaluate + * to true as a Boolean. + */ +enum error_code { + SUCCESS = 0, ///< No error + CAPACITY, ///< This parser can't support a document that big + MEMALLOC, ///< Error allocating memory, most likely out of memory + TAPE_ERROR, ///< Something went wrong, this is a generic error + DEPTH_ERROR, ///< Your document exceeds the user-specified depth limitation + STRING_ERROR, ///< Problem while parsing a string + T_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 't' + F_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 'f' + N_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 'n' + NUMBER_ERROR, ///< Problem while parsing a number + UTF8_ERROR, ///< the input is not valid UTF-8 + UNINITIALIZED, ///< unknown error, or uninitialized document + EMPTY, ///< no structural element found + UNESCAPED_CHARS, ///< found unescaped characters in a string. + UNCLOSED_STRING, ///< missing quote at the end + UNSUPPORTED_ARCHITECTURE, ///< unsupported architecture + INCORRECT_TYPE, ///< JSON element has a different type than user expected + NUMBER_OUT_OF_RANGE, ///< JSON number does not fit in 64 bits + INDEX_OUT_OF_BOUNDS, ///< JSON array index too large + NO_SUCH_FIELD, ///< JSON field not found in object + IO_ERROR, ///< Error reading a file + INVALID_JSON_POINTER, ///< Invalid JSON pointer reference + INVALID_URI_FRAGMENT, ///< Invalid URI fragment + UNEXPECTED_ERROR, ///< indicative of a bug in simdjson + PARSER_IN_USE, ///< parser is already in use. + OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order + INSUFFICIENT_PADDING, ///< The JSON doesn't have enough padding for simdjson to safely parse it. + INCOMPLETE_ARRAY_OR_OBJECT, ///< The document ends early. + SCALAR_DOCUMENT_AS_VALUE, ///< A scalar document is treated as a value. + OUT_OF_BOUNDS, ///< Attempted to access location outside of document. + TRAILING_CONTENT, ///< Unexpected trailing content in the JSON input + NUM_ERROR_CODES +}; + +/** + * Get the error message for the given error code. + * + * dom::parser parser; + * dom::element doc; + * auto error = parser.parse("foo",3).get(doc); + * if (error) { printf("Error: %s\n", error_message(error)); } + * + * @return The error message. + */ +inline const char *error_message(error_code error) noexcept; + +/** + * Write the error message to the output stream + */ +inline std::ostream& operator<<(std::ostream& out, error_code error) noexcept; + +/** + * Exception thrown when an exception-supporting simdjson method is called + */ +struct simdjson_error : public std::exception { + /** + * Create an exception from a simdjson error code. + * @param error The error code + */ + simdjson_error(error_code error) noexcept : _error{error} { } + /** The error message */ + const char *what() const noexcept { return error_message(error()); } + /** The error code */ + error_code error() const noexcept { return _error; } +private: + /** The error code that was used */ + error_code _error; +}; + +namespace internal { + +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::simdjson_result_base { + * simdjson_result() noexcept : internal::simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct simdjson_result_base : protected std::pair { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline simdjson_result_base() noexcept; + + /** + * Create a new error result. + */ + simdjson_inline simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; + +}; // struct simdjson_result_base + +} // namespace internal + +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + */ +template +struct simdjson_result : public internal::simdjson_result_base { + /** + * @private Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline simdjson_result() noexcept; + /** + * @private Create a new error result. + */ + simdjson_inline simdjson_result(T &&value) noexcept; + /** + * @private Create a new successful result. + */ + simdjson_inline simdjson_result(error_code error_code) noexcept; + /** + * @private Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline simdjson_result(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_warn_unused simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; + +}; // struct simdjson_result + +#if SIMDJSON_EXCEPTIONS + +template +inline std::ostream& operator<<(std::ostream& out, simdjson_result value) { return out << value.value(); } +#endif // SIMDJSON_EXCEPTIONS + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +/** + * @deprecated This is an alias and will be removed, use error_code instead + */ +using ErrorValues [[deprecated("This is an alias and will be removed, use error_code instead")]] = error_code; + +/** + * @deprecated Error codes should be stored and returned as `error_code`, use `error_message()` instead. + */ +[[deprecated("Error codes should be stored and returned as `error_code`, use `error_message()` instead.")]] +inline const std::string error_message(int error) noexcept; +#endif // SIMDJSON_DISABLE_DEPRECATED_API +} // namespace simdjson + +#endif // SIMDJSON_ERROR_H +/* end file simdjson/error.h */ +/* skipped duplicate #include "simdjson/portability.h" */ + +/** + * @brief The top level simdjson namespace, containing everything the library provides. + */ +namespace simdjson { + +SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS + +/** The maximum document size supported by simdjson. */ +constexpr size_t SIMDJSON_MAXSIZE_BYTES = 0xFFFFFFFF; + +/** + * The amount of padding needed in a buffer to parse JSON. + * + * The input buf should be readable up to buf + SIMDJSON_PADDING + * this is a stopgap; there should be a better description of the + * main loop and its behavior that abstracts over this + * See https://github.com/simdjson/simdjson/issues/174 + */ +constexpr size_t SIMDJSON_PADDING = 64; + +/** + * By default, simdjson supports this many nested objects and arrays. + * + * This is the default for parser::max_depth(). + */ +constexpr size_t DEFAULT_MAX_DEPTH = 1024; + +SIMDJSON_POP_DISABLE_UNUSED_WARNINGS + +class implementation; +struct padded_string; +class padded_string_view; +enum class stage1_mode; + +namespace internal { + +template +class atomic_ptr; +class dom_parser_implementation; +class escape_json_string; +class tape_ref; +struct value128; +enum class tape_type; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_BASE_H +/* end file simdjson/base.h */ + +/* skipped duplicate #include "simdjson/error.h" */ +/* including simdjson/error-inl.h: #include "simdjson/error-inl.h" */ +/* begin file simdjson/error-inl.h */ +#ifndef SIMDJSON_ERROR_INL_H +#define SIMDJSON_ERROR_INL_H + +/* skipped duplicate #include "simdjson/error.h" */ + +#include + +namespace simdjson { +namespace internal { + // We store the error code so we can validate the error message is associated with the right code + struct error_code_info { + error_code code; + const char* message; // do not use a fancy std::string where a simple C string will do (no alloc, no destructor) + }; + // These MUST match the codes in error_code. We check this constraint in basictests. + extern SIMDJSON_DLLIMPORTEXPORT const error_code_info error_codes[]; +} // namespace internal + + +inline const char *error_message(error_code error) noexcept { + // If you're using error_code, we're trusting you got it from the enum. + return internal::error_codes[int(error)].message; +} + +// deprecated function +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +inline const std::string error_message(int error) noexcept { + if (error < 0 || error >= error_code::NUM_ERROR_CODES) { + return internal::error_codes[UNEXPECTED_ERROR].message; + } + return internal::error_codes[error].message; +} +#endif // SIMDJSON_DISABLE_DEPRECATED_API + +inline std::ostream& operator<<(std::ostream& out, error_code error) noexcept { + return out << error_message(error); +} + +namespace internal { + +// +// internal::simdjson_result_base inline implementation +// + +template +simdjson_inline void simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T&& simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline simdjson_result_base::simdjson_result_base(T &&value, error_code error) noexcept + : std::pair(std::forward(value), error) {} +template +simdjson_inline simdjson_result_base::simdjson_result_base(error_code error) noexcept + : simdjson_result_base(T{}, error) {} +template +simdjson_inline simdjson_result_base::simdjson_result_base(T &&value) noexcept + : simdjson_result_base(std::forward(value), SUCCESS) {} +template +simdjson_inline simdjson_result_base::simdjson_result_base() noexcept + : simdjson_result_base(T{}, UNINITIALIZED) {} + +} // namespace internal + +/// +/// simdjson_result inline implementation +/// + +template +simdjson_inline void simdjson_result::tie(T &value, error_code &error) && noexcept { + std::forward>(*this).tie(value, error); +} + +template +simdjson_warn_unused simdjson_inline error_code simdjson_result::get(T &value) && noexcept { + return std::forward>(*this).get(value); +} + +template +simdjson_inline error_code simdjson_result::error() const noexcept { + return internal::simdjson_result_base::error(); +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& simdjson_result::value() & noexcept(false) { + return internal::simdjson_result_base::value(); +} + +template +simdjson_inline T&& simdjson_result::value() && noexcept(false) { + return std::forward>(*this).value(); +} + +template +simdjson_inline T&& simdjson_result::take_value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline simdjson_result::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& simdjson_result::value_unsafe() const& noexcept { + return internal::simdjson_result_base::value_unsafe(); +} + +template +simdjson_inline T&& simdjson_result::value_unsafe() && noexcept { + return std::forward>(*this).value_unsafe(); +} + +template +simdjson_inline simdjson_result::simdjson_result(T &&value, error_code error) noexcept + : internal::simdjson_result_base(std::forward(value), error) {} +template +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : internal::simdjson_result_base(error) {} +template +simdjson_inline simdjson_result::simdjson_result(T &&value) noexcept + : internal::simdjson_result_base(std::forward(value)) {} +template +simdjson_inline simdjson_result::simdjson_result() noexcept + : internal::simdjson_result_base() {} + +} // namespace simdjson + +#endif // SIMDJSON_ERROR_INL_H +/* end file simdjson/error-inl.h */ +/* including simdjson/implementation.h: #include "simdjson/implementation.h" */ +/* begin file simdjson/implementation.h */ +#ifndef SIMDJSON_IMPLEMENTATION_H +#define SIMDJSON_IMPLEMENTATION_H + +/* including simdjson/internal/atomic_ptr.h: #include "simdjson/internal/atomic_ptr.h" */ +/* begin file simdjson/internal/atomic_ptr.h */ +#ifndef SIMDJSON_INTERNAL_ATOMIC_PTR_H +#define SIMDJSON_INTERNAL_ATOMIC_PTR_H + +/* skipped duplicate #include "simdjson/base.h" */ +#include + +namespace simdjson { +namespace internal { + +template +class atomic_ptr { +public: + atomic_ptr(T *_ptr) : ptr{_ptr} {} + + operator const T*() const { return ptr.load(); } + const T& operator*() const { return *ptr; } + const T* operator->() const { return ptr.load(); } + + operator T*() { return ptr.load(); } + T& operator*() { return *ptr; } + T* operator->() { return ptr.load(); } + atomic_ptr& operator=(T *_ptr) { ptr = _ptr; return *this; } + +private: + std::atomic ptr; +}; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_ATOMIC_PTR_H +/* end file simdjson/internal/atomic_ptr.h */ +/* including simdjson/internal/dom_parser_implementation.h: #include "simdjson/internal/dom_parser_implementation.h" */ +/* begin file simdjson/internal/dom_parser_implementation.h */ +#ifndef SIMDJSON_INTERNAL_DOM_PARSER_IMPLEMENTATION_H +#define SIMDJSON_INTERNAL_DOM_PARSER_IMPLEMENTATION_H + +/* skipped duplicate #include "simdjson/base.h" */ +/* skipped duplicate #include "simdjson/error.h" */ +#include + +namespace simdjson { + +namespace dom { +class document; +} // namespace dom + +/** +* This enum is used with the dom_parser_implementation::stage1 function. +* 1) The regular mode expects a fully formed JSON document. +* 2) The streaming_partial mode expects a possibly truncated +* input within a stream on JSON documents. +* 3) The stream_final mode allows us to truncate final +* unterminated strings. It is useful in conjunction with streaming_partial. +*/ +enum class stage1_mode { regular, streaming_partial, streaming_final}; + +/** + * Returns true if mode == streaming_partial or mode == streaming_final + */ +inline bool is_streaming(stage1_mode mode) { + // performance note: it is probably faster to check that mode is different + // from regular than checking that it is either streaming_partial or streaming_final. + return (mode != stage1_mode::regular); + // return (mode == stage1_mode::streaming_partial || mode == stage1_mode::streaming_final); +} + + +namespace internal { + + +/** + * An implementation of simdjson's DOM parser for a particular CPU architecture. + * + * This class is expected to be accessed only by pointer, and never move in memory (though the + * pointer can move). + */ +class dom_parser_implementation { +public: + + /** + * @private For internal implementation use + * + * Run a full JSON parse on a single document (stage1 + stage2). + * + * Guaranteed only to be called when capacity > document length. + * + * Overridden by each implementation. + * + * @param buf The json document to parse. *MUST* be allocated up to len + SIMDJSON_PADDING bytes. + * @param len The length of the json document. + * @return The error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept = 0; + + /** + * @private For internal implementation use + * + * Stage 1 of the document parser. + * + * Guaranteed only to be called when capacity > document length. + * + * Overridden by each implementation. + * + * @param buf The json document to parse. + * @param len The length of the json document. + * @param streaming Whether this is being called by parser::parse_many. + * @return The error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code stage1(const uint8_t *buf, size_t len, stage1_mode streaming) noexcept = 0; + + /** + * @private For internal implementation use + * + * Stage 2 of the document parser. + * + * Called after stage1(). + * + * Overridden by each implementation. + * + * @param doc The document to output to. + * @return The error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code stage2(dom::document &doc) noexcept = 0; + + /** + * @private For internal implementation use + * + * Stage 2 of the document parser for parser::parse_many. + * + * Guaranteed only to be called after stage1(). + * Overridden by each implementation. + * + * @param doc The document to output to. + * @return The error code, SUCCESS if there was no error, or EMPTY if all documents have been parsed. + */ + simdjson_warn_unused virtual error_code stage2_next(dom::document &doc) noexcept = 0; + + /** + * Unescape a valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + * + * Overridden by each implementation. + * + * @param str pointer to the beginning of a valid UTF-8 JSON string, must end with an unescaped quote. + * @param dst pointer to a destination buffer, it must point a region in memory of sufficient size. + * @param allow_replacement whether we allow a replacement character when the UTF-8 contains unmatched surrogate pairs. + * @return end of the of the written region (exclusive) or nullptr in case of error. + */ + simdjson_warn_unused virtual uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept = 0; + + /** + * Unescape a NON-valid UTF-8 string from src to dst, stopping at a final unescaped quote. There + * must be an unescaped quote terminating the string. It returns the final output + * position as pointer. In case of error (e.g., the string has bad escaped codes), + * then null_nullptrptr is returned. It is assumed that the output buffer is large + * enough. E.g., if src points at 'joe"', then dst needs to have four free bytes + + * SIMDJSON_PADDING bytes. + * + * Overridden by each implementation. + * + * @param str pointer to the beginning of a possibly invalid UTF-8 JSON string, must end with an unescaped quote. + * @param dst pointer to a destination buffer, it must point a region in memory of sufficient size. + * @return end of the of the written region (exclusive) or nullptr in case of error. + */ + simdjson_warn_unused virtual uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept = 0; + + /** + * Change the capacity of this parser. + * + * The capacity can never exceed SIMDJSON_MAXSIZE_BYTES (e.g., 4 GB) + * and an CAPACITY error is returned if it is attempted. + * + * Generally used for reallocation. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. + * @return The error code, or SUCCESS if there was no error. + */ + virtual error_code set_capacity(size_t capacity) noexcept = 0; + + /** + * Change the max depth of this parser. + * + * Generally used for reallocation. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. + * @return The error code, or SUCCESS if there was no error. + */ + virtual error_code set_max_depth(size_t max_depth) noexcept = 0; + + /** + * Deallocate this parser. + */ + virtual ~dom_parser_implementation() = default; + + /** Number of structural indices passed from stage 1 to stage 2 */ + uint32_t n_structural_indexes{0}; + /** Structural indices passed from stage 1 to stage 2 */ + std::unique_ptr structural_indexes{}; + /** Next structural index to parse */ + uint32_t next_structural_index{0}; + + /** + * The largest document this parser can support without reallocating. + * + * @return Current capacity, in bytes. + */ + simdjson_inline size_t capacity() const noexcept; + + /** + * The maximum level of nested object and arrays supported by this parser. + * + * @return Maximum depth, in bytes. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused inline error_code allocate(size_t capacity, size_t max_depth) noexcept; + + +protected: + /** + * The maximum document length this parser supports. + * + * Buffers are large enough to handle any document up to this length. + */ + size_t _capacity{0}; + + /** + * The maximum depth (number of nested objects and arrays) supported by this parser. + * + * Defaults to DEFAULT_MAX_DEPTH. + */ + size_t _max_depth{0}; + + // Declaring these so that subclasses can use them to implement their constructors. + simdjson_inline dom_parser_implementation() noexcept; + simdjson_inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + simdjson_inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + + simdjson_inline dom_parser_implementation(const dom_parser_implementation &) noexcept = delete; + simdjson_inline dom_parser_implementation &operator=(const dom_parser_implementation &other) noexcept = delete; +}; // class dom_parser_implementation + +simdjson_inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +simdjson_inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +simdjson_inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +simdjson_inline size_t dom_parser_implementation::capacity() const noexcept { + return _capacity; +} + +simdjson_inline size_t dom_parser_implementation::max_depth() const noexcept { + return _max_depth; +} + +simdjson_warn_unused +inline error_code dom_parser_implementation::allocate(size_t capacity, size_t max_depth) noexcept { + if (this->max_depth() != max_depth) { + error_code err = set_max_depth(max_depth); + if (err) { return err; } + } + if (_capacity != capacity) { + error_code err = set_capacity(capacity); + if (err) { return err; } + } + return SUCCESS; +} + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/internal/dom_parser_implementation.h */ + +#include + +namespace simdjson { + +/** + * Validate the UTF-8 string. + * + * @param buf the string to validate. + * @param len the length of the string in bytes. + * @return true if the string is valid UTF-8. + */ +simdjson_warn_unused bool validate_utf8(const char * buf, size_t len) noexcept; +/** + * Validate the UTF-8 string. + * + * @param sv the string_view to validate. + * @return true if the string is valid UTF-8. + */ +simdjson_inline simdjson_warn_unused bool validate_utf8(const std::string_view sv) noexcept { + return validate_utf8(sv.data(), sv.size()); +} + +/** + * Validate the UTF-8 string. + * + * @param p the string to validate. + * @return true if the string is valid UTF-8. + */ +simdjson_inline simdjson_warn_unused bool validate_utf8(const std::string& s) noexcept { + return validate_utf8(s.data(), s.size()); +} + +/** + * An implementation of simdjson for a particular CPU architecture. + * + * Also used to maintain the currently active implementation. The active implementation is + * automatically initialized on first use to the most advanced implementation supported by the host. + */ +class implementation { +public: + + /** + * The name of this implementation. + * + * const implementation *impl = simdjson::get_active_implementation(); + * cout << "simdjson is optimized for " << impl->name() << "(" << impl->description() << ")" << endl; + * + * @return the name of the implementation, e.g. "haswell", "westmere", "arm64". + */ + virtual const std::string &name() const { return _name; } + + /** + * The description of this implementation. + * + * const implementation *impl = simdjson::get_active_implementation(); + * cout << "simdjson is optimized for " << impl->name() << "(" << impl->description() << ")" << endl; + * + * @return the description of the implementation, e.g. "Intel/AMD AVX2", "Intel/AMD SSE4.2", "ARM NEON". + */ + virtual const std::string &description() const { return _description; } + + /** + * The instruction sets this implementation is compiled against + * and the current CPU match. This function may poll the current CPU/system + * and should therefore not be called too often if performance is a concern. + * + * @return true if the implementation can be safely used on the current system (determined at runtime). + */ + bool supported_by_runtime_system() const; + + /** + * @private For internal implementation use + * + * The instruction sets this implementation is compiled against. + * + * @return a mask of all required `internal::instruction_set::` values. + */ + virtual uint32_t required_instruction_sets() const { return _required_instruction_sets; } + + /** + * @private For internal implementation use + * + * const implementation *impl = simdjson::get_active_implementation(); + * cout << "simdjson is optimized for " << impl->name() << "(" << impl->description() << ")" << endl; + * + * @param capacity The largest document that will be passed to the parser. + * @param max_depth The maximum JSON object/array nesting this parser is expected to handle. + * @param dst The place to put the resulting parser implementation. + * @return the error code, or SUCCESS if there was no error. + */ + virtual error_code create_dom_parser_implementation( + size_t capacity, + size_t max_depth, + std::unique_ptr &dst + ) const noexcept = 0; + + /** + * @private For internal implementation use + * + * Minify the input string assuming that it represents a JSON string, does not parse or validate. + * + * Overridden by each implementation. + * + * @param buf the json document to minify. + * @param len the length of the json document. + * @param dst the buffer to write the minified document to. *MUST* be allocated up to len + SIMDJSON_PADDING bytes. + * @param dst_len the number of bytes written. Output only. + * @return the error code, or SUCCESS if there was no error. + */ + simdjson_warn_unused virtual error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept = 0; + + + /** + * Validate the UTF-8 string. + * + * Overridden by each implementation. + * + * @param buf the string to validate. + * @param len the length of the string in bytes. + * @return true if and only if the string is valid UTF-8. + */ + simdjson_warn_unused virtual bool validate_utf8(const char *buf, size_t len) const noexcept = 0; + +protected: + /** @private Construct an implementation with the given name and description. For subclasses. */ + simdjson_inline implementation( + std::string_view name, + std::string_view description, + uint32_t required_instruction_sets + ) : + _name(name), + _description(description), + _required_instruction_sets(required_instruction_sets) + { + } + virtual ~implementation()=default; + +private: + /** + * The name of this implementation. + */ + const std::string _name; + + /** + * The description of this implementation. + */ + const std::string _description; + + /** + * Instruction sets required for this implementation. + */ + const uint32_t _required_instruction_sets; +}; + +/** @private */ +namespace internal { + +/** + * The list of available implementations compiled into simdjson. + */ +class available_implementation_list { +public: + /** Get the list of available implementations compiled into simdjson */ + simdjson_inline available_implementation_list() {} + /** Number of implementations */ + size_t size() const noexcept; + /** STL const begin() iterator */ + const implementation * const *begin() const noexcept; + /** STL const end() iterator */ + const implementation * const *end() const noexcept; + + /** + * Get the implementation with the given name. + * + * Case sensitive. + * + * const implementation *impl = simdjson::get_available_implementations()["westmere"]; + * if (!impl) { exit(1); } + * if (!imp->supported_by_runtime_system()) { exit(1); } + * simdjson::get_active_implementation() = impl; + * + * @param name the implementation to find, e.g. "westmere", "haswell", "arm64" + * @return the implementation, or nullptr if the parse failed. + */ + const implementation * operator[](const std::string_view &name) const noexcept { + for (const implementation * impl : *this) { + if (impl->name() == name) { return impl; } + } + return nullptr; + } + + /** + * Detect the most advanced implementation supported by the current host. + * + * This is used to initialize the implementation on startup. + * + * const implementation *impl = simdjson::available_implementation::detect_best_supported(); + * simdjson::get_active_implementation() = impl; + * + * @return the most advanced supported implementation for the current host, or an + * implementation that returns UNSUPPORTED_ARCHITECTURE if there is no supported + * implementation. Will never return nullptr. + */ + const implementation *detect_best_supported() const noexcept; +}; + +} // namespace internal + +/** + * The list of available implementations compiled into simdjson. + */ +extern SIMDJSON_DLLIMPORTEXPORT const internal::available_implementation_list& get_available_implementations(); + +/** + * The active implementation. + * + * Automatically initialized on first use to the most advanced implementation supported by this hardware. + */ +extern SIMDJSON_DLLIMPORTEXPORT internal::atomic_ptr& get_active_implementation(); + +} // namespace simdjson + +#endif // SIMDJSON_IMPLEMENTATION_H +/* end file simdjson/implementation.h */ +/* including simdjson/minify.h: #include "simdjson/minify.h" */ +/* begin file simdjson/minify.h */ +#ifndef SIMDJSON_MINIFY_H +#define SIMDJSON_MINIFY_H + +/* skipped duplicate #include "simdjson/base.h" */ +/* including simdjson/padded_string.h: #include "simdjson/padded_string.h" */ +/* begin file simdjson/padded_string.h */ +#ifndef SIMDJSON_PADDED_STRING_H +#define SIMDJSON_PADDED_STRING_H + +/* skipped duplicate #include "simdjson/base.h" */ +/* skipped duplicate #include "simdjson/error.h" */ + +/* skipped duplicate #include "simdjson/error-inl.h" */ + +#include +#include +#include +#include + +namespace simdjson { + +class padded_string_view; + +/** + * String with extra allocation for ease of use with parser::parse() + * + * This is a move-only class, it cannot be copied. + */ +struct padded_string final { + + /** + * Create a new, empty padded string. + */ + explicit inline padded_string() noexcept; + /** + * Create a new padded string buffer. + * + * @param length the size of the string. + */ + explicit inline padded_string(size_t length) noexcept; + /** + * Create a new padded string by copying the given input. + * + * @param data the buffer to copy + * @param length the number of bytes to copy + */ + explicit inline padded_string(const char *data, size_t length) noexcept; + /** + * Create a new padded string by copying the given input. + * + * @param str_ the string to copy + */ + inline padded_string(const std::string & str_ ) noexcept; + /** + * Create a new padded string by copying the given input. + * + * @param sv_ the string to copy + */ + inline padded_string(std::string_view sv_) noexcept; + /** + * Move one padded string into another. + * + * The original padded string will be reduced to zero capacity. + * + * @param o the string to move. + */ + inline padded_string(padded_string &&o) noexcept; + /** + * Move one padded string into another. + * + * The original padded string will be reduced to zero capacity. + * + * @param o the string to move. + */ + inline padded_string &operator=(padded_string &&o) noexcept; + inline void swap(padded_string &o) noexcept; + ~padded_string() noexcept; + + /** + * The length of the string. + * + * Does not include padding. + */ + size_t size() const noexcept; + + /** + * The length of the string. + * + * Does not include padding. + */ + size_t length() const noexcept; + + /** + * The string data. + **/ + const char *data() const noexcept; + const uint8_t *u8data() const noexcept { return static_cast(static_cast(data_ptr));} + + /** + * The string data. + **/ + char *data() noexcept; + + /** + * Create a std::string_view with the same content. + */ + operator std::string_view() const; + + /** + * Create a padded_string_view with the same content. + */ + operator padded_string_view() const noexcept; + + /** + * Load this padded string from a file. + * + * @return IO_ERROR on error. Be mindful that on some 32-bit systems, + * the file size might be limited to 2 GB. + * + * @param path the path to the file. + **/ + inline static simdjson_result load(std::string_view path) noexcept; + +private: + padded_string &operator=(const padded_string &o) = delete; + padded_string(const padded_string &o) = delete; + + size_t viable_size{0}; + char *data_ptr{nullptr}; + +}; // padded_string + +/** + * Send padded_string instance to an output stream. + * + * @param out The output stream. + * @param s The padded_string instance. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, const padded_string& s) { return out << s.data(); } + +#if SIMDJSON_EXCEPTIONS +/** + * Send padded_string instance to an output stream. + * + * @param out The output stream. + * @param s The padded_string instance. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &s) noexcept(false) { return out << s.value(); } +#endif + +} // namespace simdjson + +// This is deliberately outside of simdjson so that people get it without having to use the namespace +inline simdjson::padded_string operator "" _padded(const char *str, size_t len); + +namespace simdjson { +namespace internal { + +// The allocate_padded_buffer function is a low-level function to allocate memory +// with padding so we can read past the "length" bytes safely. It is used by +// the padded_string class automatically. It returns nullptr in case +// of error: the caller should check for a null pointer. +// The length parameter is the maximum size in bytes of the string. +// The caller is responsible to free the memory (e.g., delete[] (...)). +inline char *allocate_padded_buffer(size_t length) noexcept; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_PADDED_STRING_H +/* end file simdjson/padded_string.h */ +#include +#include +#include + +namespace simdjson { + +/** + * + * Minify the input string assuming that it represents a JSON string, does not parse or validate. + * This function is much faster than parsing a JSON string and then writing a minified version of it. + * However, it does not validate the input. It will merely return an error in simple cases (e.g., if + * there is a string that was never terminated). + * + * + * @param buf the json document to minify. + * @param len the length of the json document. + * @param dst the buffer to write the minified document to. *MUST* be allocated up to len bytes. + * @param dst_len the number of bytes written. Output only. + * @return the error code, or SUCCESS if there was no error. + */ +simdjson_warn_unused error_code minify(const char *buf, size_t len, char *dst, size_t &dst_len) noexcept; + +} // namespace simdjson + +#endif // SIMDJSON_MINIFY_H +/* end file simdjson/minify.h */ +/* skipped duplicate #include "simdjson/padded_string.h" */ +/* including simdjson/padded_string-inl.h: #include "simdjson/padded_string-inl.h" */ +/* begin file simdjson/padded_string-inl.h */ +#ifndef SIMDJSON_PADDED_STRING_INL_H +#define SIMDJSON_PADDED_STRING_INL_H + +/* skipped duplicate #include "simdjson/padded_string.h" */ +/* including simdjson/padded_string_view.h: #include "simdjson/padded_string_view.h" */ +/* begin file simdjson/padded_string_view.h */ +#ifndef SIMDJSON_PADDED_STRING_VIEW_H +#define SIMDJSON_PADDED_STRING_VIEW_H + +/* skipped duplicate #include "simdjson/portability.h" */ +/* skipped duplicate #include "simdjson/base.h" // for SIMDJSON_PADDING */ +/* skipped duplicate #include "simdjson/error.h" */ + +#include +#include +#include +#include + +namespace simdjson { + +/** + * User-provided string that promises it has extra padded bytes at the end for use with parser::parse(). + */ +class padded_string_view : public std::string_view { +private: + size_t _capacity; + +public: + /** Create an empty padded_string_view. */ + inline padded_string_view() noexcept = default; + + /** + * Promise the given buffer has at least SIMDJSON_PADDING extra bytes allocated to it. + * + * @param s The string. + * @param len The length of the string (not including padding). + * @param capacity The allocated length of the string, including padding. + */ + explicit inline padded_string_view(const char* s, size_t len, size_t capacity) noexcept; + /** overload explicit inline padded_string_view(const char* s, size_t len) noexcept */ + explicit inline padded_string_view(const uint8_t* s, size_t len, size_t capacity) noexcept; + + /** + * Promise the given string has at least SIMDJSON_PADDING extra bytes allocated to it. + * + * The capacity of the string will be used to determine its padding. + * + * @param s The string. + */ + explicit inline padded_string_view(const std::string &s) noexcept; + + /** + * Promise the given string_view has at least SIMDJSON_PADDING extra bytes allocated to it. + * + * @param s The string. + * @param capacity The allocated length of the string, including padding. + */ + explicit inline padded_string_view(std::string_view s, size_t capacity) noexcept; + + /** The number of allocated bytes. */ + inline size_t capacity() const noexcept; + + /** + * Remove the UTF-8 Byte Order Mark (BOM) if it exists. + * + * @return whether a BOM was found and removed + */ + inline bool remove_utf8_bom() noexcept; + + /** The amount of padding on the string (capacity() - length()) */ + inline size_t padding() const noexcept; + +}; // padded_string_view + +#if SIMDJSON_EXCEPTIONS +/** + * Send padded_string instance to an output stream. + * + * @param out The output stream. + * @param s The padded_string_view. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &s) noexcept(false); +#endif + +} // namespace simdjson + +#endif // SIMDJSON_PADDED_STRING_VIEW_H +/* end file simdjson/padded_string_view.h */ + +/* skipped duplicate #include "simdjson/error-inl.h" */ +/* including simdjson/padded_string_view-inl.h: #include "simdjson/padded_string_view-inl.h" */ +/* begin file simdjson/padded_string_view-inl.h */ +#ifndef SIMDJSON_PADDED_STRING_VIEW_INL_H +#define SIMDJSON_PADDED_STRING_VIEW_INL_H + +/* skipped duplicate #include "simdjson/padded_string_view.h" */ +/* skipped duplicate #include "simdjson/error-inl.h" */ + +#include /* memcmp */ + +namespace simdjson { + +inline padded_string_view::padded_string_view(const char* s, size_t len, size_t capacity) noexcept + : std::string_view(s, len), _capacity(capacity) +{ +} + +inline padded_string_view::padded_string_view(const uint8_t* s, size_t len, size_t capacity) noexcept + : padded_string_view(reinterpret_cast(s), len, capacity) +{ +} + +inline padded_string_view::padded_string_view(const std::string &s) noexcept + : std::string_view(s), _capacity(s.capacity()) +{ +} + +inline padded_string_view::padded_string_view(std::string_view s, size_t capacity) noexcept + : std::string_view(s), _capacity(capacity) +{ +} + +inline size_t padded_string_view::capacity() const noexcept { return _capacity; } + +inline size_t padded_string_view::padding() const noexcept { return capacity() - length(); } + +inline bool padded_string_view::remove_utf8_bom() noexcept { + if(length() < 3) { return false; } + if (std::memcmp(data(), "\xEF\xBB\xBF", 3) == 0) { + remove_prefix(3); + _capacity -= 3; + return true; + } + return false; +} + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson_result &s) noexcept(false) { return out << s.value(); } +#endif + +} // namespace simdjson + + +#endif // SIMDJSON_PADDED_STRING_VIEW_INL_H +/* end file simdjson/padded_string_view-inl.h */ + +#include + +namespace simdjson { +namespace internal { + +// The allocate_padded_buffer function is a low-level function to allocate memory +// with padding so we can read past the "length" bytes safely. It is used by +// the padded_string class automatically. It returns nullptr in case +// of error: the caller should check for a null pointer. +// The length parameter is the maximum size in bytes of the string. +// The caller is responsible to free the memory (e.g., delete[] (...)). +inline char *allocate_padded_buffer(size_t length) noexcept { + const size_t totalpaddedlength = length + SIMDJSON_PADDING; + if(totalpaddedlength(1UL<<20)) { + return nullptr; + } +#endif + + char *padded_buffer = new (std::nothrow) char[totalpaddedlength]; + if (padded_buffer == nullptr) { + return nullptr; + } + // We write nulls in the padded region to avoid having uninitialized + // content which may trigger warning for some sanitizers + std::memset(padded_buffer + length, 0, totalpaddedlength - length); + return padded_buffer; +} // allocate_padded_buffer() + +} // namespace internal + + +inline padded_string::padded_string() noexcept = default; +inline padded_string::padded_string(size_t length) noexcept + : viable_size(length), data_ptr(internal::allocate_padded_buffer(length)) { +} +inline padded_string::padded_string(const char *data, size_t length) noexcept + : viable_size(length), data_ptr(internal::allocate_padded_buffer(length)) { + if ((data != nullptr) && (data_ptr != nullptr)) { + std::memcpy(data_ptr, data, length); + } +} +// note: do not pass std::string arguments by value +inline padded_string::padded_string(const std::string & str_ ) noexcept + : viable_size(str_.size()), data_ptr(internal::allocate_padded_buffer(str_.size())) { + if (data_ptr != nullptr) { + std::memcpy(data_ptr, str_.data(), str_.size()); + } +} +// note: do pass std::string_view arguments by value +inline padded_string::padded_string(std::string_view sv_) noexcept + : viable_size(sv_.size()), data_ptr(internal::allocate_padded_buffer(sv_.size())) { + if(simdjson_unlikely(!data_ptr)) { + //allocation failed or zero size + viable_size = 0; + return; + } + if (sv_.size()) { + std::memcpy(data_ptr, sv_.data(), sv_.size()); + } +} +inline padded_string::padded_string(padded_string &&o) noexcept + : viable_size(o.viable_size), data_ptr(o.data_ptr) { + o.data_ptr = nullptr; // we take ownership +} + +inline padded_string &padded_string::operator=(padded_string &&o) noexcept { + delete[] data_ptr; + data_ptr = o.data_ptr; + viable_size = o.viable_size; + o.data_ptr = nullptr; // we take ownership + o.viable_size = 0; + return *this; +} + +inline void padded_string::swap(padded_string &o) noexcept { + size_t tmp_viable_size = viable_size; + char *tmp_data_ptr = data_ptr; + viable_size = o.viable_size; + data_ptr = o.data_ptr; + o.data_ptr = tmp_data_ptr; + o.viable_size = tmp_viable_size; +} + +inline padded_string::~padded_string() noexcept { + delete[] data_ptr; +} + +inline size_t padded_string::size() const noexcept { return viable_size; } + +inline size_t padded_string::length() const noexcept { return viable_size; } + +inline const char *padded_string::data() const noexcept { return data_ptr; } + +inline char *padded_string::data() noexcept { return data_ptr; } + +inline padded_string::operator std::string_view() const { return std::string_view(data(), length()); } + +inline padded_string::operator padded_string_view() const noexcept { + return padded_string_view(data(), length(), length() + SIMDJSON_PADDING); +} + +inline simdjson_result padded_string::load(std::string_view filename) noexcept { + // Open the file + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + std::FILE *fp = std::fopen(filename.data(), "rb"); + SIMDJSON_POP_DISABLE_WARNINGS + + if (fp == nullptr) { + return IO_ERROR; + } + + // Get the file size + int ret; +#if SIMDJSON_VISUAL_STUDIO && !SIMDJSON_IS_32BITS + ret = _fseeki64(fp, 0, SEEK_END); +#else + ret = std::fseek(fp, 0, SEEK_END); +#endif // _WIN64 + if(ret < 0) { + std::fclose(fp); + return IO_ERROR; + } +#if SIMDJSON_VISUAL_STUDIO && !SIMDJSON_IS_32BITS + __int64 llen = _ftelli64(fp); + if(llen == -1L) { + std::fclose(fp); + return IO_ERROR; + } +#else + long llen = std::ftell(fp); + if((llen < 0) || (llen == LONG_MAX)) { + std::fclose(fp); + return IO_ERROR; + } +#endif + + // Allocate the padded_string + size_t len = static_cast(llen); + padded_string s(len); + if (s.data() == nullptr) { + std::fclose(fp); + return MEMALLOC; + } + + // Read the padded_string + std::rewind(fp); + size_t bytes_read = std::fread(s.data(), 1, len, fp); + if (std::fclose(fp) != 0 || bytes_read != len) { + return IO_ERROR; + } + + return s; +} + +} // namespace simdjson + +inline simdjson::padded_string operator "" _padded(const char *str, size_t len) { + return simdjson::padded_string(str, len); +} + +#endif // SIMDJSON_PADDED_STRING_INL_H +/* end file simdjson/padded_string-inl.h */ +/* skipped duplicate #include "simdjson/padded_string_view.h" */ +/* skipped duplicate #include "simdjson/padded_string_view-inl.h" */ + +/* including simdjson/dom.h: #include "simdjson/dom.h" */ +/* begin file simdjson/dom.h */ +#ifndef SIMDJSON_DOM_H +#define SIMDJSON_DOM_H + +/* including simdjson/dom/base.h: #include "simdjson/dom/base.h" */ +/* begin file simdjson/dom/base.h */ +#ifndef SIMDJSON_DOM_BASE_H +#define SIMDJSON_DOM_BASE_H + +/* skipped duplicate #include "simdjson/base.h" */ + +namespace simdjson { + +/** + * @brief A DOM API on top of the simdjson parser. + */ +namespace dom { + +/** The default batch size for parser.parse_many() and parser.load_many() */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * It is wasteful to allocate memory for tiny documents (e.g., 4 bytes). + */ +static constexpr size_t MINIMAL_DOCUMENT_CAPACITY = 32; + +class array; +class document; +class document_stream; +class element; +class key_value_pair; +class object; +class parser; + +#ifdef SIMDJSON_THREADS_ENABLED +struct stage1_worker; +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace dom + +namespace internal { + +template +class string_builder; +class tape_ref; + +} // namespace internal + +} // namespace simdjson + +#endif // SIMDJSON_DOM_BASE_H +/* end file simdjson/dom/base.h */ +/* including simdjson/dom/array.h: #include "simdjson/dom/array.h" */ +/* begin file simdjson/dom/array.h */ +#ifndef SIMDJSON_DOM_ARRAY_H +#define SIMDJSON_DOM_ARRAY_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* including simdjson/internal/tape_ref.h: #include "simdjson/internal/tape_ref.h" */ +/* begin file simdjson/internal/tape_ref.h */ +#ifndef SIMDJSON_INTERNAL_TAPE_REF_H +#define SIMDJSON_INTERNAL_TAPE_REF_H + +/* skipped duplicate #include "simdjson/base.h" */ + +namespace simdjson { +namespace dom { +class document; +} // namespace dom + +namespace internal { + +/** + * A reference to an element on the tape. Internal only. + */ +class tape_ref { +public: + simdjson_inline tape_ref() noexcept; + simdjson_inline tape_ref(const dom::document *doc, size_t json_index) noexcept; + inline size_t after_element() const noexcept; + simdjson_inline tape_type tape_ref_type() const noexcept; + simdjson_inline uint64_t tape_value() const noexcept; + simdjson_inline bool is_double() const noexcept; + simdjson_inline bool is_int64() const noexcept; + simdjson_inline bool is_uint64() const noexcept; + simdjson_inline bool is_false() const noexcept; + simdjson_inline bool is_true() const noexcept; + simdjson_inline bool is_null_on_tape() const noexcept;// different name to avoid clash with is_null. + simdjson_inline uint32_t matching_brace_index() const noexcept; + simdjson_inline uint32_t scope_count() const noexcept; + template + simdjson_inline T next_tape_value() const noexcept; + simdjson_inline uint32_t get_string_length() const noexcept; + simdjson_inline const char * get_c_str() const noexcept; + inline std::string_view get_string_view() const noexcept; + simdjson_inline bool is_document_root() const noexcept; + simdjson_inline bool usable() const noexcept; + + /** The document this element references. */ + const dom::document *doc; + + /** The index of this element on `doc.tape[]` */ + size_t json_index; +}; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_TAPE_REF_H +/* end file simdjson/internal/tape_ref.h */ + +namespace simdjson { +namespace dom { + +/** + * JSON array. + */ +class array { +public: + /** Create a new, invalid array */ + simdjson_inline array() noexcept; + + class iterator { + public: + using value_type = element; + using difference_type = std::ptrdiff_t; + + /** + * Get the actual value + */ + inline value_type operator*() const noexcept; + /** + * Get the next value. + * + * Part of the std::iterator interface. + */ + inline iterator& operator++() noexcept; + /** + * Get the next value. + * + * Part of the std::iterator interface. + */ + inline iterator operator++(int) noexcept; + /** + * Check if these values come from the same place in the JSON. + * + * Part of the std::iterator interface. + */ + inline bool operator!=(const iterator& other) const noexcept; + inline bool operator==(const iterator& other) const noexcept; + + inline bool operator<(const iterator& other) const noexcept; + inline bool operator<=(const iterator& other) const noexcept; + inline bool operator>=(const iterator& other) const noexcept; + inline bool operator>(const iterator& other) const noexcept; + + iterator() noexcept = default; + iterator(const iterator&) noexcept = default; + iterator& operator=(const iterator&) noexcept = default; + private: + simdjson_inline iterator(const internal::tape_ref &tape) noexcept; + internal::tape_ref tape; + friend class array; + }; + + /** + * Return the first array element. + * + * Part of the std::iterable interface. + */ + inline iterator begin() const noexcept; + /** + * One past the last array element. + * + * Part of the std::iterable interface. + */ + inline iterator end() const noexcept; + /** + * Get the size of the array (number of immediate children). + * It is a saturated value with a maximum of 0xFFFFFF: if the value + * is 0xFFFFFF then the size is 0xFFFFFF or greater. + */ + inline size_t size() const noexcept; + /** + * Get the total number of slots used by this array on the tape. + * + * Note that this is not the same thing as `size()`, which reports the + * number of actual elements within an array (not counting its children). + * + * Since an element can use 1 or 2 slots on the tape, you can only use this + * to figure out the total size of an array (including its children, + * recursively) if you know its structure ahead of time. + **/ + inline size_t number_of_slots() const noexcept; + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * dom::parser parser; + * array a = parser.parse(R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded); + * a.at_pointer("/0/foo/a/1") == 20 + * a.at_pointer("0")["foo"]["a"].at(1) == 20 + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) const noexcept; + + /** + * Get the value at the given index. This function has linear-time complexity and + * is equivalent to the following: + * + * size_t i=0; + * for (auto element : *this) { + * if (i == index) { return element; } + * i++; + * } + * return INDEX_OUT_OF_BOUNDS; + * + * Avoid calling the at() function repeatedly. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + inline simdjson_result at(size_t index) const noexcept; + +private: + simdjson_inline array(const internal::tape_ref &tape) noexcept; + internal::tape_ref tape; + friend class element; + friend struct simdjson_result; + template + friend class simdjson::internal::string_builder; +}; + + +} // namespace dom + +/** The result of a JSON conversion that may fail. */ +template<> +struct simdjson_result : public internal::simdjson_result_base { +public: + simdjson_inline simdjson_result() noexcept; ///< @private + simdjson_inline simdjson_result(dom::array value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + inline simdjson_result at_pointer(std::string_view json_pointer) const noexcept; + inline simdjson_result at(size_t index) const noexcept; + +#if SIMDJSON_EXCEPTIONS + inline dom::array::iterator begin() const noexcept(false); + inline dom::array::iterator end() const noexcept(false); + inline size_t size() const noexcept(false); +#endif // SIMDJSON_EXCEPTIONS +}; + + + +} // namespace simdjson + +#if defined(__cpp_lib_ranges) +#include + +namespace std { +namespace ranges { +template<> +inline constexpr bool enable_view = true; +#if SIMDJSON_EXCEPTIONS +template<> +inline constexpr bool enable_view> = true; +#endif // SIMDJSON_EXCEPTIONS +} // namespace ranges +} // namespace std +#endif // defined(__cpp_lib_ranges) + +#endif // SIMDJSON_DOM_ARRAY_H +/* end file simdjson/dom/array.h */ +/* including simdjson/dom/document_stream.h: #include "simdjson/dom/document_stream.h" */ +/* begin file simdjson/dom/document_stream.h */ +#ifndef SIMDJSON_DOCUMENT_STREAM_H +#define SIMDJSON_DOCUMENT_STREAM_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* including simdjson/dom/parser.h: #include "simdjson/dom/parser.h" */ +/* begin file simdjson/dom/parser.h */ +#ifndef SIMDJSON_DOM_PARSER_H +#define SIMDJSON_DOM_PARSER_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* including simdjson/dom/document.h: #include "simdjson/dom/document.h" */ +/* begin file simdjson/dom/document.h */ +#ifndef SIMDJSON_DOM_DOCUMENT_H +#define SIMDJSON_DOM_DOCUMENT_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ + +#include + +namespace simdjson { +namespace dom { + +/** + * A parsed JSON document. + * + * This class cannot be copied, only moved, to avoid unintended allocations. + */ +class document { +public: + /** + * Create a document container with zero capacity. + * + * The parser will allocate capacity as needed. + */ + document() noexcept = default; + ~document() noexcept = default; + + /** + * Take another document's buffers. + * + * @param other The document to take. Its capacity is zeroed and it is invalidated. + */ + document(document &&other) noexcept = default; + /** @private */ + document(const document &) = delete; // Disallow copying + /** + * Take another document's buffers. + * + * @param other The document to take. Its capacity is zeroed. + */ + document &operator=(document &&other) noexcept = default; + /** @private */ + document &operator=(const document &) = delete; // Disallow copying + + /** + * Get the root element of this document as a JSON array. + */ + element root() const noexcept; + + /** + * @private Dump the raw tape for debugging. + * + * @param os the stream to output to. + * @return false if the tape is likely wrong (e.g., you did not parse a valid JSON). + */ + bool dump_raw_tape(std::ostream &os) const noexcept; + + /** @private Structural values. */ + std::unique_ptr tape{}; + + /** @private String values. + * + * Should be at least byte_capacity. + */ + std::unique_ptr string_buf{}; + /** @private Allocate memory to support + * input JSON documents of up to len bytes. + * + * When calling this function, you lose + * all the data. + * + * The memory allocation is strict: you + * can you use this function to increase + * or lower the amount of allocated memory. + * Passsing zero clears the memory. + */ + error_code allocate(size_t len) noexcept; + /** @private Capacity in bytes, in terms + * of how many bytes of input JSON we can + * support. + */ + size_t capacity() const noexcept; + + +private: + size_t allocated_capacity{0}; + friend class parser; +}; // class document + +} // namespace dom +} // namespace simdjson + +#endif // SIMDJSON_DOM_DOCUMENT_H +/* end file simdjson/dom/document.h */ + +namespace simdjson { + +namespace dom { + +/** + * A persistent document parser. + * + * The parser is designed to be reused, holding the internal buffers necessary to do parsing, + * as well as memory for a single document. The parsed document is overwritten on each parse. + * + * This class cannot be copied, only moved, to avoid unintended allocations. + * + * @note Moving a parser instance may invalidate "dom::element" instances. If you need to + * preserve both the "dom::element" instances and the parser, consider wrapping the parser + * instance in a std::unique_ptr instance: + * + * std::unique_ptr parser(new dom::parser{}); + * auto error = parser->load(f).get(root); + * + * You can then move std::unique_ptr safely. + * + * @note This is not thread safe: one parser cannot produce two documents at the same time! + */ +class parser { +public: + /** + * Create a JSON parser. + * + * The new parser will have zero capacity. + * + * @param max_capacity The maximum document length the parser can automatically handle. The parser + * will allocate more capacity on an as needed basis (when it sees documents too big to handle) + * up to this amount. The parser still starts with zero capacity no matter what this number is: + * to allocate an initial capacity, call allocate() after constructing the parser. + * Defaults to SIMDJSON_MAXSIZE_BYTES (the largest single document simdjson can process). + */ + simdjson_inline explicit parser(size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept; + /** + * Take another parser's buffers and state. + * + * @param other The parser to take. Its capacity is zeroed. + */ + simdjson_inline parser(parser &&other) noexcept; + parser(const parser &) = delete; ///< @private Disallow copying + /** + * Take another parser's buffers and state. + * + * @param other The parser to take. Its capacity is zeroed. + */ + simdjson_inline parser &operator=(parser &&other) noexcept; + parser &operator=(const parser &) = delete; ///< @private Disallow copying + + /** Deallocate the JSON parser. */ + ~parser()=default; + + /** + * Load a JSON document from a file and return a reference to it. + * + * dom::parser parser; + * const element doc = parser.load("jsonexamples/twitter.json"); + * + * The function is eager: the file's content is loaded in memory inside the parser instance + * and immediately parsed. The file can be deleted after the `parser.load` call. + * + * ### IMPORTANT: Document Lifetime + * + * The JSON document still lives in the parser: this is the most efficient way to parse JSON + * documents because it reuses the same buffers, but you *must* use the document before you + * destroy the parser or call parse() again. + * + * Moving the parser instance is safe, but it invalidates the element instances. You may store + * the parser instance without moving it by wrapping it inside an `unique_ptr` instance like + * so: `std::unique_ptr parser(new dom::parser{});`. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than the file length, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param path The path to load. + * @return The document, or an error: + * - IO_ERROR if there was an error opening or reading the file. + * Be mindful that on some 32-bit systems, + * the file size might be limited to 2 GB. + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails. + * - CAPACITY if the parser does not have enough capacity and len > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result load(const std::string &path) & noexcept; + inline simdjson_result load(const std::string &path) && = delete ; + /** + * Parse a JSON document and return a temporary reference to it. + * + * dom::parser parser; + * element doc_root = parser.parse(buf, len); + * + * The function eagerly parses the input: the input can be modified and discarded after + * the `parser.parse(buf, len)` call has completed. + * + * ### IMPORTANT: Document Lifetime + * + * The JSON document still lives in the parser: this is the most efficient way to parse JSON + * documents because it reuses the same buffers, but you *must* use the document before you + * destroy the parser or call parse() again. + * + * Moving the parser instance is safe, but it invalidates the element instances. You may store + * the parser instance without moving it by wrapping it inside an `unique_ptr` instance like + * so: `std::unique_ptr parser(new dom::parser{});`. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * If realloc_if_needed is true (the default), it is assumed that the buffer does *not* have enough padding, + * and it is copied into an enlarged temporary buffer before parsing. Thus the following is safe: + * + * const char *json = R"({"key":"value"})"; + * const size_t json_len = std::strlen(json); + * simdjson::dom::parser parser; + * simdjson::dom::element element = parser.parse(json, json_len); + * + * If you set realloc_if_needed to false (e.g., parser.parse(json, json_len, false)), + * you must provide a buffer with at least SIMDJSON_PADDING extra bytes at the end. + * The benefit of setting realloc_if_needed to false is that you avoid a temporary + * memory allocation and a copy. + * + * The padded bytes may be read. It is not important how you initialize + * these bytes though we recommend a sensible default like null character values or spaces. + * For example, the following low-level code is safe: + * + * const char *json = R"({"key":"value"})"; + * const size_t json_len = std::strlen(json); + * std::unique_ptr padded_json_copy{new char[json_len + SIMDJSON_PADDING]}; + * std::memcpy(padded_json_copy.get(), json, json_len); + * std::memset(padded_json_copy.get() + json_len, '\0', SIMDJSON_PADDING); + * simdjson::dom::parser parser; + * simdjson::dom::element element = parser.parse(padded_json_copy.get(), json_len, false); + * + * ### Parser Capacity + * + * If the parser's current capacity is less than len, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The JSON to parse. Must have at least len + SIMDJSON_PADDING allocated bytes, unless + * realloc_if_needed is true. + * @param len The length of the JSON. + * @param realloc_if_needed Whether to reallocate and enlarge the JSON buffer to add padding. + * @return An element pointing at the root of the document, or an error: + * - MEMALLOC if realloc_if_needed is true or the parser does not have enough capacity, + * and memory allocation fails. + * - CAPACITY if the parser does not have enough capacity and len > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result parse(const uint8_t *buf, size_t len, bool realloc_if_needed = true) & noexcept; + inline simdjson_result parse(const uint8_t *buf, size_t len, bool realloc_if_needed = true) && =delete; + /** @overload parse(const uint8_t *buf, size_t len, bool realloc_if_needed) */ + simdjson_inline simdjson_result parse(const char *buf, size_t len, bool realloc_if_needed = true) & noexcept; + simdjson_inline simdjson_result parse(const char *buf, size_t len, bool realloc_if_needed = true) && =delete; + /** @overload parse(const uint8_t *buf, size_t len, bool realloc_if_needed) */ + simdjson_inline simdjson_result parse(const std::string &s) & noexcept; + simdjson_inline simdjson_result parse(const std::string &s) && =delete; + /** @overload parse(const uint8_t *buf, size_t len, bool realloc_if_needed) */ + simdjson_inline simdjson_result parse(const padded_string &s) & noexcept; + simdjson_inline simdjson_result parse(const padded_string &s) && =delete; + /** @overload parse(const uint8_t *buf, size_t len, bool realloc_if_needed) */ + simdjson_inline simdjson_result parse(const padded_string_view &v) & noexcept; + simdjson_inline simdjson_result parse(const padded_string_view &v) && =delete; + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_inline simdjson_result parse(const char *buf) noexcept = delete; + + /** + * Parse a JSON document into a provide document instance and return a temporary reference to it. + * It is similar to the function `parse` except that instead of parsing into the internal + * `document` instance associated with the parser, it allows the user to provide a document + * instance. + * + * dom::parser parser; + * dom::document doc; + * element doc_root = parser.parse_into_document(doc, buf, len); + * + * The function eagerly parses the input: the input can be modified and discarded after + * the `parser.parse(buf, len)` call has completed. + * + * ### IMPORTANT: Document Lifetime + * + * After the call to parse_into_document, the parser is no longer needed. + * + * The JSON document lives in the document instance: you must keep the document + * instance alive while you navigate through it (i.e., used the returned value from + * parse_into_document). You are encourage to reuse the document instance + * many times with new data to avoid reallocations: + * + * dom::document doc; + * element doc_root1 = parser.parse_into_document(doc, buf1, len); + * //... doc_root1 is a pointer inside doc + * element doc_root2 = parser.parse_into_document(doc, buf1, len); + * //... doc_root2 is a pointer inside doc + * // at this point doc_root1 is no longer safe + * + * Moving the document instance is safe, but it invalidates the element instances. After + * moving a document, you can recover safe access to the document root with its `root()` method. + * + * @param doc The document instance where the parsed data will be stored (on success). + * @param buf The JSON to parse. Must have at least len + SIMDJSON_PADDING allocated bytes, unless + * realloc_if_needed is true. + * @param len The length of the JSON. + * @param realloc_if_needed Whether to reallocate and enlarge the JSON buffer to add padding. + * @return An element pointing at the root of document, or an error: + * - MEMALLOC if realloc_if_needed is true or the parser does not have enough capacity, + * and memory allocation fails. + * - CAPACITY if the parser does not have enough capacity and len > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result parse_into_document(document& doc, const uint8_t *buf, size_t len, bool realloc_if_needed = true) & noexcept; + inline simdjson_result parse_into_document(document& doc, const uint8_t *buf, size_t len, bool realloc_if_needed = true) && =delete; + /** @overload parse_into_document(const uint8_t *buf, size_t len, bool realloc_if_needed) */ + simdjson_inline simdjson_result parse_into_document(document& doc, const char *buf, size_t len, bool realloc_if_needed = true) & noexcept; + simdjson_inline simdjson_result parse_into_document(document& doc, const char *buf, size_t len, bool realloc_if_needed = true) && =delete; + /** @overload parse_into_document(const uint8_t *buf, size_t len, bool realloc_if_needed) */ + simdjson_inline simdjson_result parse_into_document(document& doc, const std::string &s) & noexcept; + simdjson_inline simdjson_result parse_into_document(document& doc, const std::string &s) && =delete; + /** @overload parse_into_document(const uint8_t *buf, size_t len, bool realloc_if_needed) */ + simdjson_inline simdjson_result parse_into_document(document& doc, const padded_string &s) & noexcept; + simdjson_inline simdjson_result parse_into_document(document& doc, const padded_string &s) && =delete; + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_inline simdjson_result parse_into_document(document& doc, const char *buf) noexcept = delete; + + /** + * Load a file containing many JSON documents. + * + * dom::parser parser; + * for (const element doc : parser.load_many(path)) { + * cout << std::string(doc["title"]) << endl; + * } + * + * The file is loaded in memory and can be safely deleted after the `parser.load_many(path)` + * function has returned. The memory is held by the `parser` instance. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * And, possibly, no document many have been parsed when the `parser.load_many(path)` function + * returned. + * + * If there is a UTF-8 BOM, the parser skips it. + * + * ### Format + * + * The file must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * Documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with whitespace. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excesively small values may impact negatively the + * performance. + * + * ### Error Handling + * + * All errors are returned during iteration: if there is a global error such as memory allocation, + * it will be yielded as the first result. Iteration always stops after the first error. + * + * As with all other simdjson methods, non-exception error handling is readily available through + * the same interface, requiring you to check the error before using the document: + * + * dom::parser parser; + * dom::document_stream docs; + * auto error = parser.load_many(path).get(docs); + * if (error) { cerr << error << endl; exit(1); } + * for (auto doc : docs) { + * std::string_view title; + * if ((error = doc["title"].get(title)) { cerr << error << endl; exit(1); } + * cout << title << endl; + * } + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param path File name pointing at the concatenated JSON to parse. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 1MB (as simdjson::dom::DEFAULT_BATCH_SIZE), which has been a reasonable sweet + * spot in our tests. + * If you set the batch_size to a value smaller than simdjson::dom::MINIMAL_BATCH_SIZE + * (currently 32B), it will be replaced by simdjson::dom::MINIMAL_BATCH_SIZE. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - IO_ERROR if there was an error opening or reading the file. + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails. + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result load_many(const std::string &path, size_t batch_size = dom::DEFAULT_BATCH_SIZE) noexcept; + + /** + * Parse a buffer containing many JSON documents. + * + * dom::parser parser; + * for (element doc : parser.parse_many(buf, len)) { + * cout << std::string(doc["title"]) << endl; + * } + * + * No copy of the input buffer is made. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * And, possibly, no document many have been parsed when the `parser.load_many(path)` function + * returned. + * + * The caller is responsabile to ensure that the input string data remains unchanged and is + * not deleted during the loop. In particular, the following is unsafe and will not compile: + * + * auto docs = parser.parse_many("[\"temporary data\"]"_padded); + * // here the string "[\"temporary data\"]" may no longer exist in memory + * // the parser instance may not have even accessed the input yet + * for (element doc : docs) { + * cout << std::string(doc["title"]) << endl; + * } + * + * The following is safe: + * + * auto json = "[\"temporary data\"]"_padded; + * auto docs = parser.parse_many(json); + * for (element doc : docs) { + * cout << std::string(doc["title"]) << endl; + * } + * + * If there is a UTF-8 BOM, the parser skips it. + * + * ### Format + * + * The buffer must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with whitespace. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excesively small values may impact negatively the + * performance. + * + * ### Error Handling + * + * All errors are returned during iteration: if there is a global error such as memory allocation, + * it will be yielded as the first result. Iteration always stops after the first error. + * + * As with all other simdjson methods, non-exception error handling is readily available through + * the same interface, requiring you to check the error before using the document: + * + * dom::parser parser; + * dom::document_stream docs; + * auto error = parser.load_many(path).get(docs); + * if (error) { cerr << error << endl; exit(1); } + * for (auto doc : docs) { + * std::string_view title; + * if ((error = doc["title"].get(title)) { cerr << error << endl; exit(1); } + * cout << title << endl; + * } + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The concatenated JSON to parse. Must have at least len + SIMDJSON_PADDING allocated bytes. + * @param len The length of the concatenated JSON. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 10MB, which has been a reasonable sweet spot in our tests. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result parse_many(const uint8_t *buf, size_t len, size_t batch_size = dom::DEFAULT_BATCH_SIZE) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result parse_many(const char *buf, size_t len, size_t batch_size = dom::DEFAULT_BATCH_SIZE) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result parse_many(const std::string &s, size_t batch_size = dom::DEFAULT_BATCH_SIZE) noexcept; + inline simdjson_result parse_many(const std::string &&s, size_t batch_size) = delete;// unsafe + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result parse_many(const padded_string &s, size_t batch_size = dom::DEFAULT_BATCH_SIZE) noexcept; + inline simdjson_result parse_many(const padded_string &&s, size_t batch_size) = delete;// unsafe + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_result parse_many(const char *buf, size_t batch_size = dom::DEFAULT_BATCH_SIZE) noexcept = delete; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused inline error_code allocate(size_t capacity, size_t max_depth = DEFAULT_MAX_DEPTH) noexcept; + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API + /** + * @private deprecated because it returns bool instead of error_code, which is our standard for + * failures. Use allocate() instead. + * + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return true if successful, false if allocation failed. + */ + [[deprecated("Use allocate() instead.")]] + simdjson_warn_unused inline bool allocate_capacity(size_t capacity, size_t max_depth = DEFAULT_MAX_DEPTH) noexcept; +#endif // SIMDJSON_DISABLE_DEPRECATED_API + /** + * The largest document this parser can support without reallocating. + * + * @return Current capacity, in bytes. + */ + simdjson_inline size_t capacity() const noexcept; + + /** + * The largest document this parser can automatically support. + * + * The parser may reallocate internal buffers as needed up to this amount. + * + * @return Maximum capacity, in bytes. + */ + simdjson_inline size_t max_capacity() const noexcept; + + /** + * The maximum level of nested object and arrays supported by this parser. + * + * @return Maximum depth, in bytes. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Set max_capacity. This is the largest document this parser can automatically support. + * + * The parser may reallocate internal buffers as needed up to this amount as documents are passed + * to it. + * + * Note: To avoid limiting the memory to an absurd value, such as zero or two bytes, + * iff you try to set max_capacity to a value lower than MINIMAL_DOCUMENT_CAPACITY, + * then the maximal capacity is set to MINIMAL_DOCUMENT_CAPACITY. + * + * This call will not allocate or deallocate, even if capacity is currently above max_capacity. + * + * @param max_capacity The new maximum capacity, in bytes. + */ + simdjson_inline void set_max_capacity(size_t max_capacity) noexcept; + +#ifdef SIMDJSON_THREADS_ENABLED + /** + * The parser instance can use threads when they are available to speed up some + * operations. It is enabled by default. Changing this attribute will change the + * behavior of the parser for future operations. + */ + bool threaded{true}; +#endif + /** @private Use the new DOM API instead */ + class Iterator; + /** @private Use simdjson_error instead */ + using InvalidJSON [[deprecated("Use simdjson_error instead")]] = simdjson_error; + + /** @private [for benchmarking access] The implementation to use */ + std::unique_ptr implementation{}; + + /** @private Use `if (parser.parse(...).error())` instead */ + bool valid{false}; + /** @private Use `parser.parse(...).error()` instead */ + error_code error{UNINITIALIZED}; + + /** @private Use `parser.parse(...).value()` instead */ + document doc{}; + + /** @private returns true if the document parsed was valid */ + [[deprecated("Use the result of parser.parse() instead")]] + inline bool is_valid() const noexcept; + + /** + * @private return an error code corresponding to the last parsing attempt, see + * simdjson.h will return UNINITIALIZED if no parsing was attempted + */ + [[deprecated("Use the result of parser.parse() instead")]] + inline int get_error_code() const noexcept; + + /** @private return the string equivalent of "get_error_code" */ + [[deprecated("Use error_message() on the result of parser.parse() instead, or cout << error")]] + inline std::string get_error_message() const noexcept; + + /** @private */ + [[deprecated("Use cout << on the result of parser.parse() instead")]] + inline bool print_json(std::ostream &os) const noexcept; + + /** @private Private and deprecated: use `parser.parse(...).doc.dump_raw_tape()` instead */ + inline bool dump_raw_tape(std::ostream &os) const noexcept; + + +private: + /** + * The maximum document length this parser will automatically support. + * + * The parser will not be automatically allocated above this amount. + */ + size_t _max_capacity; + + /** + * The loaded buffer (reused each time load() is called) + */ + std::unique_ptr loaded_bytes; + + /** Capacity of loaded_bytes buffer. */ + size_t _loaded_bytes_capacity{0}; + + // all nodes are stored on the doc.tape using a 64-bit word. + // + // strings, double and ints are stored as + // a 64-bit word with a pointer to the actual value + // + // + // + // for objects or arrays, store [ or { at the beginning and } and ] at the + // end. For the openings ([ or {), we annotate them with a reference to the + // location on the doc.tape of the end, and for then closings (} and ]), we + // annotate them with a reference to the location of the opening + // + // + + /** + * Ensure we have enough capacity to handle at least desired_capacity bytes, + * and auto-allocate if not. This also allocates memory if needed in the + * internal document. + */ + inline error_code ensure_capacity(size_t desired_capacity) noexcept; + /** + * Ensure we have enough capacity to handle at least desired_capacity bytes, + * and auto-allocate if not. This also allocates memory if needed in the + * provided document. + */ + inline error_code ensure_capacity(document& doc, size_t desired_capacity) noexcept; + + /** Read the file into loaded_bytes */ + inline simdjson_result read_file(const std::string &path) noexcept; + + friend class parser::Iterator; + friend class document_stream; + + +}; // class parser + +} // namespace dom +} // namespace simdjson + +#endif // SIMDJSON_DOM_PARSER_H +/* end file simdjson/dom/parser.h */ + +#ifdef SIMDJSON_THREADS_ENABLED +#include +#include +#include +#endif + +namespace simdjson { +namespace dom { + +#ifdef SIMDJSON_THREADS_ENABLED +/** @private Custom worker class **/ +struct stage1_worker { + stage1_worker() noexcept = default; + stage1_worker(const stage1_worker&) = delete; + stage1_worker(stage1_worker&&) = delete; + stage1_worker operator=(const stage1_worker&) = delete; + ~stage1_worker(); + /** + * We only start the thread when it is needed, not at object construction, this may throw. + * You should only call this once. + **/ + void start_thread(); + /** + * Start a stage 1 job. You should first call 'run', then 'finish'. + * You must call start_thread once before. + */ + void run(document_stream * ds, dom::parser * stage1, size_t next_batch_start); + /** Wait for the run to finish (blocking). You should first call 'run', then 'finish'. **/ + void finish(); + +private: + + /** + * Normally, we would never stop the thread. But we do in the destructor. + * This function is only safe assuming that you are not waiting for results. You + * should have called run, then finish, and be done. + **/ + void stop_thread(); + + std::thread thread{}; + /** These three variables define the work done by the thread. **/ + dom::parser * stage1_thread_parser{}; + size_t _next_batch_start{}; + document_stream * owner{}; + /** + * We have two state variables. This could be streamlined to one variable in the future but + * we use two for clarity. + */ + bool has_work{false}; + bool can_work{true}; + + /** + * We lock using a mutex. + */ + std::mutex locking_mutex{}; + std::condition_variable cond_var{}; +}; +#endif + +/** + * A forward-only stream of documents. + * + * Produced by parser::parse_many. + * + */ +class document_stream { +public: + /** + * Construct an uninitialized document_stream. + * + * ```c++ + * document_stream docs; + * error = parser.parse_many(json).get(docs); + * ``` + */ + simdjson_inline document_stream() noexcept; + /** Move one document_stream to another. */ + simdjson_inline document_stream(document_stream &&other) noexcept = default; + /** Move one document_stream to another. */ + simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default; + + simdjson_inline ~document_stream() noexcept; + /** + * Returns the input size in bytes. + */ + inline size_t size_in_bytes() const noexcept; + /** + * After iterating through the stream, this method + * returns the number of bytes that were not parsed at the end + * of the stream. If truncated_bytes() differs from zero, + * then the input was truncated maybe because incomplete JSON + * documents were found at the end of the stream. You + * may need to process the bytes in the interval [size_in_bytes()-truncated_bytes(), size_in_bytes()). + * + * You should only call truncated_bytes() after streaming through all + * documents, like so: + * + * document_stream stream = parser.parse_many(json,window); + * for(auto doc : stream) { + * // do something with doc + * } + * size_t truncated = stream.truncated_bytes(); + * + */ + inline size_t truncated_bytes() const noexcept; + /** + * An iterator through a forward-only stream of documents. + */ + class iterator { + public: + using value_type = simdjson_result; + using reference = value_type; + + using difference_type = std::ptrdiff_t; + + using iterator_category = std::input_iterator_tag; + + /** + * Default constructor. + */ + simdjson_inline iterator() noexcept; + /** + * Get the current document (or error). + */ + simdjson_inline reference operator*() noexcept; + /** + * Advance to the next document (prefix). + */ + inline iterator& operator++() noexcept; + /** + * Check if we're at the end yet. + * @param other the end iterator to compare to. + */ + simdjson_inline bool operator!=(const iterator &other) const noexcept; + /** + * @private + * + * Gives the current index in the input document in bytes. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * size_t index = i.current_index(); + * } + * + * This function (current_index()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline size_t current_index() const noexcept; + /** + * @private + * + * Gives a view of the current document. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * std::string_view v = i->source(); + * } + * + * The returned string_view instance is simply a map to the (unparsed) + * source string: it may thus include white-space characters and all manner + * of padding. + * + * This function (source()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline std::string_view source() const noexcept; + + private: + simdjson_inline iterator(document_stream *s, bool finished) noexcept; + /** The document_stream we're iterating through. */ + document_stream* stream; + /** Whether we're finished or not. */ + bool finished; + friend class document_stream; + }; + + /** + * Start iterating the documents in the stream. + */ + simdjson_inline iterator begin() noexcept; + /** + * The end of the stream, for iterator comparison purposes. + */ + simdjson_inline iterator end() noexcept; + +private: + + document_stream &operator=(const document_stream &) = delete; // Disallow copying + document_stream(const document_stream &other) = delete; // Disallow copying + + /** + * Construct a document_stream. Does not allocate or parse anything until the iterator is + * used. + * + * @param parser is a reference to the parser instance used to generate this document_stream + * @param buf is the raw byte buffer we need to process + * @param len is the length of the raw byte buffer in bytes + * @param batch_size is the size of the windows (must be strictly greater or equal to the largest JSON document) + */ + simdjson_inline document_stream( + dom::parser &parser, + const uint8_t *buf, + size_t len, + size_t batch_size + ) noexcept; + + /** + * Parse the first document in the buffer. Used by begin(), to handle allocation and + * initialization. + */ + inline void start() noexcept; + + /** + * Parse the next document found in the buffer previously given to document_stream. + * + * The content should be a valid JSON document encoded as UTF-8. If there is a + * UTF-8 BOM, the parser skips it. + * + * You do NOT need to pre-allocate a parser. This function takes care of + * pre-allocating a capacity defined by the batch_size defined when creating the + * document_stream object. + * + * The function returns simdjson::EMPTY if there is no more data to be parsed. + * + * The function returns simdjson::SUCCESS (as integer = 0) in case of success + * and indicates that the buffer has successfully been parsed to the end. + * Every document it contained has been parsed without error. + * + * The function returns an error code from simdjson/simdjson.h in case of failure + * such as simdjson::CAPACITY, simdjson::MEMALLOC, simdjson::DEPTH_ERROR and so forth; + * the simdjson::error_message function converts these error codes into a string). + * + * You can also check validity by calling parser.is_valid(). The same parser can + * and should be reused for the other documents in the buffer. + */ + inline void next() noexcept; + + /** + * Pass the next batch through stage 1 and return when finished. + * When threads are enabled, this may wait for the stage 1 thread to finish. + */ + inline void load_batch() noexcept; + + /** Get the next document index. */ + inline size_t next_batch_start() const noexcept; + + /** Pass the next batch through stage 1 with the given parser. */ + inline error_code run_stage1(dom::parser &p, size_t batch_start) noexcept; + + dom::parser *parser; + const uint8_t *buf; + size_t len; + size_t batch_size; + /** The error (or lack thereof) from the current document. */ + error_code error; + size_t batch_start{0}; + size_t doc_index{}; +#ifdef SIMDJSON_THREADS_ENABLED + /** Indicates whether we use threads. Note that this needs to be a constant during the execution of the parsing. */ + bool use_thread; + + inline void load_from_stage1_thread() noexcept; + + /** Start a thread to run stage 1 on the next batch. */ + inline void start_stage1_thread() noexcept; + + /** Wait for the stage 1 thread to finish and capture the results. */ + inline void finish_stage1_thread() noexcept; + + /** The error returned from the stage 1 thread. */ + error_code stage1_thread_error{UNINITIALIZED}; + /** The thread used to run stage 1 against the next batch in the background. */ + friend struct stage1_worker; + std::unique_ptr worker{new(std::nothrow) stage1_worker()}; + /** + * The parser used to run stage 1 in the background. Will be swapped + * with the regular parser when finished. + */ + dom::parser stage1_thread_parser{}; +#endif // SIMDJSON_THREADS_ENABLED + + friend class dom::parser; + friend struct simdjson_result; + friend struct internal::simdjson_result_base; + +}; // class document_stream + +} // namespace dom + +template<> +struct simdjson_result : public internal::simdjson_result_base { +public: + simdjson_inline simdjson_result() noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result(dom::document_stream &&value) noexcept; ///< @private + +#if SIMDJSON_EXCEPTIONS + simdjson_inline dom::document_stream::iterator begin() noexcept(false); + simdjson_inline dom::document_stream::iterator end() noexcept(false); +#else // SIMDJSON_EXCEPTIONS +#ifndef SIMDJSON_DISABLE_DEPRECATED_API + [[deprecated("parse_many() and load_many() may return errors. Use document_stream stream; error = parser.parse_many().get(doc); instead.")]] + simdjson_inline dom::document_stream::iterator begin() noexcept; + [[deprecated("parse_many() and load_many() may return errors. Use document_stream stream; error = parser.parse_many().get(doc); instead.")]] + simdjson_inline dom::document_stream::iterator end() noexcept; +#endif // SIMDJSON_DISABLE_DEPRECATED_API +#endif // SIMDJSON_EXCEPTIONS +}; // struct simdjson_result + +} // namespace simdjson + +#endif // SIMDJSON_DOCUMENT_STREAM_H +/* end file simdjson/dom/document_stream.h */ +/* skipped duplicate #include "simdjson/dom/document.h" */ +/* including simdjson/dom/element.h: #include "simdjson/dom/element.h" */ +/* begin file simdjson/dom/element.h */ +#ifndef SIMDJSON_DOM_ELEMENT_H +#define SIMDJSON_DOM_ELEMENT_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/array.h" */ + +namespace simdjson { +namespace dom { + +/** + * The actual concrete type of a JSON element + * This is the type it is most easily cast to with get<>. + */ +enum class element_type { + ARRAY = '[', ///< dom::array + OBJECT = '{', ///< dom::object + INT64 = 'l', ///< int64_t + UINT64 = 'u', ///< uint64_t: any integer that fits in uint64_t but *not* int64_t + DOUBLE = 'd', ///< double: Any number with a "." or "e" that fits in double. + STRING = '"', ///< std::string_view + BOOL = 't', ///< bool + NULL_VALUE = 'n' ///< null +}; + +/** + * A JSON element. + * + * References an element in a JSON document, representing a JSON null, boolean, string, number, + * array or object. + */ +class element { +public: + /** Create a new, invalid element. */ + simdjson_inline element() noexcept; + + /** The type of this element. */ + simdjson_inline element_type type() const noexcept; + + /** + * Cast this element to an array. + * + * @returns An object that can be used to iterate the array, or: + * INCORRECT_TYPE if the JSON element is not an array. + */ + inline simdjson_result get_array() const noexcept; + /** + * Cast this element to an object. + * + * @returns An object that can be used to look up or iterate the object's fields, or: + * INCORRECT_TYPE if the JSON element is not an object. + */ + inline simdjson_result get_object() const noexcept; + /** + * Cast this element to a null-terminated C string. + * + * The string is guaranteed to be valid UTF-8. + * + * The length of the string is given by get_string_length(). Because JSON strings + * may contain null characters, it may be incorrect to use strlen to determine the + * string length. + * + * It is possible to get a single string_view instance which represents both the string + * content and its length: see get_string(). + * + * @returns A pointer to a null-terminated UTF-8 string. This string is stored in the parser and will + * be invalidated the next time it parses a document or when it is destroyed. + * Returns INCORRECT_TYPE if the JSON element is not a string. + */ + inline simdjson_result get_c_str() const noexcept; + /** + * Gives the length in bytes of the string. + * + * It is possible to get a single string_view instance which represents both the string + * content and its length: see get_string(). + * + * @returns A string length in bytes. + * Returns INCORRECT_TYPE if the JSON element is not a string. + */ + inline simdjson_result get_string_length() const noexcept; + /** + * Cast this element to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next time it + * parses a document or when it is destroyed. + * Returns INCORRECT_TYPE if the JSON element is not a string. + */ + inline simdjson_result get_string() const noexcept; + /** + * Cast this element to a signed integer. + * + * @returns A signed 64-bit integer. + * Returns INCORRECT_TYPE if the JSON element is not an integer, or NUMBER_OUT_OF_RANGE + * if it is negative. + */ + inline simdjson_result get_int64() const noexcept; + /** + * Cast this element to an unsigned integer. + * + * @returns An unsigned 64-bit integer. + * Returns INCORRECT_TYPE if the JSON element is not an integer, or NUMBER_OUT_OF_RANGE + * if it is too large. + */ + inline simdjson_result get_uint64() const noexcept; + /** + * Cast this element to a double floating-point. + * + * @returns A double value. + * Returns INCORRECT_TYPE if the JSON element is not a number. + */ + inline simdjson_result get_double() const noexcept; + /** + * Cast this element to a bool. + * + * @returns A bool value. + * Returns INCORRECT_TYPE if the JSON element is not a boolean. + */ + inline simdjson_result get_bool() const noexcept; + + /** + * Whether this element is a json array. + * + * Equivalent to is(). + */ + inline bool is_array() const noexcept; + /** + * Whether this element is a json object. + * + * Equivalent to is(). + */ + inline bool is_object() const noexcept; + /** + * Whether this element is a json string. + * + * Equivalent to is() or is(). + */ + inline bool is_string() const noexcept; + /** + * Whether this element is a json number that fits in a signed 64-bit integer. + * + * Equivalent to is(). + */ + inline bool is_int64() const noexcept; + /** + * Whether this element is a json number that fits in an unsigned 64-bit integer. + * + * Equivalent to is(). + */ + inline bool is_uint64() const noexcept; + /** + * Whether this element is a json number that fits in a double. + * + * Equivalent to is(). + */ + inline bool is_double() const noexcept; + + /** + * Whether this element is a json number. + * + * Both integers and floating points will return true. + */ + inline bool is_number() const noexcept; + + /** + * Whether this element is a json `true` or `false`. + * + * Equivalent to is(). + */ + inline bool is_bool() const noexcept; + /** + * Whether this element is a json `null`. + */ + inline bool is_null() const noexcept; + + /** + * Tell whether the value can be cast to provided type (T). + * + * Supported types: + * - Boolean: bool + * - Number: double, uint64_t, int64_t + * - String: std::string_view, const char * + * - Array: dom::array + * - Object: dom::object + * + * @tparam T bool, double, uint64_t, int64_t, std::string_view, const char *, dom::array, dom::object + */ + template + simdjson_inline bool is() const noexcept; + + /** + * Get the value as the provided type (T). + * + * Supported types: + * - Boolean: bool + * - Number: double, uint64_t, int64_t + * - String: std::string_view, const char * + * - Array: dom::array + * - Object: dom::object + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array() or get_string() instead. + * + * @tparam T bool, double, uint64_t, int64_t, std::string_view, const char *, dom::array, dom::object + * + * @returns The value cast to the given type, or: + * INCORRECT_TYPE if the value cannot be cast to the given type. + */ + + template + inline simdjson_result get() const noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are Boolean (bool), numbers (double, uint64_t, int64_t), " + "strings (std::string_view, const char *), arrays (dom::array) and objects (dom::object). " + "We recommand you use get_double(), get_bool(), get_uint64(), get_int64(), " + "get_object(), get_array() or get_string() instead of the get template."); + } + + /** + * Get the value as the provided type (T). + * + * Supported types: + * - Boolean: bool + * - Number: double, uint64_t, int64_t + * - String: std::string_view, const char * + * - Array: dom::array + * - Object: dom::object + * + * @tparam T bool, double, uint64_t, int64_t, std::string_view, const char *, dom::array, dom::object + * + * @param value The variable to set to the value. May not be set if there is an error. + * + * @returns The error that occurred, or SUCCESS if there was no error. + */ + template + simdjson_warn_unused simdjson_inline error_code get(T &value) const noexcept; + + /** + * Get the value as the provided type (T), setting error if it's not the given type. + * + * Supported types: + * - Boolean: bool + * - Number: double, uint64_t, int64_t + * - String: std::string_view, const char * + * - Array: dom::array + * - Object: dom::object + * + * @tparam T bool, double, uint64_t, int64_t, std::string_view, const char *, dom::array, dom::object + * + * @param value The variable to set to the given type. value is undefined if there is an error. + * @param error The variable to store the error. error is set to error_code::SUCCEED if there is an error. + */ + template + inline void tie(T &value, error_code &error) && noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Read this element as a boolean. + * + * @return The boolean value + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not a boolean. + */ + inline operator bool() const noexcept(false); + + /** + * Read this element as a null-terminated UTF-8 string. + * + * Be mindful that JSON allows strings to contain null characters. + * + * Does *not* convert other types to a string; requires that the JSON type of the element was + * an actual string. + * + * @return The string value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not a string. + */ + inline explicit operator const char*() const noexcept(false); + + /** + * Read this element as a null-terminated UTF-8 string. + * + * Does *not* convert other types to a string; requires that the JSON type of the element was + * an actual string. + * + * @return The string value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not a string. + */ + inline operator std::string_view() const noexcept(false); + + /** + * Read this element as an unsigned integer. + * + * @return The integer value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not an integer + * @exception simdjson_error(NUMBER_OUT_OF_RANGE) if the integer doesn't fit in 64 bits or is negative + */ + inline operator uint64_t() const noexcept(false); + /** + * Read this element as an signed integer. + * + * @return The integer value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not an integer + * @exception simdjson_error(NUMBER_OUT_OF_RANGE) if the integer doesn't fit in 64 bits + */ + inline operator int64_t() const noexcept(false); + /** + * Read this element as an double. + * + * @return The double value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not a number + * @exception simdjson_error(NUMBER_OUT_OF_RANGE) if the integer doesn't fit in 64 bits or is negative + */ + inline operator double() const noexcept(false); + /** + * Read this element as a JSON array. + * + * @return The JSON array. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not an array + */ + inline operator array() const noexcept(false); + /** + * Read this element as a JSON object (key/value pairs). + * + * @return The JSON object. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not an object + */ + inline operator object() const noexcept(false); + + /** + * Iterate over each element in this array. + * + * @return The beginning of the iteration. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not an array + */ + inline dom::array::iterator begin() const noexcept(false); + + /** + * Iterate over each element in this array. + * + * @return The end of the iteration. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON element is not an array + */ + inline dom::array::iterator end() const noexcept(false); +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the value associated with the given key. + * + * The key will be matched against **unescaped** JSON: + * + * dom::parser parser; + * int64_t(parser.parse(R"({ "a\n": 1 })"_padded)["a\n"]) == 1 + * parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get_uint64().error() == NO_SUCH_FIELD + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + * - INCORRECT_TYPE if this is not an object + */ + inline simdjson_result operator[](std::string_view key) const noexcept; + + /** + * Get the value associated with the given key. + * + * The key will be matched against **unescaped** JSON: + * + * dom::parser parser; + * int64_t(parser.parse(R"({ "a\n": 1 })"_padded)["a\n"]) == 1 + * parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get_uint64().error() == NO_SUCH_FIELD + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + * - INCORRECT_TYPE if this is not an object + */ + inline simdjson_result operator[](const char *key) const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * dom::parser parser; + * element doc = parser.parse(R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded); + * doc.at_pointer("/foo/a/1") == 20 + * doc.at_pointer("/foo")["a"].at(1) == 20 + * doc.at_pointer("")["foo"]["a"].at(1) == 20 + * + * It is allowed for a key to be the empty string: + * + * dom::parser parser; + * object obj = parser.parse(R"({ "": { "a": [ 10, 20, 30 ] }})"_padded); + * obj.at_pointer("//a/1") == 20 + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(const std::string_view json_pointer) const noexcept; + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API + /** + * + * Version 0.4 of simdjson used an incorrect interpretation of the JSON Pointer standard + * and allowed the following : + * + * dom::parser parser; + * element doc = parser.parse(R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded); + * doc.at("foo/a/1") == 20 + * + * Though it is intuitive, it is not compliant with RFC 6901 + * https://tools.ietf.org/html/rfc6901 + * + * For standard compliance, use the at_pointer function instead. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + [[deprecated("For standard compliance, use at_pointer instead, and prefix your pointers with a slash '/', see RFC6901 ")]] + inline simdjson_result at(const std::string_view json_pointer) const noexcept; +#endif // SIMDJSON_DISABLE_DEPRECATED_API + + /** + * Get the value at the given index. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + inline simdjson_result at(size_t index) const noexcept; + + /** + * Get the value associated with the given key. + * + * The key will be matched against **unescaped** JSON: + * + * dom::parser parser; + * int64_t(parser.parse(R"({ "a\n": 1 })"_padded)["a\n"]) == 1 + * parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get_uint64().error() == NO_SUCH_FIELD + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + */ + inline simdjson_result at_key(std::string_view key) const noexcept; + + /** + * Get the value associated with the given key in a case-insensitive manner. + * + * Note: The key will be matched against **unescaped** JSON. + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + */ + inline simdjson_result at_key_case_insensitive(std::string_view key) const noexcept; + + /** + * operator< defines a total order for element allowing to use them in + * ordered C++ STL containers + * + * @return TRUE if the key appears before the other one in the tape + */ + inline bool operator<(const element &other) const noexcept; + + /** + * operator== allows to verify if two element values reference the + * same JSON item + * + * @return TRUE if the two values references the same JSON element + */ + inline bool operator==(const element &other) const noexcept; + + /** @private for debugging. Prints out the root element. */ + inline bool dump_raw_tape(std::ostream &out) const noexcept; + +private: + simdjson_inline element(const internal::tape_ref &tape) noexcept; + internal::tape_ref tape; + friend class document; + friend class object; + friend class array; + friend struct simdjson_result; + template + friend class simdjson::internal::string_builder; + +}; + +} // namespace dom + +/** The result of a JSON navigation that may fail. */ +template<> +struct simdjson_result : public internal::simdjson_result_base { +public: + simdjson_inline simdjson_result() noexcept; ///< @private + simdjson_inline simdjson_result(dom::element &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + simdjson_inline simdjson_result type() const noexcept; + template + simdjson_inline bool is() const noexcept; + template + simdjson_inline simdjson_result get() const noexcept; + template + simdjson_warn_unused simdjson_inline error_code get(T &value) const noexcept; + + simdjson_inline simdjson_result get_array() const noexcept; + simdjson_inline simdjson_result get_object() const noexcept; + simdjson_inline simdjson_result get_c_str() const noexcept; + simdjson_inline simdjson_result get_string_length() const noexcept; + simdjson_inline simdjson_result get_string() const noexcept; + simdjson_inline simdjson_result get_int64() const noexcept; + simdjson_inline simdjson_result get_uint64() const noexcept; + simdjson_inline simdjson_result get_double() const noexcept; + simdjson_inline simdjson_result get_bool() const noexcept; + + simdjson_inline bool is_array() const noexcept; + simdjson_inline bool is_object() const noexcept; + simdjson_inline bool is_string() const noexcept; + simdjson_inline bool is_int64() const noexcept; + simdjson_inline bool is_uint64() const noexcept; + simdjson_inline bool is_double() const noexcept; + simdjson_inline bool is_number() const noexcept; + simdjson_inline bool is_bool() const noexcept; + simdjson_inline bool is_null() const noexcept; + + simdjson_inline simdjson_result operator[](std::string_view key) const noexcept; + simdjson_inline simdjson_result operator[](const char *key) const noexcept; + simdjson_inline simdjson_result at_pointer(const std::string_view json_pointer) const noexcept; + [[deprecated("For standard compliance, use at_pointer instead, and prefix your pointers with a slash '/', see RFC6901 ")]] + simdjson_inline simdjson_result at(const std::string_view json_pointer) const noexcept; + simdjson_inline simdjson_result at(size_t index) const noexcept; + simdjson_inline simdjson_result at_key(std::string_view key) const noexcept; + simdjson_inline simdjson_result at_key_case_insensitive(std::string_view key) const noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator bool() const noexcept(false); + simdjson_inline explicit operator const char*() const noexcept(false); + simdjson_inline operator std::string_view() const noexcept(false); + simdjson_inline operator uint64_t() const noexcept(false); + simdjson_inline operator int64_t() const noexcept(false); + simdjson_inline operator double() const noexcept(false); + simdjson_inline operator dom::array() const noexcept(false); + simdjson_inline operator dom::object() const noexcept(false); + + simdjson_inline dom::array::iterator begin() const noexcept(false); + simdjson_inline dom::array::iterator end() const noexcept(false); +#endif // SIMDJSON_EXCEPTIONS +}; + +} // namespace simdjson + +#endif // SIMDJSON_DOM_DOCUMENT_H +/* end file simdjson/dom/element.h */ +/* including simdjson/dom/object.h: #include "simdjson/dom/object.h" */ +/* begin file simdjson/dom/object.h */ +#ifndef SIMDJSON_DOM_OBJECT_H +#define SIMDJSON_DOM_OBJECT_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/element.h" */ +/* skipped duplicate #include "simdjson/internal/tape_ref.h" */ + +namespace simdjson { +namespace dom { + +/** + * JSON object. + */ +class object { +public: + /** Create a new, invalid object */ + simdjson_inline object() noexcept; + + class iterator { + public: + using value_type = key_value_pair; + using difference_type = std::ptrdiff_t; + + /** + * Get the actual key/value pair + */ + inline const value_type operator*() const noexcept; + /** + * Get the next key/value pair. + * + * Part of the std::iterator interface. + * + */ + inline iterator& operator++() noexcept; + /** + * Get the next key/value pair. + * + * Part of the std::iterator interface. + * + */ + inline iterator operator++(int) noexcept; + /** + * Check if these values come from the same place in the JSON. + * + * Part of the std::iterator interface. + */ + inline bool operator!=(const iterator& other) const noexcept; + inline bool operator==(const iterator& other) const noexcept; + + inline bool operator<(const iterator& other) const noexcept; + inline bool operator<=(const iterator& other) const noexcept; + inline bool operator>=(const iterator& other) const noexcept; + inline bool operator>(const iterator& other) const noexcept; + /** + * Get the key of this key/value pair. + */ + inline std::string_view key() const noexcept; + /** + * Get the length (in bytes) of the key in this key/value pair. + * You should expect this function to be faster than key().size(). + */ + inline uint32_t key_length() const noexcept; + /** + * Returns true if the key in this key/value pair is equal + * to the provided string_view. + */ + inline bool key_equals(std::string_view o) const noexcept; + /** + * Returns true if the key in this key/value pair is equal + * to the provided string_view in a case-insensitive manner. + * Case comparisons may only be handled correctly for ASCII strings. + */ + inline bool key_equals_case_insensitive(std::string_view o) const noexcept; + /** + * Get the key of this key/value pair. + */ + inline const char *key_c_str() const noexcept; + /** + * Get the value of this key/value pair. + */ + inline element value() const noexcept; + + iterator() noexcept = default; + iterator(const iterator&) noexcept = default; + iterator& operator=(const iterator&) noexcept = default; + private: + simdjson_inline iterator(const internal::tape_ref &tape) noexcept; + + internal::tape_ref tape; + + friend class object; + }; + + /** + * Return the first key/value pair. + * + * Part of the std::iterable interface. + */ + inline iterator begin() const noexcept; + /** + * One past the last key/value pair. + * + * Part of the std::iterable interface. + */ + inline iterator end() const noexcept; + /** + * Get the size of the object (number of keys). + * It is a saturated value with a maximum of 0xFFFFFF: if the value + * is 0xFFFFFF then the size is 0xFFFFFF or greater. + */ + inline size_t size() const noexcept; + /** + * Get the value associated with the given key. + * + * The key will be matched against **unescaped** JSON: + * + * dom::parser parser; + * int64_t(parser.parse(R"({ "a\n": 1 })"_padded)["a\n"]) == 1 + * parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get_uint64().error() == NO_SUCH_FIELD + * + * This function has linear-time complexity: the keys are checked one by one. + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + * - INCORRECT_TYPE if this is not an object + */ + inline simdjson_result operator[](std::string_view key) const noexcept; + + /** + * Get the value associated with the given key. + * + * The key will be matched against **unescaped** JSON: + * + * dom::parser parser; + * int64_t(parser.parse(R"({ "a\n": 1 })"_padded)["a\n"]) == 1 + * parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get_uint64().error() == NO_SUCH_FIELD + * + * This function has linear-time complexity: the keys are checked one by one. + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + * - INCORRECT_TYPE if this is not an object + */ + inline simdjson_result operator[](const char *key) const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * dom::parser parser; + * object obj = parser.parse(R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded); + * obj.at_pointer("/foo/a/1") == 20 + * obj.at_pointer("/foo")["a"].at(1) == 20 + * + * It is allowed for a key to be the empty string: + * + * dom::parser parser; + * object obj = parser.parse(R"({ "": { "a": [ 10, 20, 30 ] }})"_padded); + * obj.at_pointer("//a/1") == 20 + * obj.at_pointer("/")["a"].at(1) == 20 + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) const noexcept; + + /** + * Get the value associated with the given key. + * + * The key will be matched against **unescaped** JSON: + * + * dom::parser parser; + * int64_t(parser.parse(R"({ "a\n": 1 })"_padded)["a\n"]) == 1 + * parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get_uint64().error() == NO_SUCH_FIELD + * + * This function has linear-time complexity: the keys are checked one by one. + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + */ + inline simdjson_result at_key(std::string_view key) const noexcept; + + /** + * Get the value associated with the given key in a case-insensitive manner. + * It is only guaranteed to work over ASCII inputs. + * + * Note: The key will be matched against **unescaped** JSON. + * + * This function has linear-time complexity: the keys are checked one by one. + * + * @return The value associated with this field, or: + * - NO_SUCH_FIELD if the field does not exist in the object + */ + inline simdjson_result at_key_case_insensitive(std::string_view key) const noexcept; + +private: + simdjson_inline object(const internal::tape_ref &tape) noexcept; + + internal::tape_ref tape; + + friend class element; + friend struct simdjson_result; + template + friend class simdjson::internal::string_builder; +}; + +/** + * Key/value pair in an object. + */ +class key_value_pair { +public: + /** key in the key-value pair **/ + std::string_view key; + /** value in the key-value pair **/ + element value; + +private: + simdjson_inline key_value_pair(std::string_view _key, element _value) noexcept; + friend class object; +}; + +} // namespace dom + +/** The result of a JSON conversion that may fail. */ +template<> +struct simdjson_result : public internal::simdjson_result_base { +public: + simdjson_inline simdjson_result() noexcept; ///< @private + simdjson_inline simdjson_result(dom::object value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + inline simdjson_result operator[](std::string_view key) const noexcept; + inline simdjson_result operator[](const char *key) const noexcept; + inline simdjson_result at_pointer(std::string_view json_pointer) const noexcept; + inline simdjson_result at_key(std::string_view key) const noexcept; + inline simdjson_result at_key_case_insensitive(std::string_view key) const noexcept; + +#if SIMDJSON_EXCEPTIONS + inline dom::object::iterator begin() const noexcept(false); + inline dom::object::iterator end() const noexcept(false); + inline size_t size() const noexcept(false); +#endif // SIMDJSON_EXCEPTIONS +}; + +} // namespace simdjson + +#if defined(__cpp_lib_ranges) +#include + +namespace std { +namespace ranges { +template<> +inline constexpr bool enable_view = true; +#if SIMDJSON_EXCEPTIONS +template<> +inline constexpr bool enable_view> = true; +#endif // SIMDJSON_EXCEPTIONS +} // namespace ranges +} // namespace std +#endif // defined(__cpp_lib_ranges) + +#endif // SIMDJSON_DOM_OBJECT_H +/* end file simdjson/dom/object.h */ +/* skipped duplicate #include "simdjson/dom/parser.h" */ +/* including simdjson/dom/serialization.h: #include "simdjson/dom/serialization.h" */ +/* begin file simdjson/dom/serialization.h */ +#ifndef SIMDJSON_SERIALIZATION_H +#define SIMDJSON_SERIALIZATION_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/element.h" */ +/* skipped duplicate #include "simdjson/dom/object.h" */ + +#include + +namespace simdjson { + +/** + * The string_builder template and mini_formatter class + * are not part of our public API and are subject to change + * at any time! + */ +namespace internal { + +template +class base_formatter { +public: + /** Add a comma **/ + simdjson_inline void comma(); + /** Start an array, prints [ **/ + simdjson_inline void start_array(); + /** End an array, prints ] **/ + simdjson_inline void end_array(); + /** Start an array, prints { **/ + simdjson_inline void start_object(); + /** Start an array, prints } **/ + simdjson_inline void end_object(); + /** Prints a true **/ + simdjson_inline void true_atom(); + /** Prints a false **/ + simdjson_inline void false_atom(); + /** Prints a null **/ + simdjson_inline void null_atom(); + /** Prints a number **/ + simdjson_inline void number(int64_t x); + /** Prints a number **/ + simdjson_inline void number(uint64_t x); + /** Prints a number **/ + simdjson_inline void number(double x); + /** Prints a key (string + colon) **/ + simdjson_inline void key(std::string_view unescaped); + /** Prints a string. The string is escaped as needed. **/ + simdjson_inline void string(std::string_view unescaped); + /** Clears out the content. **/ + simdjson_inline void clear(); + /** + * Get access to the buffer, it is owned by the instance, but + * the user can make a copy. + **/ + simdjson_inline std::string_view str() const; + + /** Prints one character **/ + simdjson_inline void one_char(char c); + + simdjson_inline void call_print_newline() { + this->print_newline(); + } + + simdjson_inline void call_print_indents(size_t depth) { + this->print_indents(depth); + } + + simdjson_inline void call_print_space() { + this->print_space(); + } + +protected: + // implementation details (subject to change) + /** Backing buffer **/ + std::vector buffer{}; // not ideal! +}; + + +/** + * @private This is the class that we expect to use with the string_builder + * template. It tries to produce a compact version of the JSON element + * as quickly as possible. + */ +class mini_formatter : public base_formatter { +public: + simdjson_inline void print_newline(); + + simdjson_inline void print_indents(size_t depth); + + simdjson_inline void print_space(); +}; + +class pretty_formatter : public base_formatter { +public: + simdjson_inline void print_newline(); + + simdjson_inline void print_indents(size_t depth); + + simdjson_inline void print_space(); + +protected: + int indent_step = 4; +}; + +/** + * @private The string_builder template allows us to construct + * a string from a document element. It is parametrized + * by a "formatter" which handles the details. Thus + * the string_builder template could support both minification + * and prettification, and various other tradeoffs. + */ +template +class string_builder { +public: + /** Construct an initially empty builder, would print the empty string **/ + string_builder() = default; + /** Append an element to the builder (to be printed) **/ + inline void append(simdjson::dom::element value); + /** Append an array to the builder (to be printed) **/ + inline void append(simdjson::dom::array value); + /** Append an object to the builder (to be printed) **/ + inline void append(simdjson::dom::object value); + /** Reset the builder (so that it would print the empty string) **/ + simdjson_inline void clear(); + /** + * Get access to the string. The string_view is owned by the builder + * and it is invalid to use it after the string_builder has been + * destroyed. + * However you can make a copy of the string_view on memory that you + * own. + */ + simdjson_inline std::string_view str() const; + /** Append a key_value_pair to the builder (to be printed) **/ + simdjson_inline void append(simdjson::dom::key_value_pair value); +private: + formatter format{}; +}; + +} // internal + +namespace dom { + +/** + * Print JSON to an output stream. + * + * @param out The output stream. + * @param value The element. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::dom::element value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::dom::array value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. + * + * @param out The output stream. + * @param value The object. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::dom::object value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +} // namespace dom + +/** + * Converts JSON to a string. + * + * dom::parser parser; + * element doc = parser.parse(" [ 1 , 2 , 3 ] "_padded); + * cout << to_string(doc) << endl; // prints [1,2,3] + * + */ +template +std::string to_string(T x) { + // in C++, to_string is standard: http://www.cplusplus.com/reference/string/to_string/ + // Currently minify and to_string are identical but in the future, they may + // differ. + simdjson::internal::string_builder<> sb; + sb.append(x); + std::string_view answer = sb.str(); + return std::string(answer.data(), answer.size()); +} +#if SIMDJSON_EXCEPTIONS +template +std::string to_string(simdjson_result x) { + if (x.error()) { throw simdjson_error(x.error()); } + return to_string(x.value()); +} +#endif + +/** + * Minifies a JSON element or document, printing the smallest possible valid JSON. + * + * dom::parser parser; + * element doc = parser.parse(" [ 1 , 2 , 3 ] "_padded); + * cout << minify(doc) << endl; // prints [1,2,3] + * + */ +template +std::string minify(T x) { + return to_string(x); +} + +#if SIMDJSON_EXCEPTIONS +template +std::string minify(simdjson_result x) { + if (x.error()) { throw simdjson_error(x.error()); } + return to_string(x.value()); +} +#endif + +/** + * Prettifies a JSON element or document, printing the valid JSON with indentation. + * + * dom::parser parser; + * element doc = parser.parse(" [ 1 , 2 , 3 ] "_padded); + * + * // Prints: + * // { + * // [ + * // 1, + * // 2, + * // 3 + * // ] + * // } + * cout << prettify(doc) << endl; + * + */ +template +std::string prettify(T x) { + simdjson::internal::string_builder sb; + sb.append(x); + std::string_view answer = sb.str(); + return std::string(answer.data(), answer.size()); +} + +#if SIMDJSON_EXCEPTIONS +template +std::string prettify(simdjson_result x) { + if (x.error()) { throw simdjson_error(x.error()); } + return to_string(x.value()); +} +#endif + +} // namespace simdjson + + +#endif +/* end file simdjson/dom/serialization.h */ + +// Deprecated API +/* including simdjson/dom/jsonparser.h: #include "simdjson/dom/jsonparser.h" */ +/* begin file simdjson/dom/jsonparser.h */ +// TODO Remove this -- deprecated API and files + +#ifndef SIMDJSON_DOM_JSONPARSER_H +#define SIMDJSON_DOM_JSONPARSER_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/parser.h" */ +/* skipped duplicate #include "simdjson/dom/element.h" */ + +/* including simdjson/dom/parser-inl.h: #include "simdjson/dom/parser-inl.h" */ +/* begin file simdjson/dom/parser-inl.h */ +#ifndef SIMDJSON_PARSER_INL_H +#define SIMDJSON_PARSER_INL_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/document_stream.h" */ +/* skipped duplicate #include "simdjson/implementation.h" */ +/* skipped duplicate #include "simdjson/internal/dom_parser_implementation.h" */ + +/* skipped duplicate #include "simdjson/error-inl.h" */ +/* skipped duplicate #include "simdjson/padded_string-inl.h" */ +/* including simdjson/dom/document_stream-inl.h: #include "simdjson/dom/document_stream-inl.h" */ +/* begin file simdjson/dom/document_stream-inl.h */ +#ifndef SIMDJSON_DOCUMENT_STREAM_INL_H +#define SIMDJSON_DOCUMENT_STREAM_INL_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/document_stream.h" */ +/* including simdjson/dom/element-inl.h: #include "simdjson/dom/element-inl.h" */ +/* begin file simdjson/dom/element-inl.h */ +#ifndef SIMDJSON_ELEMENT_INL_H +#define SIMDJSON_ELEMENT_INL_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/element.h" */ +/* skipped duplicate #include "simdjson/dom/document.h" */ +/* skipped duplicate #include "simdjson/dom/object.h" */ +/* including simdjson/internal/tape_type.h: #include "simdjson/internal/tape_type.h" */ +/* begin file simdjson/internal/tape_type.h */ +#ifndef SIMDJSON_INTERNAL_TAPE_TYPE_H +#define SIMDJSON_INTERNAL_TAPE_TYPE_H + +namespace simdjson { +namespace internal { + +/** + * The possible types in the tape. + */ +enum class tape_type { + ROOT = 'r', + START_ARRAY = '[', + START_OBJECT = '{', + END_ARRAY = ']', + END_OBJECT = '}', + STRING = '"', + INT64 = 'l', + UINT64 = 'u', + DOUBLE = 'd', + TRUE_VALUE = 't', + FALSE_VALUE = 'f', + NULL_VALUE = 'n' +}; // enum class tape_type + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_TAPE_TYPE_H +/* end file simdjson/internal/tape_type.h */ + +/* including simdjson/dom/object-inl.h: #include "simdjson/dom/object-inl.h" */ +/* begin file simdjson/dom/object-inl.h */ +#ifndef SIMDJSON_OBJECT_INL_H +#define SIMDJSON_OBJECT_INL_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/object.h" */ +/* skipped duplicate #include "simdjson/dom/document.h" */ + +/* skipped duplicate #include "simdjson/dom/element-inl.h" */ +/* skipped duplicate #include "simdjson/error-inl.h" */ + +#include + +namespace simdjson { + +// +// simdjson_result inline implementation +// +simdjson_inline simdjson_result::simdjson_result() noexcept + : internal::simdjson_result_base() {} +simdjson_inline simdjson_result::simdjson_result(dom::object value) noexcept + : internal::simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : internal::simdjson_result_base(error) {} + +inline simdjson_result simdjson_result::operator[](std::string_view key) const noexcept { + if (error()) { return error(); } + return first[key]; +} +inline simdjson_result simdjson_result::operator[](const char *key) const noexcept { + if (error()) { return error(); } + return first[key]; +} +inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) const noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +inline simdjson_result simdjson_result::at_key(std::string_view key) const noexcept { + if (error()) { return error(); } + return first.at_key(key); +} +inline simdjson_result simdjson_result::at_key_case_insensitive(std::string_view key) const noexcept { + if (error()) { return error(); } + return first.at_key_case_insensitive(key); +} + +#if SIMDJSON_EXCEPTIONS + +inline dom::object::iterator simdjson_result::begin() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.begin(); +} +inline dom::object::iterator simdjson_result::end() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.end(); +} +inline size_t simdjson_result::size() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.size(); +} + +#endif // SIMDJSON_EXCEPTIONS + +namespace dom { + +// +// object inline implementation +// +simdjson_inline object::object() noexcept : tape{} {} +simdjson_inline object::object(const internal::tape_ref &_tape) noexcept : tape{_tape} { } +inline object::iterator object::begin() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return internal::tape_ref(tape.doc, tape.json_index + 1); +} +inline object::iterator object::end() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return internal::tape_ref(tape.doc, tape.after_element() - 1); +} +inline size_t object::size() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return tape.scope_count(); +} + +inline simdjson_result object::operator[](std::string_view key) const noexcept { + return at_key(key); +} +inline simdjson_result object::operator[](const char *key) const noexcept { + return at_key(key); +} +inline simdjson_result object::at_pointer(std::string_view json_pointer) const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + if(json_pointer.empty()) { // an empty string means that we return the current node + return element(this->tape); // copy the current node + } else if(json_pointer[0] != '/') { // otherwise there is an error + return INVALID_JSON_POINTER; + } + json_pointer = json_pointer.substr(1); + size_t slash = json_pointer.find('/'); + std::string_view key = json_pointer.substr(0, slash); + // Grab the child with the given key + simdjson_result child; + + // If there is an escape character in the key, unescape it and then get the child. + size_t escape = key.find('~'); + if (escape != std::string_view::npos) { + // Unescape the key + std::string unescaped(key); + do { + switch (unescaped[escape+1]) { + case '0': + unescaped.replace(escape, 2, "~"); + break; + case '1': + unescaped.replace(escape, 2, "/"); + break; + default: + return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer"); + } + escape = unescaped.find('~', escape+1); + } while (escape != std::string::npos); + child = at_key(unescaped); + } else { + child = at_key(key); + } + if(child.error()) { + return child; // we do not continue if there was an error + } + // If there is a /, we have to recurse and look up more of the path + if (slash != std::string_view::npos) { + child = child.at_pointer(json_pointer.substr(slash)); + } + return child; +} + +inline simdjson_result object::at_key(std::string_view key) const noexcept { + iterator end_field = end(); + for (iterator field = begin(); field != end_field; ++field) { + if (field.key_equals(key)) { + return field.value(); + } + } + return NO_SUCH_FIELD; +} +// In case you wonder why we need this, please see +// https://github.com/simdjson/simdjson/issues/323 +// People do seek keys in a case-insensitive manner. +inline simdjson_result object::at_key_case_insensitive(std::string_view key) const noexcept { + iterator end_field = end(); + for (iterator field = begin(); field != end_field; ++field) { + if (field.key_equals_case_insensitive(key)) { + return field.value(); + } + } + return NO_SUCH_FIELD; +} + +// +// object::iterator inline implementation +// +simdjson_inline object::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { } +inline const key_value_pair object::iterator::operator*() const noexcept { + return key_value_pair(key(), value()); +} +inline bool object::iterator::operator!=(const object::iterator& other) const noexcept { + return tape.json_index != other.tape.json_index; +} +inline bool object::iterator::operator==(const object::iterator& other) const noexcept { + return tape.json_index == other.tape.json_index; +} +inline bool object::iterator::operator<(const object::iterator& other) const noexcept { + return tape.json_index < other.tape.json_index; +} +inline bool object::iterator::operator<=(const object::iterator& other) const noexcept { + return tape.json_index <= other.tape.json_index; +} +inline bool object::iterator::operator>=(const object::iterator& other) const noexcept { + return tape.json_index >= other.tape.json_index; +} +inline bool object::iterator::operator>(const object::iterator& other) const noexcept { + return tape.json_index > other.tape.json_index; +} +inline object::iterator& object::iterator::operator++() noexcept { + tape.json_index++; + tape.json_index = tape.after_element(); + return *this; +} +inline object::iterator object::iterator::operator++(int) noexcept { + object::iterator out = *this; + ++*this; + return out; +} +inline std::string_view object::iterator::key() const noexcept { + return tape.get_string_view(); +} +inline uint32_t object::iterator::key_length() const noexcept { + return tape.get_string_length(); +} +inline const char* object::iterator::key_c_str() const noexcept { + return reinterpret_cast(&tape.doc->string_buf[size_t(tape.tape_value()) + sizeof(uint32_t)]); +} +inline element object::iterator::value() const noexcept { + return element(internal::tape_ref(tape.doc, tape.json_index + 1)); +} + +/** + * Design notes: + * Instead of constructing a string_view and then comparing it with a + * user-provided strings, it is probably more performant to have dedicated + * functions taking as a parameter the string we want to compare against + * and return true when they are equal. That avoids the creation of a temporary + * std::string_view. Though it is possible for the compiler to avoid entirely + * any overhead due to string_view, relying too much on compiler magic is + * problematic: compiler magic sometimes fail, and then what do you do? + * Also, enticing users to rely on high-performance function is probably better + * on the long run. + */ + +inline bool object::iterator::key_equals(std::string_view o) const noexcept { + // We use the fact that the key length can be computed quickly + // without access to the string buffer. + const uint32_t len = key_length(); + if(o.size() == len) { + // We avoid construction of a temporary string_view instance. + return (memcmp(o.data(), key_c_str(), len) == 0); + } + return false; +} + +inline bool object::iterator::key_equals_case_insensitive(std::string_view o) const noexcept { + // We use the fact that the key length can be computed quickly + // without access to the string buffer. + const uint32_t len = key_length(); + if(o.size() == len) { + // See For case-insensitive string comparisons, avoid char-by-char functions + // https://lemire.me/blog/2020/04/30/for-case-insensitive-string-comparisons-avoid-char-by-char-functions/ + // Note that it might be worth rolling our own strncasecmp function, with vectorization. + return (simdjson_strncasecmp(o.data(), key_c_str(), len) == 0); + } + return false; +} +// +// key_value_pair inline implementation +// +inline key_value_pair::key_value_pair(std::string_view _key, element _value) noexcept : + key(_key), value(_value) {} + +} // namespace dom + +} // namespace simdjson + +#if defined(__cpp_lib_ranges) +static_assert(std::ranges::view); +static_assert(std::ranges::sized_range); +#if SIMDJSON_EXCEPTIONS +static_assert(std::ranges::view>); +static_assert(std::ranges::sized_range>); +#endif // SIMDJSON_EXCEPTIONS +#endif // defined(__cpp_lib_ranges) + +#endif // SIMDJSON_OBJECT_INL_H +/* end file simdjson/dom/object-inl.h */ +/* skipped duplicate #include "simdjson/error-inl.h" */ + +#include +#include + +namespace simdjson { + +// +// simdjson_result inline implementation +// +simdjson_inline simdjson_result::simdjson_result() noexcept + : internal::simdjson_result_base() {} +simdjson_inline simdjson_result::simdjson_result(dom::element &&value) noexcept + : internal::simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : internal::simdjson_result_base(error) {} +inline simdjson_result simdjson_result::type() const noexcept { + if (error()) { return error(); } + return first.type(); +} + +template +simdjson_inline bool simdjson_result::is() const noexcept { + return !error() && first.is(); +} +template +simdjson_inline simdjson_result simdjson_result::get() const noexcept { + if (error()) { return error(); } + return first.get(); +} +template +simdjson_warn_unused simdjson_inline error_code simdjson_result::get(T &value) const noexcept { + if (error()) { return error(); } + return first.get(value); +} + +simdjson_inline simdjson_result simdjson_result::get_array() const noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() const noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_c_str() const noexcept { + if (error()) { return error(); } + return first.get_c_str(); +} +simdjson_inline simdjson_result simdjson_result::get_string_length() const noexcept { + if (error()) { return error(); } + return first.get_string_length(); +} +simdjson_inline simdjson_result simdjson_result::get_string() const noexcept { + if (error()) { return error(); } + return first.get_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() const noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() const noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_double() const noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() const noexcept { + if (error()) { return error(); } + return first.get_bool(); +} + +simdjson_inline bool simdjson_result::is_array() const noexcept { + return !error() && first.is_array(); +} +simdjson_inline bool simdjson_result::is_object() const noexcept { + return !error() && first.is_object(); +} +simdjson_inline bool simdjson_result::is_string() const noexcept { + return !error() && first.is_string(); +} +simdjson_inline bool simdjson_result::is_int64() const noexcept { + return !error() && first.is_int64(); +} +simdjson_inline bool simdjson_result::is_uint64() const noexcept { + return !error() && first.is_uint64(); +} +simdjson_inline bool simdjson_result::is_double() const noexcept { + return !error() && first.is_double(); +} +simdjson_inline bool simdjson_result::is_number() const noexcept { + return !error() && first.is_number(); +} +simdjson_inline bool simdjson_result::is_bool() const noexcept { + return !error() && first.is_bool(); +} + +simdjson_inline bool simdjson_result::is_null() const noexcept { + return !error() && first.is_null(); +} + +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) const noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) const noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::at_pointer(const std::string_view json_pointer) const noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +[[deprecated("For standard compliance, use at_pointer instead, and prefix your pointers with a slash '/', see RFC6901 ")]] +simdjson_inline simdjson_result simdjson_result::at(const std::string_view json_pointer) const noexcept { +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_DEPRECATED_WARNING + if (error()) { return error(); } + return first.at(json_pointer); +SIMDJSON_POP_DISABLE_WARNINGS +} +#endif // SIMDJSON_DISABLE_DEPRECATED_API +simdjson_inline simdjson_result simdjson_result::at(size_t index) const noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::at_key(std::string_view key) const noexcept { + if (error()) { return error(); } + return first.at_key(key); +} +simdjson_inline simdjson_result simdjson_result::at_key_case_insensitive(std::string_view key) const noexcept { + if (error()) { return error(); } + return first.at_key_case_insensitive(key); +} + +#if SIMDJSON_EXCEPTIONS + +simdjson_inline simdjson_result::operator bool() const noexcept(false) { + return get(); +} +simdjson_inline simdjson_result::operator const char *() const noexcept(false) { + return get(); +} +simdjson_inline simdjson_result::operator std::string_view() const noexcept(false) { + return get(); +} +simdjson_inline simdjson_result::operator uint64_t() const noexcept(false) { + return get(); +} +simdjson_inline simdjson_result::operator int64_t() const noexcept(false) { + return get(); +} +simdjson_inline simdjson_result::operator double() const noexcept(false) { + return get(); +} +simdjson_inline simdjson_result::operator dom::array() const noexcept(false) { + return get(); +} +simdjson_inline simdjson_result::operator dom::object() const noexcept(false) { + return get(); +} + +simdjson_inline dom::array::iterator simdjson_result::begin() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.begin(); +} +simdjson_inline dom::array::iterator simdjson_result::end() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.end(); +} + +#endif // SIMDJSON_EXCEPTIONS + +namespace dom { + +// +// element inline implementation +// +simdjson_inline element::element() noexcept : tape{} {} +simdjson_inline element::element(const internal::tape_ref &_tape) noexcept : tape{_tape} { } + +inline element_type element::type() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + auto tape_type = tape.tape_ref_type(); + return tape_type == internal::tape_type::FALSE_VALUE ? element_type::BOOL : static_cast(tape_type); +} + +inline simdjson_result element::get_bool() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + if(tape.is_true()) { + return true; + } else if(tape.is_false()) { + return false; + } + return INCORRECT_TYPE; +} +inline simdjson_result element::get_c_str() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + switch (tape.tape_ref_type()) { + case internal::tape_type::STRING: { + return tape.get_c_str(); + } + default: + return INCORRECT_TYPE; + } +} +inline simdjson_result element::get_string_length() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + switch (tape.tape_ref_type()) { + case internal::tape_type::STRING: { + return tape.get_string_length(); + } + default: + return INCORRECT_TYPE; + } +} +inline simdjson_result element::get_string() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + switch (tape.tape_ref_type()) { + case internal::tape_type::STRING: + return tape.get_string_view(); + default: + return INCORRECT_TYPE; + } +} +inline simdjson_result element::get_uint64() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + if(simdjson_unlikely(!tape.is_uint64())) { // branch rarely taken + if(tape.is_int64()) { + int64_t result = tape.next_tape_value(); + if (result < 0) { + return NUMBER_OUT_OF_RANGE; + } + return uint64_t(result); + } + return INCORRECT_TYPE; + } + return tape.next_tape_value(); +} +inline simdjson_result element::get_int64() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + if(simdjson_unlikely(!tape.is_int64())) { // branch rarely taken + if(tape.is_uint64()) { + uint64_t result = tape.next_tape_value(); + // Wrapping max in parens to handle Windows issue: https://stackoverflow.com/questions/11544073/how-do-i-deal-with-the-max-macro-in-windows-h-colliding-with-max-in-std + if (result > uint64_t((std::numeric_limits::max)())) { + return NUMBER_OUT_OF_RANGE; + } + return static_cast(result); + } + return INCORRECT_TYPE; + } + return tape.next_tape_value(); +} +inline simdjson_result element::get_double() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + // Performance considerations: + // 1. Querying tape_ref_type() implies doing a shift, it is fast to just do a straight + // comparison. + // 2. Using a switch-case relies on the compiler guessing what kind of code generation + // we want... But the compiler cannot know that we expect the type to be "double" + // most of the time. + // We can expect get to refer to a double type almost all the time. + // It is important to craft the code accordingly so that the compiler can use this + // information. (This could also be solved with profile-guided optimization.) + if(simdjson_unlikely(!tape.is_double())) { // branch rarely taken + if(tape.is_uint64()) { + return double(tape.next_tape_value()); + } else if(tape.is_int64()) { + return double(tape.next_tape_value()); + } + return INCORRECT_TYPE; + } + // this is common: + return tape.next_tape_value(); +} +inline simdjson_result element::get_array() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + switch (tape.tape_ref_type()) { + case internal::tape_type::START_ARRAY: + return array(tape); + default: + return INCORRECT_TYPE; + } +} +inline simdjson_result element::get_object() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + switch (tape.tape_ref_type()) { + case internal::tape_type::START_OBJECT: + return object(tape); + default: + return INCORRECT_TYPE; + } +} + +template +simdjson_warn_unused simdjson_inline error_code element::get(T &value) const noexcept { + return get().get(value); +} +// An element-specific version prevents recursion with simdjson_result::get(value) +template<> +simdjson_warn_unused simdjson_inline error_code element::get(element &value) const noexcept { + value = element(tape); + return SUCCESS; +} +template +inline void element::tie(T &value, error_code &error) && noexcept { + error = get(value); +} + +template +simdjson_inline bool element::is() const noexcept { + auto result = get(); + return !result.error(); +} + +template<> inline simdjson_result element::get() const noexcept { return get_array(); } +template<> inline simdjson_result element::get() const noexcept { return get_object(); } +template<> inline simdjson_result element::get() const noexcept { return get_c_str(); } +template<> inline simdjson_result element::get() const noexcept { return get_string(); } +template<> inline simdjson_result element::get() const noexcept { return get_int64(); } +template<> inline simdjson_result element::get() const noexcept { return get_uint64(); } +template<> inline simdjson_result element::get() const noexcept { return get_double(); } +template<> inline simdjson_result element::get() const noexcept { return get_bool(); } + +inline bool element::is_array() const noexcept { return is(); } +inline bool element::is_object() const noexcept { return is(); } +inline bool element::is_string() const noexcept { return is(); } +inline bool element::is_int64() const noexcept { return is(); } +inline bool element::is_uint64() const noexcept { return is(); } +inline bool element::is_double() const noexcept { return is(); } +inline bool element::is_bool() const noexcept { return is(); } +inline bool element::is_number() const noexcept { return is_int64() || is_uint64() || is_double(); } + +inline bool element::is_null() const noexcept { + return tape.is_null_on_tape(); +} + +#if SIMDJSON_EXCEPTIONS + +inline element::operator bool() const noexcept(false) { return get(); } +inline element::operator const char*() const noexcept(false) { return get(); } +inline element::operator std::string_view() const noexcept(false) { return get(); } +inline element::operator uint64_t() const noexcept(false) { return get(); } +inline element::operator int64_t() const noexcept(false) { return get(); } +inline element::operator double() const noexcept(false) { return get(); } +inline element::operator array() const noexcept(false) { return get(); } +inline element::operator object() const noexcept(false) { return get(); } + +inline array::iterator element::begin() const noexcept(false) { + return get().begin(); +} +inline array::iterator element::end() const noexcept(false) { + return get().end(); +} + +#endif // SIMDJSON_EXCEPTIONS + +inline simdjson_result element::operator[](std::string_view key) const noexcept { + return at_key(key); +} +inline simdjson_result element::operator[](const char *key) const noexcept { + return at_key(key); +} + +inline simdjson_result element::at_pointer(std::string_view json_pointer) const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + switch (tape.tape_ref_type()) { + case internal::tape_type::START_OBJECT: + return object(tape).at_pointer(json_pointer); + case internal::tape_type::START_ARRAY: + return array(tape).at_pointer(json_pointer); + default: { + if(!json_pointer.empty()) { // a non-empty string is invalid on an atom + return INVALID_JSON_POINTER; + } + // an empty string means that we return the current node + dom::element copy(*this); + return simdjson_result(std::move(copy)); + } + } +} +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +[[deprecated("For standard compliance, use at_pointer instead, and prefix your pointers with a slash '/', see RFC6901 ")]] +inline simdjson_result element::at(std::string_view json_pointer) const noexcept { + // version 0.4 of simdjson allowed non-compliant pointers + auto std_pointer = (json_pointer.empty() ? "" : "/") + std::string(json_pointer.begin(), json_pointer.end()); + return at_pointer(std_pointer); +} +#endif // SIMDJSON_DISABLE_DEPRECATED_API + +inline simdjson_result element::at(size_t index) const noexcept { + return get().at(index); +} +inline simdjson_result element::at_key(std::string_view key) const noexcept { + return get().at_key(key); +} +inline simdjson_result element::at_key_case_insensitive(std::string_view key) const noexcept { + return get().at_key_case_insensitive(key); +} +inline bool element::operator<(const element &other) const noexcept { + return tape.json_index < other.tape.json_index; +} +inline bool element::operator==(const element &other) const noexcept { + return tape.json_index == other.tape.json_index; +} + +inline bool element::dump_raw_tape(std::ostream &out) const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return tape.doc->dump_raw_tape(out); +} + + +inline std::ostream& operator<<(std::ostream& out, element_type type) { + switch (type) { + case element_type::ARRAY: + return out << "array"; + case element_type::OBJECT: + return out << "object"; + case element_type::INT64: + return out << "int64_t"; + case element_type::UINT64: + return out << "uint64_t"; + case element_type::DOUBLE: + return out << "double"; + case element_type::STRING: + return out << "string"; + case element_type::BOOL: + return out << "bool"; + case element_type::NULL_VALUE: + return out << "null"; + default: + return out << "unexpected content!!!"; // abort() usage is forbidden in the library + } +} + +} // namespace dom + +} // namespace simdjson + +#endif // SIMDJSON_ELEMENT_INL_H +/* end file simdjson/dom/element-inl.h */ +/* skipped duplicate #include "simdjson/dom/parser-inl.h" */ +/* skipped duplicate #include "simdjson/error-inl.h" */ +/* skipped duplicate #include "simdjson/internal/dom_parser_implementation.h" */ + +namespace simdjson { +namespace dom { + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void stage1_worker::finish() { + // After calling "run" someone would call finish() to wait + // for the end of the processing. + // This function will wait until either the thread has done + // the processing or, else, the destructor has been called. + std::unique_lock lock(locking_mutex); + cond_var.wait(lock, [this]{return has_work == false;}); +} + +inline stage1_worker::~stage1_worker() { + // The thread may never outlive the stage1_worker instance + // and will always be stopped/joined before the stage1_worker + // instance is gone. + stop_thread(); +} + +inline void stage1_worker::start_thread() { + std::unique_lock lock(locking_mutex); + if(thread.joinable()) { + return; // This should never happen but we never want to create more than one thread. + } + thread = std::thread([this]{ + while(true) { + std::unique_lock thread_lock(locking_mutex); + // We wait for either "run" or "stop_thread" to be called. + cond_var.wait(thread_lock, [this]{return has_work || !can_work;}); + // If, for some reason, the stop_thread() method was called (i.e., the + // destructor of stage1_worker is called, then we want to immediately destroy + // the thread (and not do any more processing). + if(!can_work) { + break; + } + this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser, + this->_next_batch_start); + this->has_work = false; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify "finish" + thread_lock.unlock(); + } + } + ); +} + + +inline void stage1_worker::stop_thread() { + std::unique_lock lock(locking_mutex); + // We have to make sure that all locks can be released. + can_work = false; + has_work = false; + cond_var.notify_all(); + lock.unlock(); + if(thread.joinable()) { + thread.join(); + } +} + +inline void stage1_worker::run(document_stream * ds, dom::parser * stage1, size_t next_batch_start) { + std::unique_lock lock(locking_mutex); + owner = ds; + _next_batch_start = next_batch_start; + stage1_thread_parser = stage1; + has_work = true; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify the thread lock that we have work + lock.unlock(); +} +#endif + +simdjson_inline document_stream::document_stream( + dom::parser &_parser, + const uint8_t *_buf, + size_t _len, + size_t _batch_size +) noexcept + : parser{&_parser}, + buf{_buf}, + len{_len}, + batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size}, + error{SUCCESS} +#ifdef SIMDJSON_THREADS_ENABLED + , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change +#endif +{ +#ifdef SIMDJSON_THREADS_ENABLED + if(worker.get() == nullptr) { + error = MEMALLOC; + } +#endif +} + +simdjson_inline document_stream::document_stream() noexcept + : parser{nullptr}, + buf{nullptr}, + len{0}, + batch_size{0}, + error{UNINITIALIZED} +#ifdef SIMDJSON_THREADS_ENABLED + , use_thread(false) +#endif +{ +} + +simdjson_inline document_stream::~document_stream() noexcept { +#ifdef SIMDJSON_THREADS_ENABLED + worker.reset(); +#endif +} + +simdjson_inline document_stream::iterator::iterator() noexcept + : stream{nullptr}, finished{true} { +} + +simdjson_inline document_stream::iterator document_stream::begin() noexcept { + start(); + // If there are no documents, we're finished. + return iterator(this, error == EMPTY); +} + +simdjson_inline document_stream::iterator document_stream::end() noexcept { + return iterator(this, true); +} + +simdjson_inline document_stream::iterator::iterator(document_stream* _stream, bool is_end) noexcept + : stream{_stream}, finished{is_end} { +} + +simdjson_inline document_stream::iterator::reference document_stream::iterator::operator*() noexcept { + // Note that in case of error, we do not yet mark + // the iterator as "finished": this detection is done + // in the operator++ function since it is possible + // to call operator++ repeatedly while omitting + // calls to operator*. + if (stream->error) { return stream->error; } + return stream->parser->doc.root(); +} + +simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept { + // If there is an error, then we want the iterator + // to be finished, no matter what. (E.g., we do not + // keep generating documents with errors, or go beyond + // a document with errors.) + // + // Users do not have to call "operator*()" when they use operator++, + // so we need to end the stream in the operator++ function. + // + // Note that setting finished = true is essential otherwise + // we would enter an infinite loop. + if (stream->error) { finished = true; } + // Note that stream->error() is guarded against error conditions + // (it will immediately return if stream->error casts to false). + // In effect, this next function does nothing when (stream->error) + // is true (hence the risk of an infinite loop). + stream->next(); + // If that was the last document, we're finished. + // It is the only type of error we do not want to appear + // in operator*. + if (stream->error == EMPTY) { finished = true; } + // If we had any other kind of error (not EMPTY) then we want + // to pass it along to the operator* and we cannot mark the result + // as "finished" just yet. + return *this; +} + +simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept { + return finished != other.finished; +} + +inline void document_stream::start() noexcept { + if (error) { return; } + error = parser->ensure_capacity(batch_size); + if (error) { return; } + // Always run the first stage 1 parse immediately + batch_start = 0; + error = run_stage1(*parser, batch_start); + while(error == EMPTY) { + // In exceptional cases, we may start with an empty block + batch_start = next_batch_start(); + if (batch_start >= len) { return; } + error = run_stage1(*parser, batch_start); + } + if (error) { return; } +#ifdef SIMDJSON_THREADS_ENABLED + if (use_thread && next_batch_start() < len) { + // Kick off the first thread if needed + error = stage1_thread_parser.ensure_capacity(batch_size); + if (error) { return; } + worker->start_thread(); + start_stage1_thread(); + if (error) { return; } + } +#endif // SIMDJSON_THREADS_ENABLED + next(); +} + +simdjson_inline size_t document_stream::iterator::current_index() const noexcept { + return stream->doc_index; +} + +simdjson_inline std::string_view document_stream::iterator::source() const noexcept { + const char* start = reinterpret_cast(stream->buf) + current_index(); + bool object_or_array = ((*start == '[') || (*start == '{')); + if(object_or_array) { + size_t next_doc_index = stream->batch_start + stream->parser->implementation->structural_indexes[stream->parser->implementation->next_structural_index - 1]; + return std::string_view(start, next_doc_index - current_index() + 1); + } else { + size_t next_doc_index = stream->batch_start + stream->parser->implementation->structural_indexes[stream->parser->implementation->next_structural_index]; + return std::string_view(reinterpret_cast(stream->buf) + current_index(), next_doc_index - current_index() - 1); + } +} + + +inline void document_stream::next() noexcept { + // We always exit at once, once in an error condition. + if (error) { return; } + + // Load the next document from the batch + doc_index = batch_start + parser->implementation->structural_indexes[parser->implementation->next_structural_index]; + error = parser->implementation->stage2_next(parser->doc); + // If that was the last document in the batch, load another batch (if available) + while (error == EMPTY) { + batch_start = next_batch_start(); + if (batch_start >= len) { break; } + +#ifdef SIMDJSON_THREADS_ENABLED + if(use_thread) { + load_from_stage1_thread(); + } else { + error = run_stage1(*parser, batch_start); + } +#else + error = run_stage1(*parser, batch_start); +#endif + if (error) { continue; } // If the error was EMPTY, we may want to load another batch. + // Run stage 2 on the first document in the batch + doc_index = batch_start + parser->implementation->structural_indexes[parser->implementation->next_structural_index]; + error = parser->implementation->stage2_next(parser->doc); + } +} +inline size_t document_stream::size_in_bytes() const noexcept { + return len; +} + +inline size_t document_stream::truncated_bytes() const noexcept { + if(error == CAPACITY) { return len - batch_start; } + return parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] - parser->implementation->structural_indexes[parser->implementation->n_structural_indexes + 1]; +} + +inline size_t document_stream::next_batch_start() const noexcept { + return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes]; +} + +inline error_code document_stream::run_stage1(dom::parser &p, size_t _batch_start) noexcept { + size_t remaining = len - _batch_start; + if (remaining <= batch_size) { + return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final); + } else { + return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial); + } +} + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void document_stream::load_from_stage1_thread() noexcept { + worker->finish(); + // Swap to the parser that was loaded up in the thread. Make sure the parser has + // enough memory to swap to, as well. + std::swap(*parser, stage1_thread_parser); + error = stage1_thread_error; + if (error) { return; } + + // If there's anything left, start the stage 1 thread! + if (next_batch_start() < len) { + start_stage1_thread(); + } +} + +inline void document_stream::start_stage1_thread() noexcept { + // we call the thread on a lambda that will update + // this->stage1_thread_error + // there is only one thread that may write to this value + // TODO this is NOT exception-safe. + this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error + size_t _next_batch_start = this->next_batch_start(); + + worker->run(this, & this->stage1_thread_parser, _next_batch_start); +} + +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace dom + +simdjson_inline simdjson_result::simdjson_result() noexcept + : simdjson_result_base() { +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : simdjson_result_base(error) { +} +simdjson_inline simdjson_result::simdjson_result(dom::document_stream &&value) noexcept + : simdjson_result_base(std::forward(value)) { +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline dom::document_stream::iterator simdjson_result::begin() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.begin(); +} +simdjson_inline dom::document_stream::iterator simdjson_result::end() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.end(); +} +#else // SIMDJSON_EXCEPTIONS +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +simdjson_inline dom::document_stream::iterator simdjson_result::begin() noexcept { + first.error = error(); + return first.begin(); +} +simdjson_inline dom::document_stream::iterator simdjson_result::end() noexcept { + first.error = error(); + return first.end(); +} +#endif // SIMDJSON_DISABLE_DEPRECATED_API +#endif // SIMDJSON_EXCEPTIONS + +} // namespace simdjson +#endif // SIMDJSON_DOCUMENT_STREAM_INL_H +/* end file simdjson/dom/document_stream-inl.h */ +/* skipped duplicate #include "simdjson/dom/element-inl.h" */ + +#include +#include /* memcmp */ + +namespace simdjson { +namespace dom { + +// +// parser inline implementation +// +simdjson_inline parser::parser(size_t max_capacity) noexcept + : _max_capacity{max_capacity}, + loaded_bytes(nullptr) { +} +simdjson_inline parser::parser(parser &&other) noexcept = default; +simdjson_inline parser &parser::operator=(parser &&other) noexcept = default; + +inline bool parser::is_valid() const noexcept { return valid; } +inline int parser::get_error_code() const noexcept { return error; } +inline std::string parser::get_error_message() const noexcept { return error_message(error); } + +inline bool parser::dump_raw_tape(std::ostream &os) const noexcept { + return valid ? doc.dump_raw_tape(os) : false; +} + +inline simdjson_result parser::read_file(const std::string &path) noexcept { + // Open the file + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + std::FILE *fp = std::fopen(path.c_str(), "rb"); + SIMDJSON_POP_DISABLE_WARNINGS + + if (fp == nullptr) { + return IO_ERROR; + } + + // Get the file size + int ret; +#if SIMDJSON_VISUAL_STUDIO && !SIMDJSON_IS_32BITS + ret = _fseeki64(fp, 0, SEEK_END); +#else + ret = std::fseek(fp, 0, SEEK_END); +#endif // _WIN64 + if(ret < 0) { + std::fclose(fp); + return IO_ERROR; + } +#if SIMDJSON_VISUAL_STUDIO && !SIMDJSON_IS_32BITS + __int64 len = _ftelli64(fp); + if(len == -1L) { + std::fclose(fp); + return IO_ERROR; + } +#else + long len = std::ftell(fp); + if((len < 0) || (len == LONG_MAX)) { + std::fclose(fp); + return IO_ERROR; + } +#endif + + // Make sure we have enough capacity to load the file + if (_loaded_bytes_capacity < size_t(len)) { + loaded_bytes.reset( internal::allocate_padded_buffer(len) ); + if (!loaded_bytes) { + std::fclose(fp); + return MEMALLOC; + } + _loaded_bytes_capacity = len; + } + + // Read the string + std::rewind(fp); + size_t bytes_read = std::fread(loaded_bytes.get(), 1, len, fp); + if (std::fclose(fp) != 0 || bytes_read != size_t(len)) { + return IO_ERROR; + } + + return bytes_read; +} + +inline simdjson_result parser::load(const std::string &path) & noexcept { + size_t len; + auto _error = read_file(path).get(len); + if (_error) { return _error; } + return parse(loaded_bytes.get(), len, false); +} + +inline simdjson_result parser::load_many(const std::string &path, size_t batch_size) noexcept { + size_t len; + auto _error = read_file(path).get(len); + if (_error) { return _error; } + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + return document_stream(*this, reinterpret_cast(loaded_bytes.get()), len, batch_size); +} + +inline simdjson_result parser::parse_into_document(document& provided_doc, const uint8_t *buf, size_t len, bool realloc_if_needed) & noexcept { + // Important: we need to ensure that document has enough capacity. + // Important: It is possible that provided_doc is actually the internal 'doc' within the parser!!! + error_code _error = ensure_capacity(provided_doc, len); + if (_error) { return _error; } + if (realloc_if_needed) { + // Make sure we have enough capacity to copy len bytes + if (!loaded_bytes || _loaded_bytes_capacity < len) { + loaded_bytes.reset( internal::allocate_padded_buffer(len) ); + if (!loaded_bytes) { + return MEMALLOC; + } + _loaded_bytes_capacity = len; + } + std::memcpy(static_cast(loaded_bytes.get()), buf, len); + buf = reinterpret_cast(loaded_bytes.get()); + } + + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + _error = implementation->parse(buf, len, provided_doc); + + if (_error) { return _error; } + + return provided_doc.root(); +} + +simdjson_inline simdjson_result parser::parse_into_document(document& provided_doc, const char *buf, size_t len, bool realloc_if_needed) & noexcept { + return parse_into_document(provided_doc, reinterpret_cast(buf), len, realloc_if_needed); +} +simdjson_inline simdjson_result parser::parse_into_document(document& provided_doc, const std::string &s) & noexcept { + return parse_into_document(provided_doc, s.data(), s.length(), s.capacity() - s.length() < SIMDJSON_PADDING); +} +simdjson_inline simdjson_result parser::parse_into_document(document& provided_doc, const padded_string &s) & noexcept { + return parse_into_document(provided_doc, s.data(), s.length(), false); +} + + +inline simdjson_result parser::parse(const uint8_t *buf, size_t len, bool realloc_if_needed) & noexcept { + return parse_into_document(doc, buf, len, realloc_if_needed); +} + +simdjson_inline simdjson_result parser::parse(const char *buf, size_t len, bool realloc_if_needed) & noexcept { + return parse(reinterpret_cast(buf), len, realloc_if_needed); +} +simdjson_inline simdjson_result parser::parse(const std::string &s) & noexcept { + return parse(s.data(), s.length(), s.capacity() - s.length() < SIMDJSON_PADDING); +} +simdjson_inline simdjson_result parser::parse(const padded_string &s) & noexcept { + return parse(s.data(), s.length(), false); +} +simdjson_inline simdjson_result parser::parse(const padded_string_view &v) & noexcept { + return parse(v.data(), v.length(), false); +} + +inline simdjson_result parser::parse_many(const uint8_t *buf, size_t len, size_t batch_size) noexcept { + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + return document_stream(*this, buf, len, batch_size); +} +inline simdjson_result parser::parse_many(const char *buf, size_t len, size_t batch_size) noexcept { + return parse_many(reinterpret_cast(buf), len, batch_size); +} +inline simdjson_result parser::parse_many(const std::string &s, size_t batch_size) noexcept { + return parse_many(s.data(), s.length(), batch_size); +} +inline simdjson_result parser::parse_many(const padded_string &s, size_t batch_size) noexcept { + return parse_many(s.data(), s.length(), batch_size); +} + +simdjson_inline size_t parser::capacity() const noexcept { + return implementation ? implementation->capacity() : 0; +} +simdjson_inline size_t parser::max_capacity() const noexcept { + return _max_capacity; +} +simdjson_inline size_t parser::max_depth() const noexcept { + return implementation ? implementation->max_depth() : DEFAULT_MAX_DEPTH; +} + +simdjson_warn_unused +inline error_code parser::allocate(size_t capacity, size_t max_depth) noexcept { + // + // Reallocate implementation if needed + // + error_code err; + if (implementation) { + err = implementation->allocate(capacity, max_depth); + } else { + err = simdjson::get_active_implementation()->create_dom_parser_implementation(capacity, max_depth, implementation); + } + if (err) { return err; } + return SUCCESS; +} + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +simdjson_warn_unused +inline bool parser::allocate_capacity(size_t capacity, size_t max_depth) noexcept { + return !allocate(capacity, max_depth); +} +#endif // SIMDJSON_DISABLE_DEPRECATED_API + +inline error_code parser::ensure_capacity(size_t desired_capacity) noexcept { + return ensure_capacity(doc, desired_capacity); +} + + +inline error_code parser::ensure_capacity(document& target_document, size_t desired_capacity) noexcept { + // 1. It is wasteful to allocate a document and a parser for documents spanning less than MINIMAL_DOCUMENT_CAPACITY bytes. + // 2. If we allow desired_capacity = 0 then it is possible to exit this function with implementation == nullptr. + if(desired_capacity < MINIMAL_DOCUMENT_CAPACITY) { desired_capacity = MINIMAL_DOCUMENT_CAPACITY; } + // If we don't have enough capacity, (try to) automatically bump it. + // If the document needs allocation, do it too. + // Both in one if statement to minimize unlikely branching. + // + // Note: we must make sure that this function is called if capacity() == 0. We do so because we + // ensure that desired_capacity > 0. + if (simdjson_unlikely(capacity() < desired_capacity || target_document.capacity() < desired_capacity)) { + if (desired_capacity > max_capacity()) { + return error = CAPACITY; + } + error_code err1 = target_document.capacity() < desired_capacity ? target_document.allocate(desired_capacity) : SUCCESS; + error_code err2 = capacity() < desired_capacity ? allocate(desired_capacity, max_depth()) : SUCCESS; + if(err1 != SUCCESS) { return error = err1; } + if(err2 != SUCCESS) { return error = err2; } + } + return SUCCESS; +} + +simdjson_inline void parser::set_max_capacity(size_t max_capacity) noexcept { + if(max_capacity > MINIMAL_DOCUMENT_CAPACITY) { + _max_capacity = max_capacity; + } else { + _max_capacity = MINIMAL_DOCUMENT_CAPACITY; + } +} + +} // namespace dom +} // namespace simdjson + +#endif // SIMDJSON_PARSER_INL_H +/* end file simdjson/dom/parser-inl.h */ + +namespace simdjson { + +// +// C API (json_parse and build_parsed_json) declarations +// + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API +[[deprecated("Use parser.parse() instead")]] +inline int json_parse(const uint8_t *buf, size_t len, dom::parser &parser, bool realloc_if_needed = true) noexcept { + error_code code = parser.parse(buf, len, realloc_if_needed).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return code; +} +[[deprecated("Use parser.parse() instead")]] +inline int json_parse(const char *buf, size_t len, dom::parser &parser, bool realloc_if_needed = true) noexcept { + error_code code = parser.parse(buf, len, realloc_if_needed).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return code; +} +[[deprecated("Use parser.parse() instead")]] +inline int json_parse(const std::string &s, dom::parser &parser, bool realloc_if_needed = true) noexcept { + error_code code = parser.parse(s.data(), s.length(), realloc_if_needed).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return code; +} +[[deprecated("Use parser.parse() instead")]] +inline int json_parse(const padded_string &s, dom::parser &parser) noexcept { + error_code code = parser.parse(s).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return code; +} + +[[deprecated("Use parser.parse() instead")]] +simdjson_warn_unused inline dom::parser build_parsed_json(const uint8_t *buf, size_t len, bool realloc_if_needed = true) noexcept { + dom::parser parser; + error_code code = parser.parse(buf, len, realloc_if_needed).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return parser; +} +[[deprecated("Use parser.parse() instead")]] +simdjson_warn_unused inline dom::parser build_parsed_json(const char *buf, size_t len, bool realloc_if_needed = true) noexcept { + dom::parser parser; + error_code code = parser.parse(buf, len, realloc_if_needed).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return parser; +} +[[deprecated("Use parser.parse() instead")]] +simdjson_warn_unused inline dom::parser build_parsed_json(const std::string &s, bool realloc_if_needed = true) noexcept { + dom::parser parser; + error_code code = parser.parse(s.data(), s.length(), realloc_if_needed).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return parser; +} +[[deprecated("Use parser.parse() instead")]] +simdjson_warn_unused inline dom::parser build_parsed_json(const padded_string &s) noexcept { + dom::parser parser; + error_code code = parser.parse(s).error(); + // The deprecated json_parse API is a signal that the user plans to *use* the error code / valid + // bits in the parser instead of heeding the result code. The normal parser unsets those in + // anticipation of making the error code ephemeral. + // Here we put the code back into the parser, until we've removed this method. + parser.valid = code == SUCCESS; + parser.error = code; + return parser; +} +#endif // SIMDJSON_DISABLE_DEPRECATED_API + +/** @private We do not want to allow implicit conversion from C string to std::string. */ +int json_parse(const char *buf, dom::parser &parser) noexcept = delete; +/** @private We do not want to allow implicit conversion from C string to std::string. */ +dom::parser build_parsed_json(const char *buf) noexcept = delete; + +} // namespace simdjson + +#endif // SIMDJSON_DOM_JSONPARSER_H +/* end file simdjson/dom/jsonparser.h */ +/* including simdjson/dom/parsedjson.h: #include "simdjson/dom/parsedjson.h" */ +/* begin file simdjson/dom/parsedjson.h */ +// TODO Remove this -- deprecated API and files + +#ifndef SIMDJSON_DOM_PARSEDJSON_H +#define SIMDJSON_DOM_PARSEDJSON_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ + +namespace simdjson { + +/** + * @deprecated Use `dom::parser` instead. + */ +using ParsedJson [[deprecated("Use dom::parser instead")]] = dom::parser; + +} // namespace simdjson + +#endif // SIMDJSON_DOM_PARSEDJSON_H +/* end file simdjson/dom/parsedjson.h */ +/* including simdjson/dom/parsedjson_iterator.h: #include "simdjson/dom/parsedjson_iterator.h" */ +/* begin file simdjson/dom/parsedjson_iterator.h */ +// TODO Remove this -- deprecated API and files + +#ifndef SIMDJSON_DOM_PARSEDJSON_ITERATOR_H +#define SIMDJSON_DOM_PARSEDJSON_ITERATOR_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/parser.h" */ + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API + +namespace simdjson { +/** @private **/ +class [[deprecated("Use the new DOM navigation API instead (see doc/basics.md)")]] dom::parser::Iterator { +public: + inline Iterator(const dom::parser &parser) noexcept(false); + inline Iterator(const Iterator &o) noexcept; + inline ~Iterator() noexcept; + + inline Iterator& operator=(const Iterator&) = delete; + + inline bool is_ok() const; + + // useful for debugging purposes + inline size_t get_tape_location() const; + + // useful for debugging purposes + inline size_t get_tape_length() const; + + // returns the current depth (start at 1 with 0 reserved for the fictitious + // root node) + inline size_t get_depth() const; + + // A scope is a series of nodes at the same depth, typically it is either an + // object ({) or an array ([). The root node has type 'r'. + inline uint8_t get_scope_type() const; + + // move forward in document order + inline bool move_forward(); + + // retrieve the character code of what we're looking at: + // [{"slutfn are the possibilities + inline uint8_t get_type() const { + return current_type; // short functions should be inlined! + } + + // get the int64_t value at this node; valid only if get_type is "l" + inline int64_t get_integer() const; + + // get the value as uint64; valid only if if get_type is "u" + inline uint64_t get_unsigned_integer() const; + + // get the string value at this node (NULL ended); valid only if get_type is " + // note that tabs, and line endings are escaped in the returned value (see + // print_with_escapes) return value is valid UTF-8, it may contain NULL chars + // within the string: get_string_length determines the true string length. + inline const char *get_string() const; + + // return the length of the string in bytes + inline uint32_t get_string_length() const; + + // get the double value at this node; valid only if + // get_type() is "d" + inline double get_double() const; + + inline bool is_object_or_array() const { return is_object() || is_array(); } + + inline bool is_object() const { return get_type() == '{'; } + + inline bool is_array() const { return get_type() == '['; } + + inline bool is_string() const { return get_type() == '"'; } + + // Returns true if the current type of the node is an signed integer. + // You can get its value with `get_integer()`. + inline bool is_integer() const { return get_type() == 'l'; } + + // Returns true if the current type of the node is an unsigned integer. + // You can get its value with `get_unsigned_integer()`. + // + // NOTE: + // Only a large value, which is out of range of a 64-bit signed integer, is + // represented internally as an unsigned node. On the other hand, a typical + // positive integer, such as 1, 42, or 1000000, is as a signed node. + // Be aware this function returns false for a signed node. + inline bool is_unsigned_integer() const { return get_type() == 'u'; } + // Returns true if the current type of the node is a double floating-point number. + inline bool is_double() const { return get_type() == 'd'; } + // Returns true if the current type of the node is a number (integer or floating-point). + inline bool is_number() const { + return is_integer() || is_unsigned_integer() || is_double(); + } + // Returns true if the current type of the node is a bool with true value. + inline bool is_true() const { return get_type() == 't'; } + // Returns true if the current type of the node is a bool with false value. + inline bool is_false() const { return get_type() == 'f'; } + // Returns true if the current type of the node is null. + inline bool is_null() const { return get_type() == 'n'; } + // Returns true if the type byte represents an object of an array + static bool is_object_or_array(uint8_t type) { + return ((type == '[') || (type == '{')); + } + + // when at {, go one level deep, looking for a given key + // if successful, we are left pointing at the value, + // if not, we are still pointing at the object ({) + // (in case of repeated keys, this only finds the first one). + // We seek the key using C's strcmp so if your JSON strings contain + // NULL chars, this would trigger a false positive: if you expect that + // to be the case, take extra precautions. + // Furthermore, we do the comparison character-by-character + // without taking into account Unicode equivalence. + inline bool move_to_key(const char *key); + + // as above, but case insensitive lookup (strcmpi instead of strcmp) + inline bool move_to_key_insensitive(const char *key); + + // when at {, go one level deep, looking for a given key + // if successful, we are left pointing at the value, + // if not, we are still pointing at the object ({) + // (in case of repeated keys, this only finds the first one). + // The string we search for can contain NULL values. + // Furthermore, we do the comparison character-by-character + // without taking into account Unicode equivalence. + inline bool move_to_key(const char *key, uint32_t length); + + // when at a key location within an object, this moves to the accompanying + // value (located next to it). This is equivalent but much faster than + // calling "next()". + inline void move_to_value(); + + // when at [, go one level deep, and advance to the given index. + // if successful, we are left pointing at the value, + // if not, we are still pointing at the array ([) + inline bool move_to_index(uint32_t index); + + // Moves the iterator to the value corresponding to the json pointer. + // Always search from the root of the document. + // if successful, we are left pointing at the value, + // if not, we are still pointing the same value we were pointing before the + // call. The json pointer follows the rfc6901 standard's syntax: + // https://tools.ietf.org/html/rfc6901 However, the standard says "If a + // referenced member name is not unique in an object, the member that is + // referenced is undefined, and evaluation fails". Here we just return the + // first corresponding value. The length parameter is the length of the + // jsonpointer string ('pointer'). + inline bool move_to(const char *pointer, uint32_t length); + + // Moves the iterator to the value corresponding to the json pointer. + // Always search from the root of the document. + // if successful, we are left pointing at the value, + // if not, we are still pointing the same value we were pointing before the + // call. The json pointer implementation follows the rfc6901 standard's + // syntax: https://tools.ietf.org/html/rfc6901 However, the standard says + // "If a referenced member name is not unique in an object, the member that + // is referenced is undefined, and evaluation fails". Here we just return + // the first corresponding value. + inline bool move_to(const std::string &pointer); + + private: + // Almost the same as move_to(), except it searches from the current + // position. The pointer's syntax is identical, though that case is not + // handled by the rfc6901 standard. The '/' is still required at the + // beginning. However, contrary to move_to(), the URI Fragment Identifier + // Representation is not supported here. Also, in case of failure, we are + // left pointing at the closest value it could reach. For these reasons it + // is private. It exists because it is used by move_to(). + inline bool relative_move_to(const char *pointer, uint32_t length); + + public: + // throughout return true if we can do the navigation, false + // otherwise + + // Within a given scope (series of nodes at the same depth within either an + // array or an object), we move forward. + // Thus, given [true, null, {"a":1}, [1,2]], we would visit true, null, { + // and [. At the object ({) or at the array ([), you can issue a "down" to + // visit their content. valid if we're not at the end of a scope (returns + // true). + inline bool next(); + + // Within a given scope (series of nodes at the same depth within either an + // array or an object), we move backward. + // Thus, given [true, null, {"a":1}, [1,2]], we would visit ], }, null, true + // when starting at the end of the scope. At the object ({) or at the array + // ([), you can issue a "down" to visit their content. + // Performance warning: This function is implemented by starting again + // from the beginning of the scope and scanning forward. You should expect + // it to be relatively slow. + inline bool prev(); + + // Moves back to either the containing array or object (type { or [) from + // within a contained scope. + // Valid unless we are at the first level of the document + inline bool up(); + + // Valid if we're at a [ or { and it starts a non-empty scope; moves us to + // start of that deeper scope if it not empty. Thus, given [true, null, + // {"a":1}, [1,2]], if we are at the { node, we would move to the "a" node. + inline bool down(); + + // move us to the start of our current scope, + // a scope is a series of nodes at the same level + inline void to_start_scope(); + + inline void rewind(); + + + + // print the node we are currently pointing at + inline bool print(std::ostream &os, bool escape_strings = true) const; + + private: + const document &doc; + size_t max_depth{}; + size_t depth{}; + size_t location{}; // our current location on a tape + size_t tape_length{}; + uint8_t current_type{}; + uint64_t current_val{}; + typedef struct { + size_t start_of_scope; + uint8_t scope_type; + } scopeindex_t; + + scopeindex_t *depth_index{}; +}; + +} // namespace simdjson +#endif // SIMDJSON_DISABLE_DEPRECATED_API + +#endif // SIMDJSON_DOM_PARSEDJSON_ITERATOR_H +/* end file simdjson/dom/parsedjson_iterator.h */ + +// Inline functions +/* including simdjson/dom/array-inl.h: #include "simdjson/dom/array-inl.h" */ +/* begin file simdjson/dom/array-inl.h */ +#ifndef SIMDJSON_ARRAY_INL_H +#define SIMDJSON_ARRAY_INL_H + +#include + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/array.h" */ +/* skipped duplicate #include "simdjson/dom/element.h" */ +/* skipped duplicate #include "simdjson/error-inl.h" */ +/* including simdjson/internal/tape_ref-inl.h: #include "simdjson/internal/tape_ref-inl.h" */ +/* begin file simdjson/internal/tape_ref-inl.h */ +#ifndef SIMDJSON_TAPE_REF_INL_H +#define SIMDJSON_TAPE_REF_INL_H + +/* skipped duplicate #include "simdjson/dom/document.h" */ +/* skipped duplicate #include "simdjson/internal/tape_ref.h" */ +/* skipped duplicate #include "simdjson/internal/tape_type.h" */ + +#include + +namespace simdjson { +namespace internal { + +constexpr const uint64_t JSON_VALUE_MASK = 0x00FFFFFFFFFFFFFF; +constexpr const uint32_t JSON_COUNT_MASK = 0xFFFFFF; + +// +// tape_ref inline implementation +// +simdjson_inline tape_ref::tape_ref() noexcept : doc{nullptr}, json_index{0} {} +simdjson_inline tape_ref::tape_ref(const dom::document *_doc, size_t _json_index) noexcept : doc{_doc}, json_index{_json_index} {} + + +simdjson_inline bool tape_ref::is_document_root() const noexcept { + return json_index == 1; // should we ever change the structure of the tape, this should get updated. +} +simdjson_inline bool tape_ref::usable() const noexcept { + return doc != nullptr; // when the document pointer is null, this tape_ref is uninitialized (should not be accessed). +} +// Some value types have a specific on-tape word value. It can be faster +// to check the type by doing a word-to-word comparison instead of extracting the +// most significant 8 bits. + +simdjson_inline bool tape_ref::is_double() const noexcept { + constexpr uint64_t tape_double = uint64_t(tape_type::DOUBLE)<<56; + return doc->tape[json_index] == tape_double; +} +simdjson_inline bool tape_ref::is_int64() const noexcept { + constexpr uint64_t tape_int64 = uint64_t(tape_type::INT64)<<56; + return doc->tape[json_index] == tape_int64; +} +simdjson_inline bool tape_ref::is_uint64() const noexcept { + constexpr uint64_t tape_uint64 = uint64_t(tape_type::UINT64)<<56; + return doc->tape[json_index] == tape_uint64; +} +simdjson_inline bool tape_ref::is_false() const noexcept { + constexpr uint64_t tape_false = uint64_t(tape_type::FALSE_VALUE)<<56; + return doc->tape[json_index] == tape_false; +} +simdjson_inline bool tape_ref::is_true() const noexcept { + constexpr uint64_t tape_true = uint64_t(tape_type::TRUE_VALUE)<<56; + return doc->tape[json_index] == tape_true; +} +simdjson_inline bool tape_ref::is_null_on_tape() const noexcept { + constexpr uint64_t tape_null = uint64_t(tape_type::NULL_VALUE)<<56; + return doc->tape[json_index] == tape_null; +} + +inline size_t tape_ref::after_element() const noexcept { + switch (tape_ref_type()) { + case tape_type::START_ARRAY: + case tape_type::START_OBJECT: + return matching_brace_index(); + case tape_type::UINT64: + case tape_type::INT64: + case tape_type::DOUBLE: + return json_index + 2; + default: + return json_index + 1; + } +} +simdjson_inline tape_type tape_ref::tape_ref_type() const noexcept { + return static_cast(doc->tape[json_index] >> 56); +} +simdjson_inline uint64_t internal::tape_ref::tape_value() const noexcept { + return doc->tape[json_index] & internal::JSON_VALUE_MASK; +} +simdjson_inline uint32_t internal::tape_ref::matching_brace_index() const noexcept { + return uint32_t(doc->tape[json_index]); +} +simdjson_inline uint32_t internal::tape_ref::scope_count() const noexcept { + return uint32_t((doc->tape[json_index] >> 32) & internal::JSON_COUNT_MASK); +} + +template +simdjson_inline T tape_ref::next_tape_value() const noexcept { + static_assert(sizeof(T) == sizeof(uint64_t), "next_tape_value() template parameter must be 64-bit"); + // Though the following is tempting... + // return *reinterpret_cast(&doc->tape[json_index + 1]); + // It is not generally safe. It is safer, and often faster to rely + // on memcpy. Yes, it is uglier, but it is also encapsulated. + T x; + std::memcpy(&x,&doc->tape[json_index + 1],sizeof(uint64_t)); + return x; +} + +simdjson_inline uint32_t internal::tape_ref::get_string_length() const noexcept { + size_t string_buf_index = size_t(tape_value()); + uint32_t len; + std::memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len)); + return len; +} + +simdjson_inline const char * internal::tape_ref::get_c_str() const noexcept { + size_t string_buf_index = size_t(tape_value()); + return reinterpret_cast(&doc->string_buf[string_buf_index + sizeof(uint32_t)]); +} + +inline std::string_view internal::tape_ref::get_string_view() const noexcept { + return std::string_view( + get_c_str(), + get_string_length() + ); +} + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_TAPE_REF_INL_H +/* end file simdjson/internal/tape_ref-inl.h */ + +#include + +namespace simdjson { + +// +// simdjson_result inline implementation +// +simdjson_inline simdjson_result::simdjson_result() noexcept + : internal::simdjson_result_base() {} +simdjson_inline simdjson_result::simdjson_result(dom::array value) noexcept + : internal::simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : internal::simdjson_result_base(error) {} + +#if SIMDJSON_EXCEPTIONS + +inline dom::array::iterator simdjson_result::begin() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.begin(); +} +inline dom::array::iterator simdjson_result::end() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.end(); +} +inline size_t simdjson_result::size() const noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first.size(); +} + +#endif // SIMDJSON_EXCEPTIONS + +inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) const noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +inline simdjson_result simdjson_result::at(size_t index) const noexcept { + if (error()) { return error(); } + return first.at(index); +} + +namespace dom { + +// +// array inline implementation +// +simdjson_inline array::array() noexcept : tape{} {} +simdjson_inline array::array(const internal::tape_ref &_tape) noexcept : tape{_tape} {} +inline array::iterator array::begin() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return internal::tape_ref(tape.doc, tape.json_index + 1); +} +inline array::iterator array::end() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return internal::tape_ref(tape.doc, tape.after_element() - 1); +} +inline size_t array::size() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return tape.scope_count(); +} +inline size_t array::number_of_slots() const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + return tape.matching_brace_index() - tape.json_index; +} +inline simdjson_result array::at_pointer(std::string_view json_pointer) const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + if(json_pointer.empty()) { // an empty string means that we return the current node + return element(this->tape); // copy the current node + } else if(json_pointer[0] != '/') { // otherwise there is an error + return INVALID_JSON_POINTER; + } + json_pointer = json_pointer.substr(1); + // - means "the append position" or "the element after the end of the array" + // We don't support this, because we're returning a real element, not a position. + if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; } + + // Read the array index + size_t array_index = 0; + size_t i; + for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) { + uint8_t digit = uint8_t(json_pointer[i] - '0'); + // Check for non-digit in array index. If it's there, we're trying to get a field in an object + if (digit > 9) { return INCORRECT_TYPE; } + array_index = array_index*10 + digit; + } + + // 0 followed by other digits is invalid + if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0" + + // Empty string is invalid; so is a "/" with no digits before it + if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index" + + // Get the child + auto child = array(tape).at(array_index); + // If there is an error, it ends here + if(child.error()) { + return child; + } + // If there is a /, we're not done yet, call recursively. + if (i < json_pointer.length()) { + child = child.at_pointer(json_pointer.substr(i)); + } + return child; +} + +inline simdjson_result array::at(size_t index) const noexcept { + SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914 + size_t i=0; + for (auto element : *this) { + if (i == index) { return element; } + i++; + } + return INDEX_OUT_OF_BOUNDS; +} + +// +// array::iterator inline implementation +// +simdjson_inline array::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { } +inline element array::iterator::operator*() const noexcept { + return element(tape); +} +inline array::iterator& array::iterator::operator++() noexcept { + tape.json_index = tape.after_element(); + return *this; +} +inline array::iterator array::iterator::operator++(int) noexcept { + array::iterator out = *this; + ++*this; + return out; +} +inline bool array::iterator::operator!=(const array::iterator& other) const noexcept { + return tape.json_index != other.tape.json_index; +} +inline bool array::iterator::operator==(const array::iterator& other) const noexcept { + return tape.json_index == other.tape.json_index; +} +inline bool array::iterator::operator<(const array::iterator& other) const noexcept { + return tape.json_index < other.tape.json_index; +} +inline bool array::iterator::operator<=(const array::iterator& other) const noexcept { + return tape.json_index <= other.tape.json_index; +} +inline bool array::iterator::operator>=(const array::iterator& other) const noexcept { + return tape.json_index >= other.tape.json_index; +} +inline bool array::iterator::operator>(const array::iterator& other) const noexcept { + return tape.json_index > other.tape.json_index; +} + +} // namespace dom + + +} // namespace simdjson + +/* skipped duplicate #include "simdjson/dom/element-inl.h" */ + +#if defined(__cpp_lib_ranges) +static_assert(std::ranges::view); +static_assert(std::ranges::sized_range); +#if SIMDJSON_EXCEPTIONS +static_assert(std::ranges::view>); +static_assert(std::ranges::sized_range>); +#endif // SIMDJSON_EXCEPTIONS +#endif // defined(__cpp_lib_ranges) + +#endif // SIMDJSON_ARRAY_INL_H +/* end file simdjson/dom/array-inl.h */ +/* skipped duplicate #include "simdjson/dom/document_stream-inl.h" */ +/* including simdjson/dom/document-inl.h: #include "simdjson/dom/document-inl.h" */ +/* begin file simdjson/dom/document-inl.h */ +#ifndef SIMDJSON_DOCUMENT_INL_H +#define SIMDJSON_DOCUMENT_INL_H + +// Inline implementations go in here. + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/document.h" */ +/* skipped duplicate #include "simdjson/dom/element-inl.h" */ +/* skipped duplicate #include "simdjson/internal/tape_ref-inl.h" */ +/* including simdjson/internal/jsonformatutils.h: #include "simdjson/internal/jsonformatutils.h" */ +/* begin file simdjson/internal/jsonformatutils.h */ +#ifndef SIMDJSON_INTERNAL_JSONFORMATUTILS_H +#define SIMDJSON_INTERNAL_JSONFORMATUTILS_H + +/* skipped duplicate #include "simdjson/base.h" */ +#include +#include +#include + +namespace simdjson { +namespace internal { + +inline std::ostream& operator<<(std::ostream& out, const escape_json_string &str); + +class escape_json_string { +public: + escape_json_string(std::string_view _str) noexcept : str{_str} {} + operator std::string() const noexcept { std::stringstream s; s << *this; return s.str(); } +private: + std::string_view str; + friend std::ostream& operator<<(std::ostream& out, const escape_json_string &unescaped); +}; + +inline std::ostream& operator<<(std::ostream& out, const escape_json_string &unescaped) { + for (size_t i=0; i(unescaped.str[i]) <= 0x1F) { + // TODO can this be done once at the beginning, or will it mess up << char? + std::ios::fmtflags f(out.flags()); + out << "\\u" << std::hex << std::setw(4) << std::setfill('0') << int(unescaped.str[i]); + out.flags(f); + } else { + out << unescaped.str[i]; + } + } + } + return out; +} + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_JSONFORMATUTILS_H +/* end file simdjson/internal/jsonformatutils.h */ + +#include + +namespace simdjson { +namespace dom { + +// +// document inline implementation +// +inline element document::root() const noexcept { + return element(internal::tape_ref(this, 1)); +} +simdjson_warn_unused +inline size_t document::capacity() const noexcept { + return allocated_capacity; +} + +simdjson_warn_unused +inline error_code document::allocate(size_t capacity) noexcept { + if (capacity == 0) { + string_buf.reset(); + tape.reset(); + allocated_capacity = 0; + return SUCCESS; + } + + // a pathological input like "[[[[..." would generate capacity tape elements, so + // need a capacity of at least capacity + 1, but it is also possible to do + // worse with "[7,7,7,7,6,7,7,7,6,7,7,6,[7,7,7,7,6,7,7,7,6,7,7,6,7,7,7,7,7,7,6" + //where capacity + 1 tape elements are + // generated, see issue https://github.com/simdjson/simdjson/issues/345 + size_t tape_capacity = SIMDJSON_ROUNDUP_N(capacity + 3, 64); + // a document with only zero-length strings... could have capacity/3 string + // and we would need capacity/3 * 5 bytes on the string buffer + size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * capacity / 3 + SIMDJSON_PADDING, 64); + string_buf.reset( new (std::nothrow) uint8_t[string_capacity]); + tape.reset(new (std::nothrow) uint64_t[tape_capacity]); + if(!(string_buf && tape)) { + allocated_capacity = 0; + string_buf.reset(); + tape.reset(); + return MEMALLOC; + } + // Technically the allocated_capacity might be larger than capacity + // so the next line is pessimistic. + allocated_capacity = capacity; + return SUCCESS; +} + +inline bool document::dump_raw_tape(std::ostream &os) const noexcept { + uint32_t string_length; + size_t tape_idx = 0; + uint64_t tape_val = tape[tape_idx]; + uint8_t type = uint8_t(tape_val >> 56); + os << tape_idx << " : " << type; + tape_idx++; + size_t how_many = 0; + if (type == 'r') { + how_many = size_t(tape_val & internal::JSON_VALUE_MASK); + } else { + // Error: no starting root node? + return false; + } + os << "\t// pointing to " << how_many << " (right after last node)\n"; + uint64_t payload; + for (; tape_idx < how_many; tape_idx++) { + os << tape_idx << " : "; + tape_val = tape[tape_idx]; + payload = tape_val & internal::JSON_VALUE_MASK; + type = uint8_t(tape_val >> 56); + switch (type) { + case '"': // we have a string + os << "string \""; + std::memcpy(&string_length, string_buf.get() + payload, sizeof(uint32_t)); + os << internal::escape_json_string(std::string_view( + reinterpret_cast(string_buf.get() + payload + sizeof(uint32_t)), + string_length + )); + os << '"'; + os << '\n'; + break; + case 'l': // we have a long int + if (tape_idx + 1 >= how_many) { + return false; + } + os << "integer " << static_cast(tape[++tape_idx]) << "\n"; + break; + case 'u': // we have a long uint + if (tape_idx + 1 >= how_many) { + return false; + } + os << "unsigned integer " << tape[++tape_idx] << "\n"; + break; + case 'd': // we have a double + os << "float "; + if (tape_idx + 1 >= how_many) { + return false; + } + double answer; + std::memcpy(&answer, &tape[++tape_idx], sizeof(answer)); + os << answer << '\n'; + break; + case 'n': // we have a null + os << "null\n"; + break; + case 't': // we have a true + os << "true\n"; + break; + case 'f': // we have a false + os << "false\n"; + break; + case '{': // we have an object + os << "{\t// pointing to next tape location " << uint32_t(payload) + << " (first node after the scope), " + << " saturated count " + << ((payload >> 32) & internal::JSON_COUNT_MASK)<< "\n"; + break; case '}': // we end an object + os << "}\t// pointing to previous tape location " << uint32_t(payload) + << " (start of the scope)\n"; + break; + case '[': // we start an array + os << "[\t// pointing to next tape location " << uint32_t(payload) + << " (first node after the scope), " + << " saturated count " + << ((payload >> 32) & internal::JSON_COUNT_MASK)<< "\n"; + break; + case ']': // we end an array + os << "]\t// pointing to previous tape location " << uint32_t(payload) + << " (start of the scope)\n"; + break; + case 'r': // we start and end with the root node + // should we be hitting the root node? + return false; + default: + return false; + } + } + tape_val = tape[tape_idx]; + payload = tape_val & internal::JSON_VALUE_MASK; + type = uint8_t(tape_val >> 56); + os << tape_idx << " : " << type << "\t// pointing to " << payload + << " (start root)\n"; + return true; +} + +} // namespace dom +} // namespace simdjson + +#endif // SIMDJSON_DOCUMENT_INL_H +/* end file simdjson/dom/document-inl.h */ +/* skipped duplicate #include "simdjson/dom/element-inl.h" */ +/* skipped duplicate #include "simdjson/dom/object-inl.h" */ +/* including simdjson/dom/parsedjson_iterator-inl.h: #include "simdjson/dom/parsedjson_iterator-inl.h" */ +/* begin file simdjson/dom/parsedjson_iterator-inl.h */ +#ifndef SIMDJSON_PARSEDJSON_ITERATOR_INL_H +#define SIMDJSON_PARSEDJSON_ITERATOR_INL_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/parsedjson_iterator.h" */ +/* skipped duplicate #include "simdjson/internal/jsonformatutils.h" */ + +/* skipped duplicate #include "simdjson/dom/parser-inl.h" */ +/* skipped duplicate #include "simdjson/internal/tape_ref-inl.h" */ + +#include +#include +#include +#include + +#ifndef SIMDJSON_DISABLE_DEPRECATED_API + +namespace simdjson { + +// VS2017 reports deprecated warnings when you define a deprecated class's methods. +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_DEPRECATED_WARNING + +// Because of template weirdness, the actual class definition is inline in the document class +simdjson_warn_unused bool dom::parser::Iterator::is_ok() const { + return location < tape_length; +} + +// useful for debugging purposes +size_t dom::parser::Iterator::get_tape_location() const { + return location; +} + +// useful for debugging purposes +size_t dom::parser::Iterator::get_tape_length() const { + return tape_length; +} + +// returns the current depth (start at 1 with 0 reserved for the fictitious root +// node) +size_t dom::parser::Iterator::get_depth() const { + return depth; +} + +// A scope is a series of nodes at the same depth, typically it is either an +// object ({) or an array ([). The root node has type 'r'. +uint8_t dom::parser::Iterator::get_scope_type() const { + return depth_index[depth].scope_type; +} + +bool dom::parser::Iterator::move_forward() { + if (location + 1 >= tape_length) { + return false; // we are at the end! + } + + if ((current_type == '[') || (current_type == '{')) { + // We are entering a new scope + depth++; + assert(depth < max_depth); + depth_index[depth].start_of_scope = location; + depth_index[depth].scope_type = current_type; + } else if ((current_type == ']') || (current_type == '}')) { + // Leaving a scope. + depth--; + } else if (is_number()) { + // these types use 2 locations on the tape, not just one. + location += 1; + } + + location += 1; + current_val = doc.tape[location]; + current_type = uint8_t(current_val >> 56); + return true; +} + +void dom::parser::Iterator::move_to_value() { + // assume that we are on a key, so move by 1. + location += 1; + current_val = doc.tape[location]; + current_type = uint8_t(current_val >> 56); +} + +bool dom::parser::Iterator::move_to_key(const char *key) { + if (down()) { + do { + const bool right_key = (strcmp(get_string(), key) == 0); + move_to_value(); + if (right_key) { + return true; + } + } while (next()); + up(); + } + return false; +} + +bool dom::parser::Iterator::move_to_key_insensitive( + const char *key) { + if (down()) { + do { + const bool right_key = (simdjson_strcasecmp(get_string(), key) == 0); + move_to_value(); + if (right_key) { + return true; + } + } while (next()); + up(); + } + return false; +} + +bool dom::parser::Iterator::move_to_key(const char *key, + uint32_t length) { + if (down()) { + do { + bool right_key = ((get_string_length() == length) && + (memcmp(get_string(), key, length) == 0)); + move_to_value(); + if (right_key) { + return true; + } + } while (next()); + up(); + } + return false; +} + +bool dom::parser::Iterator::move_to_index(uint32_t index) { + if (down()) { + uint32_t i = 0; + for (; i < index; i++) { + if (!next()) { + break; + } + } + if (i == index) { + return true; + } + up(); + } + return false; +} + +bool dom::parser::Iterator::prev() { + size_t target_location = location; + to_start_scope(); + size_t npos = location; + if (target_location == npos) { + return false; // we were already at the start + } + size_t oldnpos; + // we have that npos < target_location here + do { + oldnpos = npos; + if ((current_type == '[') || (current_type == '{')) { + // we need to jump + npos = uint32_t(current_val); + } else { + npos = npos + ((current_type == 'd' || current_type == 'l') ? 2 : 1); + } + } while (npos < target_location); + location = oldnpos; + current_val = doc.tape[location]; + current_type = uint8_t(current_val >> 56); + return true; +} + +bool dom::parser::Iterator::up() { + if (depth == 1) { + return false; // don't allow moving back to root + } + to_start_scope(); + // next we just move to the previous value + depth--; + location -= 1; + current_val = doc.tape[location]; + current_type = uint8_t(current_val >> 56); + return true; +} + +bool dom::parser::Iterator::down() { + if (location + 1 >= tape_length) { + return false; + } + if ((current_type == '[') || (current_type == '{')) { + size_t npos = uint32_t(current_val); + if (npos == location + 2) { + return false; // we have an empty scope + } + depth++; + assert(depth < max_depth); + location = location + 1; + depth_index[depth].start_of_scope = location; + depth_index[depth].scope_type = current_type; + current_val = doc.tape[location]; + current_type = uint8_t(current_val >> 56); + return true; + } + return false; +} + +void dom::parser::Iterator::to_start_scope() { + location = depth_index[depth].start_of_scope; + current_val = doc.tape[location]; + current_type = uint8_t(current_val >> 56); +} + +inline void dom::parser::Iterator::rewind() { + while (up()) + ; +} + + +bool dom::parser::Iterator::next() { + size_t npos; + if ((current_type == '[') || (current_type == '{')) { + // we need to jump + npos = uint32_t(current_val); + } else { + npos = location + (is_number() ? 2 : 1); + } + uint64_t next_val = doc.tape[npos]; + uint8_t next_type = uint8_t(next_val >> 56); + if ((next_type == ']') || (next_type == '}')) { + return false; // we reached the end of the scope + } + location = npos; + current_val = next_val; + current_type = next_type; + return true; +} +dom::parser::Iterator::Iterator(const dom::parser &pj) noexcept(false) + : doc(pj.doc) +{ +#if SIMDJSON_EXCEPTIONS + if (!pj.valid) { throw simdjson_error(pj.error); } +#else + if (!pj.valid) { return; } // abort() usage is forbidden in the library +#endif + + max_depth = pj.max_depth(); + depth_index = new scopeindex_t[max_depth + 1]; + depth_index[0].start_of_scope = location; + current_val = doc.tape[location++]; + current_type = uint8_t(current_val >> 56); + depth_index[0].scope_type = current_type; + tape_length = size_t(current_val & internal::JSON_VALUE_MASK); + if (location < tape_length) { + // If we make it here, then depth_capacity must >=2, but the compiler + // may not know this. + current_val = doc.tape[location]; + current_type = uint8_t(current_val >> 56); + depth++; + assert(depth < max_depth); + depth_index[depth].start_of_scope = location; + depth_index[depth].scope_type = current_type; + } +} +dom::parser::Iterator::Iterator( + const dom::parser::Iterator &o) noexcept + : doc(o.doc), + max_depth(o.depth), + depth(o.depth), + location(o.location), + tape_length(o.tape_length), + current_type(o.current_type), + current_val(o.current_val) +{ + depth_index = new scopeindex_t[max_depth+1]; + std::memcpy(depth_index, o.depth_index, (depth + 1) * sizeof(depth_index[0])); +} + +dom::parser::Iterator::~Iterator() noexcept { + if (depth_index) { delete[] depth_index; } +} + +bool dom::parser::Iterator::print(std::ostream &os, bool escape_strings) const { + if (!is_ok()) { + return false; + } + switch (current_type) { + case '"': // we have a string + os << '"'; + if (escape_strings) { + os << internal::escape_json_string(std::string_view(get_string(), get_string_length())); + } else { + // was: os << get_string();, but given that we can include null chars, we + // have to do something crazier: + std::copy(get_string(), get_string() + get_string_length(), std::ostream_iterator(os)); + } + os << '"'; + break; + case 'l': // we have a long int + os << get_integer(); + break; + case 'u': + os << get_unsigned_integer(); + break; + case 'd': + os << get_double(); + break; + case 'n': // we have a null + os << "null"; + break; + case 't': // we have a true + os << "true"; + break; + case 'f': // we have a false + os << "false"; + break; + case '{': // we have an object + case '}': // we end an object + case '[': // we start an array + case ']': // we end an array + os << char(current_type); + break; + default: + return false; + } + return true; +} + +bool dom::parser::Iterator::move_to(const char *pointer, + uint32_t length) { + char *new_pointer = nullptr; + if (pointer[0] == '#') { + // Converting fragment representation to string representation + new_pointer = new char[length]; + uint32_t new_length = 0; + for (uint32_t i = 1; i < length; i++) { + if (pointer[i] == '%' && pointer[i + 1] == 'x') { +#if __cpp_exceptions + try { +#endif + int fragment = + std::stoi(std::string(&pointer[i + 2], 2), nullptr, 16); + if (fragment == '\\' || fragment == '"' || (fragment <= 0x1F)) { + // escaping the character + new_pointer[new_length] = '\\'; + new_length++; + } + new_pointer[new_length] = char(fragment); + i += 3; +#if __cpp_exceptions + } catch (std::invalid_argument &) { + delete[] new_pointer; + return false; // the fragment is invalid + } +#endif + } else { + new_pointer[new_length] = pointer[i]; + } + new_length++; + } + length = new_length; + pointer = new_pointer; + } + + // saving the current state + size_t depth_s = depth; + size_t location_s = location; + uint8_t current_type_s = current_type; + uint64_t current_val_s = current_val; + + rewind(); // The json pointer is used from the root of the document. + + bool found = relative_move_to(pointer, length); + delete[] new_pointer; + + if (!found) { + // since the pointer has found nothing, we get back to the original + // position. + depth = depth_s; + location = location_s; + current_type = current_type_s; + current_val = current_val_s; + } + + return found; +} + +inline bool dom::parser::Iterator::move_to(const std::string &pointer) { + return move_to(pointer.c_str(), uint32_t(pointer.length())); +} + +inline int64_t dom::parser::Iterator::get_integer() const { + if (location + 1 >= tape_length) { + return 0; // default value in case of error + } + return static_cast(doc.tape[location + 1]); +} + +inline uint64_t dom::parser::Iterator::get_unsigned_integer() const { + if (location + 1 >= tape_length) { + return 0; // default value in case of error + } + return doc.tape[location + 1]; +} + +inline const char * dom::parser::Iterator::get_string() const { + return reinterpret_cast( + doc.string_buf.get() + (current_val & internal::JSON_VALUE_MASK) + sizeof(uint32_t)); +} + +inline uint32_t dom::parser::Iterator::get_string_length() const { + uint32_t answer; + std::memcpy(&answer, + reinterpret_cast(doc.string_buf.get() + + (current_val & internal::JSON_VALUE_MASK)), + sizeof(uint32_t)); + return answer; +} + +inline double dom::parser::Iterator::get_double() const { + if (location + 1 >= tape_length) { + return std::numeric_limits::quiet_NaN(); // default value in + // case of error + } + double answer; + std::memcpy(&answer, &doc.tape[location + 1], sizeof(answer)); + return answer; +} + +bool dom::parser::Iterator::relative_move_to(const char *pointer, + uint32_t length) { + if (length == 0) { + // returns the whole document + return true; + } + + if (pointer[0] != '/') { + // '/' must be the first character + return false; + } + + // finding the key in an object or the index in an array + std::string key_or_index; + uint32_t offset = 1; + + // checking for the "-" case + if (is_array() && pointer[1] == '-') { + if (length != 2) { + // the pointer must be exactly "/-" + // there can't be anything more after '-' as an index + return false; + } + key_or_index = '-'; + offset = length; // will skip the loop coming right after + } + + // We either transform the first reference token to a valid json key + // or we make sure it is a valid index in an array. + for (; offset < length; offset++) { + if (pointer[offset] == '/') { + // beginning of the next key or index + break; + } + if (is_array() && (pointer[offset] < '0' || pointer[offset] > '9')) { + // the index of an array must be an integer + // we also make sure std::stoi won't discard whitespaces later + return false; + } + if (pointer[offset] == '~') { + // "~1" represents "/" + if (pointer[offset + 1] == '1') { + key_or_index += '/'; + offset++; + continue; + } + // "~0" represents "~" + if (pointer[offset + 1] == '0') { + key_or_index += '~'; + offset++; + continue; + } + } + if (pointer[offset] == '\\') { + if (pointer[offset + 1] == '\\' || pointer[offset + 1] == '"' || + (pointer[offset + 1] <= 0x1F)) { + key_or_index += pointer[offset + 1]; + offset++; + continue; + } + return false; // invalid escaped character + } + if (pointer[offset] == '\"') { + // unescaped quote character. this is an invalid case. + // lets do nothing and assume most pointers will be valid. + // it won't find any corresponding json key anyway. + // return false; + } + key_or_index += pointer[offset]; + } + + bool found = false; + if (is_object()) { + if (move_to_key(key_or_index.c_str(), uint32_t(key_or_index.length()))) { + found = relative_move_to(pointer + offset, length - offset); + } + } else if (is_array()) { + if (key_or_index == "-") { // handling "-" case first + if (down()) { + while (next()) + ; // moving to the end of the array + // moving to the nonexistent value right after... + size_t npos; + if ((current_type == '[') || (current_type == '{')) { + // we need to jump + npos = uint32_t(current_val); + } else { + npos = + location + ((current_type == 'd' || current_type == 'l') ? 2 : 1); + } + location = npos; + current_val = doc.tape[npos]; + current_type = uint8_t(current_val >> 56); + return true; // how could it fail ? + } + } else { // regular numeric index + // The index can't have a leading '0' + if (key_or_index[0] == '0' && key_or_index.length() > 1) { + return false; + } + // it cannot be empty + if (key_or_index.length() == 0) { + return false; + } + // we already checked the index contains only valid digits + uint32_t index = std::stoi(key_or_index); + if (move_to_index(index)) { + found = relative_move_to(pointer + offset, length - offset); + } + } + } + + return found; +} + +SIMDJSON_POP_DISABLE_WARNINGS +} // namespace simdjson + +#endif // SIMDJSON_DISABLE_DEPRECATED_API + + +#endif // SIMDJSON_PARSEDJSON_ITERATOR_INL_H +/* end file simdjson/dom/parsedjson_iterator-inl.h */ +/* skipped duplicate #include "simdjson/dom/parser-inl.h" */ +/* skipped duplicate #include "simdjson/internal/tape_ref-inl.h" */ +/* including simdjson/dom/serialization-inl.h: #include "simdjson/dom/serialization-inl.h" */ +/* begin file simdjson/dom/serialization-inl.h */ + +#ifndef SIMDJSON_SERIALIZATION_INL_H +#define SIMDJSON_SERIALIZATION_INL_H + +/* skipped duplicate #include "simdjson/dom/base.h" */ +/* skipped duplicate #include "simdjson/dom/serialization.h" */ +/* skipped duplicate #include "simdjson/dom/parser.h" */ +/* skipped duplicate #include "simdjson/internal/tape_type.h" */ + +/* skipped duplicate #include "simdjson/dom/array-inl.h" */ +/* skipped duplicate #include "simdjson/dom/object-inl.h" */ +/* skipped duplicate #include "simdjson/internal/tape_ref-inl.h" */ + +#include + +namespace simdjson { +namespace dom { +inline bool parser::print_json(std::ostream &os) const noexcept { + if (!valid) { return false; } + simdjson::internal::string_builder<> sb; + sb.append(doc.root()); + std::string_view answer = sb.str(); + os << answer; + return true; +} + +inline std::ostream& operator<<(std::ostream& out, simdjson::dom::element value) { + simdjson::internal::string_builder<> sb; + sb.append(value); + return (out << sb.str()); +} +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::dom::array value) { + simdjson::internal::string_builder<> sb; + sb.append(value); + return (out << sb.str()); +} +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::dom::object value) { + simdjson::internal::string_builder<> sb; + sb.append(value); + return (out << sb.str()); +} +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#endif + +} // namespace dom + +/*** + * Number utility functions + **/ +namespace { +/**@private + * Escape sequence like \b or \u0001 + * We expect that most compilers will use 8 bytes for this data structure. + **/ +struct escape_sequence { + uint8_t length; + const char string[7]; // technically, we only ever need 6 characters, we pad to 8 +}; +/**@private + * This converts a signed integer into a character sequence. + * The caller is responsible for providing enough memory (at least + * 20 characters.) + * Though various runtime libraries provide itoa functions, + * it is not part of the C++ standard. The C++17 standard + * adds the to_chars functions which would do as well, but + * we want to support C++11. + */ +static char *fast_itoa(char *output, int64_t value) noexcept { + // This is a standard implementation of itoa. + char buffer[20]; + uint64_t value_positive; + // In general, negating a signed integer is unsafe. + if(value < 0) { + *output++ = '-'; + // Doing value_positive = -value; while avoiding + // undefined behavior warnings. + // It assumes two complement's which is universal at this + // point in time. + std::memcpy(&value_positive, &value, sizeof(value)); + value_positive = (~value_positive) + 1; // this is a negation + } else { + value_positive = value; + } + // We work solely with value_positive. It *might* be easier + // for an optimizing compiler to deal with an unsigned variable + // as far as performance goes. + const char *const end_buffer = buffer + 20; + char *write_pointer = buffer + 19; + // A faster approach is possible if we expect large integers: + // unroll the loop (work in 100s, 1000s) and use some kind of + // memoization. + while(value_positive >= 10) { + *write_pointer-- = char('0' + (value_positive % 10)); + value_positive /= 10; + } + *write_pointer = char('0' + value_positive); + size_t len = end_buffer - write_pointer; + std::memcpy(output, write_pointer, len); + return output + len; +} +/**@private + * This converts an unsigned integer into a character sequence. + * The caller is responsible for providing enough memory (at least + * 19 characters.) + * Though various runtime libraries provide itoa functions, + * it is not part of the C++ standard. The C++17 standard + * adds the to_chars functions which would do as well, but + * we want to support C++11. + */ +static char *fast_itoa(char *output, uint64_t value) noexcept { + // This is a standard implementation of itoa. + char buffer[20]; + const char *const end_buffer = buffer + 20; + char *write_pointer = buffer + 19; + // A faster approach is possible if we expect large integers: + // unroll the loop (work in 100s, 1000s) and use some kind of + // memoization. + while(value >= 10) { + *write_pointer-- = char('0' + (value % 10)); + value /= 10; + }; + *write_pointer = char('0' + value); + size_t len = end_buffer - write_pointer; + std::memcpy(output, write_pointer, len); + return output + len; +} + + +} // anonymous namespace +namespace internal { + +/*** + * Minifier/formatter code. + **/ + +template +simdjson_inline void base_formatter::number(uint64_t x) { + char number_buffer[24]; + char *newp = fast_itoa(number_buffer, x); + buffer.insert(buffer.end(), number_buffer, newp); +} + +template +simdjson_inline void base_formatter::number(int64_t x) { + char number_buffer[24]; + char *newp = fast_itoa(number_buffer, x); + buffer.insert(buffer.end(), number_buffer, newp); +} + +template +simdjson_inline void base_formatter::number(double x) { + char number_buffer[24]; + // Currently, passing the nullptr to the second argument is + // safe because our implementation does not check the second + // argument. + char *newp = internal::to_chars(number_buffer, nullptr, x); + buffer.insert(buffer.end(), number_buffer, newp); +} + +template +simdjson_inline void base_formatter::start_array() { one_char('['); } + + +template +simdjson_inline void base_formatter::end_array() { one_char(']'); } + +template +simdjson_inline void base_formatter::start_object() { one_char('{'); } + +template +simdjson_inline void base_formatter::end_object() { one_char('}'); } + +template +simdjson_inline void base_formatter::comma() { one_char(','); } + +template +simdjson_inline void base_formatter::true_atom() { + const char * s = "true"; + buffer.insert(buffer.end(), s, s + 4); +} + +template +simdjson_inline void base_formatter::false_atom() { + const char * s = "false"; + buffer.insert(buffer.end(), s, s + 5); +} + +template +simdjson_inline void base_formatter::null_atom() { + const char * s = "null"; + buffer.insert(buffer.end(), s, s + 4); +} + +template +simdjson_inline void base_formatter::one_char(char c) { buffer.push_back(c); } + +template +simdjson_inline void base_formatter::key(std::string_view unescaped) { + string(unescaped); + one_char(':'); +} + +template +simdjson_inline void base_formatter::string(std::string_view unescaped) { + one_char('\"'); + size_t i = 0; + // Fast path for the case where we have no control character, no ", and no backslash. + // This should include most keys. + // + // We would like to use 'bool' but some compilers take offense to bitwise operation + // with bool types. + constexpr static char needs_escaping[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + for(;i + 8 <= unescaped.length(); i += 8) { + // Poor's man vectorization. This could get much faster if we used SIMD. + // + // It is not the case that replacing '|' with '||' would be neutral performance-wise. + if(needs_escaping[uint8_t(unescaped[i])] | needs_escaping[uint8_t(unescaped[i+1])] + | needs_escaping[uint8_t(unescaped[i+2])] | needs_escaping[uint8_t(unescaped[i+3])] + | needs_escaping[uint8_t(unescaped[i+4])] | needs_escaping[uint8_t(unescaped[i+5])] + | needs_escaping[uint8_t(unescaped[i+6])] | needs_escaping[uint8_t(unescaped[i+7])] + ) { break; } + } + for(;i < unescaped.length(); i++) { + if(needs_escaping[uint8_t(unescaped[i])]) { break; } + } + // The following is also possible and omits a 256-byte table, but it is slower: + // for (; (i < unescaped.length()) && (uint8_t(unescaped[i]) > 0x1F) + // && (unescaped[i] != '\"') && (unescaped[i] != '\\'); i++) {} + + // At least for long strings, the following should be fast. We could + // do better by integrating the checks and the insertion. + buffer.insert(buffer.end(), unescaped.data(), unescaped.data() + i); + // We caught a control character if we enter this loop (slow). + // Note that we are do not restart from the beginning, but rather we continue + // from the point where we encountered something that requires escaping. + for (; i < unescaped.length(); i++) { + switch (unescaped[i]) { + case '\"': + { + const char * s = "\\\""; + buffer.insert(buffer.end(), s, s + 2); + } + break; + case '\\': + { + const char * s = "\\\\"; + buffer.insert(buffer.end(), s, s + 2); + } + break; + default: + if (uint8_t(unescaped[i]) <= 0x1F) { + // If packed, this uses 8 * 32 bytes. + // Note that we expect most compilers to embed this code in the data + // section. + constexpr static escape_sequence escaped[32] = { + {6, "\\u0000"}, {6, "\\u0001"}, {6, "\\u0002"}, {6, "\\u0003"}, + {6, "\\u0004"}, {6, "\\u0005"}, {6, "\\u0006"}, {6, "\\u0007"}, + {2, "\\b"}, {2, "\\t"}, {2, "\\n"}, {6, "\\u000b"}, + {2, "\\f"}, {2, "\\r"}, {6, "\\u000e"}, {6, "\\u000f"}, + {6, "\\u0010"}, {6, "\\u0011"}, {6, "\\u0012"}, {6, "\\u0013"}, + {6, "\\u0014"}, {6, "\\u0015"}, {6, "\\u0016"}, {6, "\\u0017"}, + {6, "\\u0018"}, {6, "\\u0019"}, {6, "\\u001a"}, {6, "\\u001b"}, + {6, "\\u001c"}, {6, "\\u001d"}, {6, "\\u001e"}, {6, "\\u001f"}}; + auto u = escaped[uint8_t(unescaped[i])]; + buffer.insert(buffer.end(), u.string, u.string + u.length); + } else { + one_char(unescaped[i]); + } + } // switch + } // for + one_char('\"'); +} + + +template +inline void base_formatter::clear() { + buffer.clear(); +} + +template +simdjson_inline std::string_view base_formatter::str() const { + return std::string_view(buffer.data(), buffer.size()); +} + +simdjson_inline void mini_formatter::print_newline() { + return; +} + +simdjson_inline void mini_formatter::print_indents(size_t depth) { + (void)depth; + return; +} + +simdjson_inline void mini_formatter::print_space() { + return; +} + +simdjson_inline void pretty_formatter::print_newline() { + one_char('\n'); +} + +simdjson_inline void pretty_formatter::print_indents(size_t depth) { + if(this->indent_step <= 0) { + return; + } + for(size_t i = 0; i < this->indent_step * depth; i++) { + one_char(' '); + } +} + +simdjson_inline void pretty_formatter::print_space() { + one_char(' '); +} + +/*** + * String building code. + **/ + +template +inline void string_builder::append(simdjson::dom::element value) { + // using tape_type = simdjson::internal::tape_type; + size_t depth = 0; + constexpr size_t MAX_DEPTH = 16; + bool is_object[MAX_DEPTH]; + is_object[0] = false; + bool after_value = false; + + internal::tape_ref iter(value.tape); + do { + // print commas after each value + if (after_value) { + format.comma(); + format.print_newline(); + } + + format.print_indents(depth); + + // If we are in an object, print the next key and :, and skip to the next + // value. + if (is_object[depth]) { + format.key(iter.get_string_view()); + format.print_space(); + iter.json_index++; + } + switch (iter.tape_ref_type()) { + + // Arrays + case tape_type::START_ARRAY: { + // If we're too deep, we need to recurse to go deeper. + depth++; + if (simdjson_unlikely(depth >= MAX_DEPTH)) { + append(simdjson::dom::array(iter)); + iter.json_index = iter.matching_brace_index() - 1; // Jump to the ] + depth--; + break; + } + + // Output start [ + format.start_array(); + iter.json_index++; + + // Handle empty [] (we don't want to come back around and print commas) + if (iter.tape_ref_type() == tape_type::END_ARRAY) { + format.end_array(); + depth--; + break; + } + + is_object[depth] = false; + after_value = false; + format.print_newline(); + continue; + } + + // Objects + case tape_type::START_OBJECT: { + // If we're too deep, we need to recurse to go deeper. + depth++; + if (simdjson_unlikely(depth >= MAX_DEPTH)) { + append(simdjson::dom::object(iter)); + iter.json_index = iter.matching_brace_index() - 1; // Jump to the } + depth--; + break; + } + + // Output start { + format.start_object(); + iter.json_index++; + + // Handle empty {} (we don't want to come back around and print commas) + if (iter.tape_ref_type() == tape_type::END_OBJECT) { + format.end_object(); + depth--; + break; + } + + is_object[depth] = true; + after_value = false; + format.print_newline(); + continue; + } + + // Scalars + case tape_type::STRING: + format.string(iter.get_string_view()); + break; + case tape_type::INT64: + format.number(iter.next_tape_value()); + iter.json_index++; // numbers take up 2 spots, so we need to increment + // extra + break; + case tape_type::UINT64: + format.number(iter.next_tape_value()); + iter.json_index++; // numbers take up 2 spots, so we need to increment + // extra + break; + case tape_type::DOUBLE: + format.number(iter.next_tape_value()); + iter.json_index++; // numbers take up 2 spots, so we need to increment + // extra + break; + case tape_type::TRUE_VALUE: + format.true_atom(); + break; + case tape_type::FALSE_VALUE: + format.false_atom(); + break; + case tape_type::NULL_VALUE: + format.null_atom(); + break; + + // These are impossible + case tape_type::END_ARRAY: + case tape_type::END_OBJECT: + case tape_type::ROOT: + SIMDJSON_UNREACHABLE(); + } + iter.json_index++; + after_value = true; + + // Handle multiple ends in a row + while (depth != 0 && (iter.tape_ref_type() == tape_type::END_ARRAY || + iter.tape_ref_type() == tape_type::END_OBJECT)) { + format.print_newline(); + depth--; + format.print_indents(depth); + if (iter.tape_ref_type() == tape_type::END_ARRAY) { + format.end_array(); + } else { + format.end_object(); + } + iter.json_index++; + } + + // Stop when we're at depth 0 + } while (depth != 0); + + format.print_newline(); +} + +template +inline void string_builder::append(simdjson::dom::object value) { + format.start_object(); + auto pair = value.begin(); + auto end = value.end(); + if (pair != end) { + append(*pair); + for (++pair; pair != end; ++pair) { + format.comma(); + append(*pair); + } + } + format.end_object(); +} + +template +inline void string_builder::append(simdjson::dom::array value) { + format.start_array(); + auto iter = value.begin(); + auto end = value.end(); + if (iter != end) { + append(*iter); + for (++iter; iter != end; ++iter) { + format.comma(); + append(*iter); + } + } + format.end_array(); +} + +template +simdjson_inline void string_builder::append(simdjson::dom::key_value_pair kv) { + format.key(kv.key); + append(kv.value); +} + +template +simdjson_inline void string_builder::clear() { + format.clear(); +} + +template +simdjson_inline std::string_view string_builder::str() const { + return format.str(); +} + + +} // namespace internal +} // namespace simdjson + +#endif +/* end file simdjson/dom/serialization-inl.h */ + +#endif // SIMDJSON_DOM_H +/* end file simdjson/dom.h */ +/* including simdjson/ondemand.h: #include "simdjson/ondemand.h" */ +/* begin file simdjson/ondemand.h */ +#ifndef SIMDJSON_ONDEMAND_H +#define SIMDJSON_ONDEMAND_H + +/* including simdjson/builtin/ondemand.h: #include "simdjson/builtin/ondemand.h" */ +/* begin file simdjson/builtin/ondemand.h */ +#ifndef SIMDJSON_BUILTIN_ONDEMAND_H +#define SIMDJSON_BUILTIN_ONDEMAND_H + +/* including simdjson/builtin.h: #include "simdjson/builtin.h" */ +/* begin file simdjson/builtin.h */ +#ifndef SIMDJSON_BUILTIN_H +#define SIMDJSON_BUILTIN_H + +/* including simdjson/builtin/base.h: #include "simdjson/builtin/base.h" */ +/* begin file simdjson/builtin/base.h */ +#ifndef SIMDJSON_BUILTIN_BASE_H +#define SIMDJSON_BUILTIN_BASE_H + +/* skipped duplicate #include "simdjson/base.h" */ +/* including simdjson/implementation_detection.h: #include "simdjson/implementation_detection.h" */ +/* begin file simdjson/implementation_detection.h */ +#ifndef SIMDJSON_IMPLEMENTATION_DETECTION_H +#define SIMDJSON_IMPLEMENTATION_DETECTION_H + +/* skipped duplicate #include "simdjson/base.h" */ + +// 0 is reserved, because undefined SIMDJSON_IMPLEMENTATION equals 0 in preprocessor macros. +#define SIMDJSON_IMPLEMENTATION_ID_arm64 1 +#define SIMDJSON_IMPLEMENTATION_ID_fallback 2 +#define SIMDJSON_IMPLEMENTATION_ID_haswell 3 +#define SIMDJSON_IMPLEMENTATION_ID_icelake 4 +#define SIMDJSON_IMPLEMENTATION_ID_ppc64 5 +#define SIMDJSON_IMPLEMENTATION_ID_westmere 6 + +#define SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL) SIMDJSON_CAT(SIMDJSON_IMPLEMENTATION_ID_, IMPL) +#define SIMDJSON_IMPLEMENTATION_ID SIMDJSON_IMPLEMENTATION_ID_FOR(SIMDJSON_IMPLEMENTATION) + +#define SIMDJSON_IMPLEMENTATION_IS(IMPL) SIMDJSON_IMPLEMENTATION_ID == SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL) + +// +// First, figure out which implementations can be run. Doing it here makes it so we don't have to worry about the order +// in which we include them. +// + +#ifndef SIMDJSON_IMPLEMENTATION_ARM64 +#define SIMDJSON_IMPLEMENTATION_ARM64 (SIMDJSON_IS_ARM64) +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_ARM64 SIMDJSON_IMPLEMENTATION_ARM64 && SIMDJSON_IS_ARM64 + +// Default Icelake to on if this is x86-64. Even if we're not compiled for it, it could be selected +// at runtime. +#ifndef SIMDJSON_IMPLEMENTATION_ICELAKE +#define SIMDJSON_IMPLEMENTATION_ICELAKE ((SIMDJSON_IS_X86_64) && (SIMDJSON_AVX512_ALLOWED) && (SIMDJSON_COMPILER_SUPPORTS_VBMI2)) +#endif + +#ifdef _MSC_VER +// To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see +// https://github.com/simdjson/simdjson/issues/1247 +#define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__)) +#else +#define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__)) +#endif + +// Default Haswell to on if this is x86-64. Even if we're not compiled for it, it could be selected +// at runtime. +#ifndef SIMDJSON_IMPLEMENTATION_HASWELL +#if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +// if icelake is always available, never enable haswell. +#define SIMDJSON_IMPLEMENTATION_HASWELL 0 +#else +#define SIMDJSON_IMPLEMENTATION_HASWELL SIMDJSON_IS_X86_64 +#endif +#endif +#ifdef _MSC_VER +// To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see +// https://github.com/simdjson/simdjson/issues/1247 +#define SIMDJSON_CAN_ALWAYS_RUN_HASWELL ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__)) +#else +#define SIMDJSON_CAN_ALWAYS_RUN_HASWELL ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__)) +#endif + +// Default Westmere to on if this is x86-64. +#ifndef SIMDJSON_IMPLEMENTATION_WESTMERE +#if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL +// if icelake or haswell are always available, never enable westmere. +#define SIMDJSON_IMPLEMENTATION_WESTMERE 0 +#else +#define SIMDJSON_IMPLEMENTATION_WESTMERE SIMDJSON_IS_X86_64 +#endif +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_WESTMERE (SIMDJSON_IMPLEMENTATION_WESTMERE && SIMDJSON_IS_X86_64 && __SSE4_2__ && __PCLMUL__) + +#ifndef SIMDJSON_IMPLEMENTATION_PPC64 +#define SIMDJSON_IMPLEMENTATION_PPC64 (SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX) +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_PPC64 SIMDJSON_IMPLEMENTATION_PPC64 && SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX + +// Default Fallback to on unless a builtin implementation has already been selected. +#ifndef SIMDJSON_IMPLEMENTATION_FALLBACK +#if SIMDJSON_CAN_ALWAYS_RUN_ARM64 || SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL || SIMDJSON_CAN_ALWAYS_RUN_WESTMERE || SIMDJSON_CAN_ALWAYS_RUN_PPC64 +// if anything at all except fallback can always run, then disable fallback. +#define SIMDJSON_IMPLEMENTATION_FALLBACK 0 +#else +#define SIMDJSON_IMPLEMENTATION_FALLBACK 1 +#endif +#endif +#define SIMDJSON_CAN_ALWAYS_RUN_FALLBACK SIMDJSON_IMPLEMENTATION_FALLBACK + +// Determine the best builtin implementation +#ifndef SIMDJSON_BUILTIN_IMPLEMENTATION + +#if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +#define SIMDJSON_BUILTIN_IMPLEMENTATION icelake +#elif SIMDJSON_CAN_ALWAYS_RUN_HASWELL +#define SIMDJSON_BUILTIN_IMPLEMENTATION haswell +#elif SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +#define SIMDJSON_BUILTIN_IMPLEMENTATION westmere +#elif SIMDJSON_CAN_ALWAYS_RUN_ARM64 +#define SIMDJSON_BUILTIN_IMPLEMENTATION arm64 +#elif SIMDJSON_CAN_ALWAYS_RUN_PPC64 +#define SIMDJSON_BUILTIN_IMPLEMENTATION ppc64 +#elif SIMDJSON_CAN_ALWAYS_RUN_FALLBACK +#define SIMDJSON_BUILTIN_IMPLEMENTATION fallback +#else +#error "All possible implementations (including fallback) have been disabled! simdjson will not run." +#endif + +#endif // SIMDJSON_BUILTIN_IMPLEMENTATION + +#define SIMDJSON_BUILTIN_IMPLEMENTATION_ID SIMDJSON_IMPLEMENTATION_ID_FOR(SIMDJSON_BUILTIN_IMPLEMENTATION) +#define SIMDJSON_BUILTIN_IMPLEMENTATION_IS(IMPL) SIMDJSON_BUILTIN_IMPLEMENTATION_ID == SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL) + +#endif // SIMDJSON_IMPLEMENTATION_DETECTION_H +/* end file simdjson/implementation_detection.h */ + +namespace simdjson { +#if SIMDJSON_BUILTIN_IMPLEMENTATION_IS(arm64) + namespace arm64 {} +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(fallback) + namespace fallback {} +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(haswell) + namespace haswell {} +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(icelake) + namespace icelake {} +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(ppc64) + namespace ppc64 {} +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(westmere) + namespace westmere {} +#else +#error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION +#endif + + /** + * Represents the best statically linked simdjson implementation that can be used by the compiling + * program. + * + * Detects what options the program is compiled against, and picks the minimum implementation that + * will work on any computer that can run the program. For example, if you compile with g++ + * -march=westmere, it will pick the westmere implementation. The haswell implementation will + * still be available, and can be selected at runtime, but the builtin implementation (and any + * code that uses it) will use westmere. + */ + namespace builtin = SIMDJSON_BUILTIN_IMPLEMENTATION; +} // namespace simdjson + +#endif // SIMDJSON_BUILTIN_BASE_H +/* end file simdjson/builtin/base.h */ +/* including simdjson/builtin/implementation.h: #include "simdjson/builtin/implementation.h" */ +/* begin file simdjson/builtin/implementation.h */ +#ifndef SIMDJSON_BUILTIN_IMPLEMENTATION_H +#define SIMDJSON_BUILTIN_IMPLEMENTATION_H + +/* skipped duplicate #include "simdjson/builtin/base.h" */ + +/* including simdjson/generic/dependencies.h: #include "simdjson/generic/dependencies.h" */ +/* begin file simdjson/generic/dependencies.h */ +#ifdef SIMDJSON_CONDITIONAL_INCLUDE +#error simdjson/generic/dependencies.h must be included before defining SIMDJSON_CONDITIONAL_INCLUDE! +#endif + +#ifndef SIMDJSON_GENERIC_DEPENDENCIES_H +#define SIMDJSON_GENERIC_DEPENDENCIES_H + +// Internal headers needed for generics. +// All includes referencing simdjson headers *not* under simdjson/generic must be here! +// Otherwise, amalgamation will fail. +/* skipped duplicate #include "simdjson/base.h" */ +/* skipped duplicate #include "simdjson/implementation.h" */ +/* skipped duplicate #include "simdjson/implementation_detection.h" */ +/* including simdjson/internal/instruction_set.h: #include "simdjson/internal/instruction_set.h" */ +/* begin file simdjson/internal/instruction_set.h */ +/* From +https://github.com/endorno/pytorch/blob/master/torch/lib/TH/generic/simd/simd.h +Highly modified. + +Copyright (c) 2016- Facebook, Inc (Adam Paszke) +Copyright (c) 2014- Facebook, Inc (Soumith Chintala) +Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) +Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) +Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) +Copyright (c) 2011-2013 NYU (Clement Farabet) +Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, +Iain Melvin, Jason Weston) Copyright (c) 2006 Idiap Research Institute +(Samy Bengio) Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, +Samy Bengio, Johnny Mariethoz) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories +America and IDIAP Research Institute nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef SIMDJSON_INTERNAL_INSTRUCTION_SET_H +#define SIMDJSON_INTERNAL_INSTRUCTION_SET_H + +namespace simdjson { +namespace internal { + +enum instruction_set { + DEFAULT = 0x0, + NEON = 0x1, + AVX2 = 0x4, + SSE42 = 0x8, + PCLMULQDQ = 0x10, + BMI1 = 0x20, + BMI2 = 0x40, + ALTIVEC = 0x80, + AVX512F = 0x100, + AVX512DQ = 0x200, + AVX512IFMA = 0x400, + AVX512PF = 0x800, + AVX512ER = 0x1000, + AVX512CD = 0x2000, + AVX512BW = 0x4000, + AVX512VL = 0x8000, + AVX512VBMI2 = 0x10000 +}; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_INSTRUCTION_SET_H +/* end file simdjson/internal/instruction_set.h */ +/* skipped duplicate #include "simdjson/internal/dom_parser_implementation.h" */ +/* including simdjson/internal/jsoncharutils_tables.h: #include "simdjson/internal/jsoncharutils_tables.h" */ +/* begin file simdjson/internal/jsoncharutils_tables.h */ +#ifndef SIMDJSON_INTERNAL_JSONCHARUTILS_TABLES_H +#define SIMDJSON_INTERNAL_JSONCHARUTILS_TABLES_H + +/* skipped duplicate #include "simdjson/base.h" */ + +#ifdef JSON_TEST_STRINGS +void found_string(const uint8_t *buf, const uint8_t *parsed_begin, + const uint8_t *parsed_end); +void found_bad_string(const uint8_t *buf); +#endif + +namespace simdjson { +namespace internal { +// structural chars here are +// they are { 0x7b } 0x7d : 0x3a [ 0x5b ] 0x5d , 0x2c (and NULL) +// we are also interested in the four whitespace characters +// space 0x20, linefeed 0x0a, horizontal tab 0x09 and carriage return 0x0d + +extern SIMDJSON_DLLIMPORTEXPORT const bool structural_or_whitespace_negated[256]; +extern SIMDJSON_DLLIMPORTEXPORT const bool structural_or_whitespace[256]; +extern SIMDJSON_DLLIMPORTEXPORT const uint32_t digit_to_val32[886]; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_JSONCHARUTILS_TABLES_H +/* end file simdjson/internal/jsoncharutils_tables.h */ +/* including simdjson/internal/numberparsing_tables.h: #include "simdjson/internal/numberparsing_tables.h" */ +/* begin file simdjson/internal/numberparsing_tables.h */ +#ifndef SIMDJSON_INTERNAL_NUMBERPARSING_TABLES_H +#define SIMDJSON_INTERNAL_NUMBERPARSING_TABLES_H + +/* skipped duplicate #include "simdjson/base.h" */ + +namespace simdjson { +namespace internal { +/** + * The smallest non-zero float (binary64) is 2^-1074. + * We take as input numbers of the form w x 10^q where w < 2^64. + * We have that w * 10^-343 < 2^(64-344) 5^-343 < 2^-1076. + * However, we have that + * (2^64-1) * 10^-342 = (2^64-1) * 2^-342 * 5^-342 > 2^-1074. + * Thus it is possible for a number of the form w * 10^-342 where + * w is a 64-bit value to be a non-zero floating-point number. + ********* + * Any number of form w * 10^309 where w>= 1 is going to be + * infinite in binary64 so we never need to worry about powers + * of 5 greater than 308. + */ +constexpr int smallest_power = -342; +constexpr int largest_power = 308; + +/** + * Represents a 128-bit value. + * low: least significant 64 bits. + * high: most significant 64 bits. + */ +struct value128 { + uint64_t low; + uint64_t high; +}; + + +// Precomputed powers of ten from 10^0 to 10^22. These +// can be represented exactly using the double type. +extern SIMDJSON_DLLIMPORTEXPORT const double power_of_ten[]; + + +/** + * When mapping numbers from decimal to binary, + * we go from w * 10^q to m * 2^p but we have + * 10^q = 5^q * 2^q, so effectively + * we are trying to match + * w * 2^q * 5^q to m * 2^p. Thus the powers of two + * are not a concern since they can be represented + * exactly using the binary notation, only the powers of five + * affect the binary significand. + */ + + +// The truncated powers of five from 5^-342 all the way to 5^308 +// The mantissa is truncated to 128 bits, and +// never rounded up. Uses about 10KB. +extern SIMDJSON_DLLIMPORTEXPORT const uint64_t power_of_five_128[]; +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_NUMBERPARSING_TABLES_H +/* end file simdjson/internal/numberparsing_tables.h */ +/* including simdjson/internal/simdprune_tables.h: #include "simdjson/internal/simdprune_tables.h" */ +/* begin file simdjson/internal/simdprune_tables.h */ +#ifndef SIMDJSON_INTERNAL_SIMDPRUNE_TABLES_H +#define SIMDJSON_INTERNAL_SIMDPRUNE_TABLES_H + +/* skipped duplicate #include "simdjson/base.h" */ + +#include + +namespace simdjson { // table modified and copied from +namespace internal { // http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetTable + +extern SIMDJSON_DLLIMPORTEXPORT const unsigned char BitsSetTable256mul2[256]; + +extern SIMDJSON_DLLIMPORTEXPORT const uint8_t pshufb_combine_table[272]; + +// 256 * 8 bytes = 2kB, easily fits in cache. +extern SIMDJSON_DLLIMPORTEXPORT const uint64_t thintable_epi8[256]; + +} // namespace internal +} // namespace simdjson + +#endif // SIMDJSON_INTERNAL_SIMDPRUNE_TABLES_H +/* end file simdjson/internal/simdprune_tables.h */ + +#endif // SIMDJSON_GENERIC_DEPENDENCIES_H +/* end file simdjson/generic/dependencies.h */ + +/* defining SIMDJSON_CONDITIONAL_INCLUDE */ +#define SIMDJSON_CONDITIONAL_INCLUDE + +#if SIMDJSON_BUILTIN_IMPLEMENTATION_IS(arm64) +/* including simdjson/arm64/implementation.h: #include "simdjson/arm64/implementation.h" */ +/* begin file simdjson/arm64/implementation.h */ +#ifndef SIMDJSON_ARM64_IMPLEMENTATION_H +#define SIMDJSON_ARM64_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation("arm64", "ARM NEON", internal::instruction_set::NEON) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_IMPLEMENTATION_H +/* end file simdjson/arm64/implementation.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(fallback) +/* including simdjson/fallback/implementation.h: #include "simdjson/fallback/implementation.h" */ +/* begin file simdjson/fallback/implementation.h */ +#ifndef SIMDJSON_FALLBACK_IMPLEMENTATION_H +#define SIMDJSON_FALLBACK_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "fallback", + "Generic fallback implementation", + 0 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_IMPLEMENTATION_H +/* end file simdjson/fallback/implementation.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(haswell) +/* including simdjson/haswell/implementation.h: #include "simdjson/haswell/implementation.h" */ +/* begin file simdjson/haswell/implementation.h */ +#ifndef SIMDJSON_HASWELL_IMPLEMENTATION_H +#define SIMDJSON_HASWELL_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_HASWELL +namespace simdjson { +namespace haswell { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "haswell", + "Intel/AMD AVX2", + internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_IMPLEMENTATION_H +/* end file simdjson/haswell/implementation.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(icelake) +/* including simdjson/icelake/implementation.h: #include "simdjson/icelake/implementation.h" */ +/* begin file simdjson/icelake/implementation.h */ +#ifndef SIMDJSON_ICELAKE_IMPLEMENTATION_H +#define SIMDJSON_ICELAKE_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_ICELAKE +namespace simdjson { +namespace icelake { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation( + "icelake", + "Intel/AMD AVX512", + internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 | internal::instruction_set::AVX512F | internal::instruction_set::AVX512DQ | internal::instruction_set::AVX512CD | internal::instruction_set::AVX512BW | internal::instruction_set::AVX512VL | internal::instruction_set::AVX512VBMI2 + ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_IMPLEMENTATION_H +/* end file simdjson/icelake/implementation.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(ppc64) +/* including simdjson/ppc64/implementation.h: #include "simdjson/ppc64/implementation.h" */ +/* begin file simdjson/ppc64/implementation.h */ +#ifndef SIMDJSON_PPC64_IMPLEMENTATION_H +#define SIMDJSON_PPC64_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +/** + * Implementation for ALTIVEC (PPC64). + */ +namespace ppc64 { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() + : simdjson::implementation("ppc64", "PPC64 ALTIVEC", + internal::instruction_set::ALTIVEC) {} + + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, size_t max_length, + std::unique_ptr &dst) + const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, + uint8_t *dst, + size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, + size_t len) const noexcept final; +}; + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_IMPLEMENTATION_H +/* end file simdjson/ppc64/implementation.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(westmere) +/* including simdjson/westmere/implementation.h: #include "simdjson/westmere/implementation.h" */ +/* begin file simdjson/westmere/implementation.h */ +#ifndef SIMDJSON_WESTMERE_IMPLEMENTATION_H +#define SIMDJSON_WESTMERE_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/instruction_set.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +namespace westmere { + +/** + * @private + */ +class implementation final : public simdjson::implementation { +public: + simdjson_inline implementation() : simdjson::implementation("westmere", "Intel/AMD SSE4.2", internal::instruction_set::SSE42 | internal::instruction_set::PCLMULQDQ) {} + simdjson_warn_unused error_code create_dom_parser_implementation( + size_t capacity, + size_t max_length, + std::unique_ptr& dst + ) const noexcept final; + simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final; + simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final; +}; + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_IMPLEMENTATION_H +/* end file simdjson/westmere/implementation.h */ +#else +#error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION +#endif + +/* undefining SIMDJSON_CONDITIONAL_INCLUDE */ +#undef SIMDJSON_CONDITIONAL_INCLUDE + +namespace simdjson { + /** + * Function which returns a pointer to an implementation matching the "builtin" implementation. + * The builtin implementation is the best statically linked simdjson implementation that can be used by the compiling + * program. If you compile with g++ -march=haswell, this will return the haswell implementation. + * It is handy to be able to check what builtin was used: builtin_implementation()->name(). + */ + const implementation * builtin_implementation(); +} // namespace simdjson + +#endif // SIMDJSON_BUILTIN_IMPLEMENTATION_H +/* end file simdjson/builtin/implementation.h */ + +/* skipped duplicate #include "simdjson/generic/dependencies.h" */ + +/* defining SIMDJSON_CONDITIONAL_INCLUDE */ +#define SIMDJSON_CONDITIONAL_INCLUDE + +#if SIMDJSON_BUILTIN_IMPLEMENTATION_IS(arm64) +/* including simdjson/arm64.h: #include "simdjson/arm64.h" */ +/* begin file simdjson/arm64.h */ +#ifndef SIMDJSON_ARM64_H +#define SIMDJSON_ARM64_H + +/* including simdjson/arm64/begin.h: #include "simdjson/arm64/begin.h" */ +/* begin file simdjson/arm64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "arm64" */ +#define SIMDJSON_IMPLEMENTATION arm64 +/* including simdjson/arm64/base.h: #include "simdjson/arm64/base.h" */ +/* begin file simdjson/arm64/base.h */ +#ifndef SIMDJSON_ARM64_BASE_H +#define SIMDJSON_ARM64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for NEON (ARMv8). + */ +namespace arm64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BASE_H +/* end file simdjson/arm64/base.h */ +/* including simdjson/arm64/intrinsics.h: #include "simdjson/arm64/intrinsics.h" */ +/* begin file simdjson/arm64/intrinsics.h */ +#ifndef SIMDJSON_ARM64_INTRINSICS_H +#define SIMDJSON_ARM64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +static_assert(sizeof(uint8x16_t) <= simdjson::SIMDJSON_PADDING, "insufficient padding for arm64"); + +#endif // SIMDJSON_ARM64_INTRINSICS_H +/* end file simdjson/arm64/intrinsics.h */ +/* including simdjson/arm64/bitmanipulation.h: #include "simdjson/arm64/bitmanipulation.h" */ +/* begin file simdjson/arm64/bitmanipulation.h */ +#ifndef SIMDJSON_ARM64_BITMANIPULATION_H +#define SIMDJSON_ARM64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int count_ones(uint64_t input_num) { + return vaddv_u8(vcnt_u8(vcreate_u8(input_num))); +} + + +#if defined(__GNUC__) // catches clang and gcc +/** + * ARM has a fast 64-bit "bit reversal function" that is handy. However, + * it is not generally available as an intrinsic function under Visual + * Studio (though this might be changing). Even under clang/gcc, we + * apparently need to invoke inline assembly. + */ +/* + * We use SIMDJSON_PREFER_REVERSE_BITS as a hint that algorithms that + * work well with bit reversal may use it. + */ +#define SIMDJSON_PREFER_REVERSE_BITS 1 + +/* reverse the bits */ +simdjson_inline uint64_t reverse_bits(uint64_t input_num) { + uint64_t rev_bits; + __asm("rbit %0, %1" : "=r"(rev_bits) : "r"(input_num)); + return rev_bits; +} + +/** + * Flips bit at index 63 - lz. Thus if you have 'leading_zeroes' leading zeroes, + * then this will set to zero the leading bit. It is possible for leading_zeroes to be + * greating or equal to 63 in which case we trigger undefined behavior, but the output + * of such undefined behavior is never used. + **/ +SIMDJSON_NO_SANITIZE_UNDEFINED +simdjson_inline uint64_t zero_leading_bit(uint64_t rev_bits, int leading_zeroes) { + return rev_bits ^ (uint64_t(0x8000000000000000) >> leading_zeroes); +} + +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BITMANIPULATION_H +/* end file simdjson/arm64/bitmanipulation.h */ +/* including simdjson/arm64/bitmask.h: #include "simdjson/arm64/bitmask.h" */ +/* begin file simdjson/arm64/bitmask.h */ +#ifndef SIMDJSON_ARM64_BITMASK_H +#define SIMDJSON_ARM64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + ///////////// + // We could do this with PMULL, but it is apparently slow. + // + //#ifdef __ARM_FEATURE_CRYPTO // some ARM processors lack this extension + //return vmull_p64(-1ULL, bitmask); + //#else + // Analysis by @sebpop: + // When diffing the assembly for src/stage1_find_marks.cpp I see that the eors are all spread out + // in between other vector code, so effectively the extra cycles of the sequence do not matter + // because the GPR units are idle otherwise and the critical path is on the FP side. + // Also the PMULL requires two extra fmovs: GPR->FP (3 cycles in N1, 5 cycles in A72 ) + // and FP->GPR (2 cycles on N1 and 5 cycles on A72.) + /////////// + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif +/* end file simdjson/arm64/bitmask.h */ +/* including simdjson/arm64/numberparsing_defs.h: #include "simdjson/arm64/numberparsing_defs.h" */ +/* begin file simdjson/arm64/numberparsing_defs.h */ +#ifndef SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +#define SIMDJSON_ARM64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if _M_ARM64 +// __umulh requires intrin.h +#include +#endif // _M_ARM64 + +namespace simdjson { +namespace arm64 { +namespace numberparsing { + +// we don't have SSE, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace arm64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +/* end file simdjson/arm64/numberparsing_defs.h */ +/* including simdjson/arm64/simd.h: #include "simdjson/arm64/simd.h" */ +/* begin file simdjson/arm64/simd.h */ +#ifndef SIMDJSON_ARM64_SIMD_H +#define SIMDJSON_ARM64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace simd { + +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO +namespace { +// Start of private section with Visual Studio workaround + + +/** + * make_uint8x16_t initializes a SIMD register (uint8x16_t). + * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} + * is not recognized under Visual Studio! This is a workaround. + * Using a std::initializer_list as a parameter resulted in + * inefficient code. With the current approach, if the parameters are + * compile-time constants, + * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. + * You should not use this function except for compile-time constants: + * it is not efficient. + */ +simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, + uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, + uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { + // Doing a load like so end ups generating worse code. + // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_u8(array); + uint8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_u8(x1, x, 0); + x = vsetq_lane_u8(x2, x, 1); + x = vsetq_lane_u8(x3, x, 2); + x = vsetq_lane_u8(x4, x, 3); + x = vsetq_lane_u8(x5, x, 4); + x = vsetq_lane_u8(x6, x, 5); + x = vsetq_lane_u8(x7, x, 6); + x = vsetq_lane_u8(x8, x, 7); + x = vsetq_lane_u8(x9, x, 8); + x = vsetq_lane_u8(x10, x, 9); + x = vsetq_lane_u8(x11, x, 10); + x = vsetq_lane_u8(x12, x, 11); + x = vsetq_lane_u8(x13, x, 12); + x = vsetq_lane_u8(x14, x, 13); + x = vsetq_lane_u8(x15, x, 14); + x = vsetq_lane_u8(x16, x, 15); + return x; +} + +simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { + uint8x8_t x{}; + x = vset_lane_u8(x1, x, 0); + x = vset_lane_u8(x2, x, 1); + x = vset_lane_u8(x3, x, 2); + x = vset_lane_u8(x4, x, 3); + x = vset_lane_u8(x5, x, 4); + x = vset_lane_u8(x6, x, 5); + x = vset_lane_u8(x7, x, 6); + x = vset_lane_u8(x8, x, 7); + return x; +} + +// We have to do the same work for make_int8x16_t +simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, + int8_t x5, int8_t x6, int8_t x7, int8_t x8, + int8_t x9, int8_t x10, int8_t x11, int8_t x12, + int8_t x13, int8_t x14, int8_t x15, int8_t x16) { + // Doing a load like so end ups generating worse code. + // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_s8(array); + int8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_s8(x1, x, 0); + x = vsetq_lane_s8(x2, x, 1); + x = vsetq_lane_s8(x3, x, 2); + x = vsetq_lane_s8(x4, x, 3); + x = vsetq_lane_s8(x5, x, 4); + x = vsetq_lane_s8(x6, x, 5); + x = vsetq_lane_s8(x7, x, 6); + x = vsetq_lane_s8(x8, x, 7); + x = vsetq_lane_s8(x9, x, 8); + x = vsetq_lane_s8(x10, x, 9); + x = vsetq_lane_s8(x11, x, 10); + x = vsetq_lane_s8(x12, x, 11); + x = vsetq_lane_s8(x13, x, 12); + x = vsetq_lane_s8(x14, x, 13); + x = vsetq_lane_s8(x15, x, 14); + x = vsetq_lane_s8(x16, x, 15); + return x; +} + +// End of private section with Visual Studio workaround +} // namespace +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO + + + template + struct simd8; + + // + // Base class of simd8 and simd8, both of which use uint8x16_t internally. + // + template> + struct base_u8 { + uint8x16_t value; + static const int SIZE = sizeof(value); + + // Conversion from/to SIMD register + simdjson_inline base_u8(const uint8x16_t _value) : value(_value) {} + simdjson_inline operator const uint8x16_t&() const { return this->value; } + simdjson_inline operator uint8x16_t&() { return this->value; } + + // Bit operations + simdjson_inline simd8 operator|(const simd8 other) const { return vorrq_u8(*this, other); } + simdjson_inline simd8 operator&(const simd8 other) const { return vandq_u8(*this, other); } + simdjson_inline simd8 operator^(const simd8 other) const { return veorq_u8(*this, other); } + simdjson_inline simd8 bit_andnot(const simd8 other) const { return vbicq_u8(*this, other); } + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + simdjson_inline simd8& operator|=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline simd8& operator&=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline simd8& operator^=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast ^ other; return *this_cast; } + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return vceqq_u8(lhs, rhs); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_u8(prev_chunk, *this, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base_u8 { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + static simdjson_inline simd8 splat(bool _value) { return vmovq_n_u8(uint8_t(-(!!_value))); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // False constructor + simdjson_inline simd8() : simd8(vdupq_n_u8(0)) {} + // Splat constructor + simdjson_inline simd8(bool _value) : simd8(splat(_value)) {} + + // We return uint32_t instead of uint16_t because that seems to be more efficient for most + // purposes (cutting it down to uint16_t costs performance in some compilers). + simdjson_inline uint32_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); +#else + const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +#endif + auto minput = *this & bit_mask; + uint8x16_t tmp = vpaddq_u8(minput, minput); + tmp = vpaddq_u8(tmp, tmp); + tmp = vpaddq_u8(tmp, tmp); + return vgetq_lane_u16(vreinterpretq_u16_u8(tmp), 0); + } + simdjson_inline bool any() const { return vmaxvq_u8(*this) != 0; } + }; + + // Unsigned bytes + template<> + struct simd8: base_u8 { + static simdjson_inline uint8x16_t splat(uint8_t _value) { return vmovq_n_u8(_value); } + static simdjson_inline uint8x16_t zero() { return vdupq_n_u8(0); } + static simdjson_inline uint8x16_t load(const uint8_t* values) { return vld1q_u8(values); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[16]) : simd8(load(values)) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(make_uint8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(uint8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(uint8_t dst[16]) const { return vst1q_u8(dst, *this); } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return vqaddq_u8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return vqsubq_u8(*this, other); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_u8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_u8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-specific operations + simdjson_inline uint8_t max_val() const { return vmaxvq_u8(*this); } + simdjson_inline uint8_t min_val() const { return vminvq_u8(*this); } + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_u8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_u8(*this, other); } + simdjson_inline simd8 operator<=(const simd8 other) const { return vcleq_u8(*this, other); } + simdjson_inline simd8 operator>=(const simd8 other) const { return vcgeq_u8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_u8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_u8(*this, other); } + // Same as >, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 gt_bits(const simd8 other) const { return simd8(*this > other); } + // Same as <, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 lt_bits(const simd8 other) const { return simd8(*this < other); } + + // Bit-specific operations + simdjson_inline simd8 any_bits_set(simd8 bits) const { return vtstq_u8(*this, bits); } + simdjson_inline bool any_bits_set_anywhere() const { return this->max_val() != 0; } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return (*this & bits).any_bits_set_anywhere(); } + template + simdjson_inline simd8 shr() const { return vshrq_n_u8(*this, N); } + template + simdjson_inline simd8 shl() const { return vshlq_n_u8(*this, N); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint16_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + uint64x2_t shufmask64 = {thintable_epi8[mask1], thintable_epi8[mask2]}; + uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + shufmask = vaddq_u8(shufmask, inc); + // this is the version "nearly pruned" + uint8x16_t pruned = vqtbl1q_u8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + uint8x16_t compactmask = vld1q_u8(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + uint8x16_t answer = vqtbl1q_u8(pruned, compactmask); + vst1q_u8(reinterpret_cast(output), answer); + } + + // Copies all bytes corresponding to a 0 in the low half of the mask (interpreted as a + // bitset) to output1, then those corresponding to a 0 in the high half to output2. + template + simdjson_inline void compress_halves(uint16_t mask, L *output1, L *output2) const { + using internal::thintable_epi8; + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + uint8x8_t compactmask1 = vcreate_u8(thintable_epi8[mask1]); + uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + compactmask2 = vadd_u8(compactmask2, inc); + // store each result (with the second store possibly overlapping the first) + vst1_u8((uint8_t*)output1, vqtbl1_u8(*this, compactmask1)); + vst1_u8((uint8_t*)output2, vqtbl1_u8(*this, compactmask2)); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_u8(*this, simd8(original)); + } + }; + + // Signed bytes + template<> + struct simd8 { + int8x16_t value; + + static simdjson_inline simd8 splat(int8_t _value) { return vmovq_n_s8(_value); } + static simdjson_inline simd8 zero() { return vdupq_n_s8(0); } + static simdjson_inline simd8 load(const int8_t values[16]) { return vld1q_s8(values); } + + // Conversion from/to SIMD register + simdjson_inline simd8(const int8x16_t _value) : value{_value} {} + simdjson_inline operator const int8x16_t&() const { return this->value; } + simdjson_inline operator int8x16_t&() { return this->value; } + + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(make_int8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(int8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(int8_t dst[16]) const { return vst1q_s8(dst, *this); } + + // Explicit conversion to/from unsigned + // + // Under Visual Studio/ARM64 uint8x16_t and int8x16_t are apparently the same type. + // In theory, we could check this occurrence with std::same_as and std::enabled_if but it is C++14 + // and relatively ugly and hard to read. +#ifndef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline explicit simd8(const uint8x16_t other): simd8(vreinterpretq_s8_u8(other)) {} +#endif + simdjson_inline explicit operator simd8() const { return vreinterpretq_u8_s8(this->value); } + + // Math + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_s8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_s8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_s8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_s8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_s8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_s8(*this, other); } + simdjson_inline simd8 operator==(const simd8 other) const { return vceqq_s8(*this, other); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_s8(prev_chunk, *this, 16 - N); + } + + // Perform a lookup assuming no value is larger than 16 + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_s8(*this, simd8(original)); + } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "ARM kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint64_t popcounts = vget_lane_u64(vreinterpret_u64_u8(vcnt_u8(vcreate_u8(~mask))), 0); + // compute the prefix sum of the popcounts of each byte + uint64_t offsets = popcounts * 0x0101010101010101; + this->chunks[0].compress_halves(uint16_t(mask), output, &output[popcounts & 0xFF]); + this->chunks[1].compress_halves(uint16_t(mask >> 16), &output[(offsets >> 8) & 0xFF], &output[(offsets >> 16) & 0xFF]); + this->chunks[2].compress_halves(uint16_t(mask >> 32), &output[(offsets >> 24) & 0xFF], &output[(offsets >> 32) & 0xFF]); + this->chunks[3].compress_halves(uint16_t(mask >> 48), &output[(offsets >> 40) & 0xFF], &output[(offsets >> 48) & 0xFF]); + return offsets >> 56; + } + + simdjson_inline uint64_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t( + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + ); +#else + const uint8x16_t bit_mask = { + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + }; +#endif + // Add each of the elements next to each other, successively, to stuff each 8 byte mask into one. + uint8x16_t sum0 = vpaddq_u8(this->chunks[0] & bit_mask, this->chunks[1] & bit_mask); + uint8x16_t sum1 = vpaddq_u8(this->chunks[2] & bit_mask, this->chunks[3] & bit_mask); + sum0 = vpaddq_u8(sum0, sum1); + sum0 = vpaddq_u8(sum0, sum0); + return vgetq_lane_u64(vreinterpretq_u64_u8(sum0), 0); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_SIMD_H +/* end file simdjson/arm64/simd.h */ +/* including simdjson/arm64/stringparsing_defs.h: #include "simdjson/arm64/stringparsing_defs.h" */ +/* begin file simdjson/arm64/stringparsing_defs.h */ +#ifndef SIMDJSON_ARM64_STRINGPARSING_DEFS_H +#define SIMDJSON_ARM64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on ARM; therefore, we + // smash them together into a 64-byte mask and get the bitmask from there. + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_STRINGPARSING_DEFS_H +/* end file simdjson/arm64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/arm64/begin.h */ +/* including simdjson/generic/amalgamated.h for arm64: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for arm64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for arm64: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for arm64 */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for arm64 */ +/* including simdjson/generic/jsoncharutils.h for arm64: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for arm64 */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for arm64 */ +/* including simdjson/generic/atomparsing.h for arm64: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace arm64 { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for arm64 */ +/* including simdjson/generic/dom_parser_implementation.h for arm64: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for arm64 */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { +namespace arm64 { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for arm64 */ +/* including simdjson/generic/implementation_simdjson_result_base.h for arm64: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for arm64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for arm64 */ +/* including simdjson/generic/numberparsing.h for arm64: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for arm64 */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace arm64 { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for arm64 */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for arm64: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for arm64 */ +/* end file simdjson/generic/amalgamated.h for arm64 */ +/* including simdjson/arm64/end.h: #include "simdjson/arm64/end.h" */ +/* begin file simdjson/arm64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "arm64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/arm64/end.h */ + +#endif // SIMDJSON_ARM64_H +/* end file simdjson/arm64.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(fallback) +/* including simdjson/fallback.h: #include "simdjson/fallback.h" */ +/* begin file simdjson/fallback.h */ +#ifndef SIMDJSON_FALLBACK_H +#define SIMDJSON_FALLBACK_H + +/* including simdjson/fallback/begin.h: #include "simdjson/fallback/begin.h" */ +/* begin file simdjson/fallback/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "fallback" */ +#define SIMDJSON_IMPLEMENTATION fallback +/* including simdjson/fallback/base.h: #include "simdjson/fallback/base.h" */ +/* begin file simdjson/fallback/base.h */ +#ifndef SIMDJSON_FALLBACK_BASE_H +#define SIMDJSON_FALLBACK_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Fallback implementation (runs on any machine). + */ +namespace fallback { + +class implementation; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BASE_H +/* end file simdjson/fallback/base.h */ +/* including simdjson/fallback/bitmanipulation.h: #include "simdjson/fallback/bitmanipulation.h" */ +/* begin file simdjson/fallback/bitmanipulation.h */ +#ifndef SIMDJSON_FALLBACK_BITMANIPULATION_H +#define SIMDJSON_FALLBACK_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +#if defined(_MSC_VER) && !defined(_M_ARM64) && !defined(_M_X64) +static inline unsigned char _BitScanForward64(unsigned long* ret, uint64_t x) { + unsigned long x0 = (unsigned long)x, top, bottom; + _BitScanForward(&top, (unsigned long)(x >> 32)); + _BitScanForward(&bottom, x0); + *ret = x0 ? bottom : 32 + top; + return x != 0; +} +static unsigned char _BitScanReverse64(unsigned long* ret, uint64_t x) { + unsigned long x1 = (unsigned long)(x >> 32), top, bottom; + _BitScanReverse(&top, x1); + _BitScanReverse(&bottom, (unsigned long)x); + *ret = x1 ? top + 32 : bottom; + return x != 0; +} +#endif + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef _MSC_VER + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// _MSC_VER +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BITMANIPULATION_H +/* end file simdjson/fallback/bitmanipulation.h */ +/* including simdjson/fallback/stringparsing_defs.h: #include "simdjson/fallback/stringparsing_defs.h" */ +/* begin file simdjson/fallback/stringparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +#define SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 1; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return c == '"'; } + simdjson_inline bool has_backslash() { return c == '\\'; } + simdjson_inline int quote_index() { return c == '"' ? 0 : 1; } + simdjson_inline int backslash_index() { return c == '\\' ? 0 : 1; } + + uint8_t c; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // store to dest unconditionally - we can overwrite the bits we don't like later + dst[0] = src[0]; + return { src[0] }; +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +/* end file simdjson/fallback/stringparsing_defs.h */ +/* including simdjson/fallback/numberparsing_defs.h: #include "simdjson/fallback/numberparsing_defs.h" */ +/* begin file simdjson/fallback/numberparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +#define SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#ifdef JSON_TEST_NUMBERS // for unit testing +void found_invalid_number(const uint8_t *buf); +void found_integer(int64_t result, const uint8_t *buf); +void found_unsigned_integer(uint64_t result, const uint8_t *buf); +void found_float(double result, const uint8_t *buf); +#endif + +namespace simdjson { +namespace fallback { +namespace numberparsing { + +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const char *chars) { + uint64_t val; + memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + return parse_eight_digits_unrolled(reinterpret_cast(chars)); +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace fallback +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +/* end file simdjson/fallback/numberparsing_defs.h */ +/* end file simdjson/fallback/begin.h */ +/* including simdjson/generic/amalgamated.h for fallback: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for fallback */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for fallback: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for fallback */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for fallback */ +/* including simdjson/generic/jsoncharutils.h for fallback: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for fallback */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for fallback */ +/* including simdjson/generic/atomparsing.h for fallback: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for fallback */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace fallback { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for fallback */ +/* including simdjson/generic/dom_parser_implementation.h for fallback: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for fallback */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace fallback +} // namespace simdjson + +namespace simdjson { +namespace fallback { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for fallback */ +/* including simdjson/generic/implementation_simdjson_result_base.h for fallback: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for fallback */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for fallback */ +/* including simdjson/generic/numberparsing.h for fallback: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for fallback */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace fallback { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for fallback */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for fallback: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for fallback */ +/* end file simdjson/generic/amalgamated.h for fallback */ +/* including simdjson/fallback/end.h: #include "simdjson/fallback/end.h" */ +/* begin file simdjson/fallback/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* undefining SIMDJSON_IMPLEMENTATION from "fallback" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/fallback/end.h */ + +#endif // SIMDJSON_FALLBACK_H +/* end file simdjson/fallback.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(haswell) +/* including simdjson/haswell.h: #include "simdjson/haswell.h" */ +/* begin file simdjson/haswell.h */ +#ifndef SIMDJSON_HASWELL_H +#define SIMDJSON_HASWELL_H + +/* including simdjson/haswell/begin.h: #include "simdjson/haswell/begin.h" */ +/* begin file simdjson/haswell/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "haswell" */ +#define SIMDJSON_IMPLEMENTATION haswell + +/* including simdjson/haswell/base.h: #include "simdjson/haswell/base.h" */ +/* begin file simdjson/haswell/base.h */ +#ifndef SIMDJSON_HASWELL_BASE_H +#define SIMDJSON_HASWELL_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_HASWELL +namespace simdjson { +/** + * Implementation for Haswell (Intel AVX2). + */ +namespace haswell { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BASE_H +/* end file simdjson/haswell/base.h */ +/* including simdjson/haswell/intrinsics.h: #include "simdjson/haswell/intrinsics.h" */ +/* begin file simdjson/haswell/intrinsics.h */ +#ifndef SIMDJSON_HASWELL_INTRINSICS_H +#define SIMDJSON_HASWELL_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m256i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for haswell kernel."); + +#endif // SIMDJSON_HASWELL_INTRINSICS_H +/* end file simdjson/haswell/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_TARGET_REGION("avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/haswell/bitmanipulation.h: #include "simdjson/haswell/bitmanipulation.h" */ +/* begin file simdjson/haswell/bitmanipulation.h */ +#ifndef SIMDJSON_HASWELL_BITMANIPULATION_H +#define SIMDJSON_HASWELL_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmask.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMANIPULATION_H +/* end file simdjson/haswell/bitmanipulation.h */ +/* including simdjson/haswell/bitmask.h: #include "simdjson/haswell/bitmask.h" */ +/* begin file simdjson/haswell/bitmask.h */ +#ifndef SIMDJSON_HASWELL_BITMASK_H +#define SIMDJSON_HASWELL_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMASK_H +/* end file simdjson/haswell/bitmask.h */ +/* including simdjson/haswell/numberparsing_defs.h: #include "simdjson/haswell/numberparsing_defs.h" */ +/* begin file simdjson/haswell/numberparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +#define SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace haswell +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +/* end file simdjson/haswell/numberparsing_defs.h */ +/* including simdjson/haswell/simd.h: #include "simdjson/haswell/simd.h" */ +/* begin file simdjson/haswell/simd.h */ +#ifndef SIMDJSON_HASWELL_SIMD_H +#define SIMDJSON_HASWELL_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m256i value; + + // Zero constructor + simdjson_inline base() : value{__m256i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m256i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m256i&() const { return this->value; } + simdjson_inline operator __m256i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm256_andnot_si256(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m256i _value) : base>(_value) {} + + friend simdjson_really_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm256_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm256_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m256i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm256_testz_si256(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm256_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm256_setzero_si256(); } + static simdjson_inline simd8 load(const T values[32]) { + return _mm256_loadu_si256(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m256i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[32]) const { return _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm256_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm256_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm256_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint32_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in four steps, first 8 bytes and then second 8 bytes... + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // second least significant 8 bits + uint8_t mask3 = uint8_t(mask >> 16); // ... + uint8_t mask4 = uint8_t(mask >> 24); // ... + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m256i shufmask = _mm256_set_epi64x(thintable_epi8[mask4], thintable_epi8[mask3], + thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask and so forth + shufmask = + _mm256_add_epi8(shufmask, _mm256_set_epi32(0x18181818, 0x18181818, + 0x10101010, 0x10101010, 0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m256i pruned = _mm256_shuffle_epi8(*this, shufmask); + // we still need to put the pieces back together. + // we compute the popcount of the first words: + int pop1 = BitsSetTable256mul2[mask1]; + int pop3 = BitsSetTable256mul2[mask3]; + + // then load the corresponding mask + // could be done with _mm256_loadu2_m128i but many standard libraries omit this intrinsic. + __m256i v256 = _mm256_castsi128_si256( + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8))); + __m256i compactmask = _mm256_insertf128_si256(v256, + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop3 * 8)), 1); + __m256i almostthere = _mm256_shuffle_epi8(pruned, compactmask); + // We just need to write out the result. + // This is the tricky bit that is hard to do + // if we want to return a SIMD register, since there + // is no single-instruction approach to recombine + // the two 128-bit lanes with an offset. + __m128i v128; + v128 = _mm256_castsi256_si128(almostthere); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output), v128); + v128 = _mm256_extractf128_si256(almostthere, 1); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output + 16 - count_ones(mask & 0xFFFF)), v128); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm256_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm256_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm256_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm256_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm256_testz_si256(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm256_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm256_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm256_movemask_epi8(_mm256_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 2, "Haswell kernel should use two registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+32)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint32_t mask1 = uint32_t(mask); + uint32_t mask2 = uint32_t(mask >> 32); + this->chunks[0].compress(mask1, output); + this->chunks[1].compress(mask2, output + 32 - count_ones(mask1)); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r_hi = this->chunks[1].to_bitmask(); + return r_lo | (r_hi << 32); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0] | this->chunks[1]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask, + this->chunks[1] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_SIMD_H +/* end file simdjson/haswell/simd.h */ +/* including simdjson/haswell/stringparsing_defs.h: #include "simdjson/haswell/stringparsing_defs.h" */ +/* begin file simdjson/haswell/stringparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +#define SIMDJSON_HASWELL_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast((v == '\\').to_bitmask()), // bs_bits + static_cast((v == '"').to_bitmask()), // quote_bits + }; +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +/* end file simdjson/haswell/stringparsing_defs.h */ +/* end file simdjson/haswell/begin.h */ +/* including simdjson/generic/amalgamated.h for haswell: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for haswell */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for haswell: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for haswell */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for haswell */ +/* including simdjson/generic/jsoncharutils.h for haswell: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for haswell */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for haswell */ +/* including simdjson/generic/atomparsing.h for haswell: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for haswell */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace haswell { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for haswell */ +/* including simdjson/generic/dom_parser_implementation.h for haswell: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for haswell */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace haswell +} // namespace simdjson + +namespace simdjson { +namespace haswell { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for haswell */ +/* including simdjson/generic/implementation_simdjson_result_base.h for haswell: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for haswell */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for haswell */ +/* including simdjson/generic/numberparsing.h for haswell: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for haswell */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace haswell { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for haswell */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for haswell: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for haswell */ +/* end file simdjson/generic/amalgamated.h for haswell */ +/* including simdjson/haswell/end.h: #include "simdjson/haswell/end.h" */ +/* begin file simdjson/haswell/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "haswell" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/haswell/end.h */ + +#endif // SIMDJSON_HASWELL_H +/* end file simdjson/haswell.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(icelake) +/* including simdjson/icelake.h: #include "simdjson/icelake.h" */ +/* begin file simdjson/icelake.h */ +#ifndef SIMDJSON_ICELAKE_H +#define SIMDJSON_ICELAKE_H + +/* including simdjson/icelake/begin.h: #include "simdjson/icelake/begin.h" */ +/* begin file simdjson/icelake/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "icelake" */ +#define SIMDJSON_IMPLEMENTATION icelake +/* including simdjson/icelake/base.h: #include "simdjson/icelake/base.h" */ +/* begin file simdjson/icelake/base.h */ +#ifndef SIMDJSON_ICELAKE_BASE_H +#define SIMDJSON_ICELAKE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_ICELAKE +namespace simdjson { +/** + * Implementation for Icelake (Intel AVX512). + */ +namespace icelake { + +class implementation; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BASE_H +/* end file simdjson/icelake/base.h */ +/* including simdjson/icelake/intrinsics.h: #include "simdjson/icelake/intrinsics.h" */ +/* begin file simdjson/icelake/intrinsics.h */ +#ifndef SIMDJSON_ICELAKE_INTRINSICS_H +#define SIMDJSON_ICELAKE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// Important: we need the AVX-512 headers: +#include +#include +#include +#include +#include +#include +#include +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m512i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for icelake"); + +#endif // SIMDJSON_ICELAKE_INTRINSICS_H +/* end file simdjson/icelake/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_TARGET_REGION("avx512f,avx512dq,avx512cd,avx512bw,avx512vbmi,avx512vbmi2,avx512vl,avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/icelake/bitmanipulation.h: #include "simdjson/icelake/bitmanipulation.h" */ +/* begin file simdjson/icelake/bitmanipulation.h */ +#ifndef SIMDJSON_ICELAKE_BITMANIPULATION_H +#define SIMDJSON_ICELAKE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMANIPULATION_H +/* end file simdjson/icelake/bitmanipulation.h */ +/* including simdjson/icelake/bitmask.h: #include "simdjson/icelake/bitmask.h" */ +/* begin file simdjson/icelake/bitmask.h */ +#ifndef SIMDJSON_ICELAKE_BITMASK_H +#define SIMDJSON_ICELAKE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMASK_H +/* end file simdjson/icelake/bitmask.h */ +/* including simdjson/icelake/simd.h: #include "simdjson/icelake/simd.h" */ +/* begin file simdjson/icelake/simd.h */ +#ifndef SIMDJSON_ICELAKE_SIMD_H +#define SIMDJSON_ICELAKE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if defined(__GNUC__) && !defined(__clang__) +#if __GNUC__ == 8 +#define SIMDJSON_GCC8 1 +#endif // __GNUC__ == 8 +#endif // defined(__GNUC__) && !defined(__clang__) + +#if SIMDJSON_GCC8 +/** + * GCC 8 fails to provide _mm512_set_epi8. We roll our own. + */ +inline __m512i _mm512_set_epi8(uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6, uint8_t a7, uint8_t a8, uint8_t a9, uint8_t a10, uint8_t a11, uint8_t a12, uint8_t a13, uint8_t a14, uint8_t a15, uint8_t a16, uint8_t a17, uint8_t a18, uint8_t a19, uint8_t a20, uint8_t a21, uint8_t a22, uint8_t a23, uint8_t a24, uint8_t a25, uint8_t a26, uint8_t a27, uint8_t a28, uint8_t a29, uint8_t a30, uint8_t a31, uint8_t a32, uint8_t a33, uint8_t a34, uint8_t a35, uint8_t a36, uint8_t a37, uint8_t a38, uint8_t a39, uint8_t a40, uint8_t a41, uint8_t a42, uint8_t a43, uint8_t a44, uint8_t a45, uint8_t a46, uint8_t a47, uint8_t a48, uint8_t a49, uint8_t a50, uint8_t a51, uint8_t a52, uint8_t a53, uint8_t a54, uint8_t a55, uint8_t a56, uint8_t a57, uint8_t a58, uint8_t a59, uint8_t a60, uint8_t a61, uint8_t a62, uint8_t a63) { + return _mm512_set_epi64(uint64_t(a7) + (uint64_t(a6) << 8) + (uint64_t(a5) << 16) + (uint64_t(a4) << 24) + (uint64_t(a3) << 32) + (uint64_t(a2) << 40) + (uint64_t(a1) << 48) + (uint64_t(a0) << 56), + uint64_t(a15) + (uint64_t(a14) << 8) + (uint64_t(a13) << 16) + (uint64_t(a12) << 24) + (uint64_t(a11) << 32) + (uint64_t(a10) << 40) + (uint64_t(a9) << 48) + (uint64_t(a8) << 56), + uint64_t(a23) + (uint64_t(a22) << 8) + (uint64_t(a21) << 16) + (uint64_t(a20) << 24) + (uint64_t(a19) << 32) + (uint64_t(a18) << 40) + (uint64_t(a17) << 48) + (uint64_t(a16) << 56), + uint64_t(a31) + (uint64_t(a30) << 8) + (uint64_t(a29) << 16) + (uint64_t(a28) << 24) + (uint64_t(a27) << 32) + (uint64_t(a26) << 40) + (uint64_t(a25) << 48) + (uint64_t(a24) << 56), + uint64_t(a39) + (uint64_t(a38) << 8) + (uint64_t(a37) << 16) + (uint64_t(a36) << 24) + (uint64_t(a35) << 32) + (uint64_t(a34) << 40) + (uint64_t(a33) << 48) + (uint64_t(a32) << 56), + uint64_t(a47) + (uint64_t(a46) << 8) + (uint64_t(a45) << 16) + (uint64_t(a44) << 24) + (uint64_t(a43) << 32) + (uint64_t(a42) << 40) + (uint64_t(a41) << 48) + (uint64_t(a40) << 56), + uint64_t(a55) + (uint64_t(a54) << 8) + (uint64_t(a53) << 16) + (uint64_t(a52) << 24) + (uint64_t(a51) << 32) + (uint64_t(a50) << 40) + (uint64_t(a49) << 48) + (uint64_t(a48) << 56), + uint64_t(a63) + (uint64_t(a62) << 8) + (uint64_t(a61) << 16) + (uint64_t(a60) << 24) + (uint64_t(a59) << 32) + (uint64_t(a58) << 40) + (uint64_t(a57) << 48) + (uint64_t(a56) << 56)); +} +#endif // SIMDJSON_GCC8 + + + +namespace simdjson { +namespace icelake { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m512i value; + + // Zero constructor + simdjson_inline base() : value{__m512i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m512i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m512i&() const { return this->value; } + simdjson_inline operator __m512i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm512_or_si512(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm512_and_si512(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm512_xor_si512(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm512_andnot_si512(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m512i _value) : base>(_value) {} + + friend simdjson_really_inline uint64_t operator==(const simd8 lhs, const simd8 rhs) { + return _mm512_cmpeq_epi8_mask(lhs, rhs); + } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + // workaround for compilers unable to figure out that 16 - N is a constant (GCC 8) + constexpr int shift = 16 - N; + return _mm512_alignr_epi8(*this, _mm512_permutex2var_epi64(prev_chunk, _mm512_set_epi64(13, 12, 11, 10, 9, 8, 7, 6), *this), shift); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm512_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m512i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + simdjson_inline bool any() const { return !!_mm512_test_epi8_mask (*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm512_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm512_setzero_si512(); } + static simdjson_inline simd8 load(const T values[64]) { + return _mm512_loadu_si512(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m512i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[64]) const { return _mm512_storeu_si512(reinterpret_cast<__m512i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm512_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm512_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm512_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint64_t mask, L * output) const { + _mm512_mask_compressstoreu_epi8 (output,~mask,*this); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31, + int8_t v32, int8_t v33, int8_t v34, int8_t v35, int8_t v36, int8_t v37, int8_t v38, int8_t v39, + int8_t v40, int8_t v41, int8_t v42, int8_t v43, int8_t v44, int8_t v45, int8_t v46, int8_t v47, + int8_t v48, int8_t v49, int8_t v50, int8_t v51, int8_t v52, int8_t v53, int8_t v54, int8_t v55, + int8_t v56, int8_t v57, int8_t v58, int8_t v59, int8_t v60, int8_t v61, int8_t v62, int8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epi8(*this, other); } + + simdjson_inline simd8 operator>(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(*this, other),_mm512_set1_epi8(uint8_t(0x80))); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(other, *this),_mm512_set1_epi8(uint8_t(0x80))); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31, + uint8_t v32, uint8_t v33, uint8_t v34, uint8_t v35, uint8_t v36, uint8_t v37, uint8_t v38, uint8_t v39, + uint8_t v40, uint8_t v41, uint8_t v42, uint8_t v43, uint8_t v44, uint8_t v45, uint8_t v46, uint8_t v47, + uint8_t v48, uint8_t v49, uint8_t v50, uint8_t v51, uint8_t v52, uint8_t v53, uint8_t v54, uint8_t v55, + uint8_t v56, uint8_t v57, uint8_t v58, uint8_t v59, uint8_t v60, uint8_t v61, uint8_t v62, uint8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm512_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm512_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline uint64_t operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline uint64_t operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return _mm512_mask_blend_epi8(*this == uint8_t(0), _mm512_set1_epi8(0), _mm512_set1_epi8(-1)); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + + simdjson_inline bool is_ascii() const { return _mm512_movepi8_mask(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { + return !_mm512_test_epi8_mask(*this, *this); + } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return !_mm512_test_epi8_mask(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm512_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm512_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline uint64_t get_bit() const { return _mm512_movepi8_mask(_mm512_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 1, "Icelake kernel should use one register per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const simd8 chunk0) : chunks{chunk0} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(mask, output); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] == mask; + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return this->chunks[0] == other.chunks[0]; + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] <= mask; + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_SIMD_H +/* end file simdjson/icelake/simd.h */ +/* including simdjson/icelake/stringparsing_defs.h: #include "simdjson/icelake/stringparsing_defs.h" */ +/* begin file simdjson/icelake/stringparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +#define SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 64; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint64_t bs_bits; + uint64_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast(v == '\\'), // bs_bits + static_cast(v == '"'), // quote_bits + }; +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +/* end file simdjson/icelake/stringparsing_defs.h */ +/* including simdjson/icelake/numberparsing_defs.h: #include "simdjson/icelake/numberparsing_defs.h" */ +/* begin file simdjson/icelake/numberparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +#define SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace numberparsing { + +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace icelake +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +/* end file simdjson/icelake/numberparsing_defs.h */ +/* end file simdjson/icelake/begin.h */ +/* including simdjson/generic/amalgamated.h for icelake: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for icelake */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for icelake: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for icelake */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for icelake */ +/* including simdjson/generic/jsoncharutils.h for icelake: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for icelake */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for icelake */ +/* including simdjson/generic/atomparsing.h for icelake: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for icelake */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace icelake { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for icelake */ +/* including simdjson/generic/dom_parser_implementation.h for icelake: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for icelake */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace icelake +} // namespace simdjson + +namespace simdjson { +namespace icelake { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for icelake */ +/* including simdjson/generic/implementation_simdjson_result_base.h for icelake: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for icelake */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for icelake */ +/* including simdjson/generic/numberparsing.h for icelake: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for icelake */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace icelake { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for icelake */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for icelake: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for icelake */ +/* end file simdjson/generic/amalgamated.h for icelake */ +/* including simdjson/icelake/end.h: #include "simdjson/icelake/end.h" */ +/* begin file simdjson/icelake/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "icelake" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/icelake/end.h */ + +#endif // SIMDJSON_ICELAKE_H +/* end file simdjson/icelake.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(ppc64) +/* including simdjson/ppc64.h: #include "simdjson/ppc64.h" */ +/* begin file simdjson/ppc64.h */ +#ifndef SIMDJSON_PPC64_H +#define SIMDJSON_PPC64_H + +/* including simdjson/ppc64/begin.h: #include "simdjson/ppc64/begin.h" */ +/* begin file simdjson/ppc64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "ppc64" */ +#define SIMDJSON_IMPLEMENTATION ppc64 +/* including simdjson/ppc64/base.h: #include "simdjson/ppc64/base.h" */ +/* begin file simdjson/ppc64/base.h */ +#ifndef SIMDJSON_PPC64_BASE_H +#define SIMDJSON_PPC64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for ALTIVEC (PPC64). + */ +namespace ppc64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BASE_H +/* end file simdjson/ppc64/base.h */ +/* including simdjson/ppc64/intrinsics.h: #include "simdjson/ppc64/intrinsics.h" */ +/* begin file simdjson/ppc64/intrinsics.h */ +#ifndef SIMDJSON_PPC64_INTRINSICS_H +#define SIMDJSON_PPC64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +// These are defined by altivec.h in GCC toolchain, it is safe to undef them. +#ifdef bool +#undef bool +#endif + +#ifdef vector +#undef vector +#endif + +static_assert(sizeof(__vector unsigned char) <= simdjson::SIMDJSON_PADDING, "insufficient padding for ppc64"); + +#endif // SIMDJSON_PPC64_INTRINSICS_H +/* end file simdjson/ppc64/intrinsics.h */ +/* including simdjson/ppc64/bitmanipulation.h: #include "simdjson/ppc64/bitmanipulation.h" */ +/* begin file simdjson/ppc64/bitmanipulation.h */ +#ifndef SIMDJSON_PPC64_BITMANIPULATION_H +#define SIMDJSON_PPC64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num - 1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline int count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num); // Visual Studio wants two underscores +} +#else +simdjson_inline int count_ones(uint64_t input_num) { + return __builtin_popcountll(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BITMANIPULATION_H +/* end file simdjson/ppc64/bitmanipulation.h */ +/* including simdjson/ppc64/bitmask.h: #include "simdjson/ppc64/bitmask.h" */ +/* begin file simdjson/ppc64/bitmask.h */ +#ifndef SIMDJSON_PPC64_BITMASK_H +#define SIMDJSON_PPC64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is +// encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + // You can use the version below, however gcc sometimes miscompiles + // vec_pmsum_be, it happens somewhere around between 8 and 9th version. + // The performance boost was not noticeable, falling back to a usual + // implementation. + // __vector unsigned long long all_ones = {~0ull, ~0ull}; + // __vector unsigned long long mask = {bitmask, 0}; + // // Clang and GCC return different values for pmsum for ull so cast it to one. + // // Generally it is not specified by ALTIVEC ISA what is returned by + // // vec_pmsum_be. + // #if defined(__LITTLE_ENDIAN__) + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[0]); + // #else + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[1]); + // #endif + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif +/* end file simdjson/ppc64/bitmask.h */ +/* including simdjson/ppc64/numberparsing_defs.h: #include "simdjson/ppc64/numberparsing_defs.h" */ +/* begin file simdjson/ppc64/numberparsing_defs.h */ +#ifndef SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +#define SIMDJSON_PPC64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if defined(__linux__) +#include +#elif defined(__FreeBSD__) +#include +#endif + +namespace simdjson { +namespace ppc64 { +namespace numberparsing { + +// we don't have appropriate instructions, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); +#ifdef __BIG_ENDIAN__ +#if defined(__linux__) + val = bswap_64(val); +#elif defined(__FreeBSD__) + val = bswap64(val); +#endif +#endif + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace ppc64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +/* end file simdjson/ppc64/numberparsing_defs.h */ +/* including simdjson/ppc64/simd.h: #include "simdjson/ppc64/simd.h" */ +/* begin file simdjson/ppc64/simd.h */ +#ifndef SIMDJSON_PPC64_SIMD_H +#define SIMDJSON_PPC64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +namespace simd { + +using __m128i = __vector unsigned char; + +template struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i &() const { + return this->value; + } + simdjson_inline operator __m128i &() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { + return vec_or(this->value, (__m128i)other); + } + simdjson_inline Child operator&(const Child other) const { + return vec_and(this->value, (__m128i)other); + } + simdjson_inline Child operator^(const Child other) const { + return vec_xor(this->value, (__m128i)other); + } + simdjson_inline Child bit_andnot(const Child other) const { + return vec_andc(this->value, (__m128i)other); + } + simdjson_inline Child &operator|=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast | other; + return *this_cast; + } + simdjson_inline Child &operator&=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast & other; + return *this_cast; + } + simdjson_inline Child &operator^=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast ^ other; + return *this_cast; + } +}; + +template > +struct base8 : base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { + return (__m128i)vec_cmpeq(lhs.value, (__m128i)rhs); + } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(simd8 prev_chunk) const { + __m128i chunk = this->value; +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve(this->value); + prev_chunk = (__m128i)vec_reve((__m128i)prev_chunk); +#endif + chunk = (__m128i)vec_sld((__m128i)prev_chunk, (__m128i)chunk, 16 - N); +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve((__m128i)chunk); +#endif + return chunk; + } +}; + +// SIMD byte mask type (returned by things like eq and gt) +template <> struct simd8 : base8 { + static simdjson_inline simd8 splat(bool _value) { + return (__m128i)vec_splats((unsigned char)(-(!!_value))); + } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) + : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) + : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { + __vector unsigned long long result; + const __m128i perm_mask = {0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40, + 0x38, 0x30, 0x28, 0x20, 0x18, 0x10, 0x08, 0x00}; + + result = ((__vector unsigned long long)vec_vbpermq((__m128i)this->value, + (__m128i)perm_mask)); +#ifdef __LITTLE_ENDIAN__ + return static_cast(result[1]); +#else + return static_cast(result[0]); +#endif + } + simdjson_inline bool any() const { + return !vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline simd8 operator~() const { + return this->value ^ (__m128i)splat(true); + } +}; + +template struct base8_numeric : base8 { + static simdjson_inline simd8 splat(T value) { + (void)value; + return (__m128i)vec_splats(value); + } + static simdjson_inline simd8 zero() { return splat(0); } + static simdjson_inline simd8 load(const T values[16]) { + return (__m128i)(vec_vsx_ld(0, reinterpret_cast(values))); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16(T v0, T v1, T v2, T v3, T v4, + T v5, T v6, T v7, T v8, T v9, + T v10, T v11, T v12, T v13, + T v14, T v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, + v14, v15); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) + : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { + vec_vsx_st(this->value, 0, reinterpret_cast<__m128i *>(dst)); + } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { + return (__m128i)((__m128i)this->value + (__m128i)other); + } + simdjson_inline simd8 operator-(const simd8 other) const { + return (__m128i)((__m128i)this->value - (__m128i)other); + } + simdjson_inline simd8 &operator+=(const simd8 other) { + *this = *this + other; + return *static_cast *>(this); + } + simdjson_inline simd8 &operator-=(const simd8 other) { + *this = *this - other; + return *static_cast *>(this); + } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior + // for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return (__m128i)vec_perm((__m128i)lookup_table, (__m128i)lookup_table, this->value); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted + // as a bitset). Passing a 0 value for mask would be equivalent to writing out + // every byte to output. Only the first 16 - count_ones(mask) bytes of the + // result are significant but 16 bytes get written. Design consideration: it + // seems like a function with the signature simd8 compress(uint32_t mask) + // would be sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L *output) const { + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + using internal::thintable_epi8; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. +#ifdef __LITTLE_ENDIAN__ + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask1], thintable_epi8[mask2]}; +#else + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask2], thintable_epi8[mask1]}; + shufmask = (__m128i)vec_reve((__m128i)shufmask); +#endif + // we increment by 0x08 the second half of the mask + shufmask = ((__m128i)shufmask) + + ((__m128i)(__vector int){0, 0, 0x08080808, 0x08080808}); + + // this is the version "nearly pruned" + __m128i pruned = vec_perm(this->value, this->value, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + vec_vsx_ld(0, reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = vec_perm(pruned, (__m128i)vec_splats(0), compactmask); + vec_vsx_st(answer, 0, reinterpret_cast<__m128i *>(output)); + } + + template + simdjson_inline simd8 + lookup_16(L replace0, L replace1, L replace2, L replace3, L replace4, + L replace5, L replace6, L replace7, L replace8, L replace9, + L replace10, L replace11, L replace12, L replace13, L replace14, + L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, replace4, replace5, replace6, + replace7, replace8, replace9, replace10, replace11, replace12, + replace13, replace14, replace15)); + } +}; + +// Signed bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8(int8_t v0, int8_t v1, int8_t v2, int8_t v3, + int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) + : simd8((__m128i)(__vector signed char){v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, + v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, + int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Order-sensitive comparisons + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return (__m128i)vec_cmpgt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return (__m128i)vec_cmplt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } +}; + +// Unsigned bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline + simd8(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, + uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, + uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15) + : simd8((__m128i){v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, + uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, + uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, + uint8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Saturated math + simdjson_inline simd8 + saturating_add(const simd8 other) const { + return (__m128i)vec_adds(this->value, (__m128i)other); + } + simdjson_inline simd8 + saturating_sub(const simd8 other) const { + return (__m128i)vec_subs(this->value, (__m128i)other); + } + + // Order-specific operations + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max(this->value, (__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min(this->value, (__m128i)other); + } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + gt_bits(const simd8 other) const { + return this->saturating_sub(other); + } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + lt_bits(const simd8 other) const { + return other.saturating_sub(*this); + } + simdjson_inline simd8 + operator<=(const simd8 other) const { + return other.max_val(*this) == other; + } + simdjson_inline simd8 + operator>=(const simd8 other) const { + return other.min_val(*this) == other; + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { + return (__m128i)vec_cmpeq(this->value, (__m128i)vec_splats(uint8_t(0))); + } + simdjson_inline simd8 bits_not_set(simd8 bits) const { + return (*this & bits).bits_not_set(); + } + simdjson_inline simd8 any_bits_set() const { + return ~this->bits_not_set(); + } + simdjson_inline simd8 any_bits_set(simd8 bits) const { + return ~this->bits_not_set(bits); + } + simdjson_inline bool bits_not_set_anywhere() const { + return vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere() const { + return !bits_not_set_anywhere(); + } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { + return vec_all_eq(vec_and(this->value, (__m128i)bits), + (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { + return !bits_not_set_anywhere(bits); + } + template simdjson_inline simd8 shr() const { + return simd8( + (__m128i)vec_sr(this->value, (__m128i)vec_splat_u8(N))); + } + template simdjson_inline simd8 shl() const { + return simd8( + (__m128i)vec_sl(this->value, (__m128i)vec_splat_u8(N))); + } +}; + +template struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, + "PPC64 kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64 &o) = delete; // no copy allowed + simd8x64 & + operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, + const simd8 chunk2, const simd8 chunk3) + : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) + : chunks{simd8::load(ptr), simd8::load(ptr + 16), + simd8::load(ptr + 32), simd8::load(ptr + 48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr + sizeof(simd8) * 0); + this->chunks[1].store(ptr + sizeof(simd8) * 1); + this->chunks[2].store(ptr + sizeof(simd8) * 2); + this->chunks[3].store(ptr + sizeof(simd8) * 3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | + (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T *output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), + output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), + output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), + output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r1 = this->chunks[1].to_bitmask(); + uint64_t r2 = this->chunks[2].to_bitmask(); + uint64_t r3 = this->chunks[3].to_bitmask(); + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] == mask, this->chunks[1] == mask, + this->chunks[2] == mask, this->chunks[3] == mask) + .to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64(this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3]) + .to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] <= mask, this->chunks[1] <= mask, + this->chunks[2] <= mask, this->chunks[3] <= mask) + .to_bitmask(); + } +}; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_SIMD_INPUT_H +/* end file simdjson/ppc64/simd.h */ +/* including simdjson/ppc64/stringparsing_defs.h: #include "simdjson/ppc64/stringparsing_defs.h" */ +/* begin file simdjson/ppc64/stringparsing_defs.h */ +#ifndef SIMDJSON_PPC64_STRINGPARSING_DEFS_H +#define SIMDJSON_PPC64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/simd.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote + copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { + return ((bs_bits - 1) & quote_bits) != 0; + } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { + return trailing_zeroes(quote_bits); + } + simdjson_inline int backslash_index() { + return trailing_zeroes(bs_bits); + } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote +backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), + "backslash and quote finder must process fewer than " + "SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on + // PPC; therefore, we smash them together into a 64-byte mask and get the + // bitmask from there. + uint64_t bs_and_quote = + simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_STRINGPARSING_DEFS_H +/* end file simdjson/ppc64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/ppc64/begin.h */ +/* including simdjson/generic/amalgamated.h for ppc64: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for ppc64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for ppc64: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for ppc64 */ +/* including simdjson/generic/jsoncharutils.h for ppc64: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for ppc64 */ +/* including simdjson/generic/atomparsing.h for ppc64: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for ppc64 */ +/* including simdjson/generic/dom_parser_implementation.h for ppc64: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { +namespace ppc64 { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for ppc64 */ +/* including simdjson/generic/implementation_simdjson_result_base.h for ppc64: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for ppc64 */ +/* including simdjson/generic/numberparsing.h for ppc64: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace ppc64 { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for ppc64 */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for ppc64: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for ppc64 */ +/* end file simdjson/generic/amalgamated.h for ppc64 */ +/* including simdjson/ppc64/end.h: #include "simdjson/ppc64/end.h" */ +/* begin file simdjson/ppc64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "ppc64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/ppc64/end.h */ + +#endif // SIMDJSON_PPC64_H +/* end file simdjson/ppc64.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(westmere) +/* including simdjson/westmere.h: #include "simdjson/westmere.h" */ +/* begin file simdjson/westmere.h */ +#ifndef SIMDJSON_WESTMERE_H +#define SIMDJSON_WESTMERE_H + +/* including simdjson/westmere/begin.h: #include "simdjson/westmere/begin.h" */ +/* begin file simdjson/westmere/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "westmere" */ +#define SIMDJSON_IMPLEMENTATION westmere +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_TARGET_REGION("sse4.2,pclmul,popcnt") +#endif + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/bitmask.h: #include "simdjson/westmere/bitmask.h" */ +/* begin file simdjson/westmere/bitmask.h */ +#ifndef SIMDJSON_WESTMERE_BITMASK_H +#define SIMDJSON_WESTMERE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processing supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMASK_H +/* end file simdjson/westmere/bitmask.h */ +/* including simdjson/westmere/numberparsing_defs.h: #include "simdjson/westmere/numberparsing_defs.h" */ +/* begin file simdjson/westmere/numberparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +#define SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H + +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace westmere +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +/* end file simdjson/westmere/numberparsing_defs.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ +/* including simdjson/westmere/stringparsing_defs.h: #include "simdjson/westmere/stringparsing_defs.h" */ +/* begin file simdjson/westmere/stringparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +#define SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ + +namespace simdjson { +namespace westmere { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + 16); + v0.store(dst); + v1.store(dst + 16); + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +/* end file simdjson/westmere/stringparsing_defs.h */ +/* end file simdjson/westmere/begin.h */ +/* including simdjson/generic/amalgamated.h for westmere: #include "simdjson/generic/amalgamated.h" */ +/* begin file simdjson/generic/amalgamated.h for westmere */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_DEPENDENCIES_H) +#error simdjson/generic/dependencies.h must be included before simdjson/generic/amalgamated.h! +#endif + +/* including simdjson/generic/base.h for westmere: #include "simdjson/generic/base.h" */ +/* begin file simdjson/generic/base.h for westmere */ +#ifndef SIMDJSON_GENERIC_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): // If we haven't got an implementation yet, we're in the editor, editing a generic file! Just */ +/* amalgamation skipped (editor-only): // use the most advanced one we can so the most possible stuff can be tested. */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation_detection.h" */ +/* amalgamation skipped (editor-only): #if SIMDJSON_IMPLEMENTATION_ICELAKE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_HASWELL */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_WESTMERE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_ARM64 */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_PPC64 */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/begin.h" */ +/* amalgamation skipped (editor-only): #elif SIMDJSON_IMPLEMENTATION_FALLBACK */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/begin.h" */ +/* amalgamation skipped (editor-only): #else */ +/* amalgamation skipped (editor-only): #error "All possible implementations (including fallback) have been disabled! simdjson will not run." */ +/* amalgamation skipped (editor-only): #endif */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_IMPLEMENTATION */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +struct open_container; +class dom_parser_implementation; + +/** + * The type of a JSON number + */ +enum class number_type { + floating_point_number=1, /// a binary64 number + signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + unsigned_integer /// a positive integer larger or equal to 1<<63 +}; + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_BASE_H +/* end file simdjson/generic/base.h for westmere */ +/* including simdjson/generic/jsoncharutils.h for westmere: #include "simdjson/generic/jsoncharutils.h" */ +/* begin file simdjson/generic/jsoncharutils.h for westmere */ +#ifndef SIMDJSON_GENERIC_JSONCHARUTILS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_JSONCHARUTILS_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/jsoncharutils_tables.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace jsoncharutils { + +// return non-zero if not a structural or whitespace char +// zero otherwise +simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace_negated[c]; +} + +simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) { + return internal::structural_or_whitespace[c]; +} + +// returns a value with the high 16 bits set if not valid +// otherwise returns the conversion of the 4 hex digits at src into the bottom +// 16 bits of the 32-bit return register +// +// see +// https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/ +static inline uint32_t hex_to_u32_nocheck( + const uint8_t *src) { // strictly speaking, static inline is a C-ism + uint32_t v1 = internal::digit_to_val32[630 + src[0]]; + uint32_t v2 = internal::digit_to_val32[420 + src[1]]; + uint32_t v3 = internal::digit_to_val32[210 + src[2]]; + uint32_t v4 = internal::digit_to_val32[0 + src[3]]; + return v1 | v2 | v3 | v4; +} + +// given a code point cp, writes to c +// the utf-8 code, outputting the length in +// bytes, if the length is zero, the code point +// is invalid +// +// This can possibly be made faster using pdep +// and clz and table lookups, but JSON documents +// have few escaped code points, and the following +// function looks cheap. +// +// Note: we assume that surrogates are treated separately +// +simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) { + if (cp <= 0x7F) { + c[0] = uint8_t(cp); + return 1; // ascii + } + if (cp <= 0x7FF) { + c[0] = uint8_t((cp >> 6) + 192); + c[1] = uint8_t((cp & 63) + 128); + return 2; // universal plane + // Surrogates are treated elsewhere... + //} //else if (0xd800 <= cp && cp <= 0xdfff) { + // return 0; // surrogates // could put assert here + } else if (cp <= 0xFFFF) { + c[0] = uint8_t((cp >> 12) + 224); + c[1] = uint8_t(((cp >> 6) & 63) + 128); + c[2] = uint8_t((cp & 63) + 128); + return 3; + } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this + // is not needed + c[0] = uint8_t((cp >> 18) + 240); + c[1] = uint8_t(((cp >> 12) & 63) + 128); + c[2] = uint8_t(((cp >> 6) & 63) + 128); + c[3] = uint8_t((cp & 63) + 128); + return 4; + } + // will return 0 when the code point was too large. + return 0; // bad r +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +} // namespace jsoncharutils +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_JSONCHARUTILS_H +/* end file simdjson/generic/jsoncharutils.h for westmere */ +/* including simdjson/generic/atomparsing.h for westmere: #include "simdjson/generic/atomparsing.h" */ +/* begin file simdjson/generic/atomparsing.h for westmere */ +#ifndef SIMDJSON_GENERIC_ATOMPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ATOMPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace westmere { +namespace { +/// @private +namespace atomparsing { + +// The string_to_uint32 is exclusively used to map literal strings to 32-bit values. +// We use memcpy instead of a pointer cast to avoid undefined behaviors since we cannot +// be certain that the character pointer will be properly aligned. +// You might think that using memcpy makes this function expensive, but you'd be wrong. +// All decent optimizing compilers (GCC, clang, Visual Studio) will compile string_to_uint32("false"); +// to the compile-time constant 1936482662. +simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; } + + +// Again in str4ncmp we use a memcpy to avoid undefined behavior. The memcpy may appear expensive. +// Yet all decent optimizing compilers will compile memcpy to a single instruction, just about. +simdjson_warn_unused +simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) { + uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++) + static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes"); + std::memcpy(&srcval, src, sizeof(uint32_t)); + return srcval ^ string_to_uint32(atom); +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src) { + return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_true_atom(src); } + else if (len == 4) { return !str4ncmp(src, "true"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src) { + return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) { + if (len > 5) { return is_valid_false_atom(src); } + else if (len == 5) { return !str4ncmp(src+1, "alse"); } + else { return false; } +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src) { + return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0; +} + +simdjson_warn_unused +simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) { + if (len > 4) { return is_valid_null_atom(src); } + else if (len == 4) { return !str4ncmp(src, "null"); } + else { return false; } +} + +} // namespace atomparsing +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ATOMPARSING_H +/* end file simdjson/generic/atomparsing.h for westmere */ +/* including simdjson/generic/dom_parser_implementation.h for westmere: #include "simdjson/generic/dom_parser_implementation.h" */ +/* begin file simdjson/generic/dom_parser_implementation.h for westmere */ +#ifndef SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +// expectation: sizeof(open_container) = 64/8. +struct open_container { + uint32_t tape_index; // where, on the tape, does the scope ([,{) begins + uint32_t count; // how many elements in the scope +}; // struct open_container + +static_assert(sizeof(open_container) == 64/8, "Open container must be 64 bits"); + +class dom_parser_implementation final : public internal::dom_parser_implementation { +public: + /** Tape location of each open { or [ */ + std::unique_ptr open_containers{}; + /** Whether each open container is a [ or { */ + std::unique_ptr is_array{}; + /** Buffer passed to stage 1 */ + const uint8_t *buf{}; + /** Length passed to stage 1 */ + size_t len{0}; + /** Document passed to stage 2 */ + dom::document *doc{}; + + inline dom_parser_implementation() noexcept; + inline dom_parser_implementation(dom_parser_implementation &&other) noexcept; + inline dom_parser_implementation &operator=(dom_parser_implementation &&other) noexcept; + dom_parser_implementation(const dom_parser_implementation &) = delete; + dom_parser_implementation &operator=(const dom_parser_implementation &) = delete; + + simdjson_warn_unused error_code parse(const uint8_t *buf, size_t len, dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage1(const uint8_t *buf, size_t len, stage1_mode partial) noexcept final; + simdjson_warn_unused error_code stage2(dom::document &doc) noexcept final; + simdjson_warn_unused error_code stage2_next(dom::document &doc) noexcept final; + simdjson_warn_unused uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) const noexcept final; + simdjson_warn_unused uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) const noexcept final; + inline simdjson_warn_unused error_code set_capacity(size_t capacity) noexcept final; + inline simdjson_warn_unused error_code set_max_depth(size_t max_depth) noexcept final; +private: + simdjson_inline simdjson_warn_unused error_code set_capacity_stage1(size_t capacity); + +}; + +} // namespace westmere +} // namespace simdjson + +namespace simdjson { +namespace westmere { + +inline dom_parser_implementation::dom_parser_implementation() noexcept = default; +inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default; +inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default; + +// Leaving these here so they can be inlined if so desired +inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept { + if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; } + // Stage 1 index output + size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7; + structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] ); + if (!structural_indexes) { _capacity = 0; return MEMALLOC; } + structural_indexes[0] = 0; + n_structural_indexes = 0; + + _capacity = capacity; + return SUCCESS; +} + +inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept { + // Stage 2 stacks + open_containers.reset(new (std::nothrow) open_container[max_depth]); + is_array.reset(new (std::nothrow) bool[max_depth]); + if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; } + + _max_depth = max_depth; + return SUCCESS; +} + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_DOM_PARSER_IMPLEMENTATION_H +/* end file simdjson/generic/dom_parser_implementation.h for westmere */ +/* including simdjson/generic/implementation_simdjson_result_base.h for westmere: #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base.h for westmere */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair +// so we can avoid inlining errors +// TODO reconcile these! +/** + * The result of a simdjson operation that could fail. + * + * Gives the option of reading error codes, or throwing an exception by casting to the desired result. + * + * This is a base class for implementations that want to add functions to the result type for + * chaining. + * + * Override like: + * + * struct simdjson_result : public internal::implementation_simdjson_result_base { + * simdjson_result() noexcept : internal::implementation_simdjson_result_base() {} + * simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base(error) {} + * simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base(std::forward(value)) {} + * simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base(value, error) {} + * // Your extra methods here + * } + * + * Then any method returning simdjson_result will be chainable with your methods. + */ +template +struct implementation_simdjson_result_base { + + /** + * Create a new empty result with error = UNINITIALIZED. + */ + simdjson_inline implementation_simdjson_result_base() noexcept = default; + + /** + * Create a new error result. + */ + simdjson_inline implementation_simdjson_result_base(error_code error) noexcept; + + /** + * Create a new successful result. + */ + simdjson_inline implementation_simdjson_result_base(T &&value) noexcept; + + /** + * Create a new result with both things (use if you don't want to branch when creating the result). + */ + simdjson_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept; + + /** + * Move the value and the error to the provided variables. + * + * @param value The variable to assign the value to. May not be set if there is an error. + * @param error The variable to assign the error to. Set to SUCCESS if there is no error. + */ + simdjson_inline void tie(T &value, error_code &error) && noexcept; + + /** + * Move the value to the provided variable. + * + * @param value The variable to assign the value to. May not be set if there is an error. + */ + simdjson_inline error_code get(T &value) && noexcept; + + /** + * The error. + */ + simdjson_inline error_code error() const noexcept; + +#if SIMDJSON_EXCEPTIONS + + /** + * Get the result value. + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T& value() & noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& value() && noexcept(false); + + /** + * Take the result value (move it). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline T&& take_value() && noexcept(false); + + /** + * Cast to the value (will throw on error). + * + * @throw simdjson_error if there was an error. + */ + simdjson_inline operator T&&() && noexcept(false); + + +#endif // SIMDJSON_EXCEPTIONS + + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline const T& value_unsafe() const& noexcept; + /** + * Get the result value. This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T& value_unsafe() & noexcept; + /** + * Take the result value (move it). This function is safe if and only + * the error() method returns a value that evaluates to false. + */ + simdjson_inline T&& value_unsafe() && noexcept; +protected: + /** users should never directly access first and second. **/ + T first{}; /** Users should never directly access 'first'. **/ + error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/ +}; // struct implementation_simdjson_result_base + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H +/* end file simdjson/generic/implementation_simdjson_result_base.h for westmere */ +/* including simdjson/generic/numberparsing.h for westmere: #include "simdjson/generic/numberparsing.h" */ +/* begin file simdjson/generic/numberparsing.h for westmere */ +#ifndef SIMDJSON_GENERIC_NUMBERPARSING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_NUMBERPARSING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/jsoncharutils.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include +#include + +namespace simdjson { +namespace westmere { +namespace numberparsing { + +#ifdef JSON_TEST_NUMBERS +#define INVALID_NUMBER(SRC) (found_invalid_number((SRC)), NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (found_integer((VALUE), (SRC)), (WRITER).append_s64((VALUE))) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (found_unsigned_integer((VALUE), (SRC)), (WRITER).append_u64((VALUE))) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (found_float((VALUE), (SRC)), (WRITER).append_double((VALUE))) +#else +#define INVALID_NUMBER(SRC) (NUMBER_ERROR) +#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE)) +#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE)) +#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE)) +#endif + +namespace { + +// Convert a mantissa, an exponent and a sign bit into an ieee64 double. +// The real_exponent needs to be in [0, 2046] (technically real_exponent = 2047 would be acceptable). +// The mantissa should be in [0,1<<53). The bit at index (1ULL << 52) while be zeroed. +simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) { + double d; + mantissa &= ~(1ULL << 52); + mantissa |= real_exponent << 52; + mantissa |= ((static_cast(negative)) << 63); + std::memcpy(&d, &mantissa, sizeof(d)); + return d; +} + +// Attempts to compute i * 10^(power) exactly; and if "negative" is +// true, negate the result. +// This function will only work in some cases, when it does not work, success is +// set to false. This should work *most of the time* (like 99% of the time). +// We assume that power is in the [smallest_power, +// largest_power] interval: the caller is responsible for this check. +simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) { + // we start with a fast path + // It was described in + // Clinger WD. How to read floating point numbers accurately. + // ACM SIGPLAN Notices. 1990 +#ifndef FLT_EVAL_METHOD +#error "FLT_EVAL_METHOD should be defined, please include cfloat." +#endif +#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0) + // We cannot be certain that x/y is rounded to nearest. + if (0 <= power && power <= 22 && i <= 9007199254740991) +#else + if (-22 <= power && power <= 22 && i <= 9007199254740991) +#endif + { + // convert the integer into a double. This is lossless since + // 0 <= i <= 2^53 - 1. + d = double(i); + // + // The general idea is as follows. + // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then + // 1) Both s and p can be represented exactly as 64-bit floating-point + // values + // (binary64). + // 2) Because s and p can be represented exactly as floating-point values, + // then s * p + // and s / p will produce correctly rounded values. + // + if (power < 0) { + d = d / simdjson::internal::power_of_ten[-power]; + } else { + d = d * simdjson::internal::power_of_ten[power]; + } + if (negative) { + d = -d; + } + return true; + } + // When 22 < power && power < 22 + 16, we could + // hope for another, secondary fast path. It was + // described by David M. Gay in "Correctly rounded + // binary-decimal and decimal-binary conversions." (1990) + // If you need to compute i * 10^(22 + x) for x < 16, + // first compute i * 10^x, if you know that result is exact + // (e.g., when i * 10^x < 2^53), + // then you can still proceed and do (i * 10^x) * 10^22. + // Is this worth your time? + // You need 22 < power *and* power < 22 + 16 *and* (i * 10^(x-22) < 2^53) + // for this second fast path to work. + // If you you have 22 < power *and* power < 22 + 16, and then you + // optimistically compute "i * 10^(x-22)", there is still a chance that you + // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of + // this optimization maybe less common than we would like. Source: + // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html + + // The fast path has now failed, so we are failing back on the slower path. + + // In the slow path, we need to adjust i so that it is > 1<<63 which is always + // possible, except if i == 0, so we handle i == 0 separately. + if(i == 0) { + d = negative ? -0.0 : 0.0; + return true; + } + + + // The exponent is 1024 + 63 + power + // + floor(log(5**power)/log(2)). + // The 1024 comes from the ieee64 standard. + // The 63 comes from the fact that we use a 64-bit word. + // + // Computing floor(log(5**power)/log(2)) could be + // slow. Instead we use a fast function. + // + // For power in (-400,350), we have that + // (((152170 + 65536) * power ) >> 16); + // is equal to + // floor(log(5**power)/log(2)) + power when power >= 0 + // and it is equal to + // ceil(log(5**-power)/log(2)) + power when power < 0 + // + // The 65536 is (1<<16) and corresponds to + // (65536 * power) >> 16 ---> power + // + // ((152170 * power ) >> 16) is equal to + // floor(log(5**power)/log(2)) + // + // Note that this is not magic: 152170/(1<<16) is + // approximatively equal to log(5)/log(2). + // The 1<<16 value is a power of two; we could use a + // larger power of 2 if we wanted to. + // + int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63; + + + // We want the most significant bit of i to be 1. Shift if needed. + int lz = leading_zeroes(i); + i <<= lz; + + + // We are going to need to do some 64-bit arithmetic to get a precise product. + // We use a table lookup approach. + // It is safe because + // power >= smallest_power + // and power <= largest_power + // We recover the mantissa of the power, it has a leading 1. It is always + // rounded down. + // + // We want the most significant 64 bits of the product. We know + // this will be non-zero because the most significant bit of i is + // 1. + const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power); + // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.) + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]); + // Both i and power_of_five_128[index] have their most significant bit set to 1 which + // implies that the either the most or the second most significant bit of the product + // is 1. We pack values in this manner for efficiency reasons: it maximizes the use + // we make of the product. It also makes it easy to reason about the product: there + // is 0 or 1 leading zero in the product. + + // Unless the least significant 9 bits of the high (64-bit) part of the full + // product are all 1s, then we know that the most significant 55 bits are + // exact and no further work is needed. Having 55 bits is necessary because + // we need 53 bits for the mantissa but we have to have one rounding bit and + // we can waste a bit if the most significant bit of the product is zero. + if((firstproduct.high & 0x1FF) == 0x1FF) { + // We want to compute i * 5^q, but only care about the top 55 bits at most. + // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing + // the full computation is wasteful. So we do what is called a "truncated + // multiplication". + // We take the most significant 64-bits, and we put them in + // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q + // to the desired approximation using one multiplication. Sometimes it does not suffice. + // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and + // then we get a better approximation to i * 5^q. + // + // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat + // more complicated. + // + // There is an extra layer of complexity in that we need more than 55 bits of + // accuracy in the round-to-even scenario. + // + // The full_multiplication function computes the 128-bit product of two 64-bit words + // with a returned value of type value128 with a "low component" corresponding to the + // 64-bit least significant bits of the product and with a "high component" corresponding + // to the 64-bit most significant bits of the product. + simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]); + firstproduct.low += secondproduct.high; + if(secondproduct.high > firstproduct.low) { firstproduct.high++; } + // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without + // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product + // is sufficiently accurate, and more computation is not needed. + } + uint64_t lower = firstproduct.low; + uint64_t upper = firstproduct.high; + // The final mantissa should be 53 bits with a leading 1. + // We shift it so that it occupies 54 bits with a leading 1. + /////// + uint64_t upperbit = upper >> 63; + uint64_t mantissa = upper >> (upperbit + 9); + lz += int(1 ^ upperbit); + + // Here we have mantissa < (1<<54). + int64_t real_exponent = exponent - lz; + if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal? + // Here have that real_exponent <= 0 so -real_exponent >= 0 + if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure. + d = negative ? -0.0 : 0.0; + return true; + } + // next line is safe because -real_exponent + 1 < 0 + mantissa >>= -real_exponent + 1; + // Thankfully, we can't have both "round-to-even" and subnormals because + // "round-to-even" only occurs for powers close to 0. + mantissa += (mantissa & 1); // round up + mantissa >>= 1; + // There is a weird scenario where we don't have a subnormal but just. + // Suppose we start with 2.2250738585072013e-308, we end up + // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal + // whereas 0x40000000000000 x 2^-1023-53 is normal. Now, we need to round + // up 0x3fffffffffffff x 2^-1023-53 and once we do, we are no longer + // subnormal, but we can only know this after rounding. + // So we only declare a subnormal if we are smaller than the threshold. + real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1; + d = to_double(mantissa, real_exponent, negative); + return true; + } + // We have to round to even. The "to even" part + // is only a problem when we are right in between two floats + // which we guard against. + // If we have lots of trailing zeros, we may fall right between two + // floating-point values. + // + // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54] + // times a power of two. That is, it is right between a number with binary significand + // m and another number with binary significand m+1; and it must be the case + // that it cannot be represented by a float itself. + // + // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p. + // Recall that 10^q = 5^q * 2^q. + // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that + // 5^23 <= 2^54 and it is the last power of five to qualify, so q <= 23. + // When q<0, we have w >= (2m+1) x 5^{-q}. We must have that w<2^{64} so + // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have + // 2^{53} x 5^{-q} < 2^{64}. + // Hence we have 5^{-q} < 2^{11}$ or q>= -4. + // + // We require lower <= 1 and not lower == 0 because we could not prove that + // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test. + if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) { + if((mantissa << (upperbit + 64 - 53 - 2)) == upper) { + mantissa &= ~1; // flip it so that we do not round up + } + } + + mantissa += mantissa & 1; + mantissa >>= 1; + + // Here we have mantissa < (1<<53), unless there was an overflow + if (mantissa >= (1ULL << 53)) { + ////////// + // This will happen when parsing values such as 7.2057594037927933e+16 + //////// + mantissa = (1ULL << 52); + real_exponent++; + } + mantissa &= ~(1ULL << 52); + // we have to check that real_exponent is in range, otherwise we bail out + if (simdjson_unlikely(real_exponent > 2046)) { + // We have an infinite value!!! We could actually throw an error here if we could. + return false; + } + d = to_double(mantissa, real_exponent, negative); + return true; +} + +// We call a fallback floating-point parser that might be slow. Note +// it will accept JSON numbers, but the JSON spec. is more restrictive so +// before you call parse_float_fallback, you need to have validated the input +// string with the JSON grammar. +// It will return an error (false) if the parsed number is infinite. +// The string parsing itself always succeeds. We know that there is at least +// one digit. +static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +static bool parse_float_fallback(const uint8_t *ptr, const uint8_t *end_ptr, double *outDouble) { + *outDouble = simdjson::internal::from_chars(reinterpret_cast(ptr), reinterpret_cast(end_ptr)); + // We do not accept infinite values. + + // Detecting finite values in a portable manner is ridiculously hard, ideally + // we would want to do: + // return !std::isfinite(*outDouble); + // but that mysteriously fails under legacy/old libc++ libraries, see + // https://github.com/simdjson/simdjson/issues/1286 + // + // Therefore, fall back to this solution (the extra parens are there + // to handle that max may be a macro on windows). + return !(*outDouble > (std::numeric_limits::max)() || *outDouble < std::numeric_limits::lowest()); +} + +// check quickly whether the next 8 chars are made of digits +// at a glance, it looks better than Mula's +// http://0x80.pl/articles/swar-digits-validate.html +simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) { + uint64_t val; + // this can read up to 7 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7"); + std::memcpy(&val, chars, 8); + // a branchy method might be faster: + // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030) + // && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) == + // 0x3030303030303030); + return (((val & 0xF0F0F0F0F0F0F0F0) | + (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == + 0x3333333333333333); +} + +template +SIMDJSON_NO_SANITIZE_UNDEFINED // We deliberately allow overflow here and check later +simdjson_inline bool parse_digit(const uint8_t c, I &i) { + const uint8_t digit = static_cast(c - '0'); + if (digit > 9) { + return false; + } + // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication + i = 10 * i + digit; // might overflow, we will handle the overflow later + return true; +} + +simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) { + // we continue with the fiction that we have an integer. If the + // floating point number is representable as x * 10^z for some integer + // z that fits in 53 bits, then we will be able to convert back the + // the integer into a float in a lossless manner. + const uint8_t *const first_after_period = p; + +#ifdef SIMDJSON_SWAR_NUMBER_PARSING +#if SIMDJSON_SWAR_NUMBER_PARSING + // this helps if we have lots of decimals! + // this turns out to be frequent enough. + if (is_made_of_eight_digits_fast(p)) { + i = i * 100000000 + parse_eight_digits_unrolled(p); + p += 8; + } +#endif // SIMDJSON_SWAR_NUMBER_PARSING +#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING + // Unrolling the first digit makes a small difference on some implementations (e.g. westmere) + if (parse_digit(*p, i)) { ++p; } + while (parse_digit(*p, i)) { p++; } + exponent = first_after_period - p; + // Decimal without digits (123.) is illegal + if (exponent == 0) { + return INVALID_NUMBER(src); + } + return SUCCESS; +} + +simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) { + // Exp Sign: -123.456e[-]78 + bool neg_exp = ('-' == *p); + if (neg_exp || '+' == *p) { p++; } // Skip + as well + + // Exponent: -123.456e-[78] + auto start_exp = p; + int64_t exp_number = 0; + while (parse_digit(*p, exp_number)) { ++p; } + // It is possible for parse_digit to overflow. + // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN. + // Thus we *must* check for possible overflow before we negate exp_number. + + // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into + // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may + // not oblige and may, in fact, generate two distinct paths in any case. It might be + // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off + // instructions for a simdjson_likely branch, an unconclusive gain. + + // If there were no digits, it's an error. + if (simdjson_unlikely(p == start_exp)) { + return INVALID_NUMBER(src); + } + // We have a valid positive exponent in exp_number at this point, except that + // it may have overflowed. + + // If there were more than 18 digits, we may have overflowed the integer. We have to do + // something!!!! + if (simdjson_unlikely(p > start_exp+18)) { + // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow + while (*start_exp == '0') { start_exp++; } + // 19 digits could overflow int64_t and is kind of absurd anyway. We don't + // support exponents smaller than -999,999,999,999,999,999 and bigger + // than 999,999,999,999,999,999. + // We can truncate. + // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before + // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could + // truncate at 324. + // Note that there is no reason to fail per se at this point in time. + // E.g., 0e999999999999999999999 is a fine number. + if (p > start_exp+18) { exp_number = 999999999999999999; } + } + // At this point, we know that exp_number is a sane, positive, signed integer. + // It is <= 999,999,999,999,999,999. As long as 'exponent' is in + // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent' + // is bounded in magnitude by the size of the JSON input, we are fine in this universe. + // To sum it up: the next line should never overflow. + exponent += (neg_exp ? -exp_number : exp_number); + return SUCCESS; +} + +simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) { + // It is possible that the integer had an overflow. + // We have to handle the case where we have 0.0000somenumber. + const uint8_t *start = start_digits; + while ((*start == '0') || (*start == '.')) { ++start; } + // we over-decrement by one when there is a '.' + return digit_count - size_t(start - start_digits); +} + +} // unnamed namespace + +/** @private */ +template +error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) { + double d; + if (parse_float_fallback(src, &d)) { + writer.append_double(d); + return SUCCESS; + } + return INVALID_NUMBER(src); +} + +/** @private */ +template +simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) { + // If we frequently had to deal with long strings of digits, + // we could extend our code by using a 128-bit integer instead + // of a 64-bit integer. However, this is uncommon in practice. + // + // 9999999999999999999 < 2**64 so we can accommodate 19 digits. + // If we have a decimal separator, then digit_count - 1 is the number of digits, but we + // may not have a decimal separator! + if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) { + // Ok, chances are good that we had an overflow! + // this is almost never going to get called!!! + // we start anew, going slowly!!! + // This will happen in the following examples: + // 10000000000000000000000000000000000000000000e+308 + // 3.1415926535897932384626433832795028841971693993751 + // + // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens + // because slow_float_parsing is a non-inlined function. If we passed our writer reference to + // it, it would force it to be stored in memory, preventing the compiler from picking it apart + // and putting into registers. i.e. if we pass it as reference, it gets slow. + // This is what forces the skip_double, as well. + error_code error = slow_float_parsing(src, writer); + writer.skip_double(); + return error; + } + // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other + // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331 + // To future reader: we'd love if someone found a better way, or at least could explain this result! + if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) { + // + // Important: smallest_power is such that it leads to a zero value. + // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero + // so something x 10^-343 goes to zero, but not so with something x 10^-342. + static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough"); + // + if((exponent < simdjson::internal::smallest_power) || (i == 0)) { + // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero + WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer); + return SUCCESS; + } else { // (exponent > largest_power) and (i != 0) + // We have, for sure, an infinite value and simdjson refuses to parse infinite values. + return INVALID_NUMBER(src); + } + } + double d; + if (!compute_float_64(exponent, i, negative, d)) { + // we are almost never going to get here. + if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); } + } + WRITE_DOUBLE(d, src, writer); + return SUCCESS; +} + +// for performance analysis, it is sometimes useful to skip parsing +#ifdef SIMDJSON_SKIPNUMBERPARSING + +template +simdjson_inline error_code parse_number(const uint8_t *const, W &writer) { + writer.append_s64(0); // always write zero + return SUCCESS; // always succeeds +} + +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * const src) noexcept { return 0; } +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { return false; } +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { return number_type::signed_integer; } +#else + +// parse the number at src +// define JSON_TEST_NUMBERS for unit testing +// +// It is assumed that the number is followed by a structural ({,},],[) character +// or a white space character. If that is not the case (e.g., when the JSON +// document is made of a single number), then it is necessary to copy the +// content and append a space before calling this function. +// +// Our objective is accurate parsing (ULP of 0) at high speed. +template +simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) { + + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); } + + // + // Handle floats if there is a . or e (or both) + // + int64_t exponent = 0; + bool is_float = false; + if ('.' == *p) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) ); + digit_count = int(p - start_digits); // used later to guard against overflows + } + if (('e' == *p) || ('E' == *p)) { + is_float = true; + ++p; + SIMDJSON_TRY( parse_exponent(src, p, exponent) ); + } + if (is_float) { + const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p); + SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) ); + if (dirty_end) { return INVALID_NUMBER(src); } + return SUCCESS; + } + + // The longest negative 64-bit number is 19 digits. + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + size_t longest_digit_count = negative ? 19 : 20; + if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); } + if (digit_count == longest_digit_count) { + if (negative) { + // Anything negative above INT64_MAX+1 is invalid + if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src); } + WRITE_INTEGER(~i+1, src, writer); + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + } else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); } + } + + // Write unsigned if it doesn't fit in a signed integer. + if (i > uint64_t(INT64_MAX)) { + WRITE_UNSIGNED(i, src, writer); + } else { + WRITE_INTEGER(negative ? (~i+1) : i, src, writer); + } + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); } + return SUCCESS; +} + +// Inlineable functions +namespace { + +// This table can be used to characterize the final character of an integer +// string. For JSON structural character and allowable white space characters, +// we return SUCCESS. For 'e', '.' and 'E', we return INCORRECT_TYPE. Otherwise +// we return NUMBER_ERROR. +// Optimization note: we could easily reduce the size of the table by half (to 128) +// at the cost of an extra branch. +// Optimization note: we want the values to use at most 8 bits (not, e.g., 32 bits): +static_assert(error_code(uint8_t(NUMBER_ERROR))== NUMBER_ERROR, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(SUCCESS))== SUCCESS, "bad NUMBER_ERROR cast"); +static_assert(error_code(uint8_t(INCORRECT_TYPE))== INCORRECT_TYPE, "bad NUMBER_ERROR cast"); + +const uint8_t integer_string_finisher[256] = { + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, INCORRECT_TYPE, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, SUCCESS, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, INCORRECT_TYPE, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, SUCCESS, NUMBER_ERROR, + SUCCESS, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, NUMBER_ERROR, + NUMBER_ERROR}; + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + + +// Parse any number from 0 to 18,446,744,073,709,551,615 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_unsigned(const uint8_t * const src, const uint8_t * const src_end) noexcept { + const uint8_t *p = src; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if ((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from 0 to 18,446,744,073,709,551,615 +simdjson_unused simdjson_inline simdjson_result parse_unsigned_in_string(const uint8_t * const src) noexcept { + const uint8_t *p = src + 1; + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // The longest positive 64-bit number is 20 digits. + // We do it this way so we don't trigger this branch unless we must. + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > 20)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if (*p != '"') { return NUMBER_ERROR; } + + if (digit_count == 20) { + // Positive overflow check: + // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the + // biggest uint64_t. + // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX. + // If we got here, it's a 20 digit number starting with the digit "1". + // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller + // than 1,553,255,926,290,448,384. + // - That is smaller than the smallest possible 20-digit number the user could write: + // 10,000,000,000,000,000,000. + // - Therefore, if the number is positive and lower than that, it's overflow. + // - The value we are looking at is less than or equal to INT64_MAX. + // + // Note: we use src[1] and not src[0] because src[0] is the quote character in this + // instance. + if (src[1] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; } + } + + return i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while (parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_integer(const uint8_t * const src, const uint8_t * const src_end) noexcept { + // + // Check for minus sign + // + if(src == src_end) { return NUMBER_ERROR; } + bool negative = (*src == '-'); + const uint8_t *p = src + uint8_t(negative); + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = p; + uint64_t i = 0; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(p - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*p)) { + // return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if((p != src_end) && integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +// Parse any number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 +simdjson_unused simdjson_inline simdjson_result parse_integer_in_string(const uint8_t *src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare + const uint8_t *const start_digits = src; + uint64_t i = 0; + while (parse_digit(*src, i)) { src++; } + + // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error. + // Optimization note: size_t is expected to be unsigned. + size_t digit_count = size_t(src - start_digits); + // We go from + // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + // so we can never represent numbers that have more than 19 digits. + size_t longest_digit_count = 19; + // Optimization note: the compiler can probably merge + // ((digit_count == 0) || (digit_count > longest_digit_count)) + // into a single branch since digit_count is unsigned. + if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; } + // Here digit_count > 0. + if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; } + // We can do the following... + // if (!jsoncharutils::is_structural_or_whitespace(*src)) { + // return (*src == '.' || *src == 'e' || *src == 'E') ? INCORRECT_TYPE : NUMBER_ERROR; + // } + // as a single table lookup: + if(*src != '"') { return NUMBER_ERROR; } + // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX. + // Performance note: This check is only needed when digit_count == longest_digit_count but it is + // so cheap that we might as well always make it. + if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; } + return negative ? (~i+1) : i; +} + +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline bool is_negative(const uint8_t * src) noexcept { + return (*src == '-'); +} + +simdjson_unused simdjson_inline simdjson_result is_integer(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { return true; } + return false; +} + +simdjson_unused simdjson_inline simdjson_result get_number_type(const uint8_t * src) noexcept { + bool negative = (*src == '-'); + src += uint8_t(negative); + const uint8_t *p = src; + while(static_cast(*p - '0') <= 9) { p++; } + if ( p == src ) { return NUMBER_ERROR; } + if (jsoncharutils::is_structural_or_whitespace(*p)) { + // We have an integer. + // If the number is negative and valid, it must be a signed integer. + if(negative) { return number_type::signed_integer; } + // We want values larger or equal to 9223372036854775808 to be unsigned + // integers, and the other values to be signed integers. + int digit_count = int(p - src); + if(digit_count >= 19) { + const uint8_t * smaller_big_integer = reinterpret_cast("9223372036854775808"); + if((digit_count >= 20) || (memcmp(src, smaller_big_integer, 19) >= 0)) { + return number_type::unsigned_integer; + } + } + return number_type::signed_integer; + } + // Hopefully, we have 'e' or 'E' or '.'. + return number_type::floating_point_number; +} + +// Never read at src_end or beyond +simdjson_unused simdjson_inline simdjson_result parse_double(const uint8_t * src, const uint8_t * const src_end) noexcept { + if(src == src_end) { return NUMBER_ERROR; } + // + // Check for minus sign + // + bool negative = (*src == '-'); + src += uint8_t(negative); + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + if(p == src_end) { return NUMBER_ERROR; } + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while ((p != src_end) && parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely((p != src_end) && (*p == '.'))) { + p++; + const uint8_t *start_decimal_digits = p; + if ((p == src_end) || !parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while ((p != src_end) && parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if ((p != src_end) && (*p == 'e' || *p == 'E')) { + p++; + if(p == src_end) { return NUMBER_ERROR; } + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while ((p != src_end) && parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if ((p != src_end) && jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), src_end, &d)) { + return NUMBER_ERROR; + } + return d; +} + +simdjson_unused simdjson_inline simdjson_result parse_double_in_string(const uint8_t * src) noexcept { + // + // Check for minus sign + // + bool negative = (*(src + 1) == '-'); + src += uint8_t(negative) + 1; + + // + // Parse the integer part. + // + uint64_t i = 0; + const uint8_t *p = src; + p += parse_digit(*p, i); + bool leading_zero = (i == 0); + while (parse_digit(*p, i)) { p++; } + // no integer digits, or 0123 (zero must be solo) + if ( p == src ) { return INCORRECT_TYPE; } + if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; } + + // + // Parse the decimal part. + // + int64_t exponent = 0; + bool overflow; + if (simdjson_likely(*p == '.')) { + p++; + const uint8_t *start_decimal_digits = p; + if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits + p++; + while (parse_digit(*p, i)) { p++; } + exponent = -(p - start_decimal_digits); + + // Overflow check. More than 19 digits (minus the decimal) may be overflow. + overflow = p-src-1 > 19; + if (simdjson_unlikely(overflow && leading_zero)) { + // Skip leading 0.00000 and see if it still overflows + const uint8_t *start_digits = src + 2; + while (*start_digits == '0') { start_digits++; } + overflow = start_digits-src > 19; + } + } else { + overflow = p-src > 19; + } + + // + // Parse the exponent + // + if (*p == 'e' || *p == 'E') { + p++; + bool exp_neg = *p == '-'; + p += exp_neg || *p == '+'; + + uint64_t exp = 0; + const uint8_t *start_exp_digits = p; + while (parse_digit(*p, exp)) { p++; } + // no exp digits, or 20+ exp digits + if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; } + + exponent += exp_neg ? 0-exp : exp; + } + + if (*p != '"') { return NUMBER_ERROR; } + + overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power; + + // + // Assemble (or slow-parse) the float + // + double d; + if (simdjson_likely(!overflow)) { + if (compute_float_64(exponent, i, negative, d)) { return d; } + } + if (!parse_float_fallback(src - uint8_t(negative), &d)) { + return NUMBER_ERROR; + } + return d; +} + +} // unnamed namespace +#endif // SIMDJSON_SKIPNUMBERPARSING + +} // namespace numberparsing + +inline std::ostream& operator<<(std::ostream& out, number_type type) noexcept { + switch (type) { + case number_type::signed_integer: out << "integer in [-9223372036854775808,9223372036854775808)"; break; + case number_type::unsigned_integer: out << "unsigned integer in [9223372036854775808,18446744073709551616)"; break; + case number_type::floating_point_number: out << "floating-point number (binary64)"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_NUMBERPARSING_H +/* end file simdjson/generic/numberparsing.h for westmere */ + +/* including simdjson/generic/implementation_simdjson_result_base-inl.h for westmere: #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* begin file simdjson/generic/implementation_simdjson_result_base-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { + +// +// internal::implementation_simdjson_result_base inline implementation +// + +template +simdjson_inline void implementation_simdjson_result_base::tie(T &value, error_code &error) && noexcept { + error = this->second; + if (!error) { + value = std::forward>(*this).first; + } +} + +template +simdjson_warn_unused simdjson_inline error_code implementation_simdjson_result_base::get(T &value) && noexcept { + error_code error; + std::forward>(*this).tie(value, error); + return error; +} + +template +simdjson_inline error_code implementation_simdjson_result_base::error() const noexcept { + return this->second; +} + +#if SIMDJSON_EXCEPTIONS + +template +simdjson_inline T& implementation_simdjson_result_base::value() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +template +simdjson_inline T&& implementation_simdjson_result_base::take_value() && noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::operator T&&() && noexcept(false) { + return std::forward>(*this).take_value(); +} + +#endif // SIMDJSON_EXCEPTIONS + +template +simdjson_inline const T& implementation_simdjson_result_base::value_unsafe() const& noexcept { + return this->first; +} + +template +simdjson_inline T& implementation_simdjson_result_base::value_unsafe() & noexcept { + return this->first; +} + +template +simdjson_inline T&& implementation_simdjson_result_base::value_unsafe() && noexcept { + return std::forward(this->first); +} + +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value, error_code error) noexcept + : first{std::forward(value)}, second{error} {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(error_code error) noexcept + : implementation_simdjson_result_base(T{}, error) {} +template +simdjson_inline implementation_simdjson_result_base::implementation_simdjson_result_base(T &&value) noexcept + : implementation_simdjson_result_base(std::forward(value), SUCCESS) {} + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H +/* end file simdjson/generic/implementation_simdjson_result_base-inl.h for westmere */ +/* end file simdjson/generic/amalgamated.h for westmere */ +/* including simdjson/westmere/end.h: #include "simdjson/westmere/end.h" */ +/* begin file simdjson/westmere/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "westmere" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/westmere/end.h */ + +#endif // SIMDJSON_WESTMERE_H +/* end file simdjson/westmere.h */ +#else +#error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION +#endif + +/* undefining SIMDJSON_CONDITIONAL_INCLUDE */ +#undef SIMDJSON_CONDITIONAL_INCLUDE + +#endif // SIMDJSON_BUILTIN_H +/* end file simdjson/builtin.h */ +/* skipped duplicate #include "simdjson/builtin/base.h" */ + +/* including simdjson/generic/ondemand/dependencies.h: #include "simdjson/generic/ondemand/dependencies.h" */ +/* begin file simdjson/generic/ondemand/dependencies.h */ +#ifdef SIMDJSON_CONDITIONAL_INCLUDE +#error simdjson/generic/ondemand/dependencies.h must be included before defining SIMDJSON_CONDITIONAL_INCLUDE! +#endif + +#ifndef SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H +#define SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H + +// Internal headers needed for ondemand generics. +// All includes not under simdjson/generic/ondemand must be here! +// Otherwise, amalgamation will fail. +/* skipped duplicate #include "simdjson/dom/base.h" // for MINIMAL_DOCUMENT_CAPACITY */ +/* skipped duplicate #include "simdjson/implementation.h" */ +/* skipped duplicate #include "simdjson/padded_string.h" */ +/* skipped duplicate #include "simdjson/padded_string_view.h" */ +/* skipped duplicate #include "simdjson/internal/dom_parser_implementation.h" */ + +#endif // SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H +/* end file simdjson/generic/ondemand/dependencies.h */ + +/* defining SIMDJSON_CONDITIONAL_INCLUDE */ +#define SIMDJSON_CONDITIONAL_INCLUDE + +#if SIMDJSON_BUILTIN_IMPLEMENTATION_IS(arm64) +/* including simdjson/arm64/ondemand.h: #include "simdjson/arm64/ondemand.h" */ +/* begin file simdjson/arm64/ondemand.h */ +#ifndef SIMDJSON_ARM64_ONDEMAND_H +#define SIMDJSON_ARM64_ONDEMAND_H + +/* including simdjson/arm64/begin.h: #include "simdjson/arm64/begin.h" */ +/* begin file simdjson/arm64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "arm64" */ +#define SIMDJSON_IMPLEMENTATION arm64 +/* including simdjson/arm64/base.h: #include "simdjson/arm64/base.h" */ +/* begin file simdjson/arm64/base.h */ +#ifndef SIMDJSON_ARM64_BASE_H +#define SIMDJSON_ARM64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for NEON (ARMv8). + */ +namespace arm64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BASE_H +/* end file simdjson/arm64/base.h */ +/* including simdjson/arm64/intrinsics.h: #include "simdjson/arm64/intrinsics.h" */ +/* begin file simdjson/arm64/intrinsics.h */ +#ifndef SIMDJSON_ARM64_INTRINSICS_H +#define SIMDJSON_ARM64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +static_assert(sizeof(uint8x16_t) <= simdjson::SIMDJSON_PADDING, "insufficient padding for arm64"); + +#endif // SIMDJSON_ARM64_INTRINSICS_H +/* end file simdjson/arm64/intrinsics.h */ +/* including simdjson/arm64/bitmanipulation.h: #include "simdjson/arm64/bitmanipulation.h" */ +/* begin file simdjson/arm64/bitmanipulation.h */ +#ifndef SIMDJSON_ARM64_BITMANIPULATION_H +#define SIMDJSON_ARM64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int count_ones(uint64_t input_num) { + return vaddv_u8(vcnt_u8(vcreate_u8(input_num))); +} + + +#if defined(__GNUC__) // catches clang and gcc +/** + * ARM has a fast 64-bit "bit reversal function" that is handy. However, + * it is not generally available as an intrinsic function under Visual + * Studio (though this might be changing). Even under clang/gcc, we + * apparently need to invoke inline assembly. + */ +/* + * We use SIMDJSON_PREFER_REVERSE_BITS as a hint that algorithms that + * work well with bit reversal may use it. + */ +#define SIMDJSON_PREFER_REVERSE_BITS 1 + +/* reverse the bits */ +simdjson_inline uint64_t reverse_bits(uint64_t input_num) { + uint64_t rev_bits; + __asm("rbit %0, %1" : "=r"(rev_bits) : "r"(input_num)); + return rev_bits; +} + +/** + * Flips bit at index 63 - lz. Thus if you have 'leading_zeroes' leading zeroes, + * then this will set to zero the leading bit. It is possible for leading_zeroes to be + * greating or equal to 63 in which case we trigger undefined behavior, but the output + * of such undefined behavior is never used. + **/ +SIMDJSON_NO_SANITIZE_UNDEFINED +simdjson_inline uint64_t zero_leading_bit(uint64_t rev_bits, int leading_zeroes) { + return rev_bits ^ (uint64_t(0x8000000000000000) >> leading_zeroes); +} + +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_BITMANIPULATION_H +/* end file simdjson/arm64/bitmanipulation.h */ +/* including simdjson/arm64/bitmask.h: #include "simdjson/arm64/bitmask.h" */ +/* begin file simdjson/arm64/bitmask.h */ +#ifndef SIMDJSON_ARM64_BITMASK_H +#define SIMDJSON_ARM64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + ///////////// + // We could do this with PMULL, but it is apparently slow. + // + //#ifdef __ARM_FEATURE_CRYPTO // some ARM processors lack this extension + //return vmull_p64(-1ULL, bitmask); + //#else + // Analysis by @sebpop: + // When diffing the assembly for src/stage1_find_marks.cpp I see that the eors are all spread out + // in between other vector code, so effectively the extra cycles of the sequence do not matter + // because the GPR units are idle otherwise and the critical path is on the FP side. + // Also the PMULL requires two extra fmovs: GPR->FP (3 cycles in N1, 5 cycles in A72 ) + // and FP->GPR (2 cycles on N1 and 5 cycles on A72.) + /////////// + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif +/* end file simdjson/arm64/bitmask.h */ +/* including simdjson/arm64/numberparsing_defs.h: #include "simdjson/arm64/numberparsing_defs.h" */ +/* begin file simdjson/arm64/numberparsing_defs.h */ +#ifndef SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +#define SIMDJSON_ARM64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if _M_ARM64 +// __umulh requires intrin.h +#include +#endif // _M_ARM64 + +namespace simdjson { +namespace arm64 { +namespace numberparsing { + +// we don't have SSE, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace arm64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ARM64_NUMBERPARSING_DEFS_H +/* end file simdjson/arm64/numberparsing_defs.h */ +/* including simdjson/arm64/simd.h: #include "simdjson/arm64/simd.h" */ +/* begin file simdjson/arm64/simd.h */ +#ifndef SIMDJSON_ARM64_SIMD_H +#define SIMDJSON_ARM64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { +namespace simd { + +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO +namespace { +// Start of private section with Visual Studio workaround + + +/** + * make_uint8x16_t initializes a SIMD register (uint8x16_t). + * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} + * is not recognized under Visual Studio! This is a workaround. + * Using a std::initializer_list as a parameter resulted in + * inefficient code. With the current approach, if the parameters are + * compile-time constants, + * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. + * You should not use this function except for compile-time constants: + * it is not efficient. + */ +simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, + uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, + uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { + // Doing a load like so end ups generating worse code. + // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_u8(array); + uint8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_u8(x1, x, 0); + x = vsetq_lane_u8(x2, x, 1); + x = vsetq_lane_u8(x3, x, 2); + x = vsetq_lane_u8(x4, x, 3); + x = vsetq_lane_u8(x5, x, 4); + x = vsetq_lane_u8(x6, x, 5); + x = vsetq_lane_u8(x7, x, 6); + x = vsetq_lane_u8(x8, x, 7); + x = vsetq_lane_u8(x9, x, 8); + x = vsetq_lane_u8(x10, x, 9); + x = vsetq_lane_u8(x11, x, 10); + x = vsetq_lane_u8(x12, x, 11); + x = vsetq_lane_u8(x13, x, 12); + x = vsetq_lane_u8(x14, x, 13); + x = vsetq_lane_u8(x15, x, 14); + x = vsetq_lane_u8(x16, x, 15); + return x; +} + +simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, + uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { + uint8x8_t x{}; + x = vset_lane_u8(x1, x, 0); + x = vset_lane_u8(x2, x, 1); + x = vset_lane_u8(x3, x, 2); + x = vset_lane_u8(x4, x, 3); + x = vset_lane_u8(x5, x, 4); + x = vset_lane_u8(x6, x, 5); + x = vset_lane_u8(x7, x, 6); + x = vset_lane_u8(x8, x, 7); + return x; +} + +// We have to do the same work for make_int8x16_t +simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, + int8_t x5, int8_t x6, int8_t x7, int8_t x8, + int8_t x9, int8_t x10, int8_t x11, int8_t x12, + int8_t x13, int8_t x14, int8_t x15, int8_t x16) { + // Doing a load like so end ups generating worse code. + // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, + // x9, x10,x11,x12,x13,x14,x15,x16}; + // return vld1q_s8(array); + int8x16_t x{}; + // incredibly, Visual Studio does not allow x[0] = x1 + x = vsetq_lane_s8(x1, x, 0); + x = vsetq_lane_s8(x2, x, 1); + x = vsetq_lane_s8(x3, x, 2); + x = vsetq_lane_s8(x4, x, 3); + x = vsetq_lane_s8(x5, x, 4); + x = vsetq_lane_s8(x6, x, 5); + x = vsetq_lane_s8(x7, x, 6); + x = vsetq_lane_s8(x8, x, 7); + x = vsetq_lane_s8(x9, x, 8); + x = vsetq_lane_s8(x10, x, 9); + x = vsetq_lane_s8(x11, x, 10); + x = vsetq_lane_s8(x12, x, 11); + x = vsetq_lane_s8(x13, x, 12); + x = vsetq_lane_s8(x14, x, 13); + x = vsetq_lane_s8(x15, x, 14); + x = vsetq_lane_s8(x16, x, 15); + return x; +} + +// End of private section with Visual Studio workaround +} // namespace +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO + + + template + struct simd8; + + // + // Base class of simd8 and simd8, both of which use uint8x16_t internally. + // + template> + struct base_u8 { + uint8x16_t value; + static const int SIZE = sizeof(value); + + // Conversion from/to SIMD register + simdjson_inline base_u8(const uint8x16_t _value) : value(_value) {} + simdjson_inline operator const uint8x16_t&() const { return this->value; } + simdjson_inline operator uint8x16_t&() { return this->value; } + + // Bit operations + simdjson_inline simd8 operator|(const simd8 other) const { return vorrq_u8(*this, other); } + simdjson_inline simd8 operator&(const simd8 other) const { return vandq_u8(*this, other); } + simdjson_inline simd8 operator^(const simd8 other) const { return veorq_u8(*this, other); } + simdjson_inline simd8 bit_andnot(const simd8 other) const { return vbicq_u8(*this, other); } + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + simdjson_inline simd8& operator|=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline simd8& operator&=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline simd8& operator^=(const simd8 other) { auto this_cast = static_cast*>(this); *this_cast = *this_cast ^ other; return *this_cast; } + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return vceqq_u8(lhs, rhs); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_u8(prev_chunk, *this, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base_u8 { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + static simdjson_inline simd8 splat(bool _value) { return vmovq_n_u8(uint8_t(-(!!_value))); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // False constructor + simdjson_inline simd8() : simd8(vdupq_n_u8(0)) {} + // Splat constructor + simdjson_inline simd8(bool _value) : simd8(splat(_value)) {} + + // We return uint32_t instead of uint16_t because that seems to be more efficient for most + // purposes (cutting it down to uint16_t costs performance in some compilers). + simdjson_inline uint32_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); +#else + const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +#endif + auto minput = *this & bit_mask; + uint8x16_t tmp = vpaddq_u8(minput, minput); + tmp = vpaddq_u8(tmp, tmp); + tmp = vpaddq_u8(tmp, tmp); + return vgetq_lane_u16(vreinterpretq_u16_u8(tmp), 0); + } + simdjson_inline bool any() const { return vmaxvq_u8(*this) != 0; } + }; + + // Unsigned bytes + template<> + struct simd8: base_u8 { + static simdjson_inline uint8x16_t splat(uint8_t _value) { return vmovq_n_u8(_value); } + static simdjson_inline uint8x16_t zero() { return vdupq_n_u8(0); } + static simdjson_inline uint8x16_t load(const uint8_t* values) { return vld1q_u8(values); } + + simdjson_inline simd8(const uint8x16_t _value) : base_u8(_value) {} + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[16]) : simd8(load(values)) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(make_uint8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(uint8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(uint8_t dst[16]) const { return vst1q_u8(dst, *this); } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return vqaddq_u8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return vqsubq_u8(*this, other); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_u8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_u8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-specific operations + simdjson_inline uint8_t max_val() const { return vmaxvq_u8(*this); } + simdjson_inline uint8_t min_val() const { return vminvq_u8(*this); } + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_u8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_u8(*this, other); } + simdjson_inline simd8 operator<=(const simd8 other) const { return vcleq_u8(*this, other); } + simdjson_inline simd8 operator>=(const simd8 other) const { return vcgeq_u8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_u8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_u8(*this, other); } + // Same as >, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 gt_bits(const simd8 other) const { return simd8(*this > other); } + // Same as <, but instead of guaranteeing all 1's == true, false = 0 and true = nonzero. For ARM, returns all 1's. + simdjson_inline simd8 lt_bits(const simd8 other) const { return simd8(*this < other); } + + // Bit-specific operations + simdjson_inline simd8 any_bits_set(simd8 bits) const { return vtstq_u8(*this, bits); } + simdjson_inline bool any_bits_set_anywhere() const { return this->max_val() != 0; } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return (*this & bits).any_bits_set_anywhere(); } + template + simdjson_inline simd8 shr() const { return vshrq_n_u8(*this, N); } + template + simdjson_inline simd8 shl() const { return vshlq_n_u8(*this, N); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint16_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + uint64x2_t shufmask64 = {thintable_epi8[mask1], thintable_epi8[mask2]}; + uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + shufmask = vaddq_u8(shufmask, inc); + // this is the version "nearly pruned" + uint8x16_t pruned = vqtbl1q_u8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + uint8x16_t compactmask = vld1q_u8(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + uint8x16_t answer = vqtbl1q_u8(pruned, compactmask); + vst1q_u8(reinterpret_cast(output), answer); + } + + // Copies all bytes corresponding to a 0 in the low half of the mask (interpreted as a + // bitset) to output1, then those corresponding to a 0 in the high half to output2. + template + simdjson_inline void compress_halves(uint16_t mask, L *output1, L *output2) const { + using internal::thintable_epi8; + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + uint8x8_t compactmask1 = vcreate_u8(thintable_epi8[mask1]); + uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); + // we increment by 0x08 the second half of the mask +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); +#else + uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; +#endif + compactmask2 = vadd_u8(compactmask2, inc); + // store each result (with the second store possibly overlapping the first) + vst1_u8((uint8_t*)output1, vqtbl1_u8(*this, compactmask1)); + vst1_u8((uint8_t*)output2, vqtbl1_u8(*this, compactmask2)); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_u8(*this, simd8(original)); + } + }; + + // Signed bytes + template<> + struct simd8 { + int8x16_t value; + + static simdjson_inline simd8 splat(int8_t _value) { return vmovq_n_s8(_value); } + static simdjson_inline simd8 zero() { return vdupq_n_s8(0); } + static simdjson_inline simd8 load(const int8_t values[16]) { return vld1q_s8(values); } + + // Conversion from/to SIMD register + simdjson_inline simd8(const int8x16_t _value) : value{_value} {} + simdjson_inline operator const int8x16_t&() const { return this->value; } + simdjson_inline operator int8x16_t&() { return this->value; } + + // Zero constructor + simdjson_inline simd8() : simd8(zero()) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(make_int8x16_t( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} +#else + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(int8x16_t{ + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + }) {} +#endif + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Store to array + simdjson_inline void store(int8_t dst[16]) const { return vst1q_s8(dst, *this); } + + // Explicit conversion to/from unsigned + // + // Under Visual Studio/ARM64 uint8x16_t and int8x16_t are apparently the same type. + // In theory, we could check this occurrence with std::same_as and std::enabled_if but it is C++14 + // and relatively ugly and hard to read. +#ifndef SIMDJSON_REGULAR_VISUAL_STUDIO + simdjson_inline explicit simd8(const uint8x16_t other): simd8(vreinterpretq_s8_u8(other)) {} +#endif + simdjson_inline explicit operator simd8() const { return vreinterpretq_u8_s8(this->value); } + + // Math + simdjson_inline simd8 operator+(const simd8 other) const { return vaddq_s8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return vsubq_s8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *this; } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *this; } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return vmaxq_s8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return vminq_s8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return vcgtq_s8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return vcltq_s8(*this, other); } + simdjson_inline simd8 operator==(const simd8 other) const { return vceqq_s8(*this, other); } + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return vextq_s8(prev_chunk, *this, 16 - N); + } + + // Perform a lookup assuming no value is larger than 16 + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return lookup_table.apply_lookup_16_to(*this); + } + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + + template + simdjson_inline simd8 apply_lookup_16_to(const simd8 original) { + return vqtbl1q_s8(*this, simd8(original)); + } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "ARM kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint64_t popcounts = vget_lane_u64(vreinterpret_u64_u8(vcnt_u8(vcreate_u8(~mask))), 0); + // compute the prefix sum of the popcounts of each byte + uint64_t offsets = popcounts * 0x0101010101010101; + this->chunks[0].compress_halves(uint16_t(mask), output, &output[popcounts & 0xFF]); + this->chunks[1].compress_halves(uint16_t(mask >> 16), &output[(offsets >> 8) & 0xFF], &output[(offsets >> 16) & 0xFF]); + this->chunks[2].compress_halves(uint16_t(mask >> 32), &output[(offsets >> 24) & 0xFF], &output[(offsets >> 32) & 0xFF]); + this->chunks[3].compress_halves(uint16_t(mask >> 48), &output[(offsets >> 40) & 0xFF], &output[(offsets >> 48) & 0xFF]); + return offsets >> 56; + } + + simdjson_inline uint64_t to_bitmask() const { +#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO + const uint8x16_t bit_mask = make_uint8x16_t( + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + ); +#else + const uint8x16_t bit_mask = { + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 + }; +#endif + // Add each of the elements next to each other, successively, to stuff each 8 byte mask into one. + uint8x16_t sum0 = vpaddq_u8(this->chunks[0] & bit_mask, this->chunks[1] & bit_mask); + uint8x16_t sum1 = vpaddq_u8(this->chunks[2] & bit_mask, this->chunks[3] & bit_mask); + sum0 = vpaddq_u8(sum0, sum1); + sum0 = vpaddq_u8(sum0, sum0); + return vgetq_lane_u64(vreinterpretq_u64_u8(sum0), 0); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_SIMD_H +/* end file simdjson/arm64/simd.h */ +/* including simdjson/arm64/stringparsing_defs.h: #include "simdjson/arm64/stringparsing_defs.h" */ +/* begin file simdjson/arm64/stringparsing_defs.h */ +#ifndef SIMDJSON_ARM64_STRINGPARSING_DEFS_H +#define SIMDJSON_ARM64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on ARM; therefore, we + // smash them together into a 64-byte mask and get the bitmask from there. + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_ARM64_STRINGPARSING_DEFS_H +/* end file simdjson/arm64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/arm64/begin.h */ +/* including simdjson/generic/ondemand/amalgamated.h for arm64: #include "simdjson/generic/ondemand/amalgamated.h" */ +/* begin file simdjson/generic/ondemand/amalgamated.h for arm64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H) +#error simdjson/generic/ondemand/dependencies.h must be included before simdjson/generic/ondemand/amalgamated.h! +#endif + +// Stuff other things depend on +/* including simdjson/generic/ondemand/base.h for arm64: #include "simdjson/generic/ondemand/base.h" */ +/* begin file simdjson/generic/ondemand/base.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +/** + * A fast, simple, DOM-like interface that parses JSON as you use it. + * + * Designed for maximum speed and a lower memory profile. + */ +namespace ondemand { + +/** Represents the depth of a JSON value (number of nested arrays/objects). */ +using depth_t = int32_t; + +/** @copydoc simdjson::arm64::number_type */ +using number_type = simdjson::arm64::number_type; + +/** @private Position in the JSON buffer indexes */ +using token_position = const uint32_t *; + +class array; +class array_iterator; +class document; +class document_reference; +class document_stream; +class field; +class json_iterator; +enum class json_type; +struct number; +class object; +class object_iterator; +class parser; +class raw_json_string; +class token_iterator; +class value; +class value_iterator; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_BASE_H +/* end file simdjson/generic/ondemand/base.h for arm64 */ +/* including simdjson/generic/ondemand/value_iterator.h for arm64: #include "simdjson/generic/ondemand/value_iterator.h" */ +/* begin file simdjson/generic/ondemand/value_iterator.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * Iterates through a single JSON value at a particular depth. + * + * Does not keep track of the type of value: provides methods for objects, arrays and scalars and expects + * the caller to call the right ones. + * + * @private This is not intended for external use. + */ +class value_iterator { +protected: + /** The underlying JSON iterator */ + json_iterator *_json_iter{}; + /** The depth of this value */ + depth_t _depth{}; + /** + * The starting token index for this value + */ + token_position _start_position{}; + +public: + simdjson_inline value_iterator() noexcept = default; + + /** + * Denote that we're starting a document. + */ + simdjson_inline void start_document() noexcept; + + /** + * Skips a non-iterated or partially-iterated JSON value, whether it is a scalar, array or object. + * + * Optimized for scalars. + */ + simdjson_warn_unused simdjson_inline error_code skip_child() noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is at the start of the value + */ + simdjson_inline bool at_start() const noexcept; + + /** + * Tell whether the value is open--if the value has not been used, or the array/object is still open. + */ + simdjson_inline bool is_open() const noexcept; + + /** + * Tell whether the value is at an object's first field (just after the {). + */ + simdjson_inline bool at_first_field() const noexcept; + + /** + * Abandon all iteration. + */ + simdjson_inline void abandon() noexcept; + + /** + * Get the child value as a value_iterator. + */ + simdjson_inline value_iterator child_value() const noexcept; + + /** + * Get the depth of this value. + */ + simdjson_inline int32_t depth() const noexcept; + + /** + * Get the JSON type of this value. + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() const noexcept; + + /** + * @addtogroup object Object iteration + * + * Methods to iterate and find object fields. These methods generally *assume* the value is + * actually an object; the caller is responsible for keeping track of that fact. + * + * @{ + */ + + /** + * Start an object iteration. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + */ + simdjson_warn_unused simdjson_inline simdjson_result start_object() noexcept; + /** + * Start an object iteration from the root. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_object() noexcept; + /** + * Checks whether an object could be started from the root. May be called by start_root_object. + * + * @returns SUCCESS if it is possible to safely start an object from the root (document level). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_object() noexcept; + /** + * Start an object iteration after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_object() noexcept; + /** + * Start an object iteration from the root, after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_object() noexcept; + + /** + * Moves to the next field in an object. + * + * Looks for , and }. If } is found, the object is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return whether there is another field in the object. + * @error TAPE_ERROR If there is a comma missing between fields. + * @error TAPE_ERROR If there is a comma, but not enough tokens remaining to have a key, :, and value. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_field() noexcept; + + /** + * Get the current field's key. + */ + simdjson_warn_unused simdjson_inline simdjson_result field_key() noexcept; + + /** + * Pass the : in the field and move to its value. + */ + simdjson_warn_unused simdjson_inline error_code field_value() noexcept; + + /** + * Find the next field with the given key. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline error_code find_field(const std::string_view key) noexcept; + + /** + * Find the next field with the given key, *without* unescaping. This assumes object order: it + * will not find the field if it was already passed when looking for some *other* field. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_raw(const std::string_view key) noexcept; + + /** + * Find the field with the given key without regard to order, and *without* unescaping. + * + * This is an unordered object lookup: if the field is not found initially, it will cycle around and scan from the beginning. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_unordered_raw(const std::string_view key) noexcept; + + /** @} */ + + /** + * @addtogroup array Array iteration + * Methods to iterate over array elements. These methods generally *assume* the value is actually + * an object; the caller is responsible for keeping track of that fact. + * @{ + */ + + /** + * Check for an opening [ and start an array iteration. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + */ + simdjson_warn_unused simdjson_inline simdjson_result start_array() noexcept; + /** + * Check for an opening [ and start an array iteration while at the root. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_array() noexcept; + /** + * Checks whether an array could be started from the root. May be called by start_root_array. + * + * @returns SUCCESS if it is possible to safely start an array from the root (document level). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_array() noexcept; + /** + * Start an array iteration, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_array() noexcept; + /** + * Start an array iteration from the root, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_array() noexcept; + + /** + * Moves to the next element in an array. + * + * Looks for , and ]. If ] is found, the array is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return Whether there is another element in the array. + * @error TAPE_ERROR If there is a comma missing between elements. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_element() noexcept; + + /** + * Get a child value iterator. + */ + simdjson_warn_unused simdjson_inline value_iterator child() const noexcept; + + /** @} */ + + /** + * @defgroup scalar Scalar values + * @addtogroup scalar + * @{ + */ + + simdjson_warn_unused simdjson_inline simdjson_result get_string(bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_bool() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_null() noexcept; + simdjson_warn_unused simdjson_inline bool is_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_integer() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + simdjson_warn_unused simdjson_inline simdjson_result get_root_string(bool check_trailing, bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_wobbly_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_raw_json_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_bool(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline bool is_root_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_integer(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number_type(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_null(bool check_trailing) noexcept; + + simdjson_inline error_code error() const noexcept; + simdjson_inline uint8_t *&string_buf_loc() noexcept; + simdjson_inline const json_iterator &json_iter() const noexcept; + simdjson_inline json_iterator &json_iter() noexcept; + + simdjson_inline void assert_is_valid() const noexcept; + simdjson_inline bool is_valid() const noexcept; + + /** @} */ +protected: + /** + * Restarts an array iteration. + * @returns Whether the array has any elements (returns false for empty). + */ + simdjson_inline simdjson_result reset_array() noexcept; + /** + * Restarts an object iteration. + * @returns Whether the object has any fields (returns false for empty). + */ + simdjson_inline simdjson_result reset_object() noexcept; + /** + * move_at_start(): moves us so that we are pointing at the beginning of + * the container. It updates the index so that at_start() is true and it + * syncs the depth. The user can then create a new container instance. + * + * Usage: used with value::count_elements(). + **/ + simdjson_inline void move_at_start() noexcept; + + /** + * move_at_container_start(): moves us so that we are pointing at the beginning of + * the container so that assert_at_container_start() passes. + * + * Usage: used with reset_array() and reset_object(). + **/ + simdjson_inline void move_at_container_start() noexcept; + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + simdjson_inline value_iterator(json_iterator *json_iter, depth_t depth, token_position start_index) noexcept; + + simdjson_inline simdjson_result parse_null(const uint8_t *json) const noexcept; + simdjson_inline simdjson_result parse_bool(const uint8_t *json) const noexcept; + simdjson_inline const uint8_t *peek_start() const noexcept; + simdjson_inline uint32_t peek_start_length() const noexcept; + + /** + * The general idea of the advance_... methods and the peek_* methods + * is that you first peek and check that you have desired type. If you do, + * and only if you do, then you advance. + * + * We used to unconditionally advance. But this made reasoning about our + * current state difficult. + * Suppose you always advance. Look at the 'value' matching the key + * "shadowable" in the following example... + * + * ({"globals":{"a":{"shadowable":[}}}}) + * + * If the user thinks it is a Boolean and asks for it, then we check the '[', + * decide it is not a Boolean, but still move into the next character ('}'). Now + * we are left pointing at '}' right after a '['. And we have not yet reported + * an error, only that we do not have a Boolean. + * + * If, instead, you just stand your ground until it is content that you know, then + * you will only even move beyond the '[' if the user tells you that you have an + * array. So you will be at the '}' character inside the array and, hopefully, you + * will then catch the error because an array cannot start with '}', but the code + * processing Boolean values does not know this. + * + * So the contract is: first call 'peek_...' and then call 'advance_...' only + * if you have determined that it is a type you can handle. + * + * Unfortunately, it makes the code more verbose, longer and maybe more error prone. + */ + + simdjson_inline void advance_scalar(const char *type) noexcept; + simdjson_inline void advance_root_scalar(const char *type) noexcept; + simdjson_inline void advance_non_root_scalar(const char *type) noexcept; + + simdjson_inline const uint8_t *peek_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_root_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_non_root_scalar(const char *type) noexcept; + + + simdjson_inline error_code start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept; + simdjson_inline error_code end_container() noexcept; + + /** + * Advance to a place expecting a value (increasing depth). + * + * @return The current token (the one left behind). + * @error TAPE_ERROR If the document ended early. + */ + simdjson_inline simdjson_result advance_to_value() noexcept; + + simdjson_inline error_code incorrect_type_error(const char *message) const noexcept; + simdjson_inline error_code error_unless_more_tokens(uint32_t tokens=1) const noexcept; + + simdjson_inline bool is_at_start() const noexcept; + /** + * is_at_iterator_start() returns true on an array or object after it has just been + * created, whether the instance is empty or not. + * + * Usage: used by array::begin() in debug mode (SIMDJSON_DEVELOPMENT_CHECKS) + */ + simdjson_inline bool is_at_iterator_start() const noexcept; + + /** + * Assuming that we are within an object, this returns true if we + * are pointing at a key. + * + * Usage: the skip_child() method should never be used while we are pointing + * at a key inside an object. + */ + simdjson_inline bool is_at_key() const noexcept; + + inline void assert_at_start() const noexcept; + inline void assert_at_container_start() const noexcept; + inline void assert_at_root() const noexcept; + inline void assert_at_child() const noexcept; + inline void assert_at_next() const noexcept; + inline void assert_at_non_root_start() const noexcept; + + /** Get the starting position of this value */ + simdjson_inline token_position start_position() const noexcept; + + /** @copydoc error_code json_iterator::position() const noexcept; */ + simdjson_inline token_position position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position last_position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position end_position() const noexcept; + /** @copydoc error_code json_iterator::report_error(error_code error, const char *message) noexcept; */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + friend class document; + friend class object; + friend class array; + friend class value; +}; // value_iterator + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::value_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H +/* end file simdjson/generic/ondemand/value_iterator.h for arm64 */ +/* including simdjson/generic/ondemand/value.h for arm64: #include "simdjson/generic/ondemand/value.h" */ +/* begin file simdjson/generic/ondemand/value.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * An ephemeral JSON value returned during iteration. It is only valid for as long as you do + * not access more data in the JSON document. + */ +class value { +public: + /** + * Create a new invalid value. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline value() noexcept = default; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) noexcept; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() noexcept; + + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() noexcept; + + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + + /** + * Cast this JSON value (inside string) to a unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + + /** + * Cast this JSON value to a "wobbly" string. + * + * The string is may not be a valid UTF-8 string. + * See https://simonsapin.github.io/wtf-8/ + * + * Important: a value should be consumed once. Calling get_wobbly_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); +#endif + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + * + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * Performance hint: You should only call count_elements() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method on the object instance. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @return The type of JSON value (json_type::array, json_type::object, json_type::string, + * json_type::number, json_type::boolean, or json_type::null). + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the value is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the value is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the value is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * Performance note: if you call this function systematically + * before parsing a number, you may have fallen for a performance + * anti-pattern. + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + * + * Performance note: this is designed with performance in mind. When + * calling 'get_number()', you scan the number string only once, determining + * efficiently the type and storing it in an efficient manner. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. However, if this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view is guaranteed to be + * a non-space token. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + * + * See also value::raw_json(). + */ + simdjson_inline std::string_view raw_json_token() noexcept; + + /** + * Get a string_view pointing at this value in the JSON document. + * If this element is an array or an object, it consumes the array or the object + * and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + * If this element is a scalar (string, number, Boolean, null), it returns what + * raw_json_token() would return. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + simdjson_inline simdjson_result current_location() noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. + * + * Calling at_pointer() on non-document instances (e.g., arrays and objects) is not + * standardized (by RFC 6901). We provide some experimental support for JSON pointers + * on non-document instances. Yet it is not the case when calling at_pointer on an array + * or an object instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + +protected: + /** + * Create a value. + */ + simdjson_inline value(const value_iterator &iter) noexcept; + + /** + * Skip this value, allowing iteration to continue. + */ + simdjson_inline void skip() noexcept; + + /** + * Start a value at the current position. + * + * (It should already be started; this is just a self-documentation method.) + */ + static simdjson_inline value start(const value_iterator &iter) noexcept; + + /** + * Resume a value. + */ + static simdjson_inline value resume(const value_iterator &iter) noexcept; + + /** + * Get the object, starting or resuming it as necessary + */ + simdjson_inline simdjson_result start_or_resume_object() noexcept; + + // simdjson_inline void log_value(const char *type) const noexcept; + // simdjson_inline void log_error(const char *message) const noexcept; + + value_iterator iter{}; + + friend class document; + friend class array_iterator; + friend class field; + friend class object; + friend struct simdjson_result; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::value &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result get_array() noexcept; + simdjson_inline simdjson_result get_object() noexcept; + + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() noexcept; + + template simdjson_inline error_code get(T &out) noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator arm64::ondemand::array() noexcept(false); + simdjson_inline operator arm64::ondemand::object() noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator arm64::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + */ + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + + /** @copydoc simdjson_inline std::string_view value::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + + /** @copydoc simdjson_inline simdjson_result current_location() noexcept */ + simdjson_inline simdjson_result current_location() noexcept; + /** @copydoc simdjson_inline int32_t current_depth() const noexcept */ + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H +/* end file simdjson/generic/ondemand/value.h for arm64 */ +/* including simdjson/generic/ondemand/logger.h for arm64: #include "simdjson/generic/ondemand/logger.h" */ +/* begin file simdjson/generic/ondemand/logger.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +// Logging should be free unless SIMDJSON_VERBOSE_LOGGING is set. Importantly, it is critical +// that the call to the log functions be side-effect free. Thus, for example, you should not +// create temporary std::string instances. +namespace logger { + +enum class log_level : int32_t { + info = 0, + error = 1 +}; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + +// We do not want these functions to be 'really inlined' since real inlining is +// for performance purposes and if you are using the loggers, you do not care about +// performance (or should not). +static inline void log_headers() noexcept; +// If args are provided, title will be treated as format string +template +static inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +template +static inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; +static inline void log_event(const json_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_value(const json_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_start_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; + +static inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail="") noexcept; +static inline void log_error(const json_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +static inline void log_event(const value_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const value_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_error(const value_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +} // namespace logger +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_H +/* end file simdjson/generic/ondemand/logger.h for arm64 */ +/* including simdjson/generic/ondemand/token_iterator.h for arm64: #include "simdjson/generic/ondemand/token_iterator.h" */ +/* begin file simdjson/generic/ondemand/token_iterator.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * Iterates through JSON tokens (`{` `}` `[` `]` `,` `:` `""` `123` `true` `false` `null`) + * detected by stage 1. + * + * @private This is not intended for external use. + */ +class token_iterator { +public: + /** + * Create a new invalid token_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline token_iterator() noexcept = default; + simdjson_inline token_iterator(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator &operator=(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator(const token_iterator &other) noexcept = default; + simdjson_inline token_iterator &operator=(const token_iterator &other) noexcept = default; + + /** + * Advance to the next token (returning the current one). + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + /** + * Reports the current offset in bytes from the start of the underlying buffer. + */ + simdjson_inline uint32_t current_offset() const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + + /** + * Return the current index. + */ + simdjson_inline token_position position() const noexcept; + /** + * Reset to a previously saved index. + */ + simdjson_inline void set_position(token_position target_position) noexcept; + + // NOTE: we don't support a full C++ iterator interface, because we expect people to make + // different calls to advance the iterator based on *their own* state. + + simdjson_inline bool operator==(const token_iterator &other) const noexcept; + simdjson_inline bool operator!=(const token_iterator &other) const noexcept; + simdjson_inline bool operator>(const token_iterator &other) const noexcept; + simdjson_inline bool operator>=(const token_iterator &other) const noexcept; + simdjson_inline bool operator<(const token_iterator &other) const noexcept; + simdjson_inline bool operator<=(const token_iterator &other) const noexcept; + +protected: + simdjson_inline token_iterator(const uint8_t *buf, token_position position) noexcept; + + /** + * Get the index of the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_index(int32_t delta=0) const noexcept; + /** + * Get the index of the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline uint32_t peek_index(token_position position) const noexcept; + + const uint8_t *buf{}; + token_position _position{}; + + friend class json_iterator; + friend class value_iterator; + friend class object; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::token_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H +/* end file simdjson/generic/ondemand/token_iterator.h for arm64 */ +/* including simdjson/generic/ondemand/json_iterator.h for arm64: #include "simdjson/generic/ondemand/json_iterator.h" */ +/* begin file simdjson/generic/ondemand/json_iterator.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * Iterates through JSON tokens, keeping track of depth and string buffer. + * + * @private This is not intended for external use. + */ +class json_iterator { +protected: + token_iterator token{}; + ondemand::parser *parser{}; + /** + * Next free location in the string buffer. + * + * Used by raw_json_string::unescape() to have a place to unescape strings to. + */ + uint8_t *_string_buf_loc{}; + /** + * JSON error, if there is one. + * + * INCORRECT_TYPE and NO_SUCH_FIELD are *not* stored here, ever. + * + * PERF NOTE: we *hope* this will be elided into control flow, as it is only used (a) in the first + * iteration of the loop, or (b) for the final iteration after a missing comma is found in ++. If + * this is not elided, we should make sure it's at least not using up a register. Failing that, + * we should store it in document so there's only one of them. + */ + error_code error{SUCCESS}; + /** + * Depth of the current token in the JSON. + * + * - 0 = finished with document + * - 1 = document root value (could be [ or {, not yet known) + * - 2 = , or } inside root array/object + * - 3 = key or value inside root array/object. + */ + depth_t _depth{}; + /** + * Beginning of the document indexes. + * Normally we have root == parser->implementation->structural_indexes.get() + * but this may differ, especially in streaming mode (where we have several + * documents); + */ + token_position _root{}; + /** + * Normally, a json_iterator operates over a single document, but in + * some cases, we may have a stream of documents. This attribute is meant + * as meta-data: the json_iterator works the same irrespective of the + * value of this attribute. + */ + bool _streaming{false}; + +public: + simdjson_inline json_iterator() noexcept = default; + simdjson_inline json_iterator(json_iterator &&other) noexcept; + simdjson_inline json_iterator &operator=(json_iterator &&other) noexcept; + simdjson_inline explicit json_iterator(const json_iterator &other) noexcept = default; + simdjson_inline json_iterator &operator=(const json_iterator &other) noexcept = default; + /** + * Skips a JSON value, whether it is a scalar, array or object. + */ + simdjson_warn_unused simdjson_inline error_code skip_child(depth_t parent_depth) noexcept; + + /** + * Tell whether the iterator is still at the start + */ + simdjson_inline bool at_root() const noexcept; + + /** + * Tell whether we should be expected to run in streaming + * mode (iterating over many documents). It is pure metadata + * that does not affect how the iterator works. It is used by + * start_root_array() and start_root_object(). + */ + simdjson_inline bool streaming() const noexcept; + + /** + * Get the root value iterator + */ + simdjson_inline token_position root_position() const noexcept; + /** + * Assert that we are at the document depth (== 1) + */ + simdjson_inline void assert_at_document_depth() const noexcept; + /** + * Assert that we are at the root of the document + */ + simdjson_inline void assert_at_root() const noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is live (has not been moved). + */ + simdjson_inline bool is_alive() const noexcept; + + /** + * Abandon this iterator, setting depth to 0 (as if the document is finished). + */ + simdjson_inline void abandon() noexcept; + + /** + * Advance the current token without modifying depth. + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + + /** + * Returns true if there is a single token in the index (i.e., it is + * a JSON with a scalar value such as a single number). + * + * @return whether there is a single token + */ + simdjson_inline bool is_single_token() const noexcept; + + /** + * Assert that there are at least the given number of tokens left. + * + * Has no effect in release builds. + */ + simdjson_inline void assert_more_tokens(uint32_t required_tokens=1) const noexcept; + /** + * Assert that the given position addresses an actual token (is within bounds). + * + * Has no effect in release builds. + */ + simdjson_inline void assert_valid_position(token_position position) const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + /** + * Get a pointer to the current location in the input buffer. + * + * This is not null-terminated; it is a view into the JSON. + * + * You may be pointing outside of the input buffer: it is not generally + * safe to dereference this pointer. + */ + simdjson_inline const uint8_t *unsafe_pointer() const noexcept; + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token to retrieve. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token to retrieve. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + /** + * Get the JSON text for the last token in the document. + * + * This is not null-terminated; it is a view into the JSON. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek_last() const noexcept; + + /** + * Ascend one level. + * + * Validates that the depth - 1 == parent_depth. + * + * @param parent_depth the expected parent depth. + */ + simdjson_inline void ascend_to(depth_t parent_depth) noexcept; + + /** + * Descend one level. + * + * Validates that the new depth == child_depth. + * + * @param child_depth the expected child depth. + */ + simdjson_inline void descend_to(depth_t child_depth) noexcept; + simdjson_inline void descend_to(depth_t child_depth, int32_t delta) noexcept; + + /** + * Get current depth. + */ + simdjson_inline depth_t depth() const noexcept; + + /** + * Get current (writeable) location in the string buffer. + */ + simdjson_inline uint8_t *&string_buf_loc() noexcept; + + /** + * Report an unrecoverable error, preventing further iteration. + * + * @param error The error to report. Must not be SUCCESS, UNINITIALIZED, INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + /** + * Log error, but don't stop iteration. + * @param error The error to report. Must be INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code optional_error(error_code error, const char *message) noexcept; + + /** + * Take an input in json containing max_len characters and attempt to copy it over to tmpbuf, a buffer with + * N bytes of capacity. It will return false if N is too small (smaller than max_len) of if it is zero. + * The buffer (tmpbuf) is padded with space characters. + */ + simdjson_warn_unused simdjson_inline bool copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept; + + simdjson_inline token_position position() const noexcept; + /** + * Write the raw_json_string to the string buffer and return a string_view. + * Each raw_json_string should be unescaped once, or else the string buffer might + * overflow. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, bool allow_replacement) noexcept; + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in) noexcept; + + simdjson_inline void reenter_child(token_position position, depth_t child_depth) noexcept; + + simdjson_inline error_code consume_character(char c) noexcept; +#if SIMDJSON_DEVELOPMENT_CHECKS + simdjson_inline token_position start_position(depth_t depth) const noexcept; + simdjson_inline void set_start_position(depth_t depth, token_position position) noexcept; +#endif + + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Updates this json iterator so that it is back at the beginning of the document, + * as if it had just been created. + */ + inline void rewind() noexcept; + /** + * This checks whether the {,},[,] are balanced so that the document + * ends with proper zero depth. This requires scanning the whole document + * and it may be expensive. It is expected that it will be rarely called. + * It does not attempt to match { with } and [ with ]. + */ + inline bool balanced() const noexcept; +protected: + simdjson_inline json_iterator(const uint8_t *buf, ondemand::parser *parser) noexcept; + /// The last token before the end + simdjson_inline token_position last_position() const noexcept; + /// The token *at* the end. This points at gibberish and should only be used for comparison. + simdjson_inline token_position end_position() const noexcept; + /// The end of the buffer. + simdjson_inline token_position end() const noexcept; + + friend class document; + friend class document_stream; + friend class object; + friend class array; + friend class value; + friend class raw_json_string; + friend class parser; + friend class value_iterator; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; // json_iterator + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::json_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H +/* end file simdjson/generic/ondemand/json_iterator.h for arm64 */ +/* including simdjson/generic/ondemand/json_type.h for arm64: #include "simdjson/generic/ondemand/json_type.h" */ +/* begin file simdjson/generic/ondemand/json_type.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * The type of a JSON value. + */ +enum class json_type { + // Start at 1 to catch uninitialized / default values more easily + array=1, ///< A JSON array ( [ 1, 2, 3 ... ] ) + object, ///< A JSON object ( { "a": 1, "b" 2, ... } ) + number, ///< A JSON number ( 1 or -2.3 or 4.5e6 ...) + string, ///< A JSON string ( "a" or "hello world\n" ...) + boolean, ///< A JSON boolean (true or false) + null ///< A JSON null (null) +}; + +/** + * A type representing a JSON number. + * The design of the struct is deliberately straight-forward. All + * functions return standard values with no error check. + */ +struct number { + + /** + * return the automatically determined type of + * the number: number_type::floating_point_number, + * number_type::signed_integer or number_type::unsigned_integer. + * + * enum class number_type { + * floating_point_number=1, /// a binary64 number + * signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + * unsigned_integer /// a positive integer larger or equal to 1<<63 + * }; + */ + simdjson_inline ondemand::number_type get_number_type() const noexcept; + /** + * return true if the automatically determined type of + * the number is number_type::unsigned_integer. + */ + simdjson_inline bool is_uint64() const noexcept; + /** + * return the value as a uint64_t, only valid if is_uint64() is true. + */ + simdjson_inline uint64_t get_uint64() const noexcept; + simdjson_inline operator uint64_t() const noexcept; + + /** + * return true if the automatically determined type of + * the number is number_type::signed_integer. + */ + simdjson_inline bool is_int64() const noexcept; + /** + * return the value as a int64_t, only valid if is_int64() is true. + */ + simdjson_inline int64_t get_int64() const noexcept; + simdjson_inline operator int64_t() const noexcept; + + + /** + * return true if the automatically determined type of + * the number is number_type::floating_point_number. + */ + simdjson_inline bool is_double() const noexcept; + /** + * return the value as a double, only valid if is_double() is true. + */ + simdjson_inline double get_double() const noexcept; + simdjson_inline operator double() const noexcept; + + /** + * Convert the number to a double. Though it always succeed, the conversion + * may be lossy if the number cannot be represented exactly. + */ + simdjson_inline double as_double() const noexcept; + + +protected: + /** + * The next block of declaration is designed so that we can call the number parsing + * functions on a number type. They are protected and should never be used outside + * of the core simdjson library. + */ + friend class value_iterator; + template + friend error_code numberparsing::slow_float_parsing(simdjson_unused const uint8_t * src, W writer); + template + friend error_code numberparsing::write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer); + template + friend error_code numberparsing::parse_number(const uint8_t *const src, W &writer); + /** Store a signed 64-bit value to the number. */ + simdjson_inline void append_s64(int64_t value) noexcept; + /** Store an unsigned 64-bit value to the number. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + /** Store a double value to the number. */ + simdjson_inline void append_double(double value) noexcept; + /** Specifies that the value is a double, but leave it undefined. */ + simdjson_inline void skip_double() noexcept; + /** + * End of friend declarations. + */ + + /** + * Our attributes are a union type (size = 64 bits) + * followed by a type indicator. + */ + union { + double floating_point_number; + int64_t signed_integer; + uint64_t unsigned_integer; + } payload{0}; + number_type type{number_type::signed_integer}; +}; + +/** + * Write the JSON type to the output stream + * + * @param out The output stream. + * @param type The json_type. + */ +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept; + +#if SIMDJSON_EXCEPTIONS +/** + * Send JSON type to an output stream. + * + * @param out The output stream. + * @param type The json_type. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false); +#endif + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::json_type &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H +/* end file simdjson/generic/ondemand/json_type.h for arm64 */ +/* including simdjson/generic/ondemand/raw_json_string.h for arm64: #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * A string escaped per JSON rules, terminated with quote ("). They are used to represent + * unescaped keys inside JSON documents. + * + * (In other words, a pointer to the beginning of a string, just after the start quote, inside a + * JSON file.) + * + * This class is deliberately simplistic and has little functionality. You can + * compare a raw_json_string instance with an unescaped C string, but + * that is nearly all you can do. + * + * The raw_json_string is unescaped. If you wish to write an unescaped version of it to your own + * buffer, you may do so using the parser.unescape(string, buff) method, using an ondemand::parser + * instance. Doing so requires you to have a sufficiently large buffer. + * + * The raw_json_string instances originate typically from field instance which in turn represent + * key-value pairs from object instances. From a field instance, you get the raw_json_string + * instance by calling key(). You can, if you want a more usable string_view instance, call + * the unescaped_key() method on the field instance. You may also create a raw_json_string from + * any other string value, with the value.get_raw_json_string() method. Again, you can get + * a more usable string_view instance by calling get_string(). + * + */ +class raw_json_string { +public: + /** + * Create a new invalid raw_json_string. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline raw_json_string() noexcept = default; + + /** + * Create a new invalid raw_json_string pointed at the given location in the JSON. + * + * The given location must be just *after* the beginning quote (") in the JSON file. + * + * It *must* be terminated by a ", and be a valid JSON string. + */ + simdjson_inline raw_json_string(const uint8_t * _buf) noexcept; + /** + * Get the raw pointer to the beginning of the string in the JSON (just after the "). + * + * It is possible for this function to return a null pointer if the instance + * has outlived its existence. + */ + simdjson_inline const char * raw() const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done) on target.size() characters, + * and if the raw_json_string instance has a quote character at byte index target.size(). + * We never read more than length + 1 bytes in the raw_json_string instance. + * If length is smaller than target.size(), this will return false. + * + * The std::string_view instance may contain any characters. However, the caller + * is responsible for setting length so that length bytes may be read in the + * raw_json_string. + * + * Performance: the comparison may be done using memcmp which may be efficient + * for long strings. + */ + simdjson_inline bool unsafe_is_equal(size_t length, std::string_view target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The std::string_view instance should not contain unescaped quote characters: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * Performance: the comparison is done byte-by-byte which might be inefficient for + * long strings. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The provided C string should not contain an unescaped quote character: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(const char* target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(const char* target) const noexcept; + + /** + * Returns true if target is free from unescaped quote. If target is known at + * compile-time, we might expect the computation to happen at compile time with + * many compilers (not all!). + */ + static simdjson_inline bool is_free_from_unescaped_quote(std::string_view target) noexcept; + static simdjson_inline bool is_free_from_unescaped_quote(const char* target) noexcept; + +private: + + + /** + * This will set the inner pointer to zero, effectively making + * this instance unusable. + */ + simdjson_inline void consume() noexcept { buf = nullptr; } + + /** + * Checks whether the inner pointer is non-null and thus usable. + */ + simdjson_inline simdjson_warn_unused bool alive() const noexcept { return buf != nullptr; } + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result will be a valid UTF-8. + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + * @param allow_replacement Whether we allow replacement of invalid surrogate pairs. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape(json_iterator &iter, bool allow_replacement) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result may not be a valid UTF-8. https://simonsapin.github.io/wtf-8/ + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(json_iterator &iter) const noexcept; + const uint8_t * buf{}; + friend class object; + friend class field; + friend class parser; + friend struct simdjson_result; +}; + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &, const raw_json_string &) noexcept; + +/** + * Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible + * for providing a string with no unescaped quote. Note that unescaped quotes cannot be present in valid JSON strings. + */ +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept; +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept; + + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::raw_json_string &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private + + simdjson_inline simdjson_result raw() const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape(arm64::ondemand::json_iterator &iter, bool allow_replacement) const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(arm64::ondemand::json_iterator &iter) const noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H +/* end file simdjson/generic/ondemand/raw_json_string.h for arm64 */ +/* including simdjson/generic/ondemand/parser.h for arm64: #include "simdjson/generic/ondemand/parser.h" */ +/* begin file simdjson/generic/ondemand/parser.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * The default batch size for document_stream instances for this On Demand kernel. + * Note that different On Demand kernel may use a different DEFAULT_BATCH_SIZE value + * in the future. + */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * A JSON fragment iterator. + * + * This holds the actual iterator as well as the buffer for writing strings. + */ +class parser { +public: + /** + * Create a JSON parser. + * + * The new parser will have zero capacity. + */ + inline explicit parser(size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept; + + inline parser(parser &&other) noexcept = default; + simdjson_inline parser(const parser &other) = delete; + simdjson_inline parser &operator=(const parser &other) = delete; + simdjson_inline parser &operator=(parser &&other) noexcept = default; + + /** Deallocate the JSON parser. */ + inline ~parser() noexcept = default; + + /** + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * document doc = parser.iterate(json); + * + * It is expected that the content is a valid UTF-8 file, containing a valid JSON document. + * Otherwise the iterate method may return an error. In particular, the whole input should be + * valid: we do not attempt to tolerate incorrect content either before or after a JSON + * document. If there is a UTF-8 BOM, the parser skips it. + * + * ### IMPORTANT: Validate what you use + * + * Calling iterate on an invalid JSON document may not immediately trigger an error. The call to + * iterate does not parse and validate the whole document. + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * @param len The length of the JSON. + * @param capacity The number of bytes allocated in the JSON (must be at least len+SIMDJSON_PADDING). + * + * @return The document, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate(padded_string_view json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const char *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const uint8_t *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string_view json, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(padded_string &&json) & noexcept = delete; + + /** + * @private + * + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * json_iterator doc = parser.iterate(json); + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * The ondemand::document instance holds the iterator. The document must remain in scope + * while you are accessing instances of ondemand::value, ondemand::object, ondemand::array. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * + * @return The iterator, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate_raw(padded_string_view json) & noexcept; + + + /** + * Parse a buffer containing many JSON documents. + * + * auto json = R"({ "foo": 1 } { "foo": 2 } { "foo": 3 } )"_padded; + * ondemand::parser parser; + * ondemand::document_stream docs = parser.iterate_many(json); + * for (auto & doc : docs) { + * std::cout << doc["foo"] << std::endl; + * } + * // Prints 1 2 3 + * + * No copy of the input buffer is made. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * + * The caller is responsabile to ensure that the input string data remains unchanged and is + * not deleted during the loop. + * + * ### Format + * + * The buffer must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by ASCII whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. Documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with ASCII whitespace. + * + * The characters inside a JSON document, and between JSON documents, must be valid Unicode (UTF-8). + * If there is a UTF-8 BOM, the parser skips it. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excessively small values may impact negatively the + * performance. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The concatenated JSON to parse. + * @param len The length of the concatenated JSON. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 10MB, which has been a reasonable sweet spot in our tests. + * @param allow_comma_separated (defaults on false) This allows a mode where the documents are + * separated by commas instead of whitespace. It comes with a performance + * penalty because the entire document is indexed at once (and the document must be + * less than 4 GB), and there is no multithreading. In this mode, the batch_size parameter + * is effectively ignored, as it is set to at least the document size. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result iterate_many(const uint8_t *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const char *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const std::string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const std::string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const padded_string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const padded_string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_result iterate_many(const char *buf, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept = delete; + + /** The capacity of this parser (the largest document it can process). */ + simdjson_inline size_t capacity() const noexcept; + /** The maximum capacity of this parser (the largest document it is allowed to process). */ + simdjson_inline size_t max_capacity() const noexcept; + simdjson_inline void set_max_capacity(size_t max_capacity) noexcept; + /** + * The maximum depth of this parser (the most deeply nested objects and arrays it can process). + * This parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * The max_depth parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused error_code allocate(size_t capacity, size_t max_depth=DEFAULT_MAX_DEPTH) noexcept; + + #ifdef SIMDJSON_THREADS_ENABLED + /** + * The parser instance can use threads when they are available to speed up some + * operations. It is enabled by default. Changing this attribute will change the + * behavior of the parser for future operations. + */ + bool threaded{true}; + #endif + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result must be valid UTF-8. + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @param allow_replacement Whether we allow a replacement if the input string contains unmatched surrogate pairs. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement = false) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result may not be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept; + +private: + /** @private [for benchmarking access] The implementation to use */ + std::unique_ptr implementation{}; + size_t _capacity{0}; + size_t _max_capacity; + size_t _max_depth{DEFAULT_MAX_DEPTH}; + std::unique_ptr string_buf{}; +#if SIMDJSON_DEVELOPMENT_CHECKS + std::unique_ptr start_positions{}; +#endif + + friend class json_iterator; + friend class document_stream; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::parser &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_H +/* end file simdjson/generic/ondemand/parser.h for arm64 */ + +// All other declarations +/* including simdjson/generic/ondemand/array.h for arm64: #include "simdjson/generic/ondemand/array.h" */ +/* begin file simdjson/generic/ondemand/array.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * A forward-only JSON array. + */ +class array { +public: + /** + * Create a new invalid array. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline array() noexcept = default; + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an array is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the beginning of the array and checks whether the + * array is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result is_empty() & noexcept; + /** + * Reset the iterator so that we are pointing back at the + * beginning of the array. You should still consume values only once even if you + * can iterate through the array more than once. If you unescape a string + * within the array more than once, you have unsafe code. Note that rewinding + * an array means that you may need to reparse it anew: it is not a free + * operation. + * + * @returns true if the array contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/0/foo/a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an array + * instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the array and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Get the value at the given index. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; +protected: + /** + * Go to the end of the array, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + + /** + * Begin array iteration. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + */ + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + /** + * Begin array iteration from the root. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + * @error TAPE_ERROR if there is no closing ] at the end of the document. + */ + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + /** + * Begin array iteration. + * + * This version of the method should be called after the initial [ has been verified, and is + * intended for use by switch statements that check the type of a value. + * + * @param iter The iterator. Must be after the initial [. Will be *moved* into the resulting array. + */ + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + + /** + * Create an array at the given Internal array creation. Call array::start() or array::started() instead of this. + * + * @param iter The iterator. Must either be at the start of the first element with iter.is_alive() + * == true, or past the [] with is_alive() == false if the array is empty. Will be *moved* + * into the resulting array. + */ + simdjson_inline array(const value_iterator &iter) noexcept; + + /** + * Iterator marking current position. + * + * iter.is_alive() == false indicates iteration is complete. + */ + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; + friend struct simdjson_result; + friend class array_iterator; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::array &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + inline simdjson_result count_elements() & noexcept; + inline simdjson_result is_empty() & noexcept; + inline simdjson_result reset() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_H +/* end file simdjson/generic/ondemand/array.h for arm64 */ +/* including simdjson/generic/ondemand/array_iterator.h for arm64: #include "simdjson/generic/ondemand/array_iterator.h" */ +/* begin file simdjson/generic/ondemand/array_iterator.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * A forward-only JSON array. + * + * This is an input_iterator, meaning: + * - It is forward-only + * - * must be called exactly once per element. + * - ++ must be called exactly once in between each * (*, ++, *, ++, * ...) + */ +class array_iterator { +public: + /** Create a new, invalid array iterator. */ + simdjson_inline array_iterator() noexcept = default; + + // + // Iterator interface + // + + /** + * Get the current element. + * + * Part of the std::iterator interface. + */ + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + /** + * Check if we are at the end of the JSON. + * + * Part of the std::iterator interface. + * + * @return true if there are no more elements in the JSON array. + */ + simdjson_inline bool operator==(const array_iterator &) const noexcept; + /** + * Check if there are more elements in the JSON array. + * + * Part of the std::iterator interface. + * + * @return true if there are more elements in the JSON array. + */ + simdjson_inline bool operator!=(const array_iterator &) const noexcept; + /** + * Move to the next element. + * + * Part of the std::iterator interface. + */ + simdjson_inline array_iterator &operator++() noexcept; + +private: + value_iterator iter{}; + + simdjson_inline array_iterator(const value_iterator &iter) noexcept; + + friend class array; + friend class value; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::array_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H +/* end file simdjson/generic/ondemand/array_iterator.h for arm64 */ +/* including simdjson/generic/ondemand/document.h for arm64: #include "simdjson/generic/ondemand/document.h" */ +/* begin file simdjson/generic/ondemand/document.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * A JSON document. It holds a json_iterator instance. + * + * Used by tokens to get text, and string buffer location. + * + * You must keep the document around during iteration. + */ +class document { +public: + /** + * Create a new invalid document. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline document() noexcept = default; + simdjson_inline document(const document &other) noexcept = delete; // pass your documents by reference, not by copy + simdjson_inline document(document &&other) noexcept = default; + simdjson_inline document &operator=(const document &other) noexcept = delete; + simdjson_inline document &operator=(document &&other) noexcept = default; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() & noexcept; + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() & noexcept; + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + /** + * Cast this JSON value (inside string) to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: Calling get_string() twice on the same document is an error. + * + * @param Whether to allow a replacement character for unmatched surrogate pairs. + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + /** + * Cast this JSON value to a string. + * + * The string is not guaranteed to be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * + * Important: Calling get_wobbly_string() twice on the same document is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + /** + * Cast this JSON value to a value when the document is an object or an array. + * + * @returns A value if a JSON array or object cannot be found. + * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result get_value() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() & noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + /** @overload template simdjson_result get() & noexcept */ + template simdjson_inline simdjson_result get() && noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool, value + * + * Be mindful that the document instance must remain in scope while you are accessing object, array and value instances. + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) & noexcept; + /** @overload template error_code get(T &out) & noexcept */ + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() & noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() & noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); + /** + * Cast this JSON value to a value. + * + * @returns A value value. + * @exception if a JSON value cannot be found + */ + simdjson_inline operator value() noexcept(false); +#endif + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) & noexcept; + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to + * a key a single time. Doing object["mykey"].to_string()and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the document is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the document is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the document is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. If this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view may be the padded buffer. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + /** + * Reset the iterator inside the document instance so we are pointing back at the + * beginning of the document, as if it had just been created. It invalidates all + * values, objects and arrays that you have created so far (including unescaped strings). + */ + inline void rewind() noexcept; + /** + * Returns debugging information. + */ + inline std::string to_debug_string() noexcept; + /** + * Some unrecoverable error conditions may render the document instance unusable. + * The is_alive() method returns true when the document is still suitable. + */ + inline bool is_alive() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Returns true if this document has been fully parsed. + * If you have consumed the whole document and at_end() returns + * false, then there may be trailing content. + */ + inline bool at_end() const noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() automatically calls rewind between each call. Thus + * all values, objects and arrays that you have created so far (including unescaped strings) + * are invalidated. After calling at_pointer, you need to consume the result: string values + * should be stored in your own variables, arrays should be decoded and stored in your own array-like + * structures and so forth. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + * - SCALAR_DOCUMENT_AS_VALUE if the json_pointer is empty and the document is not a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the document and returns a string_view instance corresponding to the + * document as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; +protected: + /** + * Consumes the document. + */ + simdjson_inline error_code consume() noexcept; + + simdjson_inline document(ondemand::json_iterator &&iter) noexcept; + simdjson_inline const uint8_t *text(uint32_t idx) const noexcept; + + simdjson_inline value_iterator resume_value_iterator() noexcept; + simdjson_inline value_iterator get_root_value_iterator() noexcept; + simdjson_inline simdjson_result start_or_resume_object() noexcept; + static simdjson_inline document start(ondemand::json_iterator &&iter) noexcept; + + // + // Fields + // + json_iterator iter{}; ///< Current position in the document + static constexpr depth_t DOCUMENT_DEPTH = 0; ///< document depth is always 0 + + friend class array_iterator; + friend class value; + friend class ondemand::parser; + friend class object; + friend class array; + friend class field; + friend class token; + friend class document_stream; + friend class document_reference; +}; + + +/** + * A document_reference is a thin wrapper around a document reference instance. + */ +class document_reference { +public: + simdjson_inline document_reference() noexcept; + simdjson_inline document_reference(document &d) noexcept; + simdjson_inline document_reference(const document_reference &other) noexcept = default; + simdjson_inline document_reference& operator=(const document_reference &other) noexcept = default; + simdjson_inline void rewind() noexcept; + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + + simdjson_inline simdjson_result is_null() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + simdjson_inline operator document&() const noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator array() & noexcept(false); + simdjson_inline operator object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +private: + document *doc{nullptr}; +}; +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::document &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() & noexcept; + template simdjson_inline simdjson_result get() && noexcept; + + template simdjson_inline error_code get(T &out) & noexcept; + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator arm64::ondemand::array() & noexcept(false); + simdjson_inline operator arm64::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator arm64::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator arm64::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool at_end() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + + + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::document_reference value, error_code error) noexcept; + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator arm64::ondemand::array() & noexcept(false); + simdjson_inline operator arm64::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator arm64::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator arm64::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document_reference::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H +/* end file simdjson/generic/ondemand/document.h for arm64 */ +/* including simdjson/generic/ondemand/document_stream.h for arm64: #include "simdjson/generic/ondemand/document_stream.h" */ +/* begin file simdjson/generic/ondemand/document_stream.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#ifdef SIMDJSON_THREADS_ENABLED +#include +#include +#include +#endif + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED +/** @private Custom worker class **/ +struct stage1_worker { + stage1_worker() noexcept = default; + stage1_worker(const stage1_worker&) = delete; + stage1_worker(stage1_worker&&) = delete; + stage1_worker operator=(const stage1_worker&) = delete; + ~stage1_worker(); + /** + * We only start the thread when it is needed, not at object construction, this may throw. + * You should only call this once. + **/ + void start_thread(); + /** + * Start a stage 1 job. You should first call 'run', then 'finish'. + * You must call start_thread once before. + */ + void run(document_stream * ds, parser * stage1, size_t next_batch_start); + /** Wait for the run to finish (blocking). You should first call 'run', then 'finish'. **/ + void finish(); + +private: + + /** + * Normally, we would never stop the thread. But we do in the destructor. + * This function is only safe assuming that you are not waiting for results. You + * should have called run, then finish, and be done. + **/ + void stop_thread(); + + std::thread thread{}; + /** These three variables define the work done by the thread. **/ + ondemand::parser * stage1_thread_parser{}; + size_t _next_batch_start{}; + document_stream * owner{}; + /** + * We have two state variables. This could be streamlined to one variable in the future but + * we use two for clarity. + */ + bool has_work{false}; + bool can_work{true}; + + /** + * We lock using a mutex. + */ + std::mutex locking_mutex{}; + std::condition_variable cond_var{}; + + friend class document_stream; +}; +#endif // SIMDJSON_THREADS_ENABLED + +/** + * A forward-only stream of documents. + * + * Produced by parser::iterate_many. + * + */ +class document_stream { +public: + /** + * Construct an uninitialized document_stream. + * + * ```c++ + * document_stream docs; + * auto error = parser.iterate_many(json).get(docs); + * ``` + */ + simdjson_inline document_stream() noexcept; + /** Move one document_stream to another. */ + simdjson_inline document_stream(document_stream &&other) noexcept = default; + /** Move one document_stream to another. */ + simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default; + + simdjson_inline ~document_stream() noexcept; + + /** + * Returns the input size in bytes. + */ + inline size_t size_in_bytes() const noexcept; + + /** + * After iterating through the stream, this method + * returns the number of bytes that were not parsed at the end + * of the stream. If truncated_bytes() differs from zero, + * then the input was truncated maybe because incomplete JSON + * documents were found at the end of the stream. You + * may need to process the bytes in the interval [size_in_bytes()-truncated_bytes(), size_in_bytes()). + * + * You should only call truncated_bytes() after streaming through all + * documents, like so: + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto & doc : stream) { + * // do something with doc + * } + * size_t truncated = stream.truncated_bytes(); + * + */ + inline size_t truncated_bytes() const noexcept; + + class iterator { + public: + using value_type = simdjson_result; + using reference = value_type; + + using difference_type = std::ptrdiff_t; + + using iterator_category = std::input_iterator_tag; + + /** + * Default constructor. + */ + simdjson_inline iterator() noexcept; + /** + * Get the current document (or error). + */ + simdjson_inline simdjson_result operator*() noexcept; + /** + * Advance to the next document (prefix). + */ + inline iterator& operator++() noexcept; + /** + * Check if we're at the end yet. + * @param other the end iterator to compare to. + */ + simdjson_inline bool operator!=(const iterator &other) const noexcept; + /** + * @private + * + * Gives the current index in the input document in bytes. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * size_t index = i.current_index(); + * } + * + * This function (current_index()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline size_t current_index() const noexcept; + + /** + * @private + * + * Gives a view of the current document at the current position. + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * std::string_view v = i.source(); + * } + * + * The returned string_view instance is simply a map to the (unparsed) + * source string: it may thus include white-space characters and all manner + * of padding. + * + * This function (source()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + * + */ + simdjson_inline std::string_view source() const noexcept; + + /** + * Returns error of the stream (if any). + */ + inline error_code error() const noexcept; + + private: + simdjson_inline iterator(document_stream *s, bool finished) noexcept; + /** The document_stream we're iterating through. */ + document_stream* stream; + /** Whether we're finished or not. */ + bool finished; + + friend class document; + friend class document_stream; + friend class json_iterator; + }; + + /** + * Start iterating the documents in the stream. + */ + simdjson_inline iterator begin() noexcept; + /** + * The end of the stream, for iterator comparison purposes. + */ + simdjson_inline iterator end() noexcept; + +private: + + document_stream &operator=(const document_stream &) = delete; // Disallow copying + document_stream(const document_stream &other) = delete; // Disallow copying + + /** + * Construct a document_stream. Does not allocate or parse anything until the iterator is + * used. + * + * @param parser is a reference to the parser instance used to generate this document_stream + * @param buf is the raw byte buffer we need to process + * @param len is the length of the raw byte buffer in bytes + * @param batch_size is the size of the windows (must be strictly greater or equal to the largest JSON document) + */ + simdjson_inline document_stream( + ondemand::parser &parser, + const uint8_t *buf, + size_t len, + size_t batch_size, + bool allow_comma_separated + ) noexcept; + + /** + * Parse the first document in the buffer. Used by begin(), to handle allocation and + * initialization. + */ + inline void start() noexcept; + + /** + * Parse the next document found in the buffer previously given to document_stream. + * + * The content should be a valid JSON document encoded as UTF-8. If there is a + * UTF-8 BOM, the parser skips it. + * + * You do NOT need to pre-allocate a parser. This function takes care of + * pre-allocating a capacity defined by the batch_size defined when creating the + * document_stream object. + * + * The function returns simdjson::EMPTY if there is no more data to be parsed. + * + * The function returns simdjson::SUCCESS (as integer = 0) in case of success + * and indicates that the buffer has successfully been parsed to the end. + * Every document it contained has been parsed without error. + * + * The function returns an error code from simdjson/simdjson.h in case of failure + * such as simdjson::CAPACITY, simdjson::MEMALLOC, simdjson::DEPTH_ERROR and so forth; + * the simdjson::error_message function converts these error codes into a string). + * + * You can also check validity by calling parser.is_valid(). The same parser can + * and should be reused for the other documents in the buffer. + */ + inline void next() noexcept; + + /** Move the json_iterator of the document to the location of the next document in the stream. */ + inline void next_document() noexcept; + + /** Get the next document index. */ + inline size_t next_batch_start() const noexcept; + + /** Pass the next batch through stage 1 with the given parser. */ + inline error_code run_stage1(ondemand::parser &p, size_t batch_start) noexcept; + + // Fields + ondemand::parser *parser; + const uint8_t *buf; + size_t len; + size_t batch_size; + bool allow_comma_separated; + /** + * We are going to use just one document instance. The document owns + * the json_iterator. It implies that we only ever pass a reference + * to the document to the users. + */ + document doc{}; + /** The error (or lack thereof) from the current document. */ + error_code error; + size_t batch_start{0}; + size_t doc_index{}; + + #ifdef SIMDJSON_THREADS_ENABLED + /** Indicates whether we use threads. Note that this needs to be a constant during the execution of the parsing. */ + bool use_thread; + + inline void load_from_stage1_thread() noexcept; + + /** Start a thread to run stage 1 on the next batch. */ + inline void start_stage1_thread() noexcept; + + /** Wait for the stage 1 thread to finish and capture the results. */ + inline void finish_stage1_thread() noexcept; + + /** The error returned from the stage 1 thread. */ + error_code stage1_thread_error{UNINITIALIZED}; + /** The thread used to run stage 1 against the next batch in the background. */ + std::unique_ptr worker{new(std::nothrow) stage1_worker()}; + /** + * The parser used to run stage 1 in the background. Will be swapped + * with the regular parser when finished. + */ + ondemand::parser stage1_thread_parser{}; + + friend struct stage1_worker; + #endif // SIMDJSON_THREADS_ENABLED + + friend class parser; + friend class document; + friend class json_iterator; + friend struct simdjson_result; + friend struct internal::simdjson_result_base; +}; // document_stream + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::document_stream &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H +/* end file simdjson/generic/ondemand/document_stream.h for arm64 */ +/* including simdjson/generic/ondemand/field.h for arm64: #include "simdjson/generic/ondemand/field.h" */ +/* begin file simdjson/generic/ondemand/field.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * A JSON field (key/value pair) in an object. + * + * Returned from object iteration. + * + * Extends from std::pair so you can use C++ algorithms that rely on pairs. + */ +class field : public std::pair { +public: + /** + * Create a new invalid field. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline field() noexcept; + + /** + * Get the key as a string_view (for higher speed, consider raw_key). + * We deliberately use a more cumbersome name (unescaped_key) to force users + * to think twice about using it. + * + * This consumes the key: once you have called unescaped_key(), you cannot + * call it again nor can you call key(). + */ + simdjson_inline simdjson_warn_unused simdjson_result unescaped_key(bool allow_replacement) noexcept; + /** + * Get the key as a raw_json_string. Can be used for direct comparison with + * an unescaped C string: e.g., key() == "test". + */ + simdjson_inline raw_json_string key() const noexcept; + /** + * Get the field value. + */ + simdjson_inline ondemand::value &value() & noexcept; + /** + * @overload ondemand::value &ondemand::value() & noexcept + */ + simdjson_inline ondemand::value value() && noexcept; + +protected: + simdjson_inline field(raw_json_string key, ondemand::value &&value) noexcept; + static simdjson_inline simdjson_result start(value_iterator &parent_iter) noexcept; + static simdjson_inline simdjson_result start(const value_iterator &parent_iter, raw_json_string key) noexcept; + friend struct simdjson_result; + friend class object_iterator; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::field &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result unescaped_key(bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result key() noexcept; + simdjson_inline simdjson_result value() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_H +/* end file simdjson/generic/ondemand/field.h for arm64 */ +/* including simdjson/generic/ondemand/object.h for arm64: #include "simdjson/generic/ondemand/object.h" */ +/* begin file simdjson/generic/ondemand/object.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +/** + * A forward-only JSON object field iterator. + */ +class object { +public: + /** + * Create a new invalid object. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a + * key a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an object + * instance: there is no rewind and no invalidation. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + + /** + * Reset the iterator so that we are pointing back at the + * beginning of the object. You should still consume values only once even if you + * can iterate through the object more than once. If you unescape a string within + * the object more than once, you have unsafe code. Note that rewinding an object + * means that you may need to reparse it anew: it is not a free operation. + * + * @returns true if the object contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * This method scans the beginning of the object and checks whether the + * object is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + inline simdjson_result is_empty() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Consumes the object and returns a string_view instance corresponding to the + * object as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + +protected: + /** + * Go to the end of the object, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + static simdjson_inline object resume(const value_iterator &iter) noexcept; + simdjson_inline object(const value_iterator &iter) noexcept; + + simdjson_warn_unused simdjson_inline error_code find_field_raw(const std::string_view key) noexcept; + + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::object &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + inline simdjson_result reset() noexcept; + inline simdjson_result is_empty() noexcept; + inline simdjson_result count_fields() & noexcept; + inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_H +/* end file simdjson/generic/ondemand/object.h for arm64 */ +/* including simdjson/generic/ondemand/object_iterator.h for arm64: #include "simdjson/generic/ondemand/object_iterator.h" */ +/* begin file simdjson/generic/ondemand/object_iterator.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +class object_iterator { +public: + /** + * Create a new invalid object_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object_iterator() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline simdjson_result operator*() noexcept; + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const object_iterator &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const object_iterator &) const noexcept; + // Checks for ']' and ',' + simdjson_inline object_iterator &operator++() noexcept; + +private: + /** + * The underlying JSON iterator. + * + * PERF NOTE: expected to be elided in favor of the parent document: this is set when the object + * is first used, and never changes afterwards. + */ + value_iterator iter{}; + + simdjson_inline object_iterator(const value_iterator &iter) noexcept; + friend struct simdjson_result; + friend class object; +}; + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public arm64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(arm64::ondemand::object_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + // Checks for ']' and ',' + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H +/* end file simdjson/generic/ondemand/object_iterator.h for arm64 */ +/* including simdjson/generic/ondemand/serialization.h for arm64: #include "simdjson/generic/ondemand/serialization.h" */ +/* begin file simdjson/generic/ondemand/serialization.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Create a string-view instance out of a document instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(arm64::ondemand::document& x) noexcept; +/** + * Create a string-view instance out of a value instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. The value must + * not have been accessed previously. It does not + * validate the content. + */ +inline simdjson_result to_json_string(arm64::ondemand::value& x) noexcept; +/** + * Create a string-view instance out of an object instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(arm64::ondemand::object& x) noexcept; +/** + * Create a string-view instance out of an array instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(arm64::ondemand::array& x) noexcept; +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +} // namespace simdjson + +/** + * We want to support argument-dependent lookup (ADL). + * Hence we should define operator<< in the namespace + * where the argument (here value, object, etc.) resides. + * Credit: @madhur4127 + * See https://github.com/simdjson/simdjson/issues/1768 + */ +namespace simdjson { namespace arm64 { namespace ondemand { + +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The element. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::value x); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::array value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::document& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::document_reference& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The object. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::object value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +}}} // namespace simdjson::arm64::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H +/* end file simdjson/generic/ondemand/serialization.h for arm64 */ + +// Inline definitions +/* including simdjson/generic/ondemand/array-inl.h for arm64: #include "simdjson/generic/ondemand/array-inl.h" */ +/* begin file simdjson/generic/ondemand/array-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter->depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the array is first found and the iterator is just past the `{`. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the `,` before the next value (or `]`). In this state, +// depth == iter->depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter->depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter->depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the array iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet element may be missing or not be an +// array--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter->depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between elements, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter->depth == depth, and at_start == false. +// +// ## Terminal State +// +// The terminal state has iter->depth < depth. at_start is always false. +// +// - Finished: When we have reached a `]` or have reported an error, we are finished. We signal this +// by decrementing depth. In this state, iter->depth < depth, at_start == false, and +// error == SUCCESS. +// + +simdjson_inline array::array(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result array::start(value_iterator &iter) noexcept { + // We don't need to know if the array is empty to start iteration, but we do want to know if there + // is an error--thus `simdjson_unused`. + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::start_root(value_iterator &iter) noexcept { + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_root_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::started(value_iterator &iter) noexcept { + bool has_value; + SIMDJSON_TRY(iter.started_array().get(has_value)); + return array(iter); +} + +simdjson_inline simdjson_result array::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return array_iterator(iter); +} +simdjson_inline simdjson_result array::end() noexcept { + return array_iterator(iter); +} +simdjson_inline error_code array::consume() noexcept { + auto error = iter.json_iter().skip_child(iter.depth()-1); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result array::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter._json_iter->unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline simdjson_result array::count_elements() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the array after counting the number of elements. + iter.reset_array(); + return count; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline simdjson_result array::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_array().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +inline simdjson_result array::reset() & noexcept { + return iter.reset_array(); +} + +inline simdjson_result array::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + // - means "the append position" or "the element after the end of the array" + // We don't support this, because we're returning a real element, not a position. + if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; } + + // Read the array index + size_t array_index = 0; + size_t i; + for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) { + uint8_t digit = uint8_t(json_pointer[i] - '0'); + // Check for non-digit in array index. If it's there, we're trying to get a field in an object + if (digit > 9) { return INCORRECT_TYPE; } + array_index = array_index*10 + digit; + } + + // 0 followed by other digits is invalid + if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0" + + // Empty string is invalid; so is a "/" with no digits before it + if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index" + // Get the child + auto child = at(array_index); + // If there is an error, it ends here + if(child.error()) { + return child; + } + + // If there is a /, we're not done yet, call recursively. + if (i < json_pointer.length()) { + child = child.at_pointer(json_pointer.substr(i)); + } + return child; +} + +simdjson_inline simdjson_result array::at(size_t index) noexcept { + size_t i = 0; + for (auto value : *this) { + if (i == index) { return value; } + i++; + } + return INDEX_OUT_OF_BOUNDS; +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + arm64::ondemand::array &&value +) noexcept + : implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept + : implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::is_empty() & noexcept { + if (error()) { return error(); } + return first.is_empty(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H +/* end file simdjson/generic/ondemand/array-inl.h for arm64 */ +/* including simdjson/generic/ondemand/array_iterator-inl.h for arm64: #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/array_iterator-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline array_iterator::array_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result array_iterator::operator*() noexcept { + if (iter.error()) { iter.abandon(); return iter.error(); } + return value(iter.child()); +} +simdjson_inline bool array_iterator::operator==(const array_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept { + return iter.is_open(); +} +simdjson_inline array_iterator &array_iterator::operator++() noexcept { + error_code error; + // PERF NOTE this is a safety rail ... users should exit loops as soon as they receive an error, so we'll never get here. + // However, it does not seem to make a perf difference, so we add it out of an abundance of caution. + if (( error = iter.error() )) { return *this; } + if (( error = iter.skip_child() )) { return *this; } + if (( error = iter.has_next_element().error() )) { return *this; } + return *this; +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + arm64::ondemand::array_iterator &&value +) noexcept + : arm64::implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : arm64::implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++(first); + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/array_iterator-inl.h for arm64 */ +/* including simdjson/generic/ondemand/document-inl.h for arm64: #include "simdjson/generic/ondemand/document-inl.h" */ +/* begin file simdjson/generic/ondemand/document-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline document::document(ondemand::json_iterator &&_iter) noexcept + : iter{std::forward(_iter)} +{ + logger::log_start_value(iter, "document"); +} + +simdjson_inline document document::start(json_iterator &&iter) noexcept { + return document(std::forward(iter)); +} + +inline void document::rewind() noexcept { + iter.rewind(); +} + +inline std::string document::to_debug_string() noexcept { + return iter.to_string(); +} + +inline simdjson_result document::current_location() const noexcept { + return iter.current_location(); +} + +inline int32_t document::current_depth() const noexcept { + return iter.depth(); +} + +inline bool document::at_end() const noexcept { + return iter.at_end(); +} + + +inline bool document::is_alive() noexcept { + return iter.is_alive(); +} +simdjson_inline value_iterator document::resume_value_iterator() noexcept { + return value_iterator(&iter, 1, iter.root_position()); +} +simdjson_inline value_iterator document::get_root_value_iterator() noexcept { + return resume_value_iterator(); +} +simdjson_inline simdjson_result document::start_or_resume_object() noexcept { + if (iter.at_root()) { + return get_object(); + } else { + return object::resume(resume_value_iterator()); + } +} +simdjson_inline simdjson_result document::get_value() noexcept { + // Make sure we start any arrays or objects before returning, so that start_root_() + // gets called. + iter.assert_at_document_depth(); + switch (*iter.peek()) { + case '[': { + // The following lines check that the document ends with ]. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_array(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + case '{': { + // The following lines would check that the document ends with }. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_object(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + default: + // Unfortunately, scalar documents are a special case in simdjson and they cannot + // be safely converted to value instances. + return SCALAR_DOCUMENT_AS_VALUE; + } +} +simdjson_inline simdjson_result document::get_array() & noexcept { + auto value = get_root_value_iterator(); + return array::start_root(value); +} +simdjson_inline simdjson_result document::get_object() & noexcept { + auto value = get_root_value_iterator(); + return object::start_root(value); +} + +/** + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. We want to disallow trailing + * content. + * Thus, in several implementations below, we pass a 'true' parameter value to + * a get_root_value_iterator() method: this indicates that we disallow trailing content. + */ + +simdjson_inline simdjson_result document::get_uint64() noexcept { + return get_root_value_iterator().get_root_uint64(true); +} +simdjson_inline simdjson_result document::get_uint64_in_string() noexcept { + return get_root_value_iterator().get_root_uint64_in_string(true); +} +simdjson_inline simdjson_result document::get_int64() noexcept { + return get_root_value_iterator().get_root_int64(true); +} +simdjson_inline simdjson_result document::get_int64_in_string() noexcept { + return get_root_value_iterator().get_root_int64_in_string(true); +} +simdjson_inline simdjson_result document::get_double() noexcept { + return get_root_value_iterator().get_root_double(true); +} +simdjson_inline simdjson_result document::get_double_in_string() noexcept { + return get_root_value_iterator().get_root_double_in_string(true); +} +simdjson_inline simdjson_result document::get_string(bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(true, allow_replacement); +} +template +simdjson_inline error_code document::get_string(string_type& receiver, bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(receiver, true, allow_replacement); +} +simdjson_inline simdjson_result document::get_wobbly_string() noexcept { + return get_root_value_iterator().get_root_wobbly_string(true); +} +simdjson_inline simdjson_result document::get_raw_json_string() noexcept { + return get_root_value_iterator().get_root_raw_json_string(true); +} +simdjson_inline simdjson_result document::get_bool() noexcept { + return get_root_value_iterator().get_root_bool(true); +} +simdjson_inline simdjson_result document::is_null() noexcept { + return get_root_value_iterator().is_root_null(true); +} + +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_array(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_object(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_double(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_bool(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_value(); } + +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_double(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_uint64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_int64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_bool(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_value(); } + +template simdjson_inline error_code document::get(T &out) & noexcept { + return get().get(out); +} +template simdjson_inline error_code document::get(T &out) && noexcept { + return std::forward(*this).get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document::operator array() & noexcept(false) { return get_array(); } +simdjson_inline document::operator object() & noexcept(false) { return get_object(); } +simdjson_inline document::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document::operator double() noexcept(false) { return get_double(); } +simdjson_inline document::operator std::string_view() noexcept(false) { return get_string(false); } +simdjson_inline document::operator raw_json_string() noexcept(false) { return get_raw_json_string(); } +simdjson_inline document::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document::operator value() noexcept(false) { return get_value(); } + +#endif +simdjson_inline simdjson_result document::count_elements() & noexcept { + auto a = get_array(); + simdjson_result answer = a.count_elements(); + /* If there was an array, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::count_fields() & noexcept { + auto a = get_object(); + simdjson_result answer = a.count_fields(); + /* If there was an object, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::at(size_t index) & noexcept { + auto a = get_array(); + return a.at(index); +} +simdjson_inline simdjson_result document::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result document::end() & noexcept { + return {}; +} + +simdjson_inline simdjson_result document::find_field(std::string_view key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field(const char *key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field_unordered(std::string_view key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::find_field_unordered(const char *key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::operator[](std::string_view key) & noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result document::operator[](const char *key) & noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline error_code document::consume() noexcept { + auto error = iter.skip_child(0); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result document::raw_json() noexcept { + auto _iter = get_root_value_iterator(); + const uint8_t * starting_point{_iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter.unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result document::type() noexcept { + return get_root_value_iterator().type(); +} + +simdjson_inline simdjson_result document::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool document::is_negative() noexcept { + return get_root_value_iterator().is_root_negative(); +} + +simdjson_inline simdjson_result document::is_integer() noexcept { + return get_root_value_iterator().is_root_integer(true); +} + +simdjson_inline simdjson_result document::get_number_type() noexcept { + return get_root_value_iterator().get_root_number_type(true); +} + +simdjson_inline simdjson_result document::get_number() noexcept { + return get_root_value_iterator().get_root_number(true); +} + + +simdjson_inline simdjson_result document::raw_json_token() noexcept { + auto _iter = get_root_value_iterator(); + return std::string_view(reinterpret_cast(_iter.peek_start()), _iter.peek_start_length()); +} + +simdjson_inline simdjson_result document::at_pointer(std::string_view json_pointer) noexcept { + rewind(); // Rewind the document each time at_pointer is called + if (json_pointer.empty()) { + return this->get_value(); + } + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + arm64::ondemand::document &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base( + error + ) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template +simdjson_inline simdjson_result simdjson_result::get() & noexcept { + if (error()) { return error(); } + return first.get(); +} +template +simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first).get(); +} +template +simdjson_inline error_code simdjson_result::get(T &out) & noexcept { + if (error()) { return error(); } + return first.get(out); +} +template +simdjson_inline error_code simdjson_result::get(T &out) && noexcept { + if (error()) { return error(); } + return std::forward(first).get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() & noexcept = delete; +template<> simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first); +} +template<> simdjson_inline error_code simdjson_result::get(arm64::ondemand::document &out) & noexcept = delete; +template<> simdjson_inline error_code simdjson_result::get(arm64::ondemand::document &out) && noexcept { + if (error()) { return error(); } + out = std::forward(first); + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} + +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} + + +simdjson_inline bool simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} + +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} + +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} + +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} + + +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator arm64::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline bool simdjson_result::at_end() const noexcept { + if (error()) { return error(); } + return first.at_end(); +} + + +simdjson_inline int32_t simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline document_reference::document_reference() noexcept : doc{nullptr} {} +simdjson_inline document_reference::document_reference(document &d) noexcept : doc(&d) {} +simdjson_inline void document_reference::rewind() noexcept { doc->rewind(); } +simdjson_inline simdjson_result document_reference::get_array() & noexcept { return doc->get_array(); } +simdjson_inline simdjson_result document_reference::get_object() & noexcept { return doc->get_object(); } +/** + * The document_reference instances are used primarily/solely for streams of JSON + * documents. + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. + * + * However, for streams of JSON documents, we want to be able to start from + * "321" "321" "321" + * and parse it successfully as a stream of JSON documents, calling get_uint64_in_string() + * successfully each time. + * + * To achieve this result, we pass a 'false' to a get_root_value_iterator() method: + * this indicates that we allow trailing content. + */ +simdjson_inline simdjson_result document_reference::get_uint64() noexcept { return doc->get_root_value_iterator().get_root_uint64(false); } +simdjson_inline simdjson_result document_reference::get_uint64_in_string() noexcept { return doc->get_root_value_iterator().get_root_uint64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_int64() noexcept { return doc->get_root_value_iterator().get_root_int64(false); } +simdjson_inline simdjson_result document_reference::get_int64_in_string() noexcept { return doc->get_root_value_iterator().get_root_int64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_double() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_double_in_string() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_string(bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(false, allow_replacement); } +template +simdjson_inline error_code document_reference::get_string(string_type& receiver, bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(receiver, false, allow_replacement); } +simdjson_inline simdjson_result document_reference::get_wobbly_string() noexcept { return doc->get_root_value_iterator().get_root_wobbly_string(false); } +simdjson_inline simdjson_result document_reference::get_raw_json_string() noexcept { return doc->get_root_value_iterator().get_root_raw_json_string(false); } +simdjson_inline simdjson_result document_reference::get_bool() noexcept { return doc->get_root_value_iterator().get_root_bool(false); } +simdjson_inline simdjson_result document_reference::get_value() noexcept { return doc->get_value(); } +simdjson_inline simdjson_result document_reference::is_null() noexcept { return doc->get_root_value_iterator().is_root_null(false); } + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document_reference::operator array() & noexcept(false) { return array(*doc); } +simdjson_inline document_reference::operator object() & noexcept(false) { return object(*doc); } +simdjson_inline document_reference::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document_reference::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document_reference::operator double() noexcept(false) { return get_double(); } +simdjson_inline document_reference::operator std::string_view() noexcept(false) { return std::string_view(*doc); } +simdjson_inline document_reference::operator raw_json_string() noexcept(false) { return raw_json_string(*doc); } +simdjson_inline document_reference::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document_reference::operator value() noexcept(false) { return value(*doc); } +#endif +simdjson_inline simdjson_result document_reference::count_elements() & noexcept { return doc->count_elements(); } +simdjson_inline simdjson_result document_reference::count_fields() & noexcept { return doc->count_fields(); } +simdjson_inline simdjson_result document_reference::at(size_t index) & noexcept { return doc->at(index); } +simdjson_inline simdjson_result document_reference::begin() & noexcept { return doc->begin(); } +simdjson_inline simdjson_result document_reference::end() & noexcept { return doc->end(); } +simdjson_inline simdjson_result document_reference::find_field(std::string_view key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::find_field(const char *key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::operator[](std::string_view key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::operator[](const char *key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::find_field_unordered(std::string_view key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::find_field_unordered(const char *key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::type() noexcept { return doc->type(); } +simdjson_inline simdjson_result document_reference::is_scalar() noexcept { return doc->is_scalar(); } +simdjson_inline simdjson_result document_reference::current_location() noexcept { return doc->current_location(); } +simdjson_inline int32_t document_reference::current_depth() const noexcept { return doc->current_depth(); } +simdjson_inline bool document_reference::is_negative() noexcept { return doc->is_negative(); } +simdjson_inline simdjson_result document_reference::is_integer() noexcept { return doc->get_root_value_iterator().is_root_integer(false); } +simdjson_inline simdjson_result document_reference::get_number_type() noexcept { return doc->get_root_value_iterator().get_root_number_type(false); } +simdjson_inline simdjson_result document_reference::get_number() noexcept { return doc->get_root_value_iterator().get_root_number(false); } +simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } +simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } +simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} +simdjson_inline document_reference::operator document&() const noexcept { return *doc; } + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + + + +namespace simdjson { +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::document_reference value, error_code error) + noexcept : implementation_simdjson_result_base(std::forward(value), error) {} + + +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator arm64::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H +/* end file simdjson/generic/ondemand/document-inl.h for arm64 */ +/* including simdjson/generic/ondemand/document_stream-inl.h for arm64: #include "simdjson/generic/ondemand/document_stream-inl.h" */ +/* begin file simdjson/generic/ondemand/document_stream-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void stage1_worker::finish() { + // After calling "run" someone would call finish() to wait + // for the end of the processing. + // This function will wait until either the thread has done + // the processing or, else, the destructor has been called. + std::unique_lock lock(locking_mutex); + cond_var.wait(lock, [this]{return has_work == false;}); +} + +inline stage1_worker::~stage1_worker() { + // The thread may never outlive the stage1_worker instance + // and will always be stopped/joined before the stage1_worker + // instance is gone. + stop_thread(); +} + +inline void stage1_worker::start_thread() { + std::unique_lock lock(locking_mutex); + if(thread.joinable()) { + return; // This should never happen but we never want to create more than one thread. + } + thread = std::thread([this]{ + while(true) { + std::unique_lock thread_lock(locking_mutex); + // We wait for either "run" or "stop_thread" to be called. + cond_var.wait(thread_lock, [this]{return has_work || !can_work;}); + // If, for some reason, the stop_thread() method was called (i.e., the + // destructor of stage1_worker is called, then we want to immediately destroy + // the thread (and not do any more processing). + if(!can_work) { + break; + } + this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser, + this->_next_batch_start); + this->has_work = false; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify "finish" + thread_lock.unlock(); + } + } + ); +} + + +inline void stage1_worker::stop_thread() { + std::unique_lock lock(locking_mutex); + // We have to make sure that all locks can be released. + can_work = false; + has_work = false; + cond_var.notify_all(); + lock.unlock(); + if(thread.joinable()) { + thread.join(); + } +} + +inline void stage1_worker::run(document_stream * ds, parser * stage1, size_t next_batch_start) { + std::unique_lock lock(locking_mutex); + owner = ds; + _next_batch_start = next_batch_start; + stage1_thread_parser = stage1; + has_work = true; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify the thread lock that we have work + lock.unlock(); +} + +#endif // SIMDJSON_THREADS_ENABLED + +simdjson_inline document_stream::document_stream( + ondemand::parser &_parser, + const uint8_t *_buf, + size_t _len, + size_t _batch_size, + bool _allow_comma_separated +) noexcept + : parser{&_parser}, + buf{_buf}, + len{_len}, + batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size}, + allow_comma_separated{_allow_comma_separated}, + error{SUCCESS} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change + #endif +{ +#ifdef SIMDJSON_THREADS_ENABLED + if(worker.get() == nullptr) { + error = MEMALLOC; + } +#endif +} + +simdjson_inline document_stream::document_stream() noexcept + : parser{nullptr}, + buf{nullptr}, + len{0}, + batch_size{0}, + allow_comma_separated{false}, + error{UNINITIALIZED} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(false) + #endif +{ +} + +simdjson_inline document_stream::~document_stream() noexcept +{ + #ifdef SIMDJSON_THREADS_ENABLED + worker.reset(); + #endif +} + +inline size_t document_stream::size_in_bytes() const noexcept { + return len; +} + +inline size_t document_stream::truncated_bytes() const noexcept { + if(error == CAPACITY) { return len - batch_start; } + return parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] - parser->implementation->structural_indexes[parser->implementation->n_structural_indexes + 1]; +} + +simdjson_inline document_stream::iterator::iterator() noexcept + : stream{nullptr}, finished{true} { +} + +simdjson_inline document_stream::iterator::iterator(document_stream* _stream, bool is_end) noexcept + : stream{_stream}, finished{is_end} { +} + +simdjson_inline simdjson_result document_stream::iterator::operator*() noexcept { + //if(stream->error) { return stream->error; } + return simdjson_result(stream->doc, stream->error); +} + +simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept { + // If there is an error, then we want the iterator + // to be finished, no matter what. (E.g., we do not + // keep generating documents with errors, or go beyond + // a document with errors.) + // + // Users do not have to call "operator*()" when they use operator++, + // so we need to end the stream in the operator++ function. + // + // Note that setting finished = true is essential otherwise + // we would enter an infinite loop. + if (stream->error) { finished = true; } + // Note that stream->error() is guarded against error conditions + // (it will immediately return if stream->error casts to false). + // In effect, this next function does nothing when (stream->error) + // is true (hence the risk of an infinite loop). + stream->next(); + // If that was the last document, we're finished. + // It is the only type of error we do not want to appear + // in operator*. + if (stream->error == EMPTY) { finished = true; } + // If we had any other kind of error (not EMPTY) then we want + // to pass it along to the operator* and we cannot mark the result + // as "finished" just yet. + return *this; +} + +simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept { + return finished != other.finished; +} + +simdjson_inline document_stream::iterator document_stream::begin() noexcept { + start(); + // If there are no documents, we're finished. + return iterator(this, error == EMPTY); +} + +simdjson_inline document_stream::iterator document_stream::end() noexcept { + return iterator(this, true); +} + +inline void document_stream::start() noexcept { + if (error) { return; } + error = parser->allocate(batch_size); + if (error) { return; } + // Always run the first stage 1 parse immediately + batch_start = 0; + error = run_stage1(*parser, batch_start); + while(error == EMPTY) { + // In exceptional cases, we may start with an empty block + batch_start = next_batch_start(); + if (batch_start >= len) { return; } + error = run_stage1(*parser, batch_start); + } + if (error) { return; } + doc_index = batch_start; + doc = document(json_iterator(&buf[batch_start], parser)); + doc.iter._streaming = true; + + #ifdef SIMDJSON_THREADS_ENABLED + if (use_thread && next_batch_start() < len) { + // Kick off the first thread on next batch if needed + error = stage1_thread_parser.allocate(batch_size); + if (error) { return; } + worker->start_thread(); + start_stage1_thread(); + if (error) { return; } + } + #endif // SIMDJSON_THREADS_ENABLED +} + +inline void document_stream::next() noexcept { + // We always enter at once once in an error condition. + if (error) { return; } + next_document(); + if (error) { return; } + auto cur_struct_index = doc.iter._root - parser->implementation->structural_indexes.get(); + doc_index = batch_start + parser->implementation->structural_indexes[cur_struct_index]; + + // Check if at end of structural indexes (i.e. at end of batch) + if(cur_struct_index >= static_cast(parser->implementation->n_structural_indexes)) { + error = EMPTY; + // Load another batch (if available) + while (error == EMPTY) { + batch_start = next_batch_start(); + if (batch_start >= len) { break; } + #ifdef SIMDJSON_THREADS_ENABLED + if(use_thread) { + load_from_stage1_thread(); + } else { + error = run_stage1(*parser, batch_start); + } + #else + error = run_stage1(*parser, batch_start); + #endif + /** + * Whenever we move to another window, we need to update all pointers to make + * it appear as if the input buffer started at the beginning of the window. + * + * Take this input: + * + * {"z":5} {"1":1,"2":2,"4":4} [7, 10, 9] [15, 11, 12, 13] [154, 110, 112, 1311] + * + * Say you process the following window... + * + * '{"z":5} {"1":1,"2":2,"4":4} [7, 10, 9]' + * + * When you do so, the json_iterator has a pointer at the beginning of the memory region + * (pointing at the beginning of '{"z"...'. + * + * When you move to the window that starts at... + * + * '[7, 10, 9] [15, 11, 12, 13] ... + * + * then it is not sufficient to just run stage 1. You also need to re-anchor the + * json_iterator so that it believes we are starting at '[7, 10, 9]...'. + * + * Under the DOM front-end, this gets done automatically because the parser owns + * the pointer the data, and when you call stage1 and then stage2 on the same + * parser, then stage2 will run on the pointer acquired by stage1. + * + * That is, stage1 calls "this->buf = _buf" so the parser remembers the buffer that + * we used. But json_iterator has no callback when stage1 is called on the parser. + * In fact, I think that the parser is unaware of json_iterator. + * + * + * So we need to re-anchor the json_iterator after each call to stage 1 so that + * all of the pointers are in sync. + */ + doc.iter = json_iterator(&buf[batch_start], parser); + doc.iter._streaming = true; + /** + * End of resync. + */ + + if (error) { continue; } // If the error was EMPTY, we may want to load another batch. + doc_index = batch_start; + } + } +} + +inline void document_stream::next_document() noexcept { + // Go to next place where depth=0 (document depth) + error = doc.iter.skip_child(0); + if (error) { return; } + // Always set depth=1 at the start of document + doc.iter._depth = 1; + // consume comma if comma separated is allowed + if (allow_comma_separated) { doc.iter.consume_character(','); } + // Resets the string buffer at the beginning, thus invalidating the strings. + doc.iter._string_buf_loc = parser->string_buf.get(); + doc.iter._root = doc.iter.position(); +} + +inline size_t document_stream::next_batch_start() const noexcept { + return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes]; +} + +inline error_code document_stream::run_stage1(ondemand::parser &p, size_t _batch_start) noexcept { + // This code only updates the structural index in the parser, it does not update any json_iterator + // instance. + size_t remaining = len - _batch_start; + if (remaining <= batch_size) { + return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final); + } else { + return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial); + } +} + +simdjson_inline size_t document_stream::iterator::current_index() const noexcept { + return stream->doc_index; +} + +simdjson_inline std::string_view document_stream::iterator::source() const noexcept { + auto depth = stream->doc.iter.depth(); + auto cur_struct_index = stream->doc.iter._root - stream->parser->implementation->structural_indexes.get(); + + // If at root, process the first token to determine if scalar value + if (stream->doc.iter.at_root()) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': // Depth=1 already at start of document + break; + case '}': case ']': + depth--; + break; + default: // Scalar value document + // TODO: Remove any trailing whitespaces + // This returns a string spanning from start of value to the beginning of the next document (excluded) + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[++cur_struct_index] - current_index() - 1); + } + cur_struct_index++; + } + + while (cur_struct_index <= static_cast(stream->parser->implementation->n_structural_indexes)) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': + depth++; + break; + case '}': case ']': + depth--; + break; + } + if (depth == 0) { break; } + cur_struct_index++; + } + + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[cur_struct_index] - current_index() + stream->batch_start + 1);; +} + +inline error_code document_stream::iterator::error() const noexcept { + return stream->error; +} + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void document_stream::load_from_stage1_thread() noexcept { + worker->finish(); + // Swap to the parser that was loaded up in the thread. Make sure the parser has + // enough memory to swap to, as well. + std::swap(stage1_thread_parser,*parser); + error = stage1_thread_error; + if (error) { return; } + + // If there's anything left, start the stage 1 thread! + if (next_batch_start() < len) { + start_stage1_thread(); + } +} + +inline void document_stream::start_stage1_thread() noexcept { + // we call the thread on a lambda that will update + // this->stage1_thread_error + // there is only one thread that may write to this value + // TODO this is NOT exception-safe. + this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error + size_t _next_batch_start = this->next_batch_start(); + + worker->run(this, & this->stage1_thread_parser, _next_batch_start); +} + +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result::simdjson_result( + arm64::ondemand::document_stream &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} + +} + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H +/* end file simdjson/generic/ondemand/document_stream-inl.h for arm64 */ +/* including simdjson/generic/ondemand/field-inl.h for arm64: #include "simdjson/generic/ondemand/field-inl.h" */ +/* begin file simdjson/generic/ondemand/field-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +// clang 6 doesn't think the default constructor can be noexcept, so we make it explicit +simdjson_inline field::field() noexcept : std::pair() {} + +simdjson_inline field::field(raw_json_string key, ondemand::value &&value) noexcept + : std::pair(key, std::forward(value)) +{ +} + +simdjson_inline simdjson_result field::start(value_iterator &parent_iter) noexcept { + raw_json_string key; + SIMDJSON_TRY( parent_iter.field_key().get(key) ); + SIMDJSON_TRY( parent_iter.field_value() ); + return field::start(parent_iter, key); +} + +simdjson_inline simdjson_result field::start(const value_iterator &parent_iter, raw_json_string key) noexcept { + return field(key, parent_iter.child()); +} + +simdjson_inline simdjson_warn_unused simdjson_result field::unescaped_key(bool allow_replacement) noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() but Visual Studio won't let us. + simdjson_result answer = first.unescape(second.iter.json_iter(), allow_replacement); + first.consume(); + return answer; +} + +simdjson_inline raw_json_string field::key() const noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() by Visual Studio won't let us. + return first; +} + +simdjson_inline value &field::value() & noexcept { + return second; +} + +simdjson_inline value field::value() && noexcept { + return std::forward(*this).second; +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + arm64::ondemand::field &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::key() noexcept { + if (error()) { return error(); } + return first.key(); +} +simdjson_inline simdjson_result simdjson_result::unescaped_key(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.unescaped_key(allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::value() noexcept { + if (error()) { return error(); } + return std::move(first.value()); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H +/* end file simdjson/generic/ondemand/field-inl.h for arm64 */ +/* including simdjson/generic/ondemand/json_iterator-inl.h for arm64: #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/json_iterator-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline json_iterator::json_iterator(json_iterator &&other) noexcept + : token(std::forward(other.token)), + parser{other.parser}, + _string_buf_loc{other._string_buf_loc}, + error{other.error}, + _depth{other._depth}, + _root{other._root}, + _streaming{other._streaming} +{ + other.parser = nullptr; +} +simdjson_inline json_iterator &json_iterator::operator=(json_iterator &&other) noexcept { + token = other.token; + parser = other.parser; + _string_buf_loc = other._string_buf_loc; + error = other.error; + _depth = other._depth; + _root = other._root; + _streaming = other._streaming; + other.parser = nullptr; + return *this; +} + +simdjson_inline json_iterator::json_iterator(const uint8_t *buf, ondemand::parser *_parser) noexcept + : token(buf, &_parser->implementation->structural_indexes[0]), + parser{_parser}, + _string_buf_loc{parser->string_buf.get()}, + _depth{1}, + _root{parser->implementation->structural_indexes.get()}, + _streaming{false} + +{ + logger::log_headers(); +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif +} + +inline void json_iterator::rewind() noexcept { + token.set_position( root_position() ); + logger::log_headers(); // We start again + _string_buf_loc = parser->string_buf.get(); + _depth = 1; +} + +inline bool json_iterator::balanced() const noexcept { + token_iterator ti(token); + int32_t count{0}; + ti.set_position( root_position() ); + while(ti.peek() <= peek_last()) { + switch (*ti.return_current_and_advance()) + { + case '[': case '{': + count++; + break; + case ']': case '}': + count--; + break; + default: + break; + } + } + return count == 0; +} + + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and parent_depth, which is a desired effect. The warning does not show up if the +// skip_child() function is not marked inline). +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept { + if (depth() <= parent_depth) { return SUCCESS; } + switch (*return_current_and_advance()) { + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + + // For the first open array/object in a value, we've already incremented depth, so keep it the same + // We never stop at colon, but if we did, it wouldn't affect depth + case '[': case '{': case ':': + logger::log_start_value(*this, "skip"); + break; + // If there is a comma, we have just finished a value in an array/object, and need to get back in + case ',': + logger::log_value(*this, "skip"); + break; + // ] or } means we just finished a value and need to jump out of the array/object + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } +#if SIMDJSON_CHECK_EOF + // If there are no more tokens, the parent is incomplete. + if (at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "Missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + break; + case '"': + if(*peek() == ':') { + // We are at a key!!! + // This might happen if you just started an object and you skip it immediately. + // Performance note: it would be nice to get rid of this check as it is somewhat + // expensive. + // https://github.com/simdjson/simdjson/issues/1742 + logger::log_value(*this, "key"); + return_current_and_advance(); // eat up the ':' + break; // important!!! + } + simdjson_fallthrough; + // Anything else must be a scalar value + default: + // For the first scalar, we will have incremented depth already, so we decrement it here. + logger::log_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + } + + // Now that we've considered the first value, we only increment/decrement for arrays/objects + while (position() < end_position()) { + switch (*return_current_and_advance()) { + case '[': case '{': + logger::log_start_value(*this, "skip"); + _depth++; + break; + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + default: + logger::log_value(*this, "skip", ""); + break; + } + } + + return report_error(TAPE_ERROR, "not enough close braces"); +} + +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool json_iterator::at_root() const noexcept { + return position() == root_position(); +} + +simdjson_inline bool json_iterator::is_single_token() const noexcept { + return parser->implementation->n_structural_indexes == 1; +} + +simdjson_inline bool json_iterator::streaming() const noexcept { + return _streaming; +} + +simdjson_inline token_position json_iterator::root_position() const noexcept { + return _root; +} + +simdjson_inline void json_iterator::assert_at_document_depth() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +} + +simdjson_inline void json_iterator::assert_at_root() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + // Under Visual Studio, the next SIMDJSON_ASSUME fails with: the argument + // has side effects that will be discarded. + SIMDJSON_ASSUME( token.position() == _root ); +#endif +} + +simdjson_inline void json_iterator::assert_more_tokens(uint32_t required_tokens) const noexcept { + assert_valid_position(token._position + required_tokens - 1); +} + +simdjson_inline void json_iterator::assert_valid_position(token_position position) const noexcept { +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME( position >= &parser->implementation->structural_indexes[0] ); + SIMDJSON_ASSUME( position < &parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] ); +#endif +} + +simdjson_inline bool json_iterator::at_end() const noexcept { + return position() == end_position(); +} +simdjson_inline token_position json_iterator::end_position() const noexcept { + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + return &parser->implementation->structural_indexes[n_structural_indexes]; +} + +inline std::string json_iterator::to_string() const noexcept { + if( !is_alive() ) { return "dead json_iterator instance"; } + const char * current_structural = reinterpret_cast(token.peek()); + return std::string("json_iterator [ depth : ") + std::to_string(_depth) + + std::string(", structural : '") + std::string(current_structural,1) + + std::string("', offset : ") + std::to_string(token.current_offset()) + + std::string("', error : ") + error_message(error) + + std::string(" ]"); +} + +inline simdjson_result json_iterator::current_location() const noexcept { + if (!is_alive()) { // Unrecoverable error + if (!at_root()) { + return reinterpret_cast(token.peek(-1)); + } else { + return reinterpret_cast(token.peek()); + } + } + if (at_end()) { + return OUT_OF_BOUNDS; + } + return reinterpret_cast(token.peek()); +} + +simdjson_inline bool json_iterator::is_alive() const noexcept { + return parser; +} + +simdjson_inline void json_iterator::abandon() noexcept { + parser = nullptr; + _depth = 0; +} + +simdjson_inline const uint8_t *json_iterator::return_current_and_advance() noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif // SIMDJSON_CHECK_EOF + return token.return_current_and_advance(); +} + +simdjson_inline const uint8_t *json_iterator::unsafe_pointer() const noexcept { + // deliberately done without safety guard: + return token.peek(); +} + +simdjson_inline const uint8_t *json_iterator::peek(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // SIMDJSON_CHECK_EOF + return token.peek(delta); +} + +simdjson_inline uint32_t json_iterator::peek_length(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // #if SIMDJSON_CHECK_EOF + return token.peek_length(delta); +} + +simdjson_inline const uint8_t *json_iterator::peek(token_position position) const noexcept { + // todo: currently we require end-of-string buffering, but the following + // assert_valid_position should be turned on if/when we lift that condition. + // assert_valid_position(position); + // This is almost surely related to SIMDJSON_CHECK_EOF but given that SIMDJSON_CHECK_EOF + // is ON by default, we have no choice but to disable it for real with a comment. + return token.peek(position); +} + +simdjson_inline uint32_t json_iterator::peek_length(token_position position) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_valid_position(position); +#endif // SIMDJSON_CHECK_EOF + return token.peek_length(position); +} + +simdjson_inline token_position json_iterator::last_position() const noexcept { + // The following line fails under some compilers... + // SIMDJSON_ASSUME(parser->implementation->n_structural_indexes > 0); + // since it has side-effects. + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + SIMDJSON_ASSUME(n_structural_indexes > 0); + return &parser->implementation->structural_indexes[n_structural_indexes - 1]; +} +simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept { + return token.peek(last_position()); +} + +simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept { + SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1); + SIMDJSON_ASSUME(_depth == parent_depth + 1); + _depth = parent_depth; +} + +simdjson_inline void json_iterator::descend_to(depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); + _depth = child_depth; +} + +simdjson_inline depth_t json_iterator::depth() const noexcept { + return _depth; +} + +simdjson_inline uint8_t *&json_iterator::string_buf_loc() noexcept { + return _string_buf_loc; +} + +simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD); + logger::log_error(*this, message); + error = _error; + return error; +} + +simdjson_inline token_position json_iterator::position() const noexcept { + return token.position(); +} + +simdjson_inline simdjson_result json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept { + return parser->unescape(in, _string_buf_loc, allow_replacement); +} + +simdjson_inline simdjson_result json_iterator::unescape_wobbly(raw_json_string in) noexcept { + return parser->unescape_wobbly(in, _string_buf_loc); +} + +simdjson_inline void json_iterator::reenter_child(token_position position, depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); +#if SIMDJSON_DEVELOPMENT_CHECKS +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME(size_t(child_depth) < parser->max_depth()); + SIMDJSON_ASSUME(position >= parser->start_positions[child_depth]); +#endif +#endif + token.set_position(position); + _depth = child_depth; +} + +simdjson_inline error_code json_iterator::consume_character(char c) noexcept { + if (*peek() == c) { + return_current_and_advance(); + return SUCCESS; + } + return TAPE_ERROR; +} + +#if SIMDJSON_DEVELOPMENT_CHECKS + +simdjson_inline token_position json_iterator::start_position(depth_t depth) const noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + return size_t(depth) < parser->max_depth() ? parser->start_positions[depth] : 0; +} + +simdjson_inline void json_iterator::set_start_position(depth_t depth, token_position position) noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + if(size_t(depth) < parser->max_depth()) { parser->start_positions[depth] = position; } +} + +#endif + + +simdjson_inline error_code json_iterator::optional_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error == INCORRECT_TYPE || _error == NO_SUCH_FIELD); + logger::log_error(*this, message); + return _error; +} + + +simdjson_warn_unused simdjson_inline bool json_iterator::copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept { + // This function is not expected to be called in performance-sensitive settings. + // Let us guard against silly cases: + if((N < max_len) || (N == 0)) { return false; } + // Copy to the buffer. + std::memcpy(tmpbuf, json, max_len); + if(N > max_len) { // We pad whatever remains with ' '. + std::memset(tmpbuf + max_len, ' ', N - max_len); + } + return true; +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::json_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/json_iterator-inl.h for arm64 */ +/* including simdjson/generic/ondemand/json_type-inl.h for arm64: #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* begin file simdjson/generic/ondemand/json_type-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept { + switch (type) { + case json_type::array: out << "array"; break; + case json_type::object: out << "object"; break; + case json_type::number: out << "number"; break; + case json_type::string: out << "string"; break; + case json_type::boolean: out << "boolean"; break; + case json_type::null: out << "null"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false) { + return out << type.value(); +} +#endif + + + +simdjson_inline number_type number::get_number_type() const noexcept { + return type; +} + +simdjson_inline bool number::is_uint64() const noexcept { + return get_number_type() == number_type::unsigned_integer; +} + +simdjson_inline uint64_t number::get_uint64() const noexcept { + return payload.unsigned_integer; +} + +simdjson_inline number::operator uint64_t() const noexcept { + return get_uint64(); +} + + +simdjson_inline bool number::is_int64() const noexcept { + return get_number_type() == number_type::signed_integer; +} + +simdjson_inline int64_t number::get_int64() const noexcept { + return payload.signed_integer; +} + +simdjson_inline number::operator int64_t() const noexcept { + return get_int64(); +} + +simdjson_inline bool number::is_double() const noexcept { + return get_number_type() == number_type::floating_point_number; +} + +simdjson_inline double number::get_double() const noexcept { + return payload.floating_point_number; +} + +simdjson_inline number::operator double() const noexcept { + return get_double(); +} + +simdjson_inline double number::as_double() const noexcept { + if(is_double()) { + return payload.floating_point_number; + } + if(is_int64()) { + return double(payload.signed_integer); + } + return double(payload.unsigned_integer); +} + +simdjson_inline void number::append_s64(int64_t value) noexcept { + payload.signed_integer = value; + type = number_type::signed_integer; +} + +simdjson_inline void number::append_u64(uint64_t value) noexcept { + payload.unsigned_integer = value; + type = number_type::unsigned_integer; +} + +simdjson_inline void number::append_double(double value) noexcept { + payload.floating_point_number = value; + type = number_type::floating_point_number; +} + +simdjson_inline void number::skip_double() noexcept { + type = number_type::floating_point_number; +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::json_type &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H +/* end file simdjson/generic/ondemand/json_type-inl.h for arm64 */ +/* including simdjson/generic/ondemand/logger-inl.h for arm64: #include "simdjson/generic/ondemand/logger-inl.h" */ +/* begin file simdjson/generic/ondemand/logger-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace arm64 { +namespace ondemand { +namespace logger { + +static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; +static constexpr const int LOG_EVENT_LEN = 20; +static constexpr const int LOG_BUFFER_LEN = 30; +static constexpr const int LOG_SMALL_BUFFER_LEN = 10; +static int log_depth = 0; // Not threadsafe. Log only. + +// Helper to turn unprintable or newline characters into spaces +static inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } +} + +template +static inline std::string string_format(const std::string& format, const Args&... args) +{ + SIMDJSON_PUSH_DISABLE_ALL_WARNINGS + int size_s = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; + auto size = static_cast(size_s); + if (size <= 0) return std::string(); + std::unique_ptr buf(new char[size]); + std::snprintf(buf.get(), size, format.c_str(), args...); + SIMDJSON_POP_DISABLE_WARNINGS + return std::string(buf.get(), buf.get() + size - 1); +} + +static inline log_level get_log_level_from_env() +{ + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + char *lvl = getenv("SIMDJSON_LOG_LEVEL"); + SIMDJSON_POP_DISABLE_WARNINGS + if (lvl && simdjson_strcasecmp(lvl, "ERROR") == 0) { return log_level::error; } + return log_level::info; +} + +static inline log_level log_threshold() +{ + static log_level threshold = get_log_level_from_env(); + return threshold; +} + +static inline bool should_log(log_level level) +{ + return level >= log_threshold(); +} + +inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "", type, detail, log_level::info); +} +inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "+", type, detail, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} +inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_line(iter, "+", type, "", delta, depth_delta, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} + +inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + if (LOG_ENABLED) { log_depth--; } + log_line(iter, "-", type, "", delta, depth_delta, log_level::info); +} + +inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_line(iter, "ERROR: ", error, detail, delta, depth_delta, log_level::error); +} +inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept { + log_line(iter, index, depth, "ERROR: ", error, detail, log_level::error); +} + +inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_event(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_value(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_value(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_start_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_start_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_end_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_end_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_error(const value_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_error(iter.json_iter(), error, detail, delta, depth_delta); +} + +inline void log_headers() noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(log_level::info))) { + // Technically a static variable is not thread-safe, but if you are using threads and logging... well... + static bool displayed_hint{false}; + log_depth = 0; + printf("\n"); + if (!displayed_hint) { + // We only print this helpful header once. + printf("# Logging provides the depth and position of the iterator user-visible steps:\n"); + printf("# +array says 'this is where we were when we discovered the start array'\n"); + printf( + "# -array says 'this is where we were when we ended the array'\n"); + printf("# skip says 'this is a structural or value I am skipping'\n"); + printf("# +/-skip says 'this is a start/end array or object I am skipping'\n"); + printf("#\n"); + printf("# The indentation of the terms (array, string,...) indicates the depth,\n"); + printf("# in addition to the depth being displayed.\n"); + printf("#\n"); + printf("# Every token in the document has a single depth determined by the tokens before it,\n"); + printf("# and is not affected by what the token actually is.\n"); + printf("#\n"); + printf("# Not all structural elements are presented as tokens in the logs.\n"); + printf("#\n"); + printf("# We never give control to the user within an empty array or an empty object.\n"); + printf("#\n"); + printf("# Inside an array, having a depth greater than the array's depth means that\n"); + printf("# we are pointing inside a value.\n"); + printf("# Having a depth equal to the array means that we are pointing right before a value.\n"); + printf("# Having a depth smaller than the array means that we have moved beyond the array.\n"); + displayed_hint = true; + } + printf("\n"); + printf("| %-*s ", LOG_EVENT_LEN, "Event"); + printf("| %-*s ", LOG_BUFFER_LEN, "Buffer"); + printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next"); + // printf("| %-*s ", 5, "Next#"); + printf("| %-*s ", 5, "Depth"); + printf("| Detail "); + printf("|\n"); + + printf("|%.*s", LOG_EVENT_LEN + 2, DASHES); + printf("|%.*s", LOG_BUFFER_LEN + 2, DASHES); + printf("|%.*s", LOG_SMALL_BUFFER_LEN + 2, DASHES); + // printf("|%.*s", 5+2, DASHES); + printf("|%.*s", 5 + 2, DASHES); + printf("|--------"); + printf("|\n"); + fflush(stdout); + } + } +} + +template +inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, log_level level, Args&&... args) noexcept { + log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail, level, std::forward(args)...); +} + +template +inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, log_level level, Args&&... args) noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(level))) { + const int indent = depth * 2; + const auto buf = iter.token.buf; + auto msg = string_format(title, std::forward(args)...); + printf("| %*s%s%-*s ", indent, "", title_prefix, + LOG_EVENT_LEN - indent - int(strlen(title_prefix)), msg.c_str()); + { + // Print the current structural. + printf("| "); + // Before we begin, the index might point right before the document. + // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938 + if (index < iter._root) { + printf("%*s", LOG_BUFFER_LEN, ""); + } else { + auto current_structural = &buf[*index]; + for (int i = 0; i < LOG_BUFFER_LEN; i++) { + printf("%c", printable_char(current_structural[i])); + } + } + printf(" "); + } + { + // Print the next structural. + printf("| "); + auto next_structural = &buf[*(index + 1)]; + for (int i = 0; i < LOG_SMALL_BUFFER_LEN; i++) { + printf("%c", printable_char(next_structural[i])); + } + printf(" "); + } + // printf("| %5u ", *(index+1)); + printf("| %5i ", depth); + printf("| %6.*s ", int(detail.size()), detail.data()); + printf("|\n"); + fflush(stdout); + } + } +} + +} // namespace logger +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H +/* end file simdjson/generic/ondemand/logger-inl.h for arm64 */ +/* including simdjson/generic/ondemand/object-inl.h for arm64: #include "simdjson/generic/ondemand/object-inl.h" */ +/* begin file simdjson/generic/ondemand/object-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) & noexcept { + return find_field_unordered(key); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) && noexcept { + return std::forward(*this).find_field_unordered(key); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} + +simdjson_inline simdjson_result object::start(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_object().error() ); + return object(iter); +} +simdjson_inline simdjson_result object::start_root(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_root_object().error() ); + return object(iter); +} +simdjson_inline error_code object::consume() noexcept { + if(iter.is_at_key()) { + /** + * whenever you are pointing at a key, calling skip_child() is + * unsafe because you will hit a string and you will assume that + * it is string value, and this mistake will lead you to make bad + * depth computation. + */ + /** + * We want to 'consume' the key. We could really + * just do _json_iter->return_current_and_advance(); at this + * point, but, for clarity, we will use the high-level API to + * eat the key. We assume that the compiler optimizes away + * most of the work. + */ + simdjson_unused raw_json_string actual_key; + auto error = iter.field_key().get(actual_key); + if (error) { iter.abandon(); return error; }; + // Let us move to the value while we are at it. + if ((error = iter.field_value())) { iter.abandon(); return error; } + } + auto error_skip = iter.json_iter().skip_child(iter.depth()-1); + if(error_skip) { iter.abandon(); } + return error_skip; +} + +simdjson_inline simdjson_result object::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + const uint8_t * final_point{iter._json_iter->peek()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result object::started(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.started_object().error() ); + return object(iter); +} + +simdjson_inline object object::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline object::object(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result object::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return object_iterator(iter); +} +simdjson_inline simdjson_result object::end() noexcept { + return object_iterator(iter); +} + +inline simdjson_result object::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + size_t slash = json_pointer.find('/'); + std::string_view key = json_pointer.substr(0, slash); + // Grab the child with the given key + simdjson_result child; + + // If there is an escape character in the key, unescape it and then get the child. + size_t escape = key.find('~'); + if (escape != std::string_view::npos) { + // Unescape the key + std::string unescaped(key); + do { + switch (unescaped[escape+1]) { + case '0': + unescaped.replace(escape, 2, "~"); + break; + case '1': + unescaped.replace(escape, 2, "/"); + break; + default: + return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer"); + } + escape = unescaped.find('~', escape+1); + } while (escape != std::string::npos); + child = find_field(unescaped); // Take note find_field does not unescape keys when matching + } else { + child = find_field(key); + } + if(child.error()) { + return child; // we do not continue if there was an error + } + // If there is a /, we have to recurse and look up more of the path + if (slash != std::string_view::npos) { + child = child.at_pointer(json_pointer.substr(slash)); + } + return child; +} + +simdjson_inline simdjson_result object::count_fields() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the object after counting the number of elements. + iter.reset_object(); + return count; +} + +simdjson_inline simdjson_result object::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_object().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +simdjson_inline simdjson_result object::reset() & noexcept { + return iter.reset_object(); +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::object &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first)[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +inline simdjson_result simdjson_result::reset() noexcept { + if (error()) { return error(); } + return first.reset(); +} + +inline simdjson_result simdjson_result::is_empty() noexcept { + if (error()) { return error(); } + return first.is_empty(); +} + +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H +/* end file simdjson/generic/ondemand/object-inl.h for arm64 */ +/* including simdjson/generic/ondemand/object_iterator-inl.h for arm64: #include "simdjson/generic/ondemand/object_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/object_iterator-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +// +// object_iterator +// + +simdjson_inline object_iterator::object_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result object_iterator::operator*() noexcept { + error_code error = iter.error(); + if (error) { iter.abandon(); return error; } + auto result = field::start(iter); + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (result.error()) { iter.abandon(); } + return result; +} +simdjson_inline bool object_iterator::operator==(const object_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool object_iterator::operator!=(const object_iterator &) const noexcept { + return iter.is_open(); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline object_iterator &object_iterator::operator++() noexcept { + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (!iter.is_open()) { return *this; } // Iterator will be released if there is an error + + simdjson_unused error_code error; + if ((error = iter.skip_child() )) { return *this; } + + simdjson_unused bool has_value; + if ((error = iter.has_next_field().get(has_value) )) { return *this; }; + return *this; +} +SIMDJSON_POP_DISABLE_WARNINGS + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter.depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the object is first found and the iterator is just past the {. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the , or } before the next value. In this state, +// depth == iter.depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter.depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter.depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the object iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet field may be missing or not be an +// object--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter.depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between fields, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter.depth == depth, and at_start == false. +// +// Errors that occur while reading a field to give to the user (such as when the key is not a +// string or the field is missing a colon) are yielded immediately. Depth is then decremented, +// moving to the Finished state without transitioning through an Error state at all. +// +// ## Terminal State +// +// The terminal state has iter.depth < depth. at_start is always false. +// +// - Finished: When we have reached a }, we are finished. We signal this by decrementing depth. +// In this state, iter.depth < depth, at_start == false, and error == SUCCESS. +// + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + arm64::ondemand::object_iterator &&value +) noexcept + : implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +// Checks for ']' and ',' +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++first; + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/object_iterator-inl.h for arm64 */ +/* including simdjson/generic/ondemand/parser-inl.h for arm64: #include "simdjson/generic/ondemand/parser-inl.h" */ +/* begin file simdjson/generic/ondemand/parser-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string_view.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/dom/base.h" // for MINIMAL_DOCUMENT_CAPACITY */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline parser::parser(size_t max_capacity) noexcept + : _max_capacity{max_capacity} { +} + +simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept { + if (new_capacity > max_capacity()) { return CAPACITY; } + if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; } + + // string_capacity copied from document::allocate + _capacity = 0; + size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * new_capacity / 3 + SIMDJSON_PADDING, 64); + string_buf.reset(new (std::nothrow) uint8_t[string_capacity]); +#if SIMDJSON_DEVELOPMENT_CHECKS + start_positions.reset(new (std::nothrow) token_position[new_max_depth]); +#endif + if (implementation) { + SIMDJSON_TRY( implementation->set_capacity(new_capacity) ); + SIMDJSON_TRY( implementation->set_max_depth(new_max_depth) ); + } else { + SIMDJSON_TRY( simdjson::get_active_implementation()->create_dom_parser_implementation(new_capacity, new_max_depth, implementation) ); + } + _capacity = new_capacity; + _max_depth = new_max_depth; + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length() || !string_buf) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return document::start({ reinterpret_cast(json.data()), this }); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const char *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const uint8_t *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string_view json, size_t allocated) & noexcept { + return iterate(padded_string_view(json, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string &json) & noexcept { + if(json.capacity() - json.size() < SIMDJSON_PADDING) { + json.reserve(json.size() + SIMDJSON_PADDING); + } + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const std::string &json) & noexcept { + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + padded_string_view json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + const padded_string &json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate_raw(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length()) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return json_iterator(reinterpret_cast(json.data()), this); +} + +inline simdjson_result parser::iterate_many(const uint8_t *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + if(allow_comma_separated && batch_size < len) { batch_size = len; } + return document_stream(*this, buf, len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const char *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(reinterpret_cast(buf), len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const std::string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const padded_string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} + +simdjson_inline size_t parser::capacity() const noexcept { + return _capacity; +} +simdjson_inline size_t parser::max_capacity() const noexcept { + return _max_capacity; +} +simdjson_inline size_t parser::max_depth() const noexcept { + return _max_depth; +} + +simdjson_inline void parser::set_max_capacity(size_t max_capacity) noexcept { + if(max_capacity < dom::MINIMAL_DOCUMENT_CAPACITY) { + _max_capacity = max_capacity; + } else { + _max_capacity = dom::MINIMAL_DOCUMENT_CAPACITY; + } +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement) const noexcept { + uint8_t *end = implementation->parse_string(in.buf, dst, allow_replacement); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept { + uint8_t *end = implementation->parse_wobbly_string(in.buf, dst); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::parser &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H +/* end file simdjson/generic/ondemand/parser-inl.h for arm64 */ +/* including simdjson/generic/ondemand/raw_json_string-inl.h for arm64: #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +namespace arm64 { +namespace ondemand { + +simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {} + +simdjson_inline const char * raw_json_string::raw() const noexcept { return reinterpret_cast(buf); } + + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;pos < target.size() && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;pos < target.size();pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;target[pos] && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;target[pos];pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string_view target) const noexcept { + // If we are going to call memcmp, then we must know something about the length of the raw_json_string. + return (length >= target.size()) && (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); +} + +simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + if(target.size() <= SIMDJSON_PADDING) { + return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); + } + const char * r{raw()}; + size_t pos{0}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(std::string_view target) const noexcept { + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(const char * target) const noexcept { + // Assumptions: 'target' does not contain unescaped quote characters, is null terminated and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(const char* target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept { + return a.unsafe_is_equal(c); +} + +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept { + return a == c; +} + +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept { + return !(a == c); +} + +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept { + return !(a == c); +} + + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept { + return iter.unescape(*this, allow_replacement); +} + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape_wobbly(json_iterator &iter) const noexcept { + return iter.unescape_wobbly(*this); +} + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &out, const raw_json_string &str) noexcept { + bool in_escape = false; + const char *s = str.raw(); + while (true) { + switch (*s) { + case '\\': in_escape = !in_escape; break; + case '"': if (in_escape) { in_escape = false; } else { return out; } break; + default: if (in_escape) { in_escape = false; } + } + out << *s; + s++; + } +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::raw_json_string &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::raw() const noexcept { + if (error()) { return error(); } + return first.raw(); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape(arm64::ondemand::json_iterator &iter, bool allow_replacement) const noexcept { + if (error()) { return error(); } + return first.unescape(iter, allow_replacement); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape_wobbly(arm64::ondemand::json_iterator &iter) const noexcept { + if (error()) { return error(); } + return first.unescape_wobbly(iter); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H +/* end file simdjson/generic/ondemand/raw_json_string-inl.h for arm64 */ +/* including simdjson/generic/ondemand/serialization-inl.h for arm64: #include "simdjson/generic/ondemand/serialization-inl.h" */ +/* begin file simdjson/generic/ondemand/serialization-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/serialization.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +inline std::string_view trim(const std::string_view str) noexcept { + // We can almost surely do better by rolling our own find_first_not_of function. + size_t first = str.find_first_not_of(" \t\n\r"); + // If we have the empty string (just white space), then no trimming is possible, and + // we return the empty string_view. + if (std::string_view::npos == first) { return std::string_view(); } + size_t last = str.find_last_not_of(" \t\n\r"); + return str.substr(first, (last - first + 1)); +} + + +inline simdjson_result to_json_string(arm64::ondemand::document& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(arm64::ondemand::document_reference& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(arm64::ondemand::value& x) noexcept { + /** + * If we somehow receive a value that has already been consumed, + * then the following code could be in trouble. E.g., we create + * an array as needed, but if an array was already created, then + * it could be bad. + */ + using namespace arm64::ondemand; + arm64::ondemand::json_type t; + auto error = x.type().get(t); + if(error != SUCCESS) { return error; } + switch (t) + { + case json_type::array: + { + arm64::ondemand::array array; + error = x.get_array().get(array); + if(error) { return error; } + return to_json_string(array); + } + case json_type::object: + { + arm64::ondemand::object object; + error = x.get_object().get(object); + if(error) { return error; } + return to_json_string(object); + } + default: + return trim(x.raw_json_token()); + } +} + +inline simdjson_result to_json_string(arm64::ondemand::object& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(arm64::ondemand::array& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} +} // namespace simdjson + +namespace simdjson { namespace arm64 { namespace ondemand { + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::document_reference& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::arm64::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif +}}} // namespace simdjson::arm64::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H +/* end file simdjson/generic/ondemand/serialization-inl.h for arm64 */ +/* including simdjson/generic/ondemand/token_iterator-inl.h for arm64: #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/token_iterator-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline token_iterator::token_iterator( + const uint8_t *_buf, + token_position position +) noexcept : buf{_buf}, _position{position} +{ +} + +simdjson_inline uint32_t token_iterator::current_offset() const noexcept { + return *(_position); +} + + +simdjson_inline const uint8_t *token_iterator::return_current_and_advance() noexcept { + return &buf[*(_position++)]; +} + +simdjson_inline const uint8_t *token_iterator::peek(token_position position) const noexcept { + return &buf[*position]; +} +simdjson_inline uint32_t token_iterator::peek_index(token_position position) const noexcept { + return *position; +} +simdjson_inline uint32_t token_iterator::peek_length(token_position position) const noexcept { + return *(position+1) - *position; +} + +simdjson_inline const uint8_t *token_iterator::peek(int32_t delta) const noexcept { + return &buf[*(_position+delta)]; +} +simdjson_inline uint32_t token_iterator::peek_index(int32_t delta) const noexcept { + return *(_position+delta); +} +simdjson_inline uint32_t token_iterator::peek_length(int32_t delta) const noexcept { + return *(_position+delta+1) - *(_position+delta); +} + +simdjson_inline token_position token_iterator::position() const noexcept { + return _position; +} +simdjson_inline void token_iterator::set_position(token_position target_position) noexcept { + _position = target_position; +} + +simdjson_inline bool token_iterator::operator==(const token_iterator &other) const noexcept { + return _position == other._position; +} +simdjson_inline bool token_iterator::operator!=(const token_iterator &other) const noexcept { + return _position != other._position; +} +simdjson_inline bool token_iterator::operator>(const token_iterator &other) const noexcept { + return _position > other._position; +} +simdjson_inline bool token_iterator::operator>=(const token_iterator &other) const noexcept { + return _position >= other._position; +} +simdjson_inline bool token_iterator::operator<(const token_iterator &other) const noexcept { + return _position < other._position; +} +simdjson_inline bool token_iterator::operator<=(const token_iterator &other) const noexcept { + return _position <= other._position; +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::token_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/token_iterator-inl.h for arm64 */ +/* including simdjson/generic/ondemand/value-inl.h for arm64: #include "simdjson/generic/ondemand/value-inl.h" */ +/* begin file simdjson/generic/ondemand/value-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline value::value(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} +simdjson_inline value value::start(const value_iterator &iter) noexcept { + return iter; +} +simdjson_inline value value::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline simdjson_result value::get_array() noexcept { + return array::start(iter); +} +simdjson_inline simdjson_result value::get_object() noexcept { + return object::start(iter); +} +simdjson_inline simdjson_result value::start_or_resume_object() noexcept { + if (iter.at_start()) { + return get_object(); + } else { + return object::resume(iter); + } +} + +simdjson_inline simdjson_result value::get_raw_json_string() noexcept { + return iter.get_raw_json_string(); +} +simdjson_inline simdjson_result value::get_string(bool allow_replacement) noexcept { + return iter.get_string(allow_replacement); +} +template +simdjson_inline error_code value::get_string(string_type& receiver, bool allow_replacement) noexcept { + return iter.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result value::get_wobbly_string() noexcept { + return iter.get_wobbly_string(); +} +simdjson_inline simdjson_result value::get_double() noexcept { + return iter.get_double(); +} +simdjson_inline simdjson_result value::get_double_in_string() noexcept { + return iter.get_double_in_string(); +} +simdjson_inline simdjson_result value::get_uint64() noexcept { + return iter.get_uint64(); +} +simdjson_inline simdjson_result value::get_uint64_in_string() noexcept { + return iter.get_uint64_in_string(); +} +simdjson_inline simdjson_result value::get_int64() noexcept { + return iter.get_int64(); +} +simdjson_inline simdjson_result value::get_int64_in_string() noexcept { + return iter.get_int64_in_string(); +} +simdjson_inline simdjson_result value::get_bool() noexcept { + return iter.get_bool(); +} +simdjson_inline simdjson_result value::is_null() noexcept { + return iter.is_null(); +} +template<> simdjson_inline simdjson_result value::get() noexcept { return get_array(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_object(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_number(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_double(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_bool(); } + +template simdjson_inline error_code value::get(T &out) noexcept { + return get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline value::operator array() noexcept(false) { + return get_array(); +} +simdjson_inline value::operator object() noexcept(false) { + return get_object(); +} +simdjson_inline value::operator uint64_t() noexcept(false) { + return get_uint64(); +} +simdjson_inline value::operator int64_t() noexcept(false) { + return get_int64(); +} +simdjson_inline value::operator double() noexcept(false) { + return get_double(); +} +simdjson_inline value::operator std::string_view() noexcept(false) { + return get_string(false); +} +simdjson_inline value::operator raw_json_string() noexcept(false) { + return get_raw_json_string(); +} +simdjson_inline value::operator bool() noexcept(false) { + return get_bool(); +} +#endif + +simdjson_inline simdjson_result value::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result value::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result value::count_elements() & noexcept { + simdjson_result answer; + auto a = get_array(); + answer = a.count_elements(); + // count_elements leaves you pointing inside the array, at the first element. + // We need to move back so that the user can create a new array (which requires that + // we point at '['). + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::count_fields() & noexcept { + simdjson_result answer; + auto a = get_object(); + answer = a.count_fields(); + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::at(size_t index) noexcept { + auto a = get_array(); + return a.at(index); +} + +simdjson_inline simdjson_result value::find_field(std::string_view key) noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result value::find_field(const char *key) noexcept { + return start_or_resume_object().find_field(key); +} + +simdjson_inline simdjson_result value::find_field_unordered(std::string_view key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result value::find_field_unordered(const char *key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} + +simdjson_inline simdjson_result value::operator[](std::string_view key) noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result value::operator[](const char *key) noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline simdjson_result value::type() noexcept { + return iter.type(); +} + +simdjson_inline simdjson_result value::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool value::is_negative() noexcept { + return iter.is_negative(); +} + +simdjson_inline simdjson_result value::is_integer() noexcept { + return iter.is_integer(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number_type() noexcept { + return iter.get_number_type(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number() noexcept { + return iter.get_number(); +} + +simdjson_inline std::string_view value::raw_json_token() noexcept { + return std::string_view(reinterpret_cast(iter.peek_start()), iter.peek_start_length()); +} + +simdjson_inline simdjson_result value::raw_json() noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: { + ondemand::array array; + SIMDJSON_TRY(get_array().get(array)); + return array.raw_json(); + } + case json_type::object: { + ondemand::object object; + SIMDJSON_TRY(get_object().get(object)); + return object.raw_json(); + } + default: + return raw_json_token(); + } +} + +simdjson_inline simdjson_result value::current_location() noexcept { + return iter.json_iter().current_location(); +} + +simdjson_inline int32_t value::current_depth() const noexcept{ + return iter.json_iter().depth(); +} + +simdjson_inline simdjson_result value::at_pointer(std::string_view json_pointer) noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + arm64::ondemand::value &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + if (error()) { return error(); } + return {}; +} + +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} + +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) noexcept { + if (error()) { return error(); } + return first[key]; +} + +simdjson_inline simdjson_result simdjson_result::get_array() noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return first.get(); +} +template simdjson_inline error_code simdjson_result::get(T &out) noexcept { + if (error()) { return error(); } + return first.get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return std::move(first); +} +template<> simdjson_inline error_code simdjson_result::get(arm64::ondemand::value &out) noexcept { + if (error()) { return error(); } + out = first; + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator arm64::ondemand::array() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::object() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator arm64::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H +/* end file simdjson/generic/ondemand/value-inl.h for arm64 */ +/* including simdjson/generic/ondemand/value_iterator-inl.h for arm64: #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/value_iterator-inl.h for arm64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/atomparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace arm64 { +namespace ondemand { + +simdjson_inline value_iterator::value_iterator( + json_iterator *json_iter, + depth_t depth, + token_position start_position +) noexcept : _json_iter{json_iter}, _depth{depth}, _start_position{start_position} +{ +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_root_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_object() noexcept { + assert_at_container_start(); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + if (*_json_iter->peek() == '}') { + logger::log_value(*_json_iter, "empty object"); + _json_iter->return_current_and_advance(); + end_container(); + return false; + } + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_object() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // object: e.g., `{"a":2} foo }`. Users concerned with garbage content should + // call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != '}') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing } at end"); + } + // If the last character is } *and* the first gibberish character is also '}' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == '}') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed object. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_object() noexcept { + auto error = check_root_object(); + if(error) { return error; } + return started_object(); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept { +#if SIMDJSON_CHECK_EOF + if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); } + // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + _json_iter->ascend_to(depth()-1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_field() noexcept { + assert_at_next(); + + // It's illegal to call this unless there are more tokens: anything that ends in } or ] is + // obligated to verify there are more tokens if they are not the top level. + switch (*_json_iter->return_current_and_advance()) { + case '}': + logger::log_end_value(*_json_iter, "object"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between object fields"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_raw(const std::string_view key) noexcept { + error_code error; + bool has_value; + // + // Initially, the object can be in one of a few different places: + // + // 1. The start of the object, at the first field: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + if (at_first_field()) { + has_value = true; + + // + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + return false; + + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + if ((error = skip_child() )) { abandon(); return error; } + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + while (has_value) { + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + //if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); // Skip the value entirely + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + + // If the loop ended, we're out of fields to look at. + return false; +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_unordered_raw(const std::string_view key) noexcept { + /** + * When find_field_unordered_raw is called, we can either be pointing at the + * first key, pointing outside (at the closing brace) or if a key was matched + * we can be either pointing right afterthe ':' right before the value (that we need skip), + * or we may have consumed the value and we might be at a comma or at the + * final brace (ready for a call to has_next_field()). + */ + error_code error; + bool has_value; + + // First, we scan from that point to the end. + // If we don't find a match, we may loop back around, and scan from the beginning to that point. + token_position search_start = _json_iter->position(); + + // We want to know whether we need to go back to the beginning. + bool at_first = at_first_field(); + /////////////// + // Initially, the object can be in one of a few different places: + // + // 1. At the first key: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + // + if (at_first) { + has_value = true; + + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { + +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + SIMDJSON_TRY(reset_object().get(has_value)); + at_first = true; + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + // If someone queried a key but they not did access the value, then we are left pointing + // at the ':' and we need to move forward through the value... If the value was + // processed then skip_child() does not move the iterator (but may adjust the depth). + if ((error = skip_child() )) { abandon(); return error; } + search_start = _json_iter->position(); + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + + // After initial processing, we will be in one of two states: + // + // ``` + // // At the beginning of a field + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // At the end of the object + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // ``` + // + // Next, we find a match starting from the current position. + while (has_value) { + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + // Performance note: it maybe wasteful to rewind to the beginning when there might be + // no other query following. Indeed, it would require reskipping the whole object. + // Instead, you can just stay where you are. If there is a new query, there is always time + // to rewind. + if(at_first) { return false; } + + // If we reach the end without finding a match, search the rest of the fields starting at the + // beginning of the object. + // (We have already run through the object before, so we've already validated its structure. We + // don't check errors in this bit.) + SIMDJSON_TRY(reset_object().get(has_value)); + while (true) { + SIMDJSON_ASSUME(has_value); // we should reach search_start before ever reaching the end of the object + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + error = field_key().get(actual_key); SIMDJSON_ASSUME(!error); + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + error = field_value(); SIMDJSON_ASSUME(!error); + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // If we reached the end of the key-value pair we started from, then we know + // that the key is not there so we return false. We are either right before + // the next comma or the final brace. + if(_json_iter->position() == search_start) { return false; } + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + error = has_next_field().get(has_value); SIMDJSON_ASSUME(!error); + // If we make the mistake of exiting here, then we could be left pointing at a key + // in the middle of an object. That's not an allowable state. + } + // If the loop ended, we're out of fields to look at. The program should + // never reach this point. + return false; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::field_key() noexcept { + assert_at_next(); + + const uint8_t *key = _json_iter->return_current_and_advance(); + if (*(key++) != '"') { return report_error(TAPE_ERROR, "Object key is not a string"); } + return raw_json_string(key); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::field_value() noexcept { + assert_at_next(); + + if (*_json_iter->return_current_and_advance() != ':') { return report_error(TAPE_ERROR, "Missing colon in object field"); } + _json_iter->descend_to(depth()+1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_root_array(); +} + +inline std::string value_iterator::to_string() const noexcept { + auto answer = std::string("value_iterator [ depth : ") + std::to_string(_depth) + std::string(", "); + if(_json_iter != nullptr) { answer += _json_iter->to_string(); } + answer += std::string(" ]"); + return answer; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_array() noexcept { + assert_at_container_start(); + if (*_json_iter->peek() == ']') { + logger::log_value(*_json_iter, "empty array"); + _json_iter->return_current_and_advance(); + SIMDJSON_TRY( end_container() ); + return false; + } + _json_iter->descend_to(depth()+1); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // array: e.g., `[1, 2] foo]`. Users concerned with garbage content should + // also call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != ']') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end"); + } + // If the last character is ] *and* the first gibberish character is also ']' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed array. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_array() noexcept { + auto error = check_root_array(); + if (error) { return error; } + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_element() noexcept { + assert_at_next(); + + logger::log_event(*this, "has_next_element"); + switch (*_json_iter->return_current_and_advance()) { + case ']': + logger::log_end_value(*_json_iter, "array"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + _json_iter->descend_to(depth()+1); + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between array elements"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_bool(const uint8_t *json) const noexcept { + auto not_true = atomparsing::str4ncmp(json, "true"); + auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e'); + bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]); + if (error) { return incorrect_type_error("Not a boolean"); } + return simdjson_result(!not_true); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_null(const uint8_t *json) const noexcept { + bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]); + // if we start with 'n', we must be a null + if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); } + return is_null_string; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_string(bool allow_replacement) noexcept { + return get_raw_json_string().unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_string(string_type& receiver, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_string(allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_wobbly_string() noexcept { + return get_raw_json_string().unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_raw_json_string() noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64() noexcept { + auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64_in_string() noexcept { + auto result = numberparsing::parse_unsigned_in_string(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64() noexcept { + auto result = numberparsing::parse_integer(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64_in_string() noexcept { + auto result = numberparsing::parse_integer_in_string(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double() noexcept { + auto result = numberparsing::parse_double(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double_in_string() noexcept { + auto result = numberparsing::parse_double_in_string(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_bool() noexcept { + auto result = parse_bool(peek_non_root_scalar("bool")); + if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); } + return result; +} +simdjson_inline simdjson_result value_iterator::is_null() noexcept { + bool is_null_value; + SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value)); + if(is_null_value) { advance_non_root_scalar("null"); } + return is_null_value; +} +simdjson_inline bool value_iterator::is_negative() noexcept { + return numberparsing::is_negative(peek_non_root_scalar("numbersign")); +} +simdjson_inline bool value_iterator::is_root_negative() noexcept { + return numberparsing::is_negative(peek_root_scalar("numbersign")); +} +simdjson_inline simdjson_result value_iterator::is_integer() noexcept { + return numberparsing::is_integer(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number_type() noexcept { + return numberparsing::get_number_type(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number() noexcept { + number num; + error_code error = numberparsing::parse_number(peek_non_root_scalar("number"), num); + if(error) { return error; } + return num; +} + +simdjson_inline simdjson_result value_iterator::is_root_integer(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("is_root_integer"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + return false; // if there are more than 20 characters, it cannot be represented as an integer. + } + auto answer = numberparsing::is_integer(tmpbuf); + // If the parsing was a success, we must still check that it is + // a single scalar. Note that we parse first because of cases like '[]' where + // getting TRAILING_CONTENT is wrong. + if(check_trailing && (answer.error() == SUCCESS) && (!_json_iter->is_single_token())) { return TRAILING_CONTENT; } + return answer; +} + +simdjson_inline simdjson_result value_iterator::get_root_number_type(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto answer = numberparsing::get_number_type(tmpbuf); + if (check_trailing && (answer.error() == SUCCESS) && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + return answer; +} +simdjson_inline simdjson_result value_iterator::get_root_number(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + number num; + error_code error = numberparsing::parse_number(tmpbuf, num); + if(error) { return error; } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("number"); + return num; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_string(bool check_trailing, bool allow_replacement) noexcept { + return get_root_raw_json_string(check_trailing).unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_root_string(check_trailing, allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_wobbly_string(bool check_trailing) noexcept { + return get_root_raw_json_string(check_trailing).unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_raw_json_string(bool check_trailing) noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_bool(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("bool"); + uint8_t tmpbuf[5+1+1]; // +1 for null termination + tmpbuf[5+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 5+1)) { return incorrect_type_error("Not a boolean"); } + auto result = parse_bool(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("bool"); + } + return result; +} +simdjson_inline simdjson_result value_iterator::is_root_null(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("null"); + bool result = (max_len >= 4 && !atomparsing::str4ncmp(json, "null") && + (max_len == 4 || jsoncharutils::is_structural_or_whitespace(json[4]))); + if(result) { // we have something that looks like a null. + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("null"); + } + return result; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth >= _depth ); + + return _json_iter->skip_child(depth()); +} + +simdjson_inline value_iterator value_iterator::child() const noexcept { + assert_at_child(); + return { _json_iter, depth()+1, _json_iter->token.position() }; +} + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and iterator depth, which is a desired effect. It does not happen if is_open is +// marked non-inline. +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline bool value_iterator::is_open() const noexcept { + return _json_iter->depth() >= depth(); +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool value_iterator::at_end() const noexcept { + return _json_iter->at_end(); +} + +simdjson_inline bool value_iterator::at_start() const noexcept { + return _json_iter->token.position() == start_position(); +} + +simdjson_inline bool value_iterator::at_first_field() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + return _json_iter->token.position() == start_position() + 1; +} + +simdjson_inline void value_iterator::abandon() noexcept { + _json_iter->abandon(); +} + +simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept { + return _depth; +} +simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept { + return _json_iter->error; +} +simdjson_warn_unused simdjson_inline uint8_t *&value_iterator::string_buf_loc() noexcept { + return _json_iter->string_buf_loc(); +} +simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept { + return *_json_iter; +} +simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept { + return *_json_iter; +} + +simdjson_inline const uint8_t *value_iterator::peek_start() const noexcept { + return _json_iter->peek(start_position()); +} +simdjson_inline uint32_t value_iterator::peek_start_length() const noexcept { + return _json_iter->peek_length(start_position()); +} + +simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return peek_start(); } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return; } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept { + logger::log_start_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + const uint8_t *json; + if (!is_at_start()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + json = peek_start(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + } else { + assert_at_start(); + /** + * We should be prudent. Let us peek. If it is not the right type, we + * return an error. Only once we have determined that we have the right + * type are we allowed to advance! + */ + json = _json_iter->peek(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + _json_iter->return_current_and_advance(); + } + + + return SUCCESS; +} + + +simdjson_inline const uint8_t *value_iterator::peek_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_root(); + return _json_iter->peek(); +} +simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_non_root_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_root(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} +simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_non_root_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept { + logger::log_error(*_json_iter, start_position(), depth(), message); + return INCORRECT_TYPE; +} + +simdjson_inline bool value_iterator::is_at_start() const noexcept { + return position() == start_position(); +} + +simdjson_inline bool value_iterator::is_at_key() const noexcept { + // Keys are at the same depth as the object. + // Note here that we could be safer and check that we are within an object, + // but we do not. + return _depth == _json_iter->_depth && *_json_iter->peek() == '"'; +} + +simdjson_inline bool value_iterator::is_at_iterator_start() const noexcept { + // We can legitimately be either at the first value ([1]), or after the array if it's empty ([]). + auto delta = position() - start_position(); + return delta == 1 || delta == 2; +} + +inline void value_iterator::assert_at_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_container_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_next() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +simdjson_inline void value_iterator::move_at_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position); +} + +simdjson_inline void value_iterator::move_at_container_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position + 1); +} + +simdjson_inline simdjson_result value_iterator::reset_array() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_array(); +} + +simdjson_inline simdjson_result value_iterator::reset_object() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_object(); +} + +inline void value_iterator::assert_at_child() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_root() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth == 1 ); +} + +inline void value_iterator::assert_at_non_root_start() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth > 1 ); +} + +inline void value_iterator::assert_is_valid() const noexcept { + SIMDJSON_ASSUME( _json_iter != nullptr ); +} + +simdjson_inline bool value_iterator::is_valid() const noexcept { + return _json_iter != nullptr; +} + +simdjson_inline simdjson_result value_iterator::type() const noexcept { + switch (*peek_start()) { + case '{': + return json_type::object; + case '[': + return json_type::array; + case '"': + return json_type::string; + case 'n': + return json_type::null; + case 't': case 'f': + return json_type::boolean; + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return json_type::number; + default: + return TAPE_ERROR; + } +} + +simdjson_inline token_position value_iterator::start_position() const noexcept { + return _start_position; +} + +simdjson_inline token_position value_iterator::position() const noexcept { + return _json_iter->position(); +} + +simdjson_inline token_position value_iterator::end_position() const noexcept { + return _json_iter->end_position(); +} + +simdjson_inline token_position value_iterator::last_position() const noexcept { + return _json_iter->last_position(); +} + +simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept { + return _json_iter->report_error(error, message); +} + +} // namespace ondemand +} // namespace arm64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(arm64::ondemand::value_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/value_iterator-inl.h for arm64 */ +/* end file simdjson/generic/ondemand/amalgamated.h for arm64 */ +/* including simdjson/arm64/end.h: #include "simdjson/arm64/end.h" */ +/* begin file simdjson/arm64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/arm64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "arm64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/arm64/end.h */ + +#endif // SIMDJSON_ARM64_ONDEMAND_H +/* end file simdjson/arm64/ondemand.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(fallback) +/* including simdjson/fallback/ondemand.h: #include "simdjson/fallback/ondemand.h" */ +/* begin file simdjson/fallback/ondemand.h */ +#ifndef SIMDJSON_FALLBACK_ONDEMAND_H +#define SIMDJSON_FALLBACK_ONDEMAND_H + +/* including simdjson/fallback/begin.h: #include "simdjson/fallback/begin.h" */ +/* begin file simdjson/fallback/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "fallback" */ +#define SIMDJSON_IMPLEMENTATION fallback +/* including simdjson/fallback/base.h: #include "simdjson/fallback/base.h" */ +/* begin file simdjson/fallback/base.h */ +#ifndef SIMDJSON_FALLBACK_BASE_H +#define SIMDJSON_FALLBACK_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Fallback implementation (runs on any machine). + */ +namespace fallback { + +class implementation; + +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BASE_H +/* end file simdjson/fallback/base.h */ +/* including simdjson/fallback/bitmanipulation.h: #include "simdjson/fallback/bitmanipulation.h" */ +/* begin file simdjson/fallback/bitmanipulation.h */ +#ifndef SIMDJSON_FALLBACK_BITMANIPULATION_H +#define SIMDJSON_FALLBACK_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +#if defined(_MSC_VER) && !defined(_M_ARM64) && !defined(_M_X64) +static inline unsigned char _BitScanForward64(unsigned long* ret, uint64_t x) { + unsigned long x0 = (unsigned long)x, top, bottom; + _BitScanForward(&top, (unsigned long)(x >> 32)); + _BitScanForward(&bottom, x0); + *ret = x0 ? bottom : 32 + top; + return x != 0; +} +static unsigned char _BitScanReverse64(unsigned long* ret, uint64_t x) { + unsigned long x1 = (unsigned long)(x >> 32), top, bottom; + _BitScanReverse(&top, x1); + _BitScanReverse(&bottom, (unsigned long)x); + *ret = x1 ? top + 32 : bottom; + return x != 0; +} +#endif + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#ifdef _MSC_VER + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// _MSC_VER +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_BITMANIPULATION_H +/* end file simdjson/fallback/bitmanipulation.h */ +/* including simdjson/fallback/stringparsing_defs.h: #include "simdjson/fallback/stringparsing_defs.h" */ +/* begin file simdjson/fallback/stringparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +#define SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace { + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 1; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return c == '"'; } + simdjson_inline bool has_backslash() { return c == '\\'; } + simdjson_inline int quote_index() { return c == '"' ? 0 : 1; } + simdjson_inline int backslash_index() { return c == '\\' ? 0 : 1; } + + uint8_t c; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // store to dest unconditionally - we can overwrite the bits we don't like later + dst[0] = src[0]; + return { src[0] }; +} + +} // unnamed namespace +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_FALLBACK_STRINGPARSING_DEFS_H +/* end file simdjson/fallback/stringparsing_defs.h */ +/* including simdjson/fallback/numberparsing_defs.h: #include "simdjson/fallback/numberparsing_defs.h" */ +/* begin file simdjson/fallback/numberparsing_defs.h */ +#ifndef SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +#define SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#ifdef JSON_TEST_NUMBERS // for unit testing +void found_invalid_number(const uint8_t *buf); +void found_integer(int64_t result, const uint8_t *buf); +void found_unsigned_integer(uint64_t result, const uint8_t *buf); +void found_float(double result, const uint8_t *buf); +#endif + +namespace simdjson { +namespace fallback { +namespace numberparsing { + +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const char *chars) { + uint64_t val; + memcpy(&val, chars, sizeof(uint64_t)); + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + return parse_eight_digits_unrolled(reinterpret_cast(chars)); +} + +#if SIMDJSON_IS_32BITS // _umul128 for x86, arm +// this is a slow emulation routine for 32-bit +// +static simdjson_inline uint64_t __emulu(uint32_t x, uint32_t y) { + return x * (uint64_t)y; +} +static simdjson_inline uint64_t _umul128(uint64_t ab, uint64_t cd, uint64_t *hi) { + uint64_t ad = __emulu((uint32_t)(ab >> 32), (uint32_t)cd); + uint64_t bd = __emulu((uint32_t)ab, (uint32_t)cd); + uint64_t adbc = ad + __emulu((uint32_t)ab, (uint32_t)(cd >> 32)); + uint64_t adbc_carry = !!(adbc < ad); + uint64_t lo = bd + (adbc << 32); + *hi = __emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + + (adbc_carry << 32) + !!(lo < bd); + return lo; +} +#endif + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace fallback +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_FALLBACK_NUMBERPARSING_DEFS_H +/* end file simdjson/fallback/numberparsing_defs.h */ +/* end file simdjson/fallback/begin.h */ +/* including simdjson/generic/ondemand/amalgamated.h for fallback: #include "simdjson/generic/ondemand/amalgamated.h" */ +/* begin file simdjson/generic/ondemand/amalgamated.h for fallback */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H) +#error simdjson/generic/ondemand/dependencies.h must be included before simdjson/generic/ondemand/amalgamated.h! +#endif + +// Stuff other things depend on +/* including simdjson/generic/ondemand/base.h for fallback: #include "simdjson/generic/ondemand/base.h" */ +/* begin file simdjson/generic/ondemand/base.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +/** + * A fast, simple, DOM-like interface that parses JSON as you use it. + * + * Designed for maximum speed and a lower memory profile. + */ +namespace ondemand { + +/** Represents the depth of a JSON value (number of nested arrays/objects). */ +using depth_t = int32_t; + +/** @copydoc simdjson::fallback::number_type */ +using number_type = simdjson::fallback::number_type; + +/** @private Position in the JSON buffer indexes */ +using token_position = const uint32_t *; + +class array; +class array_iterator; +class document; +class document_reference; +class document_stream; +class field; +class json_iterator; +enum class json_type; +struct number; +class object; +class object_iterator; +class parser; +class raw_json_string; +class token_iterator; +class value; +class value_iterator; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_BASE_H +/* end file simdjson/generic/ondemand/base.h for fallback */ +/* including simdjson/generic/ondemand/value_iterator.h for fallback: #include "simdjson/generic/ondemand/value_iterator.h" */ +/* begin file simdjson/generic/ondemand/value_iterator.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * Iterates through a single JSON value at a particular depth. + * + * Does not keep track of the type of value: provides methods for objects, arrays and scalars and expects + * the caller to call the right ones. + * + * @private This is not intended for external use. + */ +class value_iterator { +protected: + /** The underlying JSON iterator */ + json_iterator *_json_iter{}; + /** The depth of this value */ + depth_t _depth{}; + /** + * The starting token index for this value + */ + token_position _start_position{}; + +public: + simdjson_inline value_iterator() noexcept = default; + + /** + * Denote that we're starting a document. + */ + simdjson_inline void start_document() noexcept; + + /** + * Skips a non-iterated or partially-iterated JSON value, whether it is a scalar, array or object. + * + * Optimized for scalars. + */ + simdjson_warn_unused simdjson_inline error_code skip_child() noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is at the start of the value + */ + simdjson_inline bool at_start() const noexcept; + + /** + * Tell whether the value is open--if the value has not been used, or the array/object is still open. + */ + simdjson_inline bool is_open() const noexcept; + + /** + * Tell whether the value is at an object's first field (just after the {). + */ + simdjson_inline bool at_first_field() const noexcept; + + /** + * Abandon all iteration. + */ + simdjson_inline void abandon() noexcept; + + /** + * Get the child value as a value_iterator. + */ + simdjson_inline value_iterator child_value() const noexcept; + + /** + * Get the depth of this value. + */ + simdjson_inline int32_t depth() const noexcept; + + /** + * Get the JSON type of this value. + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() const noexcept; + + /** + * @addtogroup object Object iteration + * + * Methods to iterate and find object fields. These methods generally *assume* the value is + * actually an object; the caller is responsible for keeping track of that fact. + * + * @{ + */ + + /** + * Start an object iteration. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + */ + simdjson_warn_unused simdjson_inline simdjson_result start_object() noexcept; + /** + * Start an object iteration from the root. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_object() noexcept; + /** + * Checks whether an object could be started from the root. May be called by start_root_object. + * + * @returns SUCCESS if it is possible to safely start an object from the root (document level). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_object() noexcept; + /** + * Start an object iteration after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_object() noexcept; + /** + * Start an object iteration from the root, after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_object() noexcept; + + /** + * Moves to the next field in an object. + * + * Looks for , and }. If } is found, the object is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return whether there is another field in the object. + * @error TAPE_ERROR If there is a comma missing between fields. + * @error TAPE_ERROR If there is a comma, but not enough tokens remaining to have a key, :, and value. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_field() noexcept; + + /** + * Get the current field's key. + */ + simdjson_warn_unused simdjson_inline simdjson_result field_key() noexcept; + + /** + * Pass the : in the field and move to its value. + */ + simdjson_warn_unused simdjson_inline error_code field_value() noexcept; + + /** + * Find the next field with the given key. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline error_code find_field(const std::string_view key) noexcept; + + /** + * Find the next field with the given key, *without* unescaping. This assumes object order: it + * will not find the field if it was already passed when looking for some *other* field. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_raw(const std::string_view key) noexcept; + + /** + * Find the field with the given key without regard to order, and *without* unescaping. + * + * This is an unordered object lookup: if the field is not found initially, it will cycle around and scan from the beginning. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_unordered_raw(const std::string_view key) noexcept; + + /** @} */ + + /** + * @addtogroup array Array iteration + * Methods to iterate over array elements. These methods generally *assume* the value is actually + * an object; the caller is responsible for keeping track of that fact. + * @{ + */ + + /** + * Check for an opening [ and start an array iteration. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + */ + simdjson_warn_unused simdjson_inline simdjson_result start_array() noexcept; + /** + * Check for an opening [ and start an array iteration while at the root. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_array() noexcept; + /** + * Checks whether an array could be started from the root. May be called by start_root_array. + * + * @returns SUCCESS if it is possible to safely start an array from the root (document level). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_array() noexcept; + /** + * Start an array iteration, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_array() noexcept; + /** + * Start an array iteration from the root, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_array() noexcept; + + /** + * Moves to the next element in an array. + * + * Looks for , and ]. If ] is found, the array is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return Whether there is another element in the array. + * @error TAPE_ERROR If there is a comma missing between elements. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_element() noexcept; + + /** + * Get a child value iterator. + */ + simdjson_warn_unused simdjson_inline value_iterator child() const noexcept; + + /** @} */ + + /** + * @defgroup scalar Scalar values + * @addtogroup scalar + * @{ + */ + + simdjson_warn_unused simdjson_inline simdjson_result get_string(bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_bool() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_null() noexcept; + simdjson_warn_unused simdjson_inline bool is_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_integer() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + simdjson_warn_unused simdjson_inline simdjson_result get_root_string(bool check_trailing, bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_wobbly_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_raw_json_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_bool(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline bool is_root_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_integer(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number_type(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_null(bool check_trailing) noexcept; + + simdjson_inline error_code error() const noexcept; + simdjson_inline uint8_t *&string_buf_loc() noexcept; + simdjson_inline const json_iterator &json_iter() const noexcept; + simdjson_inline json_iterator &json_iter() noexcept; + + simdjson_inline void assert_is_valid() const noexcept; + simdjson_inline bool is_valid() const noexcept; + + /** @} */ +protected: + /** + * Restarts an array iteration. + * @returns Whether the array has any elements (returns false for empty). + */ + simdjson_inline simdjson_result reset_array() noexcept; + /** + * Restarts an object iteration. + * @returns Whether the object has any fields (returns false for empty). + */ + simdjson_inline simdjson_result reset_object() noexcept; + /** + * move_at_start(): moves us so that we are pointing at the beginning of + * the container. It updates the index so that at_start() is true and it + * syncs the depth. The user can then create a new container instance. + * + * Usage: used with value::count_elements(). + **/ + simdjson_inline void move_at_start() noexcept; + + /** + * move_at_container_start(): moves us so that we are pointing at the beginning of + * the container so that assert_at_container_start() passes. + * + * Usage: used with reset_array() and reset_object(). + **/ + simdjson_inline void move_at_container_start() noexcept; + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + simdjson_inline value_iterator(json_iterator *json_iter, depth_t depth, token_position start_index) noexcept; + + simdjson_inline simdjson_result parse_null(const uint8_t *json) const noexcept; + simdjson_inline simdjson_result parse_bool(const uint8_t *json) const noexcept; + simdjson_inline const uint8_t *peek_start() const noexcept; + simdjson_inline uint32_t peek_start_length() const noexcept; + + /** + * The general idea of the advance_... methods and the peek_* methods + * is that you first peek and check that you have desired type. If you do, + * and only if you do, then you advance. + * + * We used to unconditionally advance. But this made reasoning about our + * current state difficult. + * Suppose you always advance. Look at the 'value' matching the key + * "shadowable" in the following example... + * + * ({"globals":{"a":{"shadowable":[}}}}) + * + * If the user thinks it is a Boolean and asks for it, then we check the '[', + * decide it is not a Boolean, but still move into the next character ('}'). Now + * we are left pointing at '}' right after a '['. And we have not yet reported + * an error, only that we do not have a Boolean. + * + * If, instead, you just stand your ground until it is content that you know, then + * you will only even move beyond the '[' if the user tells you that you have an + * array. So you will be at the '}' character inside the array and, hopefully, you + * will then catch the error because an array cannot start with '}', but the code + * processing Boolean values does not know this. + * + * So the contract is: first call 'peek_...' and then call 'advance_...' only + * if you have determined that it is a type you can handle. + * + * Unfortunately, it makes the code more verbose, longer and maybe more error prone. + */ + + simdjson_inline void advance_scalar(const char *type) noexcept; + simdjson_inline void advance_root_scalar(const char *type) noexcept; + simdjson_inline void advance_non_root_scalar(const char *type) noexcept; + + simdjson_inline const uint8_t *peek_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_root_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_non_root_scalar(const char *type) noexcept; + + + simdjson_inline error_code start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept; + simdjson_inline error_code end_container() noexcept; + + /** + * Advance to a place expecting a value (increasing depth). + * + * @return The current token (the one left behind). + * @error TAPE_ERROR If the document ended early. + */ + simdjson_inline simdjson_result advance_to_value() noexcept; + + simdjson_inline error_code incorrect_type_error(const char *message) const noexcept; + simdjson_inline error_code error_unless_more_tokens(uint32_t tokens=1) const noexcept; + + simdjson_inline bool is_at_start() const noexcept; + /** + * is_at_iterator_start() returns true on an array or object after it has just been + * created, whether the instance is empty or not. + * + * Usage: used by array::begin() in debug mode (SIMDJSON_DEVELOPMENT_CHECKS) + */ + simdjson_inline bool is_at_iterator_start() const noexcept; + + /** + * Assuming that we are within an object, this returns true if we + * are pointing at a key. + * + * Usage: the skip_child() method should never be used while we are pointing + * at a key inside an object. + */ + simdjson_inline bool is_at_key() const noexcept; + + inline void assert_at_start() const noexcept; + inline void assert_at_container_start() const noexcept; + inline void assert_at_root() const noexcept; + inline void assert_at_child() const noexcept; + inline void assert_at_next() const noexcept; + inline void assert_at_non_root_start() const noexcept; + + /** Get the starting position of this value */ + simdjson_inline token_position start_position() const noexcept; + + /** @copydoc error_code json_iterator::position() const noexcept; */ + simdjson_inline token_position position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position last_position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position end_position() const noexcept; + /** @copydoc error_code json_iterator::report_error(error_code error, const char *message) noexcept; */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + friend class document; + friend class object; + friend class array; + friend class value; +}; // value_iterator + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::value_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H +/* end file simdjson/generic/ondemand/value_iterator.h for fallback */ +/* including simdjson/generic/ondemand/value.h for fallback: #include "simdjson/generic/ondemand/value.h" */ +/* begin file simdjson/generic/ondemand/value.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * An ephemeral JSON value returned during iteration. It is only valid for as long as you do + * not access more data in the JSON document. + */ +class value { +public: + /** + * Create a new invalid value. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline value() noexcept = default; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) noexcept; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() noexcept; + + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() noexcept; + + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + + /** + * Cast this JSON value (inside string) to a unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + + /** + * Cast this JSON value to a "wobbly" string. + * + * The string is may not be a valid UTF-8 string. + * See https://simonsapin.github.io/wtf-8/ + * + * Important: a value should be consumed once. Calling get_wobbly_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); +#endif + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + * + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * Performance hint: You should only call count_elements() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method on the object instance. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @return The type of JSON value (json_type::array, json_type::object, json_type::string, + * json_type::number, json_type::boolean, or json_type::null). + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the value is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the value is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the value is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * Performance note: if you call this function systematically + * before parsing a number, you may have fallen for a performance + * anti-pattern. + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + * + * Performance note: this is designed with performance in mind. When + * calling 'get_number()', you scan the number string only once, determining + * efficiently the type and storing it in an efficient manner. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. However, if this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view is guaranteed to be + * a non-space token. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + * + * See also value::raw_json(). + */ + simdjson_inline std::string_view raw_json_token() noexcept; + + /** + * Get a string_view pointing at this value in the JSON document. + * If this element is an array or an object, it consumes the array or the object + * and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + * If this element is a scalar (string, number, Boolean, null), it returns what + * raw_json_token() would return. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + simdjson_inline simdjson_result current_location() noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. + * + * Calling at_pointer() on non-document instances (e.g., arrays and objects) is not + * standardized (by RFC 6901). We provide some experimental support for JSON pointers + * on non-document instances. Yet it is not the case when calling at_pointer on an array + * or an object instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + +protected: + /** + * Create a value. + */ + simdjson_inline value(const value_iterator &iter) noexcept; + + /** + * Skip this value, allowing iteration to continue. + */ + simdjson_inline void skip() noexcept; + + /** + * Start a value at the current position. + * + * (It should already be started; this is just a self-documentation method.) + */ + static simdjson_inline value start(const value_iterator &iter) noexcept; + + /** + * Resume a value. + */ + static simdjson_inline value resume(const value_iterator &iter) noexcept; + + /** + * Get the object, starting or resuming it as necessary + */ + simdjson_inline simdjson_result start_or_resume_object() noexcept; + + // simdjson_inline void log_value(const char *type) const noexcept; + // simdjson_inline void log_error(const char *message) const noexcept; + + value_iterator iter{}; + + friend class document; + friend class array_iterator; + friend class field; + friend class object; + friend struct simdjson_result; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::value &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result get_array() noexcept; + simdjson_inline simdjson_result get_object() noexcept; + + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() noexcept; + + template simdjson_inline error_code get(T &out) noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator fallback::ondemand::array() noexcept(false); + simdjson_inline operator fallback::ondemand::object() noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator fallback::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + */ + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + + /** @copydoc simdjson_inline std::string_view value::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + + /** @copydoc simdjson_inline simdjson_result current_location() noexcept */ + simdjson_inline simdjson_result current_location() noexcept; + /** @copydoc simdjson_inline int32_t current_depth() const noexcept */ + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H +/* end file simdjson/generic/ondemand/value.h for fallback */ +/* including simdjson/generic/ondemand/logger.h for fallback: #include "simdjson/generic/ondemand/logger.h" */ +/* begin file simdjson/generic/ondemand/logger.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +// Logging should be free unless SIMDJSON_VERBOSE_LOGGING is set. Importantly, it is critical +// that the call to the log functions be side-effect free. Thus, for example, you should not +// create temporary std::string instances. +namespace logger { + +enum class log_level : int32_t { + info = 0, + error = 1 +}; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + +// We do not want these functions to be 'really inlined' since real inlining is +// for performance purposes and if you are using the loggers, you do not care about +// performance (or should not). +static inline void log_headers() noexcept; +// If args are provided, title will be treated as format string +template +static inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +template +static inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; +static inline void log_event(const json_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_value(const json_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_start_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; + +static inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail="") noexcept; +static inline void log_error(const json_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +static inline void log_event(const value_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const value_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_error(const value_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +} // namespace logger +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_H +/* end file simdjson/generic/ondemand/logger.h for fallback */ +/* including simdjson/generic/ondemand/token_iterator.h for fallback: #include "simdjson/generic/ondemand/token_iterator.h" */ +/* begin file simdjson/generic/ondemand/token_iterator.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * Iterates through JSON tokens (`{` `}` `[` `]` `,` `:` `""` `123` `true` `false` `null`) + * detected by stage 1. + * + * @private This is not intended for external use. + */ +class token_iterator { +public: + /** + * Create a new invalid token_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline token_iterator() noexcept = default; + simdjson_inline token_iterator(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator &operator=(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator(const token_iterator &other) noexcept = default; + simdjson_inline token_iterator &operator=(const token_iterator &other) noexcept = default; + + /** + * Advance to the next token (returning the current one). + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + /** + * Reports the current offset in bytes from the start of the underlying buffer. + */ + simdjson_inline uint32_t current_offset() const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + + /** + * Return the current index. + */ + simdjson_inline token_position position() const noexcept; + /** + * Reset to a previously saved index. + */ + simdjson_inline void set_position(token_position target_position) noexcept; + + // NOTE: we don't support a full C++ iterator interface, because we expect people to make + // different calls to advance the iterator based on *their own* state. + + simdjson_inline bool operator==(const token_iterator &other) const noexcept; + simdjson_inline bool operator!=(const token_iterator &other) const noexcept; + simdjson_inline bool operator>(const token_iterator &other) const noexcept; + simdjson_inline bool operator>=(const token_iterator &other) const noexcept; + simdjson_inline bool operator<(const token_iterator &other) const noexcept; + simdjson_inline bool operator<=(const token_iterator &other) const noexcept; + +protected: + simdjson_inline token_iterator(const uint8_t *buf, token_position position) noexcept; + + /** + * Get the index of the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_index(int32_t delta=0) const noexcept; + /** + * Get the index of the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline uint32_t peek_index(token_position position) const noexcept; + + const uint8_t *buf{}; + token_position _position{}; + + friend class json_iterator; + friend class value_iterator; + friend class object; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::token_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H +/* end file simdjson/generic/ondemand/token_iterator.h for fallback */ +/* including simdjson/generic/ondemand/json_iterator.h for fallback: #include "simdjson/generic/ondemand/json_iterator.h" */ +/* begin file simdjson/generic/ondemand/json_iterator.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * Iterates through JSON tokens, keeping track of depth and string buffer. + * + * @private This is not intended for external use. + */ +class json_iterator { +protected: + token_iterator token{}; + ondemand::parser *parser{}; + /** + * Next free location in the string buffer. + * + * Used by raw_json_string::unescape() to have a place to unescape strings to. + */ + uint8_t *_string_buf_loc{}; + /** + * JSON error, if there is one. + * + * INCORRECT_TYPE and NO_SUCH_FIELD are *not* stored here, ever. + * + * PERF NOTE: we *hope* this will be elided into control flow, as it is only used (a) in the first + * iteration of the loop, or (b) for the final iteration after a missing comma is found in ++. If + * this is not elided, we should make sure it's at least not using up a register. Failing that, + * we should store it in document so there's only one of them. + */ + error_code error{SUCCESS}; + /** + * Depth of the current token in the JSON. + * + * - 0 = finished with document + * - 1 = document root value (could be [ or {, not yet known) + * - 2 = , or } inside root array/object + * - 3 = key or value inside root array/object. + */ + depth_t _depth{}; + /** + * Beginning of the document indexes. + * Normally we have root == parser->implementation->structural_indexes.get() + * but this may differ, especially in streaming mode (where we have several + * documents); + */ + token_position _root{}; + /** + * Normally, a json_iterator operates over a single document, but in + * some cases, we may have a stream of documents. This attribute is meant + * as meta-data: the json_iterator works the same irrespective of the + * value of this attribute. + */ + bool _streaming{false}; + +public: + simdjson_inline json_iterator() noexcept = default; + simdjson_inline json_iterator(json_iterator &&other) noexcept; + simdjson_inline json_iterator &operator=(json_iterator &&other) noexcept; + simdjson_inline explicit json_iterator(const json_iterator &other) noexcept = default; + simdjson_inline json_iterator &operator=(const json_iterator &other) noexcept = default; + /** + * Skips a JSON value, whether it is a scalar, array or object. + */ + simdjson_warn_unused simdjson_inline error_code skip_child(depth_t parent_depth) noexcept; + + /** + * Tell whether the iterator is still at the start + */ + simdjson_inline bool at_root() const noexcept; + + /** + * Tell whether we should be expected to run in streaming + * mode (iterating over many documents). It is pure metadata + * that does not affect how the iterator works. It is used by + * start_root_array() and start_root_object(). + */ + simdjson_inline bool streaming() const noexcept; + + /** + * Get the root value iterator + */ + simdjson_inline token_position root_position() const noexcept; + /** + * Assert that we are at the document depth (== 1) + */ + simdjson_inline void assert_at_document_depth() const noexcept; + /** + * Assert that we are at the root of the document + */ + simdjson_inline void assert_at_root() const noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is live (has not been moved). + */ + simdjson_inline bool is_alive() const noexcept; + + /** + * Abandon this iterator, setting depth to 0 (as if the document is finished). + */ + simdjson_inline void abandon() noexcept; + + /** + * Advance the current token without modifying depth. + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + + /** + * Returns true if there is a single token in the index (i.e., it is + * a JSON with a scalar value such as a single number). + * + * @return whether there is a single token + */ + simdjson_inline bool is_single_token() const noexcept; + + /** + * Assert that there are at least the given number of tokens left. + * + * Has no effect in release builds. + */ + simdjson_inline void assert_more_tokens(uint32_t required_tokens=1) const noexcept; + /** + * Assert that the given position addresses an actual token (is within bounds). + * + * Has no effect in release builds. + */ + simdjson_inline void assert_valid_position(token_position position) const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + /** + * Get a pointer to the current location in the input buffer. + * + * This is not null-terminated; it is a view into the JSON. + * + * You may be pointing outside of the input buffer: it is not generally + * safe to dereference this pointer. + */ + simdjson_inline const uint8_t *unsafe_pointer() const noexcept; + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token to retrieve. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token to retrieve. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + /** + * Get the JSON text for the last token in the document. + * + * This is not null-terminated; it is a view into the JSON. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek_last() const noexcept; + + /** + * Ascend one level. + * + * Validates that the depth - 1 == parent_depth. + * + * @param parent_depth the expected parent depth. + */ + simdjson_inline void ascend_to(depth_t parent_depth) noexcept; + + /** + * Descend one level. + * + * Validates that the new depth == child_depth. + * + * @param child_depth the expected child depth. + */ + simdjson_inline void descend_to(depth_t child_depth) noexcept; + simdjson_inline void descend_to(depth_t child_depth, int32_t delta) noexcept; + + /** + * Get current depth. + */ + simdjson_inline depth_t depth() const noexcept; + + /** + * Get current (writeable) location in the string buffer. + */ + simdjson_inline uint8_t *&string_buf_loc() noexcept; + + /** + * Report an unrecoverable error, preventing further iteration. + * + * @param error The error to report. Must not be SUCCESS, UNINITIALIZED, INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + /** + * Log error, but don't stop iteration. + * @param error The error to report. Must be INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code optional_error(error_code error, const char *message) noexcept; + + /** + * Take an input in json containing max_len characters and attempt to copy it over to tmpbuf, a buffer with + * N bytes of capacity. It will return false if N is too small (smaller than max_len) of if it is zero. + * The buffer (tmpbuf) is padded with space characters. + */ + simdjson_warn_unused simdjson_inline bool copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept; + + simdjson_inline token_position position() const noexcept; + /** + * Write the raw_json_string to the string buffer and return a string_view. + * Each raw_json_string should be unescaped once, or else the string buffer might + * overflow. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, bool allow_replacement) noexcept; + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in) noexcept; + + simdjson_inline void reenter_child(token_position position, depth_t child_depth) noexcept; + + simdjson_inline error_code consume_character(char c) noexcept; +#if SIMDJSON_DEVELOPMENT_CHECKS + simdjson_inline token_position start_position(depth_t depth) const noexcept; + simdjson_inline void set_start_position(depth_t depth, token_position position) noexcept; +#endif + + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Updates this json iterator so that it is back at the beginning of the document, + * as if it had just been created. + */ + inline void rewind() noexcept; + /** + * This checks whether the {,},[,] are balanced so that the document + * ends with proper zero depth. This requires scanning the whole document + * and it may be expensive. It is expected that it will be rarely called. + * It does not attempt to match { with } and [ with ]. + */ + inline bool balanced() const noexcept; +protected: + simdjson_inline json_iterator(const uint8_t *buf, ondemand::parser *parser) noexcept; + /// The last token before the end + simdjson_inline token_position last_position() const noexcept; + /// The token *at* the end. This points at gibberish and should only be used for comparison. + simdjson_inline token_position end_position() const noexcept; + /// The end of the buffer. + simdjson_inline token_position end() const noexcept; + + friend class document; + friend class document_stream; + friend class object; + friend class array; + friend class value; + friend class raw_json_string; + friend class parser; + friend class value_iterator; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; // json_iterator + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::json_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H +/* end file simdjson/generic/ondemand/json_iterator.h for fallback */ +/* including simdjson/generic/ondemand/json_type.h for fallback: #include "simdjson/generic/ondemand/json_type.h" */ +/* begin file simdjson/generic/ondemand/json_type.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * The type of a JSON value. + */ +enum class json_type { + // Start at 1 to catch uninitialized / default values more easily + array=1, ///< A JSON array ( [ 1, 2, 3 ... ] ) + object, ///< A JSON object ( { "a": 1, "b" 2, ... } ) + number, ///< A JSON number ( 1 or -2.3 or 4.5e6 ...) + string, ///< A JSON string ( "a" or "hello world\n" ...) + boolean, ///< A JSON boolean (true or false) + null ///< A JSON null (null) +}; + +/** + * A type representing a JSON number. + * The design of the struct is deliberately straight-forward. All + * functions return standard values with no error check. + */ +struct number { + + /** + * return the automatically determined type of + * the number: number_type::floating_point_number, + * number_type::signed_integer or number_type::unsigned_integer. + * + * enum class number_type { + * floating_point_number=1, /// a binary64 number + * signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + * unsigned_integer /// a positive integer larger or equal to 1<<63 + * }; + */ + simdjson_inline ondemand::number_type get_number_type() const noexcept; + /** + * return true if the automatically determined type of + * the number is number_type::unsigned_integer. + */ + simdjson_inline bool is_uint64() const noexcept; + /** + * return the value as a uint64_t, only valid if is_uint64() is true. + */ + simdjson_inline uint64_t get_uint64() const noexcept; + simdjson_inline operator uint64_t() const noexcept; + + /** + * return true if the automatically determined type of + * the number is number_type::signed_integer. + */ + simdjson_inline bool is_int64() const noexcept; + /** + * return the value as a int64_t, only valid if is_int64() is true. + */ + simdjson_inline int64_t get_int64() const noexcept; + simdjson_inline operator int64_t() const noexcept; + + + /** + * return true if the automatically determined type of + * the number is number_type::floating_point_number. + */ + simdjson_inline bool is_double() const noexcept; + /** + * return the value as a double, only valid if is_double() is true. + */ + simdjson_inline double get_double() const noexcept; + simdjson_inline operator double() const noexcept; + + /** + * Convert the number to a double. Though it always succeed, the conversion + * may be lossy if the number cannot be represented exactly. + */ + simdjson_inline double as_double() const noexcept; + + +protected: + /** + * The next block of declaration is designed so that we can call the number parsing + * functions on a number type. They are protected and should never be used outside + * of the core simdjson library. + */ + friend class value_iterator; + template + friend error_code numberparsing::slow_float_parsing(simdjson_unused const uint8_t * src, W writer); + template + friend error_code numberparsing::write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer); + template + friend error_code numberparsing::parse_number(const uint8_t *const src, W &writer); + /** Store a signed 64-bit value to the number. */ + simdjson_inline void append_s64(int64_t value) noexcept; + /** Store an unsigned 64-bit value to the number. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + /** Store a double value to the number. */ + simdjson_inline void append_double(double value) noexcept; + /** Specifies that the value is a double, but leave it undefined. */ + simdjson_inline void skip_double() noexcept; + /** + * End of friend declarations. + */ + + /** + * Our attributes are a union type (size = 64 bits) + * followed by a type indicator. + */ + union { + double floating_point_number; + int64_t signed_integer; + uint64_t unsigned_integer; + } payload{0}; + number_type type{number_type::signed_integer}; +}; + +/** + * Write the JSON type to the output stream + * + * @param out The output stream. + * @param type The json_type. + */ +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept; + +#if SIMDJSON_EXCEPTIONS +/** + * Send JSON type to an output stream. + * + * @param out The output stream. + * @param type The json_type. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false); +#endif + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::json_type &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H +/* end file simdjson/generic/ondemand/json_type.h for fallback */ +/* including simdjson/generic/ondemand/raw_json_string.h for fallback: #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * A string escaped per JSON rules, terminated with quote ("). They are used to represent + * unescaped keys inside JSON documents. + * + * (In other words, a pointer to the beginning of a string, just after the start quote, inside a + * JSON file.) + * + * This class is deliberately simplistic and has little functionality. You can + * compare a raw_json_string instance with an unescaped C string, but + * that is nearly all you can do. + * + * The raw_json_string is unescaped. If you wish to write an unescaped version of it to your own + * buffer, you may do so using the parser.unescape(string, buff) method, using an ondemand::parser + * instance. Doing so requires you to have a sufficiently large buffer. + * + * The raw_json_string instances originate typically from field instance which in turn represent + * key-value pairs from object instances. From a field instance, you get the raw_json_string + * instance by calling key(). You can, if you want a more usable string_view instance, call + * the unescaped_key() method on the field instance. You may also create a raw_json_string from + * any other string value, with the value.get_raw_json_string() method. Again, you can get + * a more usable string_view instance by calling get_string(). + * + */ +class raw_json_string { +public: + /** + * Create a new invalid raw_json_string. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline raw_json_string() noexcept = default; + + /** + * Create a new invalid raw_json_string pointed at the given location in the JSON. + * + * The given location must be just *after* the beginning quote (") in the JSON file. + * + * It *must* be terminated by a ", and be a valid JSON string. + */ + simdjson_inline raw_json_string(const uint8_t * _buf) noexcept; + /** + * Get the raw pointer to the beginning of the string in the JSON (just after the "). + * + * It is possible for this function to return a null pointer if the instance + * has outlived its existence. + */ + simdjson_inline const char * raw() const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done) on target.size() characters, + * and if the raw_json_string instance has a quote character at byte index target.size(). + * We never read more than length + 1 bytes in the raw_json_string instance. + * If length is smaller than target.size(), this will return false. + * + * The std::string_view instance may contain any characters. However, the caller + * is responsible for setting length so that length bytes may be read in the + * raw_json_string. + * + * Performance: the comparison may be done using memcmp which may be efficient + * for long strings. + */ + simdjson_inline bool unsafe_is_equal(size_t length, std::string_view target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The std::string_view instance should not contain unescaped quote characters: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * Performance: the comparison is done byte-by-byte which might be inefficient for + * long strings. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The provided C string should not contain an unescaped quote character: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(const char* target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(const char* target) const noexcept; + + /** + * Returns true if target is free from unescaped quote. If target is known at + * compile-time, we might expect the computation to happen at compile time with + * many compilers (not all!). + */ + static simdjson_inline bool is_free_from_unescaped_quote(std::string_view target) noexcept; + static simdjson_inline bool is_free_from_unescaped_quote(const char* target) noexcept; + +private: + + + /** + * This will set the inner pointer to zero, effectively making + * this instance unusable. + */ + simdjson_inline void consume() noexcept { buf = nullptr; } + + /** + * Checks whether the inner pointer is non-null and thus usable. + */ + simdjson_inline simdjson_warn_unused bool alive() const noexcept { return buf != nullptr; } + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result will be a valid UTF-8. + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + * @param allow_replacement Whether we allow replacement of invalid surrogate pairs. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape(json_iterator &iter, bool allow_replacement) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result may not be a valid UTF-8. https://simonsapin.github.io/wtf-8/ + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(json_iterator &iter) const noexcept; + const uint8_t * buf{}; + friend class object; + friend class field; + friend class parser; + friend struct simdjson_result; +}; + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &, const raw_json_string &) noexcept; + +/** + * Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible + * for providing a string with no unescaped quote. Note that unescaped quotes cannot be present in valid JSON strings. + */ +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept; +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept; + + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::raw_json_string &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private + + simdjson_inline simdjson_result raw() const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape(fallback::ondemand::json_iterator &iter, bool allow_replacement) const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(fallback::ondemand::json_iterator &iter) const noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H +/* end file simdjson/generic/ondemand/raw_json_string.h for fallback */ +/* including simdjson/generic/ondemand/parser.h for fallback: #include "simdjson/generic/ondemand/parser.h" */ +/* begin file simdjson/generic/ondemand/parser.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * The default batch size for document_stream instances for this On Demand kernel. + * Note that different On Demand kernel may use a different DEFAULT_BATCH_SIZE value + * in the future. + */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * A JSON fragment iterator. + * + * This holds the actual iterator as well as the buffer for writing strings. + */ +class parser { +public: + /** + * Create a JSON parser. + * + * The new parser will have zero capacity. + */ + inline explicit parser(size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept; + + inline parser(parser &&other) noexcept = default; + simdjson_inline parser(const parser &other) = delete; + simdjson_inline parser &operator=(const parser &other) = delete; + simdjson_inline parser &operator=(parser &&other) noexcept = default; + + /** Deallocate the JSON parser. */ + inline ~parser() noexcept = default; + + /** + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * document doc = parser.iterate(json); + * + * It is expected that the content is a valid UTF-8 file, containing a valid JSON document. + * Otherwise the iterate method may return an error. In particular, the whole input should be + * valid: we do not attempt to tolerate incorrect content either before or after a JSON + * document. If there is a UTF-8 BOM, the parser skips it. + * + * ### IMPORTANT: Validate what you use + * + * Calling iterate on an invalid JSON document may not immediately trigger an error. The call to + * iterate does not parse and validate the whole document. + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * @param len The length of the JSON. + * @param capacity The number of bytes allocated in the JSON (must be at least len+SIMDJSON_PADDING). + * + * @return The document, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate(padded_string_view json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const char *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const uint8_t *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string_view json, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(padded_string &&json) & noexcept = delete; + + /** + * @private + * + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * json_iterator doc = parser.iterate(json); + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * The ondemand::document instance holds the iterator. The document must remain in scope + * while you are accessing instances of ondemand::value, ondemand::object, ondemand::array. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * + * @return The iterator, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate_raw(padded_string_view json) & noexcept; + + + /** + * Parse a buffer containing many JSON documents. + * + * auto json = R"({ "foo": 1 } { "foo": 2 } { "foo": 3 } )"_padded; + * ondemand::parser parser; + * ondemand::document_stream docs = parser.iterate_many(json); + * for (auto & doc : docs) { + * std::cout << doc["foo"] << std::endl; + * } + * // Prints 1 2 3 + * + * No copy of the input buffer is made. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * + * The caller is responsabile to ensure that the input string data remains unchanged and is + * not deleted during the loop. + * + * ### Format + * + * The buffer must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by ASCII whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. Documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with ASCII whitespace. + * + * The characters inside a JSON document, and between JSON documents, must be valid Unicode (UTF-8). + * If there is a UTF-8 BOM, the parser skips it. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excessively small values may impact negatively the + * performance. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The concatenated JSON to parse. + * @param len The length of the concatenated JSON. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 10MB, which has been a reasonable sweet spot in our tests. + * @param allow_comma_separated (defaults on false) This allows a mode where the documents are + * separated by commas instead of whitespace. It comes with a performance + * penalty because the entire document is indexed at once (and the document must be + * less than 4 GB), and there is no multithreading. In this mode, the batch_size parameter + * is effectively ignored, as it is set to at least the document size. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result iterate_many(const uint8_t *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const char *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const std::string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const std::string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const padded_string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const padded_string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_result iterate_many(const char *buf, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept = delete; + + /** The capacity of this parser (the largest document it can process). */ + simdjson_inline size_t capacity() const noexcept; + /** The maximum capacity of this parser (the largest document it is allowed to process). */ + simdjson_inline size_t max_capacity() const noexcept; + simdjson_inline void set_max_capacity(size_t max_capacity) noexcept; + /** + * The maximum depth of this parser (the most deeply nested objects and arrays it can process). + * This parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * The max_depth parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused error_code allocate(size_t capacity, size_t max_depth=DEFAULT_MAX_DEPTH) noexcept; + + #ifdef SIMDJSON_THREADS_ENABLED + /** + * The parser instance can use threads when they are available to speed up some + * operations. It is enabled by default. Changing this attribute will change the + * behavior of the parser for future operations. + */ + bool threaded{true}; + #endif + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result must be valid UTF-8. + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @param allow_replacement Whether we allow a replacement if the input string contains unmatched surrogate pairs. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement = false) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result may not be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept; + +private: + /** @private [for benchmarking access] The implementation to use */ + std::unique_ptr implementation{}; + size_t _capacity{0}; + size_t _max_capacity; + size_t _max_depth{DEFAULT_MAX_DEPTH}; + std::unique_ptr string_buf{}; +#if SIMDJSON_DEVELOPMENT_CHECKS + std::unique_ptr start_positions{}; +#endif + + friend class json_iterator; + friend class document_stream; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::parser &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_H +/* end file simdjson/generic/ondemand/parser.h for fallback */ + +// All other declarations +/* including simdjson/generic/ondemand/array.h for fallback: #include "simdjson/generic/ondemand/array.h" */ +/* begin file simdjson/generic/ondemand/array.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * A forward-only JSON array. + */ +class array { +public: + /** + * Create a new invalid array. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline array() noexcept = default; + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an array is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the beginning of the array and checks whether the + * array is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result is_empty() & noexcept; + /** + * Reset the iterator so that we are pointing back at the + * beginning of the array. You should still consume values only once even if you + * can iterate through the array more than once. If you unescape a string + * within the array more than once, you have unsafe code. Note that rewinding + * an array means that you may need to reparse it anew: it is not a free + * operation. + * + * @returns true if the array contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/0/foo/a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an array + * instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the array and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Get the value at the given index. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; +protected: + /** + * Go to the end of the array, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + + /** + * Begin array iteration. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + */ + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + /** + * Begin array iteration from the root. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + * @error TAPE_ERROR if there is no closing ] at the end of the document. + */ + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + /** + * Begin array iteration. + * + * This version of the method should be called after the initial [ has been verified, and is + * intended for use by switch statements that check the type of a value. + * + * @param iter The iterator. Must be after the initial [. Will be *moved* into the resulting array. + */ + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + + /** + * Create an array at the given Internal array creation. Call array::start() or array::started() instead of this. + * + * @param iter The iterator. Must either be at the start of the first element with iter.is_alive() + * == true, or past the [] with is_alive() == false if the array is empty. Will be *moved* + * into the resulting array. + */ + simdjson_inline array(const value_iterator &iter) noexcept; + + /** + * Iterator marking current position. + * + * iter.is_alive() == false indicates iteration is complete. + */ + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; + friend struct simdjson_result; + friend class array_iterator; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::array &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + inline simdjson_result count_elements() & noexcept; + inline simdjson_result is_empty() & noexcept; + inline simdjson_result reset() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_H +/* end file simdjson/generic/ondemand/array.h for fallback */ +/* including simdjson/generic/ondemand/array_iterator.h for fallback: #include "simdjson/generic/ondemand/array_iterator.h" */ +/* begin file simdjson/generic/ondemand/array_iterator.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * A forward-only JSON array. + * + * This is an input_iterator, meaning: + * - It is forward-only + * - * must be called exactly once per element. + * - ++ must be called exactly once in between each * (*, ++, *, ++, * ...) + */ +class array_iterator { +public: + /** Create a new, invalid array iterator. */ + simdjson_inline array_iterator() noexcept = default; + + // + // Iterator interface + // + + /** + * Get the current element. + * + * Part of the std::iterator interface. + */ + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + /** + * Check if we are at the end of the JSON. + * + * Part of the std::iterator interface. + * + * @return true if there are no more elements in the JSON array. + */ + simdjson_inline bool operator==(const array_iterator &) const noexcept; + /** + * Check if there are more elements in the JSON array. + * + * Part of the std::iterator interface. + * + * @return true if there are more elements in the JSON array. + */ + simdjson_inline bool operator!=(const array_iterator &) const noexcept; + /** + * Move to the next element. + * + * Part of the std::iterator interface. + */ + simdjson_inline array_iterator &operator++() noexcept; + +private: + value_iterator iter{}; + + simdjson_inline array_iterator(const value_iterator &iter) noexcept; + + friend class array; + friend class value; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::array_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H +/* end file simdjson/generic/ondemand/array_iterator.h for fallback */ +/* including simdjson/generic/ondemand/document.h for fallback: #include "simdjson/generic/ondemand/document.h" */ +/* begin file simdjson/generic/ondemand/document.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * A JSON document. It holds a json_iterator instance. + * + * Used by tokens to get text, and string buffer location. + * + * You must keep the document around during iteration. + */ +class document { +public: + /** + * Create a new invalid document. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline document() noexcept = default; + simdjson_inline document(const document &other) noexcept = delete; // pass your documents by reference, not by copy + simdjson_inline document(document &&other) noexcept = default; + simdjson_inline document &operator=(const document &other) noexcept = delete; + simdjson_inline document &operator=(document &&other) noexcept = default; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() & noexcept; + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() & noexcept; + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + /** + * Cast this JSON value (inside string) to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: Calling get_string() twice on the same document is an error. + * + * @param Whether to allow a replacement character for unmatched surrogate pairs. + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + /** + * Cast this JSON value to a string. + * + * The string is not guaranteed to be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * + * Important: Calling get_wobbly_string() twice on the same document is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + /** + * Cast this JSON value to a value when the document is an object or an array. + * + * @returns A value if a JSON array or object cannot be found. + * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result get_value() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() & noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + /** @overload template simdjson_result get() & noexcept */ + template simdjson_inline simdjson_result get() && noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool, value + * + * Be mindful that the document instance must remain in scope while you are accessing object, array and value instances. + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) & noexcept; + /** @overload template error_code get(T &out) & noexcept */ + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() & noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() & noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); + /** + * Cast this JSON value to a value. + * + * @returns A value value. + * @exception if a JSON value cannot be found + */ + simdjson_inline operator value() noexcept(false); +#endif + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) & noexcept; + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to + * a key a single time. Doing object["mykey"].to_string()and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the document is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the document is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the document is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. If this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view may be the padded buffer. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + /** + * Reset the iterator inside the document instance so we are pointing back at the + * beginning of the document, as if it had just been created. It invalidates all + * values, objects and arrays that you have created so far (including unescaped strings). + */ + inline void rewind() noexcept; + /** + * Returns debugging information. + */ + inline std::string to_debug_string() noexcept; + /** + * Some unrecoverable error conditions may render the document instance unusable. + * The is_alive() method returns true when the document is still suitable. + */ + inline bool is_alive() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Returns true if this document has been fully parsed. + * If you have consumed the whole document and at_end() returns + * false, then there may be trailing content. + */ + inline bool at_end() const noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() automatically calls rewind between each call. Thus + * all values, objects and arrays that you have created so far (including unescaped strings) + * are invalidated. After calling at_pointer, you need to consume the result: string values + * should be stored in your own variables, arrays should be decoded and stored in your own array-like + * structures and so forth. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + * - SCALAR_DOCUMENT_AS_VALUE if the json_pointer is empty and the document is not a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the document and returns a string_view instance corresponding to the + * document as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; +protected: + /** + * Consumes the document. + */ + simdjson_inline error_code consume() noexcept; + + simdjson_inline document(ondemand::json_iterator &&iter) noexcept; + simdjson_inline const uint8_t *text(uint32_t idx) const noexcept; + + simdjson_inline value_iterator resume_value_iterator() noexcept; + simdjson_inline value_iterator get_root_value_iterator() noexcept; + simdjson_inline simdjson_result start_or_resume_object() noexcept; + static simdjson_inline document start(ondemand::json_iterator &&iter) noexcept; + + // + // Fields + // + json_iterator iter{}; ///< Current position in the document + static constexpr depth_t DOCUMENT_DEPTH = 0; ///< document depth is always 0 + + friend class array_iterator; + friend class value; + friend class ondemand::parser; + friend class object; + friend class array; + friend class field; + friend class token; + friend class document_stream; + friend class document_reference; +}; + + +/** + * A document_reference is a thin wrapper around a document reference instance. + */ +class document_reference { +public: + simdjson_inline document_reference() noexcept; + simdjson_inline document_reference(document &d) noexcept; + simdjson_inline document_reference(const document_reference &other) noexcept = default; + simdjson_inline document_reference& operator=(const document_reference &other) noexcept = default; + simdjson_inline void rewind() noexcept; + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + + simdjson_inline simdjson_result is_null() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + simdjson_inline operator document&() const noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator array() & noexcept(false); + simdjson_inline operator object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +private: + document *doc{nullptr}; +}; +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::document &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() & noexcept; + template simdjson_inline simdjson_result get() && noexcept; + + template simdjson_inline error_code get(T &out) & noexcept; + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator fallback::ondemand::array() & noexcept(false); + simdjson_inline operator fallback::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator fallback::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator fallback::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool at_end() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + + + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::document_reference value, error_code error) noexcept; + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator fallback::ondemand::array() & noexcept(false); + simdjson_inline operator fallback::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator fallback::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator fallback::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document_reference::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H +/* end file simdjson/generic/ondemand/document.h for fallback */ +/* including simdjson/generic/ondemand/document_stream.h for fallback: #include "simdjson/generic/ondemand/document_stream.h" */ +/* begin file simdjson/generic/ondemand/document_stream.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#ifdef SIMDJSON_THREADS_ENABLED +#include +#include +#include +#endif + +namespace simdjson { +namespace fallback { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED +/** @private Custom worker class **/ +struct stage1_worker { + stage1_worker() noexcept = default; + stage1_worker(const stage1_worker&) = delete; + stage1_worker(stage1_worker&&) = delete; + stage1_worker operator=(const stage1_worker&) = delete; + ~stage1_worker(); + /** + * We only start the thread when it is needed, not at object construction, this may throw. + * You should only call this once. + **/ + void start_thread(); + /** + * Start a stage 1 job. You should first call 'run', then 'finish'. + * You must call start_thread once before. + */ + void run(document_stream * ds, parser * stage1, size_t next_batch_start); + /** Wait for the run to finish (blocking). You should first call 'run', then 'finish'. **/ + void finish(); + +private: + + /** + * Normally, we would never stop the thread. But we do in the destructor. + * This function is only safe assuming that you are not waiting for results. You + * should have called run, then finish, and be done. + **/ + void stop_thread(); + + std::thread thread{}; + /** These three variables define the work done by the thread. **/ + ondemand::parser * stage1_thread_parser{}; + size_t _next_batch_start{}; + document_stream * owner{}; + /** + * We have two state variables. This could be streamlined to one variable in the future but + * we use two for clarity. + */ + bool has_work{false}; + bool can_work{true}; + + /** + * We lock using a mutex. + */ + std::mutex locking_mutex{}; + std::condition_variable cond_var{}; + + friend class document_stream; +}; +#endif // SIMDJSON_THREADS_ENABLED + +/** + * A forward-only stream of documents. + * + * Produced by parser::iterate_many. + * + */ +class document_stream { +public: + /** + * Construct an uninitialized document_stream. + * + * ```c++ + * document_stream docs; + * auto error = parser.iterate_many(json).get(docs); + * ``` + */ + simdjson_inline document_stream() noexcept; + /** Move one document_stream to another. */ + simdjson_inline document_stream(document_stream &&other) noexcept = default; + /** Move one document_stream to another. */ + simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default; + + simdjson_inline ~document_stream() noexcept; + + /** + * Returns the input size in bytes. + */ + inline size_t size_in_bytes() const noexcept; + + /** + * After iterating through the stream, this method + * returns the number of bytes that were not parsed at the end + * of the stream. If truncated_bytes() differs from zero, + * then the input was truncated maybe because incomplete JSON + * documents were found at the end of the stream. You + * may need to process the bytes in the interval [size_in_bytes()-truncated_bytes(), size_in_bytes()). + * + * You should only call truncated_bytes() after streaming through all + * documents, like so: + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto & doc : stream) { + * // do something with doc + * } + * size_t truncated = stream.truncated_bytes(); + * + */ + inline size_t truncated_bytes() const noexcept; + + class iterator { + public: + using value_type = simdjson_result; + using reference = value_type; + + using difference_type = std::ptrdiff_t; + + using iterator_category = std::input_iterator_tag; + + /** + * Default constructor. + */ + simdjson_inline iterator() noexcept; + /** + * Get the current document (or error). + */ + simdjson_inline simdjson_result operator*() noexcept; + /** + * Advance to the next document (prefix). + */ + inline iterator& operator++() noexcept; + /** + * Check if we're at the end yet. + * @param other the end iterator to compare to. + */ + simdjson_inline bool operator!=(const iterator &other) const noexcept; + /** + * @private + * + * Gives the current index in the input document in bytes. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * size_t index = i.current_index(); + * } + * + * This function (current_index()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline size_t current_index() const noexcept; + + /** + * @private + * + * Gives a view of the current document at the current position. + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * std::string_view v = i.source(); + * } + * + * The returned string_view instance is simply a map to the (unparsed) + * source string: it may thus include white-space characters and all manner + * of padding. + * + * This function (source()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + * + */ + simdjson_inline std::string_view source() const noexcept; + + /** + * Returns error of the stream (if any). + */ + inline error_code error() const noexcept; + + private: + simdjson_inline iterator(document_stream *s, bool finished) noexcept; + /** The document_stream we're iterating through. */ + document_stream* stream; + /** Whether we're finished or not. */ + bool finished; + + friend class document; + friend class document_stream; + friend class json_iterator; + }; + + /** + * Start iterating the documents in the stream. + */ + simdjson_inline iterator begin() noexcept; + /** + * The end of the stream, for iterator comparison purposes. + */ + simdjson_inline iterator end() noexcept; + +private: + + document_stream &operator=(const document_stream &) = delete; // Disallow copying + document_stream(const document_stream &other) = delete; // Disallow copying + + /** + * Construct a document_stream. Does not allocate or parse anything until the iterator is + * used. + * + * @param parser is a reference to the parser instance used to generate this document_stream + * @param buf is the raw byte buffer we need to process + * @param len is the length of the raw byte buffer in bytes + * @param batch_size is the size of the windows (must be strictly greater or equal to the largest JSON document) + */ + simdjson_inline document_stream( + ondemand::parser &parser, + const uint8_t *buf, + size_t len, + size_t batch_size, + bool allow_comma_separated + ) noexcept; + + /** + * Parse the first document in the buffer. Used by begin(), to handle allocation and + * initialization. + */ + inline void start() noexcept; + + /** + * Parse the next document found in the buffer previously given to document_stream. + * + * The content should be a valid JSON document encoded as UTF-8. If there is a + * UTF-8 BOM, the parser skips it. + * + * You do NOT need to pre-allocate a parser. This function takes care of + * pre-allocating a capacity defined by the batch_size defined when creating the + * document_stream object. + * + * The function returns simdjson::EMPTY if there is no more data to be parsed. + * + * The function returns simdjson::SUCCESS (as integer = 0) in case of success + * and indicates that the buffer has successfully been parsed to the end. + * Every document it contained has been parsed without error. + * + * The function returns an error code from simdjson/simdjson.h in case of failure + * such as simdjson::CAPACITY, simdjson::MEMALLOC, simdjson::DEPTH_ERROR and so forth; + * the simdjson::error_message function converts these error codes into a string). + * + * You can also check validity by calling parser.is_valid(). The same parser can + * and should be reused for the other documents in the buffer. + */ + inline void next() noexcept; + + /** Move the json_iterator of the document to the location of the next document in the stream. */ + inline void next_document() noexcept; + + /** Get the next document index. */ + inline size_t next_batch_start() const noexcept; + + /** Pass the next batch through stage 1 with the given parser. */ + inline error_code run_stage1(ondemand::parser &p, size_t batch_start) noexcept; + + // Fields + ondemand::parser *parser; + const uint8_t *buf; + size_t len; + size_t batch_size; + bool allow_comma_separated; + /** + * We are going to use just one document instance. The document owns + * the json_iterator. It implies that we only ever pass a reference + * to the document to the users. + */ + document doc{}; + /** The error (or lack thereof) from the current document. */ + error_code error; + size_t batch_start{0}; + size_t doc_index{}; + + #ifdef SIMDJSON_THREADS_ENABLED + /** Indicates whether we use threads. Note that this needs to be a constant during the execution of the parsing. */ + bool use_thread; + + inline void load_from_stage1_thread() noexcept; + + /** Start a thread to run stage 1 on the next batch. */ + inline void start_stage1_thread() noexcept; + + /** Wait for the stage 1 thread to finish and capture the results. */ + inline void finish_stage1_thread() noexcept; + + /** The error returned from the stage 1 thread. */ + error_code stage1_thread_error{UNINITIALIZED}; + /** The thread used to run stage 1 against the next batch in the background. */ + std::unique_ptr worker{new(std::nothrow) stage1_worker()}; + /** + * The parser used to run stage 1 in the background. Will be swapped + * with the regular parser when finished. + */ + ondemand::parser stage1_thread_parser{}; + + friend struct stage1_worker; + #endif // SIMDJSON_THREADS_ENABLED + + friend class parser; + friend class document; + friend class json_iterator; + friend struct simdjson_result; + friend struct internal::simdjson_result_base; +}; // document_stream + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::document_stream &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H +/* end file simdjson/generic/ondemand/document_stream.h for fallback */ +/* including simdjson/generic/ondemand/field.h for fallback: #include "simdjson/generic/ondemand/field.h" */ +/* begin file simdjson/generic/ondemand/field.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * A JSON field (key/value pair) in an object. + * + * Returned from object iteration. + * + * Extends from std::pair so you can use C++ algorithms that rely on pairs. + */ +class field : public std::pair { +public: + /** + * Create a new invalid field. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline field() noexcept; + + /** + * Get the key as a string_view (for higher speed, consider raw_key). + * We deliberately use a more cumbersome name (unescaped_key) to force users + * to think twice about using it. + * + * This consumes the key: once you have called unescaped_key(), you cannot + * call it again nor can you call key(). + */ + simdjson_inline simdjson_warn_unused simdjson_result unescaped_key(bool allow_replacement) noexcept; + /** + * Get the key as a raw_json_string. Can be used for direct comparison with + * an unescaped C string: e.g., key() == "test". + */ + simdjson_inline raw_json_string key() const noexcept; + /** + * Get the field value. + */ + simdjson_inline ondemand::value &value() & noexcept; + /** + * @overload ondemand::value &ondemand::value() & noexcept + */ + simdjson_inline ondemand::value value() && noexcept; + +protected: + simdjson_inline field(raw_json_string key, ondemand::value &&value) noexcept; + static simdjson_inline simdjson_result start(value_iterator &parent_iter) noexcept; + static simdjson_inline simdjson_result start(const value_iterator &parent_iter, raw_json_string key) noexcept; + friend struct simdjson_result; + friend class object_iterator; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::field &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result unescaped_key(bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result key() noexcept; + simdjson_inline simdjson_result value() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_H +/* end file simdjson/generic/ondemand/field.h for fallback */ +/* including simdjson/generic/ondemand/object.h for fallback: #include "simdjson/generic/ondemand/object.h" */ +/* begin file simdjson/generic/ondemand/object.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +/** + * A forward-only JSON object field iterator. + */ +class object { +public: + /** + * Create a new invalid object. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a + * key a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an object + * instance: there is no rewind and no invalidation. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + + /** + * Reset the iterator so that we are pointing back at the + * beginning of the object. You should still consume values only once even if you + * can iterate through the object more than once. If you unescape a string within + * the object more than once, you have unsafe code. Note that rewinding an object + * means that you may need to reparse it anew: it is not a free operation. + * + * @returns true if the object contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * This method scans the beginning of the object and checks whether the + * object is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + inline simdjson_result is_empty() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Consumes the object and returns a string_view instance corresponding to the + * object as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + +protected: + /** + * Go to the end of the object, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + static simdjson_inline object resume(const value_iterator &iter) noexcept; + simdjson_inline object(const value_iterator &iter) noexcept; + + simdjson_warn_unused simdjson_inline error_code find_field_raw(const std::string_view key) noexcept; + + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::object &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + inline simdjson_result reset() noexcept; + inline simdjson_result is_empty() noexcept; + inline simdjson_result count_fields() & noexcept; + inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_H +/* end file simdjson/generic/ondemand/object.h for fallback */ +/* including simdjson/generic/ondemand/object_iterator.h for fallback: #include "simdjson/generic/ondemand/object_iterator.h" */ +/* begin file simdjson/generic/ondemand/object_iterator.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +class object_iterator { +public: + /** + * Create a new invalid object_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object_iterator() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline simdjson_result operator*() noexcept; + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const object_iterator &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const object_iterator &) const noexcept; + // Checks for ']' and ',' + simdjson_inline object_iterator &operator++() noexcept; + +private: + /** + * The underlying JSON iterator. + * + * PERF NOTE: expected to be elided in favor of the parent document: this is set when the object + * is first used, and never changes afterwards. + */ + value_iterator iter{}; + + simdjson_inline object_iterator(const value_iterator &iter) noexcept; + friend struct simdjson_result; + friend class object; +}; + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public fallback::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(fallback::ondemand::object_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + // Checks for ']' and ',' + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H +/* end file simdjson/generic/ondemand/object_iterator.h for fallback */ +/* including simdjson/generic/ondemand/serialization.h for fallback: #include "simdjson/generic/ondemand/serialization.h" */ +/* begin file simdjson/generic/ondemand/serialization.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Create a string-view instance out of a document instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(fallback::ondemand::document& x) noexcept; +/** + * Create a string-view instance out of a value instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. The value must + * not have been accessed previously. It does not + * validate the content. + */ +inline simdjson_result to_json_string(fallback::ondemand::value& x) noexcept; +/** + * Create a string-view instance out of an object instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(fallback::ondemand::object& x) noexcept; +/** + * Create a string-view instance out of an array instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(fallback::ondemand::array& x) noexcept; +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +} // namespace simdjson + +/** + * We want to support argument-dependent lookup (ADL). + * Hence we should define operator<< in the namespace + * where the argument (here value, object, etc.) resides. + * Credit: @madhur4127 + * See https://github.com/simdjson/simdjson/issues/1768 + */ +namespace simdjson { namespace fallback { namespace ondemand { + +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The element. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::value x); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::array value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::document& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::document_reference& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The object. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::object value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +}}} // namespace simdjson::fallback::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H +/* end file simdjson/generic/ondemand/serialization.h for fallback */ + +// Inline definitions +/* including simdjson/generic/ondemand/array-inl.h for fallback: #include "simdjson/generic/ondemand/array-inl.h" */ +/* begin file simdjson/generic/ondemand/array-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter->depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the array is first found and the iterator is just past the `{`. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the `,` before the next value (or `]`). In this state, +// depth == iter->depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter->depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter->depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the array iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet element may be missing or not be an +// array--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter->depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between elements, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter->depth == depth, and at_start == false. +// +// ## Terminal State +// +// The terminal state has iter->depth < depth. at_start is always false. +// +// - Finished: When we have reached a `]` or have reported an error, we are finished. We signal this +// by decrementing depth. In this state, iter->depth < depth, at_start == false, and +// error == SUCCESS. +// + +simdjson_inline array::array(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result array::start(value_iterator &iter) noexcept { + // We don't need to know if the array is empty to start iteration, but we do want to know if there + // is an error--thus `simdjson_unused`. + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::start_root(value_iterator &iter) noexcept { + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_root_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::started(value_iterator &iter) noexcept { + bool has_value; + SIMDJSON_TRY(iter.started_array().get(has_value)); + return array(iter); +} + +simdjson_inline simdjson_result array::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return array_iterator(iter); +} +simdjson_inline simdjson_result array::end() noexcept { + return array_iterator(iter); +} +simdjson_inline error_code array::consume() noexcept { + auto error = iter.json_iter().skip_child(iter.depth()-1); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result array::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter._json_iter->unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline simdjson_result array::count_elements() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the array after counting the number of elements. + iter.reset_array(); + return count; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline simdjson_result array::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_array().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +inline simdjson_result array::reset() & noexcept { + return iter.reset_array(); +} + +inline simdjson_result array::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + // - means "the append position" or "the element after the end of the array" + // We don't support this, because we're returning a real element, not a position. + if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; } + + // Read the array index + size_t array_index = 0; + size_t i; + for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) { + uint8_t digit = uint8_t(json_pointer[i] - '0'); + // Check for non-digit in array index. If it's there, we're trying to get a field in an object + if (digit > 9) { return INCORRECT_TYPE; } + array_index = array_index*10 + digit; + } + + // 0 followed by other digits is invalid + if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0" + + // Empty string is invalid; so is a "/" with no digits before it + if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index" + // Get the child + auto child = at(array_index); + // If there is an error, it ends here + if(child.error()) { + return child; + } + + // If there is a /, we're not done yet, call recursively. + if (i < json_pointer.length()) { + child = child.at_pointer(json_pointer.substr(i)); + } + return child; +} + +simdjson_inline simdjson_result array::at(size_t index) noexcept { + size_t i = 0; + for (auto value : *this) { + if (i == index) { return value; } + i++; + } + return INDEX_OUT_OF_BOUNDS; +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + fallback::ondemand::array &&value +) noexcept + : implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept + : implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::is_empty() & noexcept { + if (error()) { return error(); } + return first.is_empty(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H +/* end file simdjson/generic/ondemand/array-inl.h for fallback */ +/* including simdjson/generic/ondemand/array_iterator-inl.h for fallback: #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/array_iterator-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline array_iterator::array_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result array_iterator::operator*() noexcept { + if (iter.error()) { iter.abandon(); return iter.error(); } + return value(iter.child()); +} +simdjson_inline bool array_iterator::operator==(const array_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept { + return iter.is_open(); +} +simdjson_inline array_iterator &array_iterator::operator++() noexcept { + error_code error; + // PERF NOTE this is a safety rail ... users should exit loops as soon as they receive an error, so we'll never get here. + // However, it does not seem to make a perf difference, so we add it out of an abundance of caution. + if (( error = iter.error() )) { return *this; } + if (( error = iter.skip_child() )) { return *this; } + if (( error = iter.has_next_element().error() )) { return *this; } + return *this; +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + fallback::ondemand::array_iterator &&value +) noexcept + : fallback::implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : fallback::implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++(first); + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/array_iterator-inl.h for fallback */ +/* including simdjson/generic/ondemand/document-inl.h for fallback: #include "simdjson/generic/ondemand/document-inl.h" */ +/* begin file simdjson/generic/ondemand/document-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline document::document(ondemand::json_iterator &&_iter) noexcept + : iter{std::forward(_iter)} +{ + logger::log_start_value(iter, "document"); +} + +simdjson_inline document document::start(json_iterator &&iter) noexcept { + return document(std::forward(iter)); +} + +inline void document::rewind() noexcept { + iter.rewind(); +} + +inline std::string document::to_debug_string() noexcept { + return iter.to_string(); +} + +inline simdjson_result document::current_location() const noexcept { + return iter.current_location(); +} + +inline int32_t document::current_depth() const noexcept { + return iter.depth(); +} + +inline bool document::at_end() const noexcept { + return iter.at_end(); +} + + +inline bool document::is_alive() noexcept { + return iter.is_alive(); +} +simdjson_inline value_iterator document::resume_value_iterator() noexcept { + return value_iterator(&iter, 1, iter.root_position()); +} +simdjson_inline value_iterator document::get_root_value_iterator() noexcept { + return resume_value_iterator(); +} +simdjson_inline simdjson_result document::start_or_resume_object() noexcept { + if (iter.at_root()) { + return get_object(); + } else { + return object::resume(resume_value_iterator()); + } +} +simdjson_inline simdjson_result document::get_value() noexcept { + // Make sure we start any arrays or objects before returning, so that start_root_() + // gets called. + iter.assert_at_document_depth(); + switch (*iter.peek()) { + case '[': { + // The following lines check that the document ends with ]. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_array(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + case '{': { + // The following lines would check that the document ends with }. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_object(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + default: + // Unfortunately, scalar documents are a special case in simdjson and they cannot + // be safely converted to value instances. + return SCALAR_DOCUMENT_AS_VALUE; + } +} +simdjson_inline simdjson_result document::get_array() & noexcept { + auto value = get_root_value_iterator(); + return array::start_root(value); +} +simdjson_inline simdjson_result document::get_object() & noexcept { + auto value = get_root_value_iterator(); + return object::start_root(value); +} + +/** + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. We want to disallow trailing + * content. + * Thus, in several implementations below, we pass a 'true' parameter value to + * a get_root_value_iterator() method: this indicates that we disallow trailing content. + */ + +simdjson_inline simdjson_result document::get_uint64() noexcept { + return get_root_value_iterator().get_root_uint64(true); +} +simdjson_inline simdjson_result document::get_uint64_in_string() noexcept { + return get_root_value_iterator().get_root_uint64_in_string(true); +} +simdjson_inline simdjson_result document::get_int64() noexcept { + return get_root_value_iterator().get_root_int64(true); +} +simdjson_inline simdjson_result document::get_int64_in_string() noexcept { + return get_root_value_iterator().get_root_int64_in_string(true); +} +simdjson_inline simdjson_result document::get_double() noexcept { + return get_root_value_iterator().get_root_double(true); +} +simdjson_inline simdjson_result document::get_double_in_string() noexcept { + return get_root_value_iterator().get_root_double_in_string(true); +} +simdjson_inline simdjson_result document::get_string(bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(true, allow_replacement); +} +template +simdjson_inline error_code document::get_string(string_type& receiver, bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(receiver, true, allow_replacement); +} +simdjson_inline simdjson_result document::get_wobbly_string() noexcept { + return get_root_value_iterator().get_root_wobbly_string(true); +} +simdjson_inline simdjson_result document::get_raw_json_string() noexcept { + return get_root_value_iterator().get_root_raw_json_string(true); +} +simdjson_inline simdjson_result document::get_bool() noexcept { + return get_root_value_iterator().get_root_bool(true); +} +simdjson_inline simdjson_result document::is_null() noexcept { + return get_root_value_iterator().is_root_null(true); +} + +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_array(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_object(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_double(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_bool(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_value(); } + +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_double(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_uint64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_int64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_bool(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_value(); } + +template simdjson_inline error_code document::get(T &out) & noexcept { + return get().get(out); +} +template simdjson_inline error_code document::get(T &out) && noexcept { + return std::forward(*this).get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document::operator array() & noexcept(false) { return get_array(); } +simdjson_inline document::operator object() & noexcept(false) { return get_object(); } +simdjson_inline document::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document::operator double() noexcept(false) { return get_double(); } +simdjson_inline document::operator std::string_view() noexcept(false) { return get_string(false); } +simdjson_inline document::operator raw_json_string() noexcept(false) { return get_raw_json_string(); } +simdjson_inline document::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document::operator value() noexcept(false) { return get_value(); } + +#endif +simdjson_inline simdjson_result document::count_elements() & noexcept { + auto a = get_array(); + simdjson_result answer = a.count_elements(); + /* If there was an array, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::count_fields() & noexcept { + auto a = get_object(); + simdjson_result answer = a.count_fields(); + /* If there was an object, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::at(size_t index) & noexcept { + auto a = get_array(); + return a.at(index); +} +simdjson_inline simdjson_result document::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result document::end() & noexcept { + return {}; +} + +simdjson_inline simdjson_result document::find_field(std::string_view key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field(const char *key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field_unordered(std::string_view key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::find_field_unordered(const char *key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::operator[](std::string_view key) & noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result document::operator[](const char *key) & noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline error_code document::consume() noexcept { + auto error = iter.skip_child(0); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result document::raw_json() noexcept { + auto _iter = get_root_value_iterator(); + const uint8_t * starting_point{_iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter.unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result document::type() noexcept { + return get_root_value_iterator().type(); +} + +simdjson_inline simdjson_result document::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool document::is_negative() noexcept { + return get_root_value_iterator().is_root_negative(); +} + +simdjson_inline simdjson_result document::is_integer() noexcept { + return get_root_value_iterator().is_root_integer(true); +} + +simdjson_inline simdjson_result document::get_number_type() noexcept { + return get_root_value_iterator().get_root_number_type(true); +} + +simdjson_inline simdjson_result document::get_number() noexcept { + return get_root_value_iterator().get_root_number(true); +} + + +simdjson_inline simdjson_result document::raw_json_token() noexcept { + auto _iter = get_root_value_iterator(); + return std::string_view(reinterpret_cast(_iter.peek_start()), _iter.peek_start_length()); +} + +simdjson_inline simdjson_result document::at_pointer(std::string_view json_pointer) noexcept { + rewind(); // Rewind the document each time at_pointer is called + if (json_pointer.empty()) { + return this->get_value(); + } + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + fallback::ondemand::document &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base( + error + ) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template +simdjson_inline simdjson_result simdjson_result::get() & noexcept { + if (error()) { return error(); } + return first.get(); +} +template +simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first).get(); +} +template +simdjson_inline error_code simdjson_result::get(T &out) & noexcept { + if (error()) { return error(); } + return first.get(out); +} +template +simdjson_inline error_code simdjson_result::get(T &out) && noexcept { + if (error()) { return error(); } + return std::forward(first).get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() & noexcept = delete; +template<> simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first); +} +template<> simdjson_inline error_code simdjson_result::get(fallback::ondemand::document &out) & noexcept = delete; +template<> simdjson_inline error_code simdjson_result::get(fallback::ondemand::document &out) && noexcept { + if (error()) { return error(); } + out = std::forward(first); + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} + +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} + + +simdjson_inline bool simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} + +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} + +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} + +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} + + +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator fallback::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline bool simdjson_result::at_end() const noexcept { + if (error()) { return error(); } + return first.at_end(); +} + + +simdjson_inline int32_t simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline document_reference::document_reference() noexcept : doc{nullptr} {} +simdjson_inline document_reference::document_reference(document &d) noexcept : doc(&d) {} +simdjson_inline void document_reference::rewind() noexcept { doc->rewind(); } +simdjson_inline simdjson_result document_reference::get_array() & noexcept { return doc->get_array(); } +simdjson_inline simdjson_result document_reference::get_object() & noexcept { return doc->get_object(); } +/** + * The document_reference instances are used primarily/solely for streams of JSON + * documents. + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. + * + * However, for streams of JSON documents, we want to be able to start from + * "321" "321" "321" + * and parse it successfully as a stream of JSON documents, calling get_uint64_in_string() + * successfully each time. + * + * To achieve this result, we pass a 'false' to a get_root_value_iterator() method: + * this indicates that we allow trailing content. + */ +simdjson_inline simdjson_result document_reference::get_uint64() noexcept { return doc->get_root_value_iterator().get_root_uint64(false); } +simdjson_inline simdjson_result document_reference::get_uint64_in_string() noexcept { return doc->get_root_value_iterator().get_root_uint64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_int64() noexcept { return doc->get_root_value_iterator().get_root_int64(false); } +simdjson_inline simdjson_result document_reference::get_int64_in_string() noexcept { return doc->get_root_value_iterator().get_root_int64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_double() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_double_in_string() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_string(bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(false, allow_replacement); } +template +simdjson_inline error_code document_reference::get_string(string_type& receiver, bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(receiver, false, allow_replacement); } +simdjson_inline simdjson_result document_reference::get_wobbly_string() noexcept { return doc->get_root_value_iterator().get_root_wobbly_string(false); } +simdjson_inline simdjson_result document_reference::get_raw_json_string() noexcept { return doc->get_root_value_iterator().get_root_raw_json_string(false); } +simdjson_inline simdjson_result document_reference::get_bool() noexcept { return doc->get_root_value_iterator().get_root_bool(false); } +simdjson_inline simdjson_result document_reference::get_value() noexcept { return doc->get_value(); } +simdjson_inline simdjson_result document_reference::is_null() noexcept { return doc->get_root_value_iterator().is_root_null(false); } + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document_reference::operator array() & noexcept(false) { return array(*doc); } +simdjson_inline document_reference::operator object() & noexcept(false) { return object(*doc); } +simdjson_inline document_reference::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document_reference::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document_reference::operator double() noexcept(false) { return get_double(); } +simdjson_inline document_reference::operator std::string_view() noexcept(false) { return std::string_view(*doc); } +simdjson_inline document_reference::operator raw_json_string() noexcept(false) { return raw_json_string(*doc); } +simdjson_inline document_reference::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document_reference::operator value() noexcept(false) { return value(*doc); } +#endif +simdjson_inline simdjson_result document_reference::count_elements() & noexcept { return doc->count_elements(); } +simdjson_inline simdjson_result document_reference::count_fields() & noexcept { return doc->count_fields(); } +simdjson_inline simdjson_result document_reference::at(size_t index) & noexcept { return doc->at(index); } +simdjson_inline simdjson_result document_reference::begin() & noexcept { return doc->begin(); } +simdjson_inline simdjson_result document_reference::end() & noexcept { return doc->end(); } +simdjson_inline simdjson_result document_reference::find_field(std::string_view key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::find_field(const char *key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::operator[](std::string_view key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::operator[](const char *key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::find_field_unordered(std::string_view key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::find_field_unordered(const char *key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::type() noexcept { return doc->type(); } +simdjson_inline simdjson_result document_reference::is_scalar() noexcept { return doc->is_scalar(); } +simdjson_inline simdjson_result document_reference::current_location() noexcept { return doc->current_location(); } +simdjson_inline int32_t document_reference::current_depth() const noexcept { return doc->current_depth(); } +simdjson_inline bool document_reference::is_negative() noexcept { return doc->is_negative(); } +simdjson_inline simdjson_result document_reference::is_integer() noexcept { return doc->get_root_value_iterator().is_root_integer(false); } +simdjson_inline simdjson_result document_reference::get_number_type() noexcept { return doc->get_root_value_iterator().get_root_number_type(false); } +simdjson_inline simdjson_result document_reference::get_number() noexcept { return doc->get_root_value_iterator().get_root_number(false); } +simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } +simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } +simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} +simdjson_inline document_reference::operator document&() const noexcept { return *doc; } + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + + + +namespace simdjson { +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::document_reference value, error_code error) + noexcept : implementation_simdjson_result_base(std::forward(value), error) {} + + +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator fallback::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H +/* end file simdjson/generic/ondemand/document-inl.h for fallback */ +/* including simdjson/generic/ondemand/document_stream-inl.h for fallback: #include "simdjson/generic/ondemand/document_stream-inl.h" */ +/* begin file simdjson/generic/ondemand/document_stream-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace fallback { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void stage1_worker::finish() { + // After calling "run" someone would call finish() to wait + // for the end of the processing. + // This function will wait until either the thread has done + // the processing or, else, the destructor has been called. + std::unique_lock lock(locking_mutex); + cond_var.wait(lock, [this]{return has_work == false;}); +} + +inline stage1_worker::~stage1_worker() { + // The thread may never outlive the stage1_worker instance + // and will always be stopped/joined before the stage1_worker + // instance is gone. + stop_thread(); +} + +inline void stage1_worker::start_thread() { + std::unique_lock lock(locking_mutex); + if(thread.joinable()) { + return; // This should never happen but we never want to create more than one thread. + } + thread = std::thread([this]{ + while(true) { + std::unique_lock thread_lock(locking_mutex); + // We wait for either "run" or "stop_thread" to be called. + cond_var.wait(thread_lock, [this]{return has_work || !can_work;}); + // If, for some reason, the stop_thread() method was called (i.e., the + // destructor of stage1_worker is called, then we want to immediately destroy + // the thread (and not do any more processing). + if(!can_work) { + break; + } + this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser, + this->_next_batch_start); + this->has_work = false; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify "finish" + thread_lock.unlock(); + } + } + ); +} + + +inline void stage1_worker::stop_thread() { + std::unique_lock lock(locking_mutex); + // We have to make sure that all locks can be released. + can_work = false; + has_work = false; + cond_var.notify_all(); + lock.unlock(); + if(thread.joinable()) { + thread.join(); + } +} + +inline void stage1_worker::run(document_stream * ds, parser * stage1, size_t next_batch_start) { + std::unique_lock lock(locking_mutex); + owner = ds; + _next_batch_start = next_batch_start; + stage1_thread_parser = stage1; + has_work = true; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify the thread lock that we have work + lock.unlock(); +} + +#endif // SIMDJSON_THREADS_ENABLED + +simdjson_inline document_stream::document_stream( + ondemand::parser &_parser, + const uint8_t *_buf, + size_t _len, + size_t _batch_size, + bool _allow_comma_separated +) noexcept + : parser{&_parser}, + buf{_buf}, + len{_len}, + batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size}, + allow_comma_separated{_allow_comma_separated}, + error{SUCCESS} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change + #endif +{ +#ifdef SIMDJSON_THREADS_ENABLED + if(worker.get() == nullptr) { + error = MEMALLOC; + } +#endif +} + +simdjson_inline document_stream::document_stream() noexcept + : parser{nullptr}, + buf{nullptr}, + len{0}, + batch_size{0}, + allow_comma_separated{false}, + error{UNINITIALIZED} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(false) + #endif +{ +} + +simdjson_inline document_stream::~document_stream() noexcept +{ + #ifdef SIMDJSON_THREADS_ENABLED + worker.reset(); + #endif +} + +inline size_t document_stream::size_in_bytes() const noexcept { + return len; +} + +inline size_t document_stream::truncated_bytes() const noexcept { + if(error == CAPACITY) { return len - batch_start; } + return parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] - parser->implementation->structural_indexes[parser->implementation->n_structural_indexes + 1]; +} + +simdjson_inline document_stream::iterator::iterator() noexcept + : stream{nullptr}, finished{true} { +} + +simdjson_inline document_stream::iterator::iterator(document_stream* _stream, bool is_end) noexcept + : stream{_stream}, finished{is_end} { +} + +simdjson_inline simdjson_result document_stream::iterator::operator*() noexcept { + //if(stream->error) { return stream->error; } + return simdjson_result(stream->doc, stream->error); +} + +simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept { + // If there is an error, then we want the iterator + // to be finished, no matter what. (E.g., we do not + // keep generating documents with errors, or go beyond + // a document with errors.) + // + // Users do not have to call "operator*()" when they use operator++, + // so we need to end the stream in the operator++ function. + // + // Note that setting finished = true is essential otherwise + // we would enter an infinite loop. + if (stream->error) { finished = true; } + // Note that stream->error() is guarded against error conditions + // (it will immediately return if stream->error casts to false). + // In effect, this next function does nothing when (stream->error) + // is true (hence the risk of an infinite loop). + stream->next(); + // If that was the last document, we're finished. + // It is the only type of error we do not want to appear + // in operator*. + if (stream->error == EMPTY) { finished = true; } + // If we had any other kind of error (not EMPTY) then we want + // to pass it along to the operator* and we cannot mark the result + // as "finished" just yet. + return *this; +} + +simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept { + return finished != other.finished; +} + +simdjson_inline document_stream::iterator document_stream::begin() noexcept { + start(); + // If there are no documents, we're finished. + return iterator(this, error == EMPTY); +} + +simdjson_inline document_stream::iterator document_stream::end() noexcept { + return iterator(this, true); +} + +inline void document_stream::start() noexcept { + if (error) { return; } + error = parser->allocate(batch_size); + if (error) { return; } + // Always run the first stage 1 parse immediately + batch_start = 0; + error = run_stage1(*parser, batch_start); + while(error == EMPTY) { + // In exceptional cases, we may start with an empty block + batch_start = next_batch_start(); + if (batch_start >= len) { return; } + error = run_stage1(*parser, batch_start); + } + if (error) { return; } + doc_index = batch_start; + doc = document(json_iterator(&buf[batch_start], parser)); + doc.iter._streaming = true; + + #ifdef SIMDJSON_THREADS_ENABLED + if (use_thread && next_batch_start() < len) { + // Kick off the first thread on next batch if needed + error = stage1_thread_parser.allocate(batch_size); + if (error) { return; } + worker->start_thread(); + start_stage1_thread(); + if (error) { return; } + } + #endif // SIMDJSON_THREADS_ENABLED +} + +inline void document_stream::next() noexcept { + // We always enter at once once in an error condition. + if (error) { return; } + next_document(); + if (error) { return; } + auto cur_struct_index = doc.iter._root - parser->implementation->structural_indexes.get(); + doc_index = batch_start + parser->implementation->structural_indexes[cur_struct_index]; + + // Check if at end of structural indexes (i.e. at end of batch) + if(cur_struct_index >= static_cast(parser->implementation->n_structural_indexes)) { + error = EMPTY; + // Load another batch (if available) + while (error == EMPTY) { + batch_start = next_batch_start(); + if (batch_start >= len) { break; } + #ifdef SIMDJSON_THREADS_ENABLED + if(use_thread) { + load_from_stage1_thread(); + } else { + error = run_stage1(*parser, batch_start); + } + #else + error = run_stage1(*parser, batch_start); + #endif + /** + * Whenever we move to another window, we need to update all pointers to make + * it appear as if the input buffer started at the beginning of the window. + * + * Take this input: + * + * {"z":5} {"1":1,"2":2,"4":4} [7, 10, 9] [15, 11, 12, 13] [154, 110, 112, 1311] + * + * Say you process the following window... + * + * '{"z":5} {"1":1,"2":2,"4":4} [7, 10, 9]' + * + * When you do so, the json_iterator has a pointer at the beginning of the memory region + * (pointing at the beginning of '{"z"...'. + * + * When you move to the window that starts at... + * + * '[7, 10, 9] [15, 11, 12, 13] ... + * + * then it is not sufficient to just run stage 1. You also need to re-anchor the + * json_iterator so that it believes we are starting at '[7, 10, 9]...'. + * + * Under the DOM front-end, this gets done automatically because the parser owns + * the pointer the data, and when you call stage1 and then stage2 on the same + * parser, then stage2 will run on the pointer acquired by stage1. + * + * That is, stage1 calls "this->buf = _buf" so the parser remembers the buffer that + * we used. But json_iterator has no callback when stage1 is called on the parser. + * In fact, I think that the parser is unaware of json_iterator. + * + * + * So we need to re-anchor the json_iterator after each call to stage 1 so that + * all of the pointers are in sync. + */ + doc.iter = json_iterator(&buf[batch_start], parser); + doc.iter._streaming = true; + /** + * End of resync. + */ + + if (error) { continue; } // If the error was EMPTY, we may want to load another batch. + doc_index = batch_start; + } + } +} + +inline void document_stream::next_document() noexcept { + // Go to next place where depth=0 (document depth) + error = doc.iter.skip_child(0); + if (error) { return; } + // Always set depth=1 at the start of document + doc.iter._depth = 1; + // consume comma if comma separated is allowed + if (allow_comma_separated) { doc.iter.consume_character(','); } + // Resets the string buffer at the beginning, thus invalidating the strings. + doc.iter._string_buf_loc = parser->string_buf.get(); + doc.iter._root = doc.iter.position(); +} + +inline size_t document_stream::next_batch_start() const noexcept { + return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes]; +} + +inline error_code document_stream::run_stage1(ondemand::parser &p, size_t _batch_start) noexcept { + // This code only updates the structural index in the parser, it does not update any json_iterator + // instance. + size_t remaining = len - _batch_start; + if (remaining <= batch_size) { + return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final); + } else { + return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial); + } +} + +simdjson_inline size_t document_stream::iterator::current_index() const noexcept { + return stream->doc_index; +} + +simdjson_inline std::string_view document_stream::iterator::source() const noexcept { + auto depth = stream->doc.iter.depth(); + auto cur_struct_index = stream->doc.iter._root - stream->parser->implementation->structural_indexes.get(); + + // If at root, process the first token to determine if scalar value + if (stream->doc.iter.at_root()) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': // Depth=1 already at start of document + break; + case '}': case ']': + depth--; + break; + default: // Scalar value document + // TODO: Remove any trailing whitespaces + // This returns a string spanning from start of value to the beginning of the next document (excluded) + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[++cur_struct_index] - current_index() - 1); + } + cur_struct_index++; + } + + while (cur_struct_index <= static_cast(stream->parser->implementation->n_structural_indexes)) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': + depth++; + break; + case '}': case ']': + depth--; + break; + } + if (depth == 0) { break; } + cur_struct_index++; + } + + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[cur_struct_index] - current_index() + stream->batch_start + 1);; +} + +inline error_code document_stream::iterator::error() const noexcept { + return stream->error; +} + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void document_stream::load_from_stage1_thread() noexcept { + worker->finish(); + // Swap to the parser that was loaded up in the thread. Make sure the parser has + // enough memory to swap to, as well. + std::swap(stage1_thread_parser,*parser); + error = stage1_thread_error; + if (error) { return; } + + // If there's anything left, start the stage 1 thread! + if (next_batch_start() < len) { + start_stage1_thread(); + } +} + +inline void document_stream::start_stage1_thread() noexcept { + // we call the thread on a lambda that will update + // this->stage1_thread_error + // there is only one thread that may write to this value + // TODO this is NOT exception-safe. + this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error + size_t _next_batch_start = this->next_batch_start(); + + worker->run(this, & this->stage1_thread_parser, _next_batch_start); +} + +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result::simdjson_result( + fallback::ondemand::document_stream &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} + +} + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H +/* end file simdjson/generic/ondemand/document_stream-inl.h for fallback */ +/* including simdjson/generic/ondemand/field-inl.h for fallback: #include "simdjson/generic/ondemand/field-inl.h" */ +/* begin file simdjson/generic/ondemand/field-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +// clang 6 doesn't think the default constructor can be noexcept, so we make it explicit +simdjson_inline field::field() noexcept : std::pair() {} + +simdjson_inline field::field(raw_json_string key, ondemand::value &&value) noexcept + : std::pair(key, std::forward(value)) +{ +} + +simdjson_inline simdjson_result field::start(value_iterator &parent_iter) noexcept { + raw_json_string key; + SIMDJSON_TRY( parent_iter.field_key().get(key) ); + SIMDJSON_TRY( parent_iter.field_value() ); + return field::start(parent_iter, key); +} + +simdjson_inline simdjson_result field::start(const value_iterator &parent_iter, raw_json_string key) noexcept { + return field(key, parent_iter.child()); +} + +simdjson_inline simdjson_warn_unused simdjson_result field::unescaped_key(bool allow_replacement) noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() but Visual Studio won't let us. + simdjson_result answer = first.unescape(second.iter.json_iter(), allow_replacement); + first.consume(); + return answer; +} + +simdjson_inline raw_json_string field::key() const noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() by Visual Studio won't let us. + return first; +} + +simdjson_inline value &field::value() & noexcept { + return second; +} + +simdjson_inline value field::value() && noexcept { + return std::forward(*this).second; +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + fallback::ondemand::field &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::key() noexcept { + if (error()) { return error(); } + return first.key(); +} +simdjson_inline simdjson_result simdjson_result::unescaped_key(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.unescaped_key(allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::value() noexcept { + if (error()) { return error(); } + return std::move(first.value()); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H +/* end file simdjson/generic/ondemand/field-inl.h for fallback */ +/* including simdjson/generic/ondemand/json_iterator-inl.h for fallback: #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/json_iterator-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline json_iterator::json_iterator(json_iterator &&other) noexcept + : token(std::forward(other.token)), + parser{other.parser}, + _string_buf_loc{other._string_buf_loc}, + error{other.error}, + _depth{other._depth}, + _root{other._root}, + _streaming{other._streaming} +{ + other.parser = nullptr; +} +simdjson_inline json_iterator &json_iterator::operator=(json_iterator &&other) noexcept { + token = other.token; + parser = other.parser; + _string_buf_loc = other._string_buf_loc; + error = other.error; + _depth = other._depth; + _root = other._root; + _streaming = other._streaming; + other.parser = nullptr; + return *this; +} + +simdjson_inline json_iterator::json_iterator(const uint8_t *buf, ondemand::parser *_parser) noexcept + : token(buf, &_parser->implementation->structural_indexes[0]), + parser{_parser}, + _string_buf_loc{parser->string_buf.get()}, + _depth{1}, + _root{parser->implementation->structural_indexes.get()}, + _streaming{false} + +{ + logger::log_headers(); +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif +} + +inline void json_iterator::rewind() noexcept { + token.set_position( root_position() ); + logger::log_headers(); // We start again + _string_buf_loc = parser->string_buf.get(); + _depth = 1; +} + +inline bool json_iterator::balanced() const noexcept { + token_iterator ti(token); + int32_t count{0}; + ti.set_position( root_position() ); + while(ti.peek() <= peek_last()) { + switch (*ti.return_current_and_advance()) + { + case '[': case '{': + count++; + break; + case ']': case '}': + count--; + break; + default: + break; + } + } + return count == 0; +} + + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and parent_depth, which is a desired effect. The warning does not show up if the +// skip_child() function is not marked inline). +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept { + if (depth() <= parent_depth) { return SUCCESS; } + switch (*return_current_and_advance()) { + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + + // For the first open array/object in a value, we've already incremented depth, so keep it the same + // We never stop at colon, but if we did, it wouldn't affect depth + case '[': case '{': case ':': + logger::log_start_value(*this, "skip"); + break; + // If there is a comma, we have just finished a value in an array/object, and need to get back in + case ',': + logger::log_value(*this, "skip"); + break; + // ] or } means we just finished a value and need to jump out of the array/object + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } +#if SIMDJSON_CHECK_EOF + // If there are no more tokens, the parent is incomplete. + if (at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "Missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + break; + case '"': + if(*peek() == ':') { + // We are at a key!!! + // This might happen if you just started an object and you skip it immediately. + // Performance note: it would be nice to get rid of this check as it is somewhat + // expensive. + // https://github.com/simdjson/simdjson/issues/1742 + logger::log_value(*this, "key"); + return_current_and_advance(); // eat up the ':' + break; // important!!! + } + simdjson_fallthrough; + // Anything else must be a scalar value + default: + // For the first scalar, we will have incremented depth already, so we decrement it here. + logger::log_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + } + + // Now that we've considered the first value, we only increment/decrement for arrays/objects + while (position() < end_position()) { + switch (*return_current_and_advance()) { + case '[': case '{': + logger::log_start_value(*this, "skip"); + _depth++; + break; + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + default: + logger::log_value(*this, "skip", ""); + break; + } + } + + return report_error(TAPE_ERROR, "not enough close braces"); +} + +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool json_iterator::at_root() const noexcept { + return position() == root_position(); +} + +simdjson_inline bool json_iterator::is_single_token() const noexcept { + return parser->implementation->n_structural_indexes == 1; +} + +simdjson_inline bool json_iterator::streaming() const noexcept { + return _streaming; +} + +simdjson_inline token_position json_iterator::root_position() const noexcept { + return _root; +} + +simdjson_inline void json_iterator::assert_at_document_depth() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +} + +simdjson_inline void json_iterator::assert_at_root() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + // Under Visual Studio, the next SIMDJSON_ASSUME fails with: the argument + // has side effects that will be discarded. + SIMDJSON_ASSUME( token.position() == _root ); +#endif +} + +simdjson_inline void json_iterator::assert_more_tokens(uint32_t required_tokens) const noexcept { + assert_valid_position(token._position + required_tokens - 1); +} + +simdjson_inline void json_iterator::assert_valid_position(token_position position) const noexcept { +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME( position >= &parser->implementation->structural_indexes[0] ); + SIMDJSON_ASSUME( position < &parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] ); +#endif +} + +simdjson_inline bool json_iterator::at_end() const noexcept { + return position() == end_position(); +} +simdjson_inline token_position json_iterator::end_position() const noexcept { + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + return &parser->implementation->structural_indexes[n_structural_indexes]; +} + +inline std::string json_iterator::to_string() const noexcept { + if( !is_alive() ) { return "dead json_iterator instance"; } + const char * current_structural = reinterpret_cast(token.peek()); + return std::string("json_iterator [ depth : ") + std::to_string(_depth) + + std::string(", structural : '") + std::string(current_structural,1) + + std::string("', offset : ") + std::to_string(token.current_offset()) + + std::string("', error : ") + error_message(error) + + std::string(" ]"); +} + +inline simdjson_result json_iterator::current_location() const noexcept { + if (!is_alive()) { // Unrecoverable error + if (!at_root()) { + return reinterpret_cast(token.peek(-1)); + } else { + return reinterpret_cast(token.peek()); + } + } + if (at_end()) { + return OUT_OF_BOUNDS; + } + return reinterpret_cast(token.peek()); +} + +simdjson_inline bool json_iterator::is_alive() const noexcept { + return parser; +} + +simdjson_inline void json_iterator::abandon() noexcept { + parser = nullptr; + _depth = 0; +} + +simdjson_inline const uint8_t *json_iterator::return_current_and_advance() noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif // SIMDJSON_CHECK_EOF + return token.return_current_and_advance(); +} + +simdjson_inline const uint8_t *json_iterator::unsafe_pointer() const noexcept { + // deliberately done without safety guard: + return token.peek(); +} + +simdjson_inline const uint8_t *json_iterator::peek(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // SIMDJSON_CHECK_EOF + return token.peek(delta); +} + +simdjson_inline uint32_t json_iterator::peek_length(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // #if SIMDJSON_CHECK_EOF + return token.peek_length(delta); +} + +simdjson_inline const uint8_t *json_iterator::peek(token_position position) const noexcept { + // todo: currently we require end-of-string buffering, but the following + // assert_valid_position should be turned on if/when we lift that condition. + // assert_valid_position(position); + // This is almost surely related to SIMDJSON_CHECK_EOF but given that SIMDJSON_CHECK_EOF + // is ON by default, we have no choice but to disable it for real with a comment. + return token.peek(position); +} + +simdjson_inline uint32_t json_iterator::peek_length(token_position position) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_valid_position(position); +#endif // SIMDJSON_CHECK_EOF + return token.peek_length(position); +} + +simdjson_inline token_position json_iterator::last_position() const noexcept { + // The following line fails under some compilers... + // SIMDJSON_ASSUME(parser->implementation->n_structural_indexes > 0); + // since it has side-effects. + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + SIMDJSON_ASSUME(n_structural_indexes > 0); + return &parser->implementation->structural_indexes[n_structural_indexes - 1]; +} +simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept { + return token.peek(last_position()); +} + +simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept { + SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1); + SIMDJSON_ASSUME(_depth == parent_depth + 1); + _depth = parent_depth; +} + +simdjson_inline void json_iterator::descend_to(depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); + _depth = child_depth; +} + +simdjson_inline depth_t json_iterator::depth() const noexcept { + return _depth; +} + +simdjson_inline uint8_t *&json_iterator::string_buf_loc() noexcept { + return _string_buf_loc; +} + +simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD); + logger::log_error(*this, message); + error = _error; + return error; +} + +simdjson_inline token_position json_iterator::position() const noexcept { + return token.position(); +} + +simdjson_inline simdjson_result json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept { + return parser->unescape(in, _string_buf_loc, allow_replacement); +} + +simdjson_inline simdjson_result json_iterator::unescape_wobbly(raw_json_string in) noexcept { + return parser->unescape_wobbly(in, _string_buf_loc); +} + +simdjson_inline void json_iterator::reenter_child(token_position position, depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); +#if SIMDJSON_DEVELOPMENT_CHECKS +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME(size_t(child_depth) < parser->max_depth()); + SIMDJSON_ASSUME(position >= parser->start_positions[child_depth]); +#endif +#endif + token.set_position(position); + _depth = child_depth; +} + +simdjson_inline error_code json_iterator::consume_character(char c) noexcept { + if (*peek() == c) { + return_current_and_advance(); + return SUCCESS; + } + return TAPE_ERROR; +} + +#if SIMDJSON_DEVELOPMENT_CHECKS + +simdjson_inline token_position json_iterator::start_position(depth_t depth) const noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + return size_t(depth) < parser->max_depth() ? parser->start_positions[depth] : 0; +} + +simdjson_inline void json_iterator::set_start_position(depth_t depth, token_position position) noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + if(size_t(depth) < parser->max_depth()) { parser->start_positions[depth] = position; } +} + +#endif + + +simdjson_inline error_code json_iterator::optional_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error == INCORRECT_TYPE || _error == NO_SUCH_FIELD); + logger::log_error(*this, message); + return _error; +} + + +simdjson_warn_unused simdjson_inline bool json_iterator::copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept { + // This function is not expected to be called in performance-sensitive settings. + // Let us guard against silly cases: + if((N < max_len) || (N == 0)) { return false; } + // Copy to the buffer. + std::memcpy(tmpbuf, json, max_len); + if(N > max_len) { // We pad whatever remains with ' '. + std::memset(tmpbuf + max_len, ' ', N - max_len); + } + return true; +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::json_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/json_iterator-inl.h for fallback */ +/* including simdjson/generic/ondemand/json_type-inl.h for fallback: #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* begin file simdjson/generic/ondemand/json_type-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept { + switch (type) { + case json_type::array: out << "array"; break; + case json_type::object: out << "object"; break; + case json_type::number: out << "number"; break; + case json_type::string: out << "string"; break; + case json_type::boolean: out << "boolean"; break; + case json_type::null: out << "null"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false) { + return out << type.value(); +} +#endif + + + +simdjson_inline number_type number::get_number_type() const noexcept { + return type; +} + +simdjson_inline bool number::is_uint64() const noexcept { + return get_number_type() == number_type::unsigned_integer; +} + +simdjson_inline uint64_t number::get_uint64() const noexcept { + return payload.unsigned_integer; +} + +simdjson_inline number::operator uint64_t() const noexcept { + return get_uint64(); +} + + +simdjson_inline bool number::is_int64() const noexcept { + return get_number_type() == number_type::signed_integer; +} + +simdjson_inline int64_t number::get_int64() const noexcept { + return payload.signed_integer; +} + +simdjson_inline number::operator int64_t() const noexcept { + return get_int64(); +} + +simdjson_inline bool number::is_double() const noexcept { + return get_number_type() == number_type::floating_point_number; +} + +simdjson_inline double number::get_double() const noexcept { + return payload.floating_point_number; +} + +simdjson_inline number::operator double() const noexcept { + return get_double(); +} + +simdjson_inline double number::as_double() const noexcept { + if(is_double()) { + return payload.floating_point_number; + } + if(is_int64()) { + return double(payload.signed_integer); + } + return double(payload.unsigned_integer); +} + +simdjson_inline void number::append_s64(int64_t value) noexcept { + payload.signed_integer = value; + type = number_type::signed_integer; +} + +simdjson_inline void number::append_u64(uint64_t value) noexcept { + payload.unsigned_integer = value; + type = number_type::unsigned_integer; +} + +simdjson_inline void number::append_double(double value) noexcept { + payload.floating_point_number = value; + type = number_type::floating_point_number; +} + +simdjson_inline void number::skip_double() noexcept { + type = number_type::floating_point_number; +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::json_type &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H +/* end file simdjson/generic/ondemand/json_type-inl.h for fallback */ +/* including simdjson/generic/ondemand/logger-inl.h for fallback: #include "simdjson/generic/ondemand/logger-inl.h" */ +/* begin file simdjson/generic/ondemand/logger-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace fallback { +namespace ondemand { +namespace logger { + +static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; +static constexpr const int LOG_EVENT_LEN = 20; +static constexpr const int LOG_BUFFER_LEN = 30; +static constexpr const int LOG_SMALL_BUFFER_LEN = 10; +static int log_depth = 0; // Not threadsafe. Log only. + +// Helper to turn unprintable or newline characters into spaces +static inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } +} + +template +static inline std::string string_format(const std::string& format, const Args&... args) +{ + SIMDJSON_PUSH_DISABLE_ALL_WARNINGS + int size_s = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; + auto size = static_cast(size_s); + if (size <= 0) return std::string(); + std::unique_ptr buf(new char[size]); + std::snprintf(buf.get(), size, format.c_str(), args...); + SIMDJSON_POP_DISABLE_WARNINGS + return std::string(buf.get(), buf.get() + size - 1); +} + +static inline log_level get_log_level_from_env() +{ + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + char *lvl = getenv("SIMDJSON_LOG_LEVEL"); + SIMDJSON_POP_DISABLE_WARNINGS + if (lvl && simdjson_strcasecmp(lvl, "ERROR") == 0) { return log_level::error; } + return log_level::info; +} + +static inline log_level log_threshold() +{ + static log_level threshold = get_log_level_from_env(); + return threshold; +} + +static inline bool should_log(log_level level) +{ + return level >= log_threshold(); +} + +inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "", type, detail, log_level::info); +} +inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "+", type, detail, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} +inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_line(iter, "+", type, "", delta, depth_delta, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} + +inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + if (LOG_ENABLED) { log_depth--; } + log_line(iter, "-", type, "", delta, depth_delta, log_level::info); +} + +inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_line(iter, "ERROR: ", error, detail, delta, depth_delta, log_level::error); +} +inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept { + log_line(iter, index, depth, "ERROR: ", error, detail, log_level::error); +} + +inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_event(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_value(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_value(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_start_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_start_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_end_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_end_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_error(const value_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_error(iter.json_iter(), error, detail, delta, depth_delta); +} + +inline void log_headers() noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(log_level::info))) { + // Technically a static variable is not thread-safe, but if you are using threads and logging... well... + static bool displayed_hint{false}; + log_depth = 0; + printf("\n"); + if (!displayed_hint) { + // We only print this helpful header once. + printf("# Logging provides the depth and position of the iterator user-visible steps:\n"); + printf("# +array says 'this is where we were when we discovered the start array'\n"); + printf( + "# -array says 'this is where we were when we ended the array'\n"); + printf("# skip says 'this is a structural or value I am skipping'\n"); + printf("# +/-skip says 'this is a start/end array or object I am skipping'\n"); + printf("#\n"); + printf("# The indentation of the terms (array, string,...) indicates the depth,\n"); + printf("# in addition to the depth being displayed.\n"); + printf("#\n"); + printf("# Every token in the document has a single depth determined by the tokens before it,\n"); + printf("# and is not affected by what the token actually is.\n"); + printf("#\n"); + printf("# Not all structural elements are presented as tokens in the logs.\n"); + printf("#\n"); + printf("# We never give control to the user within an empty array or an empty object.\n"); + printf("#\n"); + printf("# Inside an array, having a depth greater than the array's depth means that\n"); + printf("# we are pointing inside a value.\n"); + printf("# Having a depth equal to the array means that we are pointing right before a value.\n"); + printf("# Having a depth smaller than the array means that we have moved beyond the array.\n"); + displayed_hint = true; + } + printf("\n"); + printf("| %-*s ", LOG_EVENT_LEN, "Event"); + printf("| %-*s ", LOG_BUFFER_LEN, "Buffer"); + printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next"); + // printf("| %-*s ", 5, "Next#"); + printf("| %-*s ", 5, "Depth"); + printf("| Detail "); + printf("|\n"); + + printf("|%.*s", LOG_EVENT_LEN + 2, DASHES); + printf("|%.*s", LOG_BUFFER_LEN + 2, DASHES); + printf("|%.*s", LOG_SMALL_BUFFER_LEN + 2, DASHES); + // printf("|%.*s", 5+2, DASHES); + printf("|%.*s", 5 + 2, DASHES); + printf("|--------"); + printf("|\n"); + fflush(stdout); + } + } +} + +template +inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, log_level level, Args&&... args) noexcept { + log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail, level, std::forward(args)...); +} + +template +inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, log_level level, Args&&... args) noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(level))) { + const int indent = depth * 2; + const auto buf = iter.token.buf; + auto msg = string_format(title, std::forward(args)...); + printf("| %*s%s%-*s ", indent, "", title_prefix, + LOG_EVENT_LEN - indent - int(strlen(title_prefix)), msg.c_str()); + { + // Print the current structural. + printf("| "); + // Before we begin, the index might point right before the document. + // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938 + if (index < iter._root) { + printf("%*s", LOG_BUFFER_LEN, ""); + } else { + auto current_structural = &buf[*index]; + for (int i = 0; i < LOG_BUFFER_LEN; i++) { + printf("%c", printable_char(current_structural[i])); + } + } + printf(" "); + } + { + // Print the next structural. + printf("| "); + auto next_structural = &buf[*(index + 1)]; + for (int i = 0; i < LOG_SMALL_BUFFER_LEN; i++) { + printf("%c", printable_char(next_structural[i])); + } + printf(" "); + } + // printf("| %5u ", *(index+1)); + printf("| %5i ", depth); + printf("| %6.*s ", int(detail.size()), detail.data()); + printf("|\n"); + fflush(stdout); + } + } +} + +} // namespace logger +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H +/* end file simdjson/generic/ondemand/logger-inl.h for fallback */ +/* including simdjson/generic/ondemand/object-inl.h for fallback: #include "simdjson/generic/ondemand/object-inl.h" */ +/* begin file simdjson/generic/ondemand/object-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) & noexcept { + return find_field_unordered(key); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) && noexcept { + return std::forward(*this).find_field_unordered(key); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} + +simdjson_inline simdjson_result object::start(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_object().error() ); + return object(iter); +} +simdjson_inline simdjson_result object::start_root(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_root_object().error() ); + return object(iter); +} +simdjson_inline error_code object::consume() noexcept { + if(iter.is_at_key()) { + /** + * whenever you are pointing at a key, calling skip_child() is + * unsafe because you will hit a string and you will assume that + * it is string value, and this mistake will lead you to make bad + * depth computation. + */ + /** + * We want to 'consume' the key. We could really + * just do _json_iter->return_current_and_advance(); at this + * point, but, for clarity, we will use the high-level API to + * eat the key. We assume that the compiler optimizes away + * most of the work. + */ + simdjson_unused raw_json_string actual_key; + auto error = iter.field_key().get(actual_key); + if (error) { iter.abandon(); return error; }; + // Let us move to the value while we are at it. + if ((error = iter.field_value())) { iter.abandon(); return error; } + } + auto error_skip = iter.json_iter().skip_child(iter.depth()-1); + if(error_skip) { iter.abandon(); } + return error_skip; +} + +simdjson_inline simdjson_result object::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + const uint8_t * final_point{iter._json_iter->peek()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result object::started(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.started_object().error() ); + return object(iter); +} + +simdjson_inline object object::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline object::object(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result object::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return object_iterator(iter); +} +simdjson_inline simdjson_result object::end() noexcept { + return object_iterator(iter); +} + +inline simdjson_result object::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + size_t slash = json_pointer.find('/'); + std::string_view key = json_pointer.substr(0, slash); + // Grab the child with the given key + simdjson_result child; + + // If there is an escape character in the key, unescape it and then get the child. + size_t escape = key.find('~'); + if (escape != std::string_view::npos) { + // Unescape the key + std::string unescaped(key); + do { + switch (unescaped[escape+1]) { + case '0': + unescaped.replace(escape, 2, "~"); + break; + case '1': + unescaped.replace(escape, 2, "/"); + break; + default: + return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer"); + } + escape = unescaped.find('~', escape+1); + } while (escape != std::string::npos); + child = find_field(unescaped); // Take note find_field does not unescape keys when matching + } else { + child = find_field(key); + } + if(child.error()) { + return child; // we do not continue if there was an error + } + // If there is a /, we have to recurse and look up more of the path + if (slash != std::string_view::npos) { + child = child.at_pointer(json_pointer.substr(slash)); + } + return child; +} + +simdjson_inline simdjson_result object::count_fields() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the object after counting the number of elements. + iter.reset_object(); + return count; +} + +simdjson_inline simdjson_result object::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_object().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +simdjson_inline simdjson_result object::reset() & noexcept { + return iter.reset_object(); +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::object &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first)[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +inline simdjson_result simdjson_result::reset() noexcept { + if (error()) { return error(); } + return first.reset(); +} + +inline simdjson_result simdjson_result::is_empty() noexcept { + if (error()) { return error(); } + return first.is_empty(); +} + +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H +/* end file simdjson/generic/ondemand/object-inl.h for fallback */ +/* including simdjson/generic/ondemand/object_iterator-inl.h for fallback: #include "simdjson/generic/ondemand/object_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/object_iterator-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +// +// object_iterator +// + +simdjson_inline object_iterator::object_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result object_iterator::operator*() noexcept { + error_code error = iter.error(); + if (error) { iter.abandon(); return error; } + auto result = field::start(iter); + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (result.error()) { iter.abandon(); } + return result; +} +simdjson_inline bool object_iterator::operator==(const object_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool object_iterator::operator!=(const object_iterator &) const noexcept { + return iter.is_open(); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline object_iterator &object_iterator::operator++() noexcept { + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (!iter.is_open()) { return *this; } // Iterator will be released if there is an error + + simdjson_unused error_code error; + if ((error = iter.skip_child() )) { return *this; } + + simdjson_unused bool has_value; + if ((error = iter.has_next_field().get(has_value) )) { return *this; }; + return *this; +} +SIMDJSON_POP_DISABLE_WARNINGS + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter.depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the object is first found and the iterator is just past the {. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the , or } before the next value. In this state, +// depth == iter.depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter.depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter.depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the object iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet field may be missing or not be an +// object--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter.depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between fields, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter.depth == depth, and at_start == false. +// +// Errors that occur while reading a field to give to the user (such as when the key is not a +// string or the field is missing a colon) are yielded immediately. Depth is then decremented, +// moving to the Finished state without transitioning through an Error state at all. +// +// ## Terminal State +// +// The terminal state has iter.depth < depth. at_start is always false. +// +// - Finished: When we have reached a }, we are finished. We signal this by decrementing depth. +// In this state, iter.depth < depth, at_start == false, and error == SUCCESS. +// + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + fallback::ondemand::object_iterator &&value +) noexcept + : implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +// Checks for ']' and ',' +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++first; + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/object_iterator-inl.h for fallback */ +/* including simdjson/generic/ondemand/parser-inl.h for fallback: #include "simdjson/generic/ondemand/parser-inl.h" */ +/* begin file simdjson/generic/ondemand/parser-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string_view.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/dom/base.h" // for MINIMAL_DOCUMENT_CAPACITY */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline parser::parser(size_t max_capacity) noexcept + : _max_capacity{max_capacity} { +} + +simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept { + if (new_capacity > max_capacity()) { return CAPACITY; } + if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; } + + // string_capacity copied from document::allocate + _capacity = 0; + size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * new_capacity / 3 + SIMDJSON_PADDING, 64); + string_buf.reset(new (std::nothrow) uint8_t[string_capacity]); +#if SIMDJSON_DEVELOPMENT_CHECKS + start_positions.reset(new (std::nothrow) token_position[new_max_depth]); +#endif + if (implementation) { + SIMDJSON_TRY( implementation->set_capacity(new_capacity) ); + SIMDJSON_TRY( implementation->set_max_depth(new_max_depth) ); + } else { + SIMDJSON_TRY( simdjson::get_active_implementation()->create_dom_parser_implementation(new_capacity, new_max_depth, implementation) ); + } + _capacity = new_capacity; + _max_depth = new_max_depth; + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length() || !string_buf) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return document::start({ reinterpret_cast(json.data()), this }); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const char *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const uint8_t *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string_view json, size_t allocated) & noexcept { + return iterate(padded_string_view(json, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string &json) & noexcept { + if(json.capacity() - json.size() < SIMDJSON_PADDING) { + json.reserve(json.size() + SIMDJSON_PADDING); + } + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const std::string &json) & noexcept { + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + padded_string_view json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + const padded_string &json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate_raw(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length()) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return json_iterator(reinterpret_cast(json.data()), this); +} + +inline simdjson_result parser::iterate_many(const uint8_t *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + if(allow_comma_separated && batch_size < len) { batch_size = len; } + return document_stream(*this, buf, len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const char *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(reinterpret_cast(buf), len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const std::string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const padded_string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} + +simdjson_inline size_t parser::capacity() const noexcept { + return _capacity; +} +simdjson_inline size_t parser::max_capacity() const noexcept { + return _max_capacity; +} +simdjson_inline size_t parser::max_depth() const noexcept { + return _max_depth; +} + +simdjson_inline void parser::set_max_capacity(size_t max_capacity) noexcept { + if(max_capacity < dom::MINIMAL_DOCUMENT_CAPACITY) { + _max_capacity = max_capacity; + } else { + _max_capacity = dom::MINIMAL_DOCUMENT_CAPACITY; + } +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement) const noexcept { + uint8_t *end = implementation->parse_string(in.buf, dst, allow_replacement); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept { + uint8_t *end = implementation->parse_wobbly_string(in.buf, dst); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::parser &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H +/* end file simdjson/generic/ondemand/parser-inl.h for fallback */ +/* including simdjson/generic/ondemand/raw_json_string-inl.h for fallback: #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +namespace fallback { +namespace ondemand { + +simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {} + +simdjson_inline const char * raw_json_string::raw() const noexcept { return reinterpret_cast(buf); } + + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;pos < target.size() && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;pos < target.size();pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;target[pos] && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;target[pos];pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string_view target) const noexcept { + // If we are going to call memcmp, then we must know something about the length of the raw_json_string. + return (length >= target.size()) && (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); +} + +simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + if(target.size() <= SIMDJSON_PADDING) { + return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); + } + const char * r{raw()}; + size_t pos{0}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(std::string_view target) const noexcept { + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(const char * target) const noexcept { + // Assumptions: 'target' does not contain unescaped quote characters, is null terminated and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(const char* target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept { + return a.unsafe_is_equal(c); +} + +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept { + return a == c; +} + +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept { + return !(a == c); +} + +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept { + return !(a == c); +} + + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept { + return iter.unescape(*this, allow_replacement); +} + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape_wobbly(json_iterator &iter) const noexcept { + return iter.unescape_wobbly(*this); +} + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &out, const raw_json_string &str) noexcept { + bool in_escape = false; + const char *s = str.raw(); + while (true) { + switch (*s) { + case '\\': in_escape = !in_escape; break; + case '"': if (in_escape) { in_escape = false; } else { return out; } break; + default: if (in_escape) { in_escape = false; } + } + out << *s; + s++; + } +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::raw_json_string &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::raw() const noexcept { + if (error()) { return error(); } + return first.raw(); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape(fallback::ondemand::json_iterator &iter, bool allow_replacement) const noexcept { + if (error()) { return error(); } + return first.unescape(iter, allow_replacement); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape_wobbly(fallback::ondemand::json_iterator &iter) const noexcept { + if (error()) { return error(); } + return first.unescape_wobbly(iter); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H +/* end file simdjson/generic/ondemand/raw_json_string-inl.h for fallback */ +/* including simdjson/generic/ondemand/serialization-inl.h for fallback: #include "simdjson/generic/ondemand/serialization-inl.h" */ +/* begin file simdjson/generic/ondemand/serialization-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/serialization.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +inline std::string_view trim(const std::string_view str) noexcept { + // We can almost surely do better by rolling our own find_first_not_of function. + size_t first = str.find_first_not_of(" \t\n\r"); + // If we have the empty string (just white space), then no trimming is possible, and + // we return the empty string_view. + if (std::string_view::npos == first) { return std::string_view(); } + size_t last = str.find_last_not_of(" \t\n\r"); + return str.substr(first, (last - first + 1)); +} + + +inline simdjson_result to_json_string(fallback::ondemand::document& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(fallback::ondemand::document_reference& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(fallback::ondemand::value& x) noexcept { + /** + * If we somehow receive a value that has already been consumed, + * then the following code could be in trouble. E.g., we create + * an array as needed, but if an array was already created, then + * it could be bad. + */ + using namespace fallback::ondemand; + fallback::ondemand::json_type t; + auto error = x.type().get(t); + if(error != SUCCESS) { return error; } + switch (t) + { + case json_type::array: + { + fallback::ondemand::array array; + error = x.get_array().get(array); + if(error) { return error; } + return to_json_string(array); + } + case json_type::object: + { + fallback::ondemand::object object; + error = x.get_object().get(object); + if(error) { return error; } + return to_json_string(object); + } + default: + return trim(x.raw_json_token()); + } +} + +inline simdjson_result to_json_string(fallback::ondemand::object& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(fallback::ondemand::array& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} +} // namespace simdjson + +namespace simdjson { namespace fallback { namespace ondemand { + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::document_reference& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::fallback::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif +}}} // namespace simdjson::fallback::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H +/* end file simdjson/generic/ondemand/serialization-inl.h for fallback */ +/* including simdjson/generic/ondemand/token_iterator-inl.h for fallback: #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/token_iterator-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline token_iterator::token_iterator( + const uint8_t *_buf, + token_position position +) noexcept : buf{_buf}, _position{position} +{ +} + +simdjson_inline uint32_t token_iterator::current_offset() const noexcept { + return *(_position); +} + + +simdjson_inline const uint8_t *token_iterator::return_current_and_advance() noexcept { + return &buf[*(_position++)]; +} + +simdjson_inline const uint8_t *token_iterator::peek(token_position position) const noexcept { + return &buf[*position]; +} +simdjson_inline uint32_t token_iterator::peek_index(token_position position) const noexcept { + return *position; +} +simdjson_inline uint32_t token_iterator::peek_length(token_position position) const noexcept { + return *(position+1) - *position; +} + +simdjson_inline const uint8_t *token_iterator::peek(int32_t delta) const noexcept { + return &buf[*(_position+delta)]; +} +simdjson_inline uint32_t token_iterator::peek_index(int32_t delta) const noexcept { + return *(_position+delta); +} +simdjson_inline uint32_t token_iterator::peek_length(int32_t delta) const noexcept { + return *(_position+delta+1) - *(_position+delta); +} + +simdjson_inline token_position token_iterator::position() const noexcept { + return _position; +} +simdjson_inline void token_iterator::set_position(token_position target_position) noexcept { + _position = target_position; +} + +simdjson_inline bool token_iterator::operator==(const token_iterator &other) const noexcept { + return _position == other._position; +} +simdjson_inline bool token_iterator::operator!=(const token_iterator &other) const noexcept { + return _position != other._position; +} +simdjson_inline bool token_iterator::operator>(const token_iterator &other) const noexcept { + return _position > other._position; +} +simdjson_inline bool token_iterator::operator>=(const token_iterator &other) const noexcept { + return _position >= other._position; +} +simdjson_inline bool token_iterator::operator<(const token_iterator &other) const noexcept { + return _position < other._position; +} +simdjson_inline bool token_iterator::operator<=(const token_iterator &other) const noexcept { + return _position <= other._position; +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::token_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/token_iterator-inl.h for fallback */ +/* including simdjson/generic/ondemand/value-inl.h for fallback: #include "simdjson/generic/ondemand/value-inl.h" */ +/* begin file simdjson/generic/ondemand/value-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline value::value(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} +simdjson_inline value value::start(const value_iterator &iter) noexcept { + return iter; +} +simdjson_inline value value::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline simdjson_result value::get_array() noexcept { + return array::start(iter); +} +simdjson_inline simdjson_result value::get_object() noexcept { + return object::start(iter); +} +simdjson_inline simdjson_result value::start_or_resume_object() noexcept { + if (iter.at_start()) { + return get_object(); + } else { + return object::resume(iter); + } +} + +simdjson_inline simdjson_result value::get_raw_json_string() noexcept { + return iter.get_raw_json_string(); +} +simdjson_inline simdjson_result value::get_string(bool allow_replacement) noexcept { + return iter.get_string(allow_replacement); +} +template +simdjson_inline error_code value::get_string(string_type& receiver, bool allow_replacement) noexcept { + return iter.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result value::get_wobbly_string() noexcept { + return iter.get_wobbly_string(); +} +simdjson_inline simdjson_result value::get_double() noexcept { + return iter.get_double(); +} +simdjson_inline simdjson_result value::get_double_in_string() noexcept { + return iter.get_double_in_string(); +} +simdjson_inline simdjson_result value::get_uint64() noexcept { + return iter.get_uint64(); +} +simdjson_inline simdjson_result value::get_uint64_in_string() noexcept { + return iter.get_uint64_in_string(); +} +simdjson_inline simdjson_result value::get_int64() noexcept { + return iter.get_int64(); +} +simdjson_inline simdjson_result value::get_int64_in_string() noexcept { + return iter.get_int64_in_string(); +} +simdjson_inline simdjson_result value::get_bool() noexcept { + return iter.get_bool(); +} +simdjson_inline simdjson_result value::is_null() noexcept { + return iter.is_null(); +} +template<> simdjson_inline simdjson_result value::get() noexcept { return get_array(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_object(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_number(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_double(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_bool(); } + +template simdjson_inline error_code value::get(T &out) noexcept { + return get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline value::operator array() noexcept(false) { + return get_array(); +} +simdjson_inline value::operator object() noexcept(false) { + return get_object(); +} +simdjson_inline value::operator uint64_t() noexcept(false) { + return get_uint64(); +} +simdjson_inline value::operator int64_t() noexcept(false) { + return get_int64(); +} +simdjson_inline value::operator double() noexcept(false) { + return get_double(); +} +simdjson_inline value::operator std::string_view() noexcept(false) { + return get_string(false); +} +simdjson_inline value::operator raw_json_string() noexcept(false) { + return get_raw_json_string(); +} +simdjson_inline value::operator bool() noexcept(false) { + return get_bool(); +} +#endif + +simdjson_inline simdjson_result value::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result value::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result value::count_elements() & noexcept { + simdjson_result answer; + auto a = get_array(); + answer = a.count_elements(); + // count_elements leaves you pointing inside the array, at the first element. + // We need to move back so that the user can create a new array (which requires that + // we point at '['). + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::count_fields() & noexcept { + simdjson_result answer; + auto a = get_object(); + answer = a.count_fields(); + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::at(size_t index) noexcept { + auto a = get_array(); + return a.at(index); +} + +simdjson_inline simdjson_result value::find_field(std::string_view key) noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result value::find_field(const char *key) noexcept { + return start_or_resume_object().find_field(key); +} + +simdjson_inline simdjson_result value::find_field_unordered(std::string_view key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result value::find_field_unordered(const char *key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} + +simdjson_inline simdjson_result value::operator[](std::string_view key) noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result value::operator[](const char *key) noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline simdjson_result value::type() noexcept { + return iter.type(); +} + +simdjson_inline simdjson_result value::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool value::is_negative() noexcept { + return iter.is_negative(); +} + +simdjson_inline simdjson_result value::is_integer() noexcept { + return iter.is_integer(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number_type() noexcept { + return iter.get_number_type(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number() noexcept { + return iter.get_number(); +} + +simdjson_inline std::string_view value::raw_json_token() noexcept { + return std::string_view(reinterpret_cast(iter.peek_start()), iter.peek_start_length()); +} + +simdjson_inline simdjson_result value::raw_json() noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: { + ondemand::array array; + SIMDJSON_TRY(get_array().get(array)); + return array.raw_json(); + } + case json_type::object: { + ondemand::object object; + SIMDJSON_TRY(get_object().get(object)); + return object.raw_json(); + } + default: + return raw_json_token(); + } +} + +simdjson_inline simdjson_result value::current_location() noexcept { + return iter.json_iter().current_location(); +} + +simdjson_inline int32_t value::current_depth() const noexcept{ + return iter.json_iter().depth(); +} + +simdjson_inline simdjson_result value::at_pointer(std::string_view json_pointer) noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + fallback::ondemand::value &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + if (error()) { return error(); } + return {}; +} + +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} + +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) noexcept { + if (error()) { return error(); } + return first[key]; +} + +simdjson_inline simdjson_result simdjson_result::get_array() noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return first.get(); +} +template simdjson_inline error_code simdjson_result::get(T &out) noexcept { + if (error()) { return error(); } + return first.get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return std::move(first); +} +template<> simdjson_inline error_code simdjson_result::get(fallback::ondemand::value &out) noexcept { + if (error()) { return error(); } + out = first; + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator fallback::ondemand::array() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::object() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator fallback::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H +/* end file simdjson/generic/ondemand/value-inl.h for fallback */ +/* including simdjson/generic/ondemand/value_iterator-inl.h for fallback: #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/value_iterator-inl.h for fallback */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/atomparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace fallback { +namespace ondemand { + +simdjson_inline value_iterator::value_iterator( + json_iterator *json_iter, + depth_t depth, + token_position start_position +) noexcept : _json_iter{json_iter}, _depth{depth}, _start_position{start_position} +{ +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_root_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_object() noexcept { + assert_at_container_start(); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + if (*_json_iter->peek() == '}') { + logger::log_value(*_json_iter, "empty object"); + _json_iter->return_current_and_advance(); + end_container(); + return false; + } + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_object() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // object: e.g., `{"a":2} foo }`. Users concerned with garbage content should + // call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != '}') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing } at end"); + } + // If the last character is } *and* the first gibberish character is also '}' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == '}') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed object. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_object() noexcept { + auto error = check_root_object(); + if(error) { return error; } + return started_object(); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept { +#if SIMDJSON_CHECK_EOF + if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); } + // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + _json_iter->ascend_to(depth()-1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_field() noexcept { + assert_at_next(); + + // It's illegal to call this unless there are more tokens: anything that ends in } or ] is + // obligated to verify there are more tokens if they are not the top level. + switch (*_json_iter->return_current_and_advance()) { + case '}': + logger::log_end_value(*_json_iter, "object"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between object fields"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_raw(const std::string_view key) noexcept { + error_code error; + bool has_value; + // + // Initially, the object can be in one of a few different places: + // + // 1. The start of the object, at the first field: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + if (at_first_field()) { + has_value = true; + + // + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + return false; + + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + if ((error = skip_child() )) { abandon(); return error; } + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + while (has_value) { + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + //if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); // Skip the value entirely + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + + // If the loop ended, we're out of fields to look at. + return false; +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_unordered_raw(const std::string_view key) noexcept { + /** + * When find_field_unordered_raw is called, we can either be pointing at the + * first key, pointing outside (at the closing brace) or if a key was matched + * we can be either pointing right afterthe ':' right before the value (that we need skip), + * or we may have consumed the value and we might be at a comma or at the + * final brace (ready for a call to has_next_field()). + */ + error_code error; + bool has_value; + + // First, we scan from that point to the end. + // If we don't find a match, we may loop back around, and scan from the beginning to that point. + token_position search_start = _json_iter->position(); + + // We want to know whether we need to go back to the beginning. + bool at_first = at_first_field(); + /////////////// + // Initially, the object can be in one of a few different places: + // + // 1. At the first key: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + // + if (at_first) { + has_value = true; + + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { + +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + SIMDJSON_TRY(reset_object().get(has_value)); + at_first = true; + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + // If someone queried a key but they not did access the value, then we are left pointing + // at the ':' and we need to move forward through the value... If the value was + // processed then skip_child() does not move the iterator (but may adjust the depth). + if ((error = skip_child() )) { abandon(); return error; } + search_start = _json_iter->position(); + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + + // After initial processing, we will be in one of two states: + // + // ``` + // // At the beginning of a field + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // At the end of the object + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // ``` + // + // Next, we find a match starting from the current position. + while (has_value) { + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + // Performance note: it maybe wasteful to rewind to the beginning when there might be + // no other query following. Indeed, it would require reskipping the whole object. + // Instead, you can just stay where you are. If there is a new query, there is always time + // to rewind. + if(at_first) { return false; } + + // If we reach the end without finding a match, search the rest of the fields starting at the + // beginning of the object. + // (We have already run through the object before, so we've already validated its structure. We + // don't check errors in this bit.) + SIMDJSON_TRY(reset_object().get(has_value)); + while (true) { + SIMDJSON_ASSUME(has_value); // we should reach search_start before ever reaching the end of the object + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + error = field_key().get(actual_key); SIMDJSON_ASSUME(!error); + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + error = field_value(); SIMDJSON_ASSUME(!error); + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // If we reached the end of the key-value pair we started from, then we know + // that the key is not there so we return false. We are either right before + // the next comma or the final brace. + if(_json_iter->position() == search_start) { return false; } + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + error = has_next_field().get(has_value); SIMDJSON_ASSUME(!error); + // If we make the mistake of exiting here, then we could be left pointing at a key + // in the middle of an object. That's not an allowable state. + } + // If the loop ended, we're out of fields to look at. The program should + // never reach this point. + return false; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::field_key() noexcept { + assert_at_next(); + + const uint8_t *key = _json_iter->return_current_and_advance(); + if (*(key++) != '"') { return report_error(TAPE_ERROR, "Object key is not a string"); } + return raw_json_string(key); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::field_value() noexcept { + assert_at_next(); + + if (*_json_iter->return_current_and_advance() != ':') { return report_error(TAPE_ERROR, "Missing colon in object field"); } + _json_iter->descend_to(depth()+1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_root_array(); +} + +inline std::string value_iterator::to_string() const noexcept { + auto answer = std::string("value_iterator [ depth : ") + std::to_string(_depth) + std::string(", "); + if(_json_iter != nullptr) { answer += _json_iter->to_string(); } + answer += std::string(" ]"); + return answer; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_array() noexcept { + assert_at_container_start(); + if (*_json_iter->peek() == ']') { + logger::log_value(*_json_iter, "empty array"); + _json_iter->return_current_and_advance(); + SIMDJSON_TRY( end_container() ); + return false; + } + _json_iter->descend_to(depth()+1); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // array: e.g., `[1, 2] foo]`. Users concerned with garbage content should + // also call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != ']') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end"); + } + // If the last character is ] *and* the first gibberish character is also ']' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed array. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_array() noexcept { + auto error = check_root_array(); + if (error) { return error; } + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_element() noexcept { + assert_at_next(); + + logger::log_event(*this, "has_next_element"); + switch (*_json_iter->return_current_and_advance()) { + case ']': + logger::log_end_value(*_json_iter, "array"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + _json_iter->descend_to(depth()+1); + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between array elements"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_bool(const uint8_t *json) const noexcept { + auto not_true = atomparsing::str4ncmp(json, "true"); + auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e'); + bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]); + if (error) { return incorrect_type_error("Not a boolean"); } + return simdjson_result(!not_true); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_null(const uint8_t *json) const noexcept { + bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]); + // if we start with 'n', we must be a null + if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); } + return is_null_string; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_string(bool allow_replacement) noexcept { + return get_raw_json_string().unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_string(string_type& receiver, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_string(allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_wobbly_string() noexcept { + return get_raw_json_string().unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_raw_json_string() noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64() noexcept { + auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64_in_string() noexcept { + auto result = numberparsing::parse_unsigned_in_string(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64() noexcept { + auto result = numberparsing::parse_integer(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64_in_string() noexcept { + auto result = numberparsing::parse_integer_in_string(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double() noexcept { + auto result = numberparsing::parse_double(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double_in_string() noexcept { + auto result = numberparsing::parse_double_in_string(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_bool() noexcept { + auto result = parse_bool(peek_non_root_scalar("bool")); + if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); } + return result; +} +simdjson_inline simdjson_result value_iterator::is_null() noexcept { + bool is_null_value; + SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value)); + if(is_null_value) { advance_non_root_scalar("null"); } + return is_null_value; +} +simdjson_inline bool value_iterator::is_negative() noexcept { + return numberparsing::is_negative(peek_non_root_scalar("numbersign")); +} +simdjson_inline bool value_iterator::is_root_negative() noexcept { + return numberparsing::is_negative(peek_root_scalar("numbersign")); +} +simdjson_inline simdjson_result value_iterator::is_integer() noexcept { + return numberparsing::is_integer(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number_type() noexcept { + return numberparsing::get_number_type(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number() noexcept { + number num; + error_code error = numberparsing::parse_number(peek_non_root_scalar("number"), num); + if(error) { return error; } + return num; +} + +simdjson_inline simdjson_result value_iterator::is_root_integer(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("is_root_integer"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + return false; // if there are more than 20 characters, it cannot be represented as an integer. + } + auto answer = numberparsing::is_integer(tmpbuf); + // If the parsing was a success, we must still check that it is + // a single scalar. Note that we parse first because of cases like '[]' where + // getting TRAILING_CONTENT is wrong. + if(check_trailing && (answer.error() == SUCCESS) && (!_json_iter->is_single_token())) { return TRAILING_CONTENT; } + return answer; +} + +simdjson_inline simdjson_result value_iterator::get_root_number_type(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto answer = numberparsing::get_number_type(tmpbuf); + if (check_trailing && (answer.error() == SUCCESS) && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + return answer; +} +simdjson_inline simdjson_result value_iterator::get_root_number(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + number num; + error_code error = numberparsing::parse_number(tmpbuf, num); + if(error) { return error; } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("number"); + return num; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_string(bool check_trailing, bool allow_replacement) noexcept { + return get_root_raw_json_string(check_trailing).unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_root_string(check_trailing, allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_wobbly_string(bool check_trailing) noexcept { + return get_root_raw_json_string(check_trailing).unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_raw_json_string(bool check_trailing) noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_bool(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("bool"); + uint8_t tmpbuf[5+1+1]; // +1 for null termination + tmpbuf[5+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 5+1)) { return incorrect_type_error("Not a boolean"); } + auto result = parse_bool(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("bool"); + } + return result; +} +simdjson_inline simdjson_result value_iterator::is_root_null(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("null"); + bool result = (max_len >= 4 && !atomparsing::str4ncmp(json, "null") && + (max_len == 4 || jsoncharutils::is_structural_or_whitespace(json[4]))); + if(result) { // we have something that looks like a null. + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("null"); + } + return result; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth >= _depth ); + + return _json_iter->skip_child(depth()); +} + +simdjson_inline value_iterator value_iterator::child() const noexcept { + assert_at_child(); + return { _json_iter, depth()+1, _json_iter->token.position() }; +} + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and iterator depth, which is a desired effect. It does not happen if is_open is +// marked non-inline. +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline bool value_iterator::is_open() const noexcept { + return _json_iter->depth() >= depth(); +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool value_iterator::at_end() const noexcept { + return _json_iter->at_end(); +} + +simdjson_inline bool value_iterator::at_start() const noexcept { + return _json_iter->token.position() == start_position(); +} + +simdjson_inline bool value_iterator::at_first_field() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + return _json_iter->token.position() == start_position() + 1; +} + +simdjson_inline void value_iterator::abandon() noexcept { + _json_iter->abandon(); +} + +simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept { + return _depth; +} +simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept { + return _json_iter->error; +} +simdjson_warn_unused simdjson_inline uint8_t *&value_iterator::string_buf_loc() noexcept { + return _json_iter->string_buf_loc(); +} +simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept { + return *_json_iter; +} +simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept { + return *_json_iter; +} + +simdjson_inline const uint8_t *value_iterator::peek_start() const noexcept { + return _json_iter->peek(start_position()); +} +simdjson_inline uint32_t value_iterator::peek_start_length() const noexcept { + return _json_iter->peek_length(start_position()); +} + +simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return peek_start(); } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return; } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept { + logger::log_start_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + const uint8_t *json; + if (!is_at_start()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + json = peek_start(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + } else { + assert_at_start(); + /** + * We should be prudent. Let us peek. If it is not the right type, we + * return an error. Only once we have determined that we have the right + * type are we allowed to advance! + */ + json = _json_iter->peek(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + _json_iter->return_current_and_advance(); + } + + + return SUCCESS; +} + + +simdjson_inline const uint8_t *value_iterator::peek_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_root(); + return _json_iter->peek(); +} +simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_non_root_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_root(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} +simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_non_root_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept { + logger::log_error(*_json_iter, start_position(), depth(), message); + return INCORRECT_TYPE; +} + +simdjson_inline bool value_iterator::is_at_start() const noexcept { + return position() == start_position(); +} + +simdjson_inline bool value_iterator::is_at_key() const noexcept { + // Keys are at the same depth as the object. + // Note here that we could be safer and check that we are within an object, + // but we do not. + return _depth == _json_iter->_depth && *_json_iter->peek() == '"'; +} + +simdjson_inline bool value_iterator::is_at_iterator_start() const noexcept { + // We can legitimately be either at the first value ([1]), or after the array if it's empty ([]). + auto delta = position() - start_position(); + return delta == 1 || delta == 2; +} + +inline void value_iterator::assert_at_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_container_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_next() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +simdjson_inline void value_iterator::move_at_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position); +} + +simdjson_inline void value_iterator::move_at_container_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position + 1); +} + +simdjson_inline simdjson_result value_iterator::reset_array() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_array(); +} + +simdjson_inline simdjson_result value_iterator::reset_object() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_object(); +} + +inline void value_iterator::assert_at_child() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_root() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth == 1 ); +} + +inline void value_iterator::assert_at_non_root_start() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth > 1 ); +} + +inline void value_iterator::assert_is_valid() const noexcept { + SIMDJSON_ASSUME( _json_iter != nullptr ); +} + +simdjson_inline bool value_iterator::is_valid() const noexcept { + return _json_iter != nullptr; +} + +simdjson_inline simdjson_result value_iterator::type() const noexcept { + switch (*peek_start()) { + case '{': + return json_type::object; + case '[': + return json_type::array; + case '"': + return json_type::string; + case 'n': + return json_type::null; + case 't': case 'f': + return json_type::boolean; + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return json_type::number; + default: + return TAPE_ERROR; + } +} + +simdjson_inline token_position value_iterator::start_position() const noexcept { + return _start_position; +} + +simdjson_inline token_position value_iterator::position() const noexcept { + return _json_iter->position(); +} + +simdjson_inline token_position value_iterator::end_position() const noexcept { + return _json_iter->end_position(); +} + +simdjson_inline token_position value_iterator::last_position() const noexcept { + return _json_iter->last_position(); +} + +simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept { + return _json_iter->report_error(error, message); +} + +} // namespace ondemand +} // namespace fallback +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(fallback::ondemand::value_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/value_iterator-inl.h for fallback */ +/* end file simdjson/generic/ondemand/amalgamated.h for fallback */ +/* including simdjson/fallback/end.h: #include "simdjson/fallback/end.h" */ +/* begin file simdjson/fallback/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/fallback/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* undefining SIMDJSON_IMPLEMENTATION from "fallback" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/fallback/end.h */ + +#endif // SIMDJSON_FALLBACK_ONDEMAND_H +/* end file simdjson/fallback/ondemand.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(haswell) +/* including simdjson/haswell/ondemand.h: #include "simdjson/haswell/ondemand.h" */ +/* begin file simdjson/haswell/ondemand.h */ +#ifndef SIMDJSON_HASWELL_ONDEMAND_H +#define SIMDJSON_HASWELL_ONDEMAND_H + +/* including simdjson/haswell/begin.h: #include "simdjson/haswell/begin.h" */ +/* begin file simdjson/haswell/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "haswell" */ +#define SIMDJSON_IMPLEMENTATION haswell + +/* including simdjson/haswell/base.h: #include "simdjson/haswell/base.h" */ +/* begin file simdjson/haswell/base.h */ +#ifndef SIMDJSON_HASWELL_BASE_H +#define SIMDJSON_HASWELL_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_HASWELL +namespace simdjson { +/** + * Implementation for Haswell (Intel AVX2). + */ +namespace haswell { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BASE_H +/* end file simdjson/haswell/base.h */ +/* including simdjson/haswell/intrinsics.h: #include "simdjson/haswell/intrinsics.h" */ +/* begin file simdjson/haswell/intrinsics.h */ +#ifndef SIMDJSON_HASWELL_INTRINSICS_H +#define SIMDJSON_HASWELL_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m256i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for haswell kernel."); + +#endif // SIMDJSON_HASWELL_INTRINSICS_H +/* end file simdjson/haswell/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_TARGET_REGION("avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/haswell/bitmanipulation.h: #include "simdjson/haswell/bitmanipulation.h" */ +/* begin file simdjson/haswell/bitmanipulation.h */ +#ifndef SIMDJSON_HASWELL_BITMANIPULATION_H +#define SIMDJSON_HASWELL_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmask.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMANIPULATION_H +/* end file simdjson/haswell/bitmanipulation.h */ +/* including simdjson/haswell/bitmask.h: #include "simdjson/haswell/bitmask.h" */ +/* begin file simdjson/haswell/bitmask.h */ +#ifndef SIMDJSON_HASWELL_BITMASK_H +#define SIMDJSON_HASWELL_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_BITMASK_H +/* end file simdjson/haswell/bitmask.h */ +/* including simdjson/haswell/numberparsing_defs.h: #include "simdjson/haswell/numberparsing_defs.h" */ +/* begin file simdjson/haswell/numberparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +#define SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace haswell +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_HASWELL_NUMBERPARSING_DEFS_H +/* end file simdjson/haswell/numberparsing_defs.h */ +/* including simdjson/haswell/simd.h: #include "simdjson/haswell/simd.h" */ +/* begin file simdjson/haswell/simd.h */ +#ifndef SIMDJSON_HASWELL_SIMD_H +#define SIMDJSON_HASWELL_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m256i value; + + // Zero constructor + simdjson_inline base() : value{__m256i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m256i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m256i&() const { return this->value; } + simdjson_inline operator __m256i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm256_andnot_si256(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m256i _value) : base>(_value) {} + + friend simdjson_really_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm256_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm256_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m256i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm256_testz_si256(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm256_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm256_setzero_si256(); } + static simdjson_inline simd8 load(const T values[32]) { + return _mm256_loadu_si256(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m256i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[32]) const { return _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm256_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm256_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm256_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint32_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in four steps, first 8 bytes and then second 8 bytes... + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // second least significant 8 bits + uint8_t mask3 = uint8_t(mask >> 16); // ... + uint8_t mask4 = uint8_t(mask >> 24); // ... + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m256i shufmask = _mm256_set_epi64x(thintable_epi8[mask4], thintable_epi8[mask3], + thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask and so forth + shufmask = + _mm256_add_epi8(shufmask, _mm256_set_epi32(0x18181818, 0x18181818, + 0x10101010, 0x10101010, 0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m256i pruned = _mm256_shuffle_epi8(*this, shufmask); + // we still need to put the pieces back together. + // we compute the popcount of the first words: + int pop1 = BitsSetTable256mul2[mask1]; + int pop3 = BitsSetTable256mul2[mask3]; + + // then load the corresponding mask + // could be done with _mm256_loadu2_m128i but many standard libraries omit this intrinsic. + __m256i v256 = _mm256_castsi128_si256( + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8))); + __m256i compactmask = _mm256_insertf128_si256(v256, + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop3 * 8)), 1); + __m256i almostthere = _mm256_shuffle_epi8(pruned, compactmask); + // We just need to write out the result. + // This is the tricky bit that is hard to do + // if we want to return a SIMD register, since there + // is no single-instruction approach to recombine + // the two 128-bit lanes with an offset. + __m128i v128; + v128 = _mm256_castsi256_si128(almostthere); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output), v128); + v128 = _mm256_extractf128_si256(almostthere, 1); + _mm_storeu_si128( reinterpret_cast<__m128i *>(output + 16 - count_ones(mask & 0xFFFF)), v128); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm256_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm256_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m256i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31 + ) : simd8(_mm256_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v16,v17,v18,v19,v20,v21,v22,v23, + v24,v25,v26,v27,v28,v29,v30,v31 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm256_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm256_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm256_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm256_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm256_testz_si256(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm256_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm256_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm256_movemask_epi8(_mm256_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 2, "Haswell kernel should use two registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+32)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + uint32_t mask1 = uint32_t(mask); + uint32_t mask2 = uint32_t(mask >> 32); + this->chunks[0].compress(mask1, output); + this->chunks[1].compress(mask2, output + 32 - count_ones(mask1)); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r_hi = this->chunks[1].to_bitmask(); + return r_lo | (r_hi << 32); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0] | this->chunks[1]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask, + this->chunks[1] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_SIMD_H +/* end file simdjson/haswell/simd.h */ +/* including simdjson/haswell/stringparsing_defs.h: #include "simdjson/haswell/stringparsing_defs.h" */ +/* begin file simdjson/haswell/stringparsing_defs.h */ +#ifndef SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +#define SIMDJSON_HASWELL_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast((v == '\\').to_bitmask()), // bs_bits + static_cast((v == '"').to_bitmask()), // quote_bits + }; +} + +} // unnamed namespace +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_HASWELL_STRINGPARSING_DEFS_H +/* end file simdjson/haswell/stringparsing_defs.h */ +/* end file simdjson/haswell/begin.h */ +/* including simdjson/generic/ondemand/amalgamated.h for haswell: #include "simdjson/generic/ondemand/amalgamated.h" */ +/* begin file simdjson/generic/ondemand/amalgamated.h for haswell */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H) +#error simdjson/generic/ondemand/dependencies.h must be included before simdjson/generic/ondemand/amalgamated.h! +#endif + +// Stuff other things depend on +/* including simdjson/generic/ondemand/base.h for haswell: #include "simdjson/generic/ondemand/base.h" */ +/* begin file simdjson/generic/ondemand/base.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +/** + * A fast, simple, DOM-like interface that parses JSON as you use it. + * + * Designed for maximum speed and a lower memory profile. + */ +namespace ondemand { + +/** Represents the depth of a JSON value (number of nested arrays/objects). */ +using depth_t = int32_t; + +/** @copydoc simdjson::haswell::number_type */ +using number_type = simdjson::haswell::number_type; + +/** @private Position in the JSON buffer indexes */ +using token_position = const uint32_t *; + +class array; +class array_iterator; +class document; +class document_reference; +class document_stream; +class field; +class json_iterator; +enum class json_type; +struct number; +class object; +class object_iterator; +class parser; +class raw_json_string; +class token_iterator; +class value; +class value_iterator; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_BASE_H +/* end file simdjson/generic/ondemand/base.h for haswell */ +/* including simdjson/generic/ondemand/value_iterator.h for haswell: #include "simdjson/generic/ondemand/value_iterator.h" */ +/* begin file simdjson/generic/ondemand/value_iterator.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * Iterates through a single JSON value at a particular depth. + * + * Does not keep track of the type of value: provides methods for objects, arrays and scalars and expects + * the caller to call the right ones. + * + * @private This is not intended for external use. + */ +class value_iterator { +protected: + /** The underlying JSON iterator */ + json_iterator *_json_iter{}; + /** The depth of this value */ + depth_t _depth{}; + /** + * The starting token index for this value + */ + token_position _start_position{}; + +public: + simdjson_inline value_iterator() noexcept = default; + + /** + * Denote that we're starting a document. + */ + simdjson_inline void start_document() noexcept; + + /** + * Skips a non-iterated or partially-iterated JSON value, whether it is a scalar, array or object. + * + * Optimized for scalars. + */ + simdjson_warn_unused simdjson_inline error_code skip_child() noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is at the start of the value + */ + simdjson_inline bool at_start() const noexcept; + + /** + * Tell whether the value is open--if the value has not been used, or the array/object is still open. + */ + simdjson_inline bool is_open() const noexcept; + + /** + * Tell whether the value is at an object's first field (just after the {). + */ + simdjson_inline bool at_first_field() const noexcept; + + /** + * Abandon all iteration. + */ + simdjson_inline void abandon() noexcept; + + /** + * Get the child value as a value_iterator. + */ + simdjson_inline value_iterator child_value() const noexcept; + + /** + * Get the depth of this value. + */ + simdjson_inline int32_t depth() const noexcept; + + /** + * Get the JSON type of this value. + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() const noexcept; + + /** + * @addtogroup object Object iteration + * + * Methods to iterate and find object fields. These methods generally *assume* the value is + * actually an object; the caller is responsible for keeping track of that fact. + * + * @{ + */ + + /** + * Start an object iteration. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + */ + simdjson_warn_unused simdjson_inline simdjson_result start_object() noexcept; + /** + * Start an object iteration from the root. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_object() noexcept; + /** + * Checks whether an object could be started from the root. May be called by start_root_object. + * + * @returns SUCCESS if it is possible to safely start an object from the root (document level). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_object() noexcept; + /** + * Start an object iteration after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_object() noexcept; + /** + * Start an object iteration from the root, after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_object() noexcept; + + /** + * Moves to the next field in an object. + * + * Looks for , and }. If } is found, the object is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return whether there is another field in the object. + * @error TAPE_ERROR If there is a comma missing between fields. + * @error TAPE_ERROR If there is a comma, but not enough tokens remaining to have a key, :, and value. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_field() noexcept; + + /** + * Get the current field's key. + */ + simdjson_warn_unused simdjson_inline simdjson_result field_key() noexcept; + + /** + * Pass the : in the field and move to its value. + */ + simdjson_warn_unused simdjson_inline error_code field_value() noexcept; + + /** + * Find the next field with the given key. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline error_code find_field(const std::string_view key) noexcept; + + /** + * Find the next field with the given key, *without* unescaping. This assumes object order: it + * will not find the field if it was already passed when looking for some *other* field. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_raw(const std::string_view key) noexcept; + + /** + * Find the field with the given key without regard to order, and *without* unescaping. + * + * This is an unordered object lookup: if the field is not found initially, it will cycle around and scan from the beginning. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_unordered_raw(const std::string_view key) noexcept; + + /** @} */ + + /** + * @addtogroup array Array iteration + * Methods to iterate over array elements. These methods generally *assume* the value is actually + * an object; the caller is responsible for keeping track of that fact. + * @{ + */ + + /** + * Check for an opening [ and start an array iteration. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + */ + simdjson_warn_unused simdjson_inline simdjson_result start_array() noexcept; + /** + * Check for an opening [ and start an array iteration while at the root. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_array() noexcept; + /** + * Checks whether an array could be started from the root. May be called by start_root_array. + * + * @returns SUCCESS if it is possible to safely start an array from the root (document level). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_array() noexcept; + /** + * Start an array iteration, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_array() noexcept; + /** + * Start an array iteration from the root, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_array() noexcept; + + /** + * Moves to the next element in an array. + * + * Looks for , and ]. If ] is found, the array is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return Whether there is another element in the array. + * @error TAPE_ERROR If there is a comma missing between elements. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_element() noexcept; + + /** + * Get a child value iterator. + */ + simdjson_warn_unused simdjson_inline value_iterator child() const noexcept; + + /** @} */ + + /** + * @defgroup scalar Scalar values + * @addtogroup scalar + * @{ + */ + + simdjson_warn_unused simdjson_inline simdjson_result get_string(bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_bool() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_null() noexcept; + simdjson_warn_unused simdjson_inline bool is_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_integer() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + simdjson_warn_unused simdjson_inline simdjson_result get_root_string(bool check_trailing, bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_wobbly_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_raw_json_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_bool(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline bool is_root_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_integer(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number_type(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_null(bool check_trailing) noexcept; + + simdjson_inline error_code error() const noexcept; + simdjson_inline uint8_t *&string_buf_loc() noexcept; + simdjson_inline const json_iterator &json_iter() const noexcept; + simdjson_inline json_iterator &json_iter() noexcept; + + simdjson_inline void assert_is_valid() const noexcept; + simdjson_inline bool is_valid() const noexcept; + + /** @} */ +protected: + /** + * Restarts an array iteration. + * @returns Whether the array has any elements (returns false for empty). + */ + simdjson_inline simdjson_result reset_array() noexcept; + /** + * Restarts an object iteration. + * @returns Whether the object has any fields (returns false for empty). + */ + simdjson_inline simdjson_result reset_object() noexcept; + /** + * move_at_start(): moves us so that we are pointing at the beginning of + * the container. It updates the index so that at_start() is true and it + * syncs the depth. The user can then create a new container instance. + * + * Usage: used with value::count_elements(). + **/ + simdjson_inline void move_at_start() noexcept; + + /** + * move_at_container_start(): moves us so that we are pointing at the beginning of + * the container so that assert_at_container_start() passes. + * + * Usage: used with reset_array() and reset_object(). + **/ + simdjson_inline void move_at_container_start() noexcept; + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + simdjson_inline value_iterator(json_iterator *json_iter, depth_t depth, token_position start_index) noexcept; + + simdjson_inline simdjson_result parse_null(const uint8_t *json) const noexcept; + simdjson_inline simdjson_result parse_bool(const uint8_t *json) const noexcept; + simdjson_inline const uint8_t *peek_start() const noexcept; + simdjson_inline uint32_t peek_start_length() const noexcept; + + /** + * The general idea of the advance_... methods and the peek_* methods + * is that you first peek and check that you have desired type. If you do, + * and only if you do, then you advance. + * + * We used to unconditionally advance. But this made reasoning about our + * current state difficult. + * Suppose you always advance. Look at the 'value' matching the key + * "shadowable" in the following example... + * + * ({"globals":{"a":{"shadowable":[}}}}) + * + * If the user thinks it is a Boolean and asks for it, then we check the '[', + * decide it is not a Boolean, but still move into the next character ('}'). Now + * we are left pointing at '}' right after a '['. And we have not yet reported + * an error, only that we do not have a Boolean. + * + * If, instead, you just stand your ground until it is content that you know, then + * you will only even move beyond the '[' if the user tells you that you have an + * array. So you will be at the '}' character inside the array and, hopefully, you + * will then catch the error because an array cannot start with '}', but the code + * processing Boolean values does not know this. + * + * So the contract is: first call 'peek_...' and then call 'advance_...' only + * if you have determined that it is a type you can handle. + * + * Unfortunately, it makes the code more verbose, longer and maybe more error prone. + */ + + simdjson_inline void advance_scalar(const char *type) noexcept; + simdjson_inline void advance_root_scalar(const char *type) noexcept; + simdjson_inline void advance_non_root_scalar(const char *type) noexcept; + + simdjson_inline const uint8_t *peek_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_root_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_non_root_scalar(const char *type) noexcept; + + + simdjson_inline error_code start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept; + simdjson_inline error_code end_container() noexcept; + + /** + * Advance to a place expecting a value (increasing depth). + * + * @return The current token (the one left behind). + * @error TAPE_ERROR If the document ended early. + */ + simdjson_inline simdjson_result advance_to_value() noexcept; + + simdjson_inline error_code incorrect_type_error(const char *message) const noexcept; + simdjson_inline error_code error_unless_more_tokens(uint32_t tokens=1) const noexcept; + + simdjson_inline bool is_at_start() const noexcept; + /** + * is_at_iterator_start() returns true on an array or object after it has just been + * created, whether the instance is empty or not. + * + * Usage: used by array::begin() in debug mode (SIMDJSON_DEVELOPMENT_CHECKS) + */ + simdjson_inline bool is_at_iterator_start() const noexcept; + + /** + * Assuming that we are within an object, this returns true if we + * are pointing at a key. + * + * Usage: the skip_child() method should never be used while we are pointing + * at a key inside an object. + */ + simdjson_inline bool is_at_key() const noexcept; + + inline void assert_at_start() const noexcept; + inline void assert_at_container_start() const noexcept; + inline void assert_at_root() const noexcept; + inline void assert_at_child() const noexcept; + inline void assert_at_next() const noexcept; + inline void assert_at_non_root_start() const noexcept; + + /** Get the starting position of this value */ + simdjson_inline token_position start_position() const noexcept; + + /** @copydoc error_code json_iterator::position() const noexcept; */ + simdjson_inline token_position position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position last_position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position end_position() const noexcept; + /** @copydoc error_code json_iterator::report_error(error_code error, const char *message) noexcept; */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + friend class document; + friend class object; + friend class array; + friend class value; +}; // value_iterator + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::value_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H +/* end file simdjson/generic/ondemand/value_iterator.h for haswell */ +/* including simdjson/generic/ondemand/value.h for haswell: #include "simdjson/generic/ondemand/value.h" */ +/* begin file simdjson/generic/ondemand/value.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * An ephemeral JSON value returned during iteration. It is only valid for as long as you do + * not access more data in the JSON document. + */ +class value { +public: + /** + * Create a new invalid value. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline value() noexcept = default; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) noexcept; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() noexcept; + + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() noexcept; + + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + + /** + * Cast this JSON value (inside string) to a unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + + /** + * Cast this JSON value to a "wobbly" string. + * + * The string is may not be a valid UTF-8 string. + * See https://simonsapin.github.io/wtf-8/ + * + * Important: a value should be consumed once. Calling get_wobbly_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); +#endif + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + * + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * Performance hint: You should only call count_elements() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method on the object instance. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @return The type of JSON value (json_type::array, json_type::object, json_type::string, + * json_type::number, json_type::boolean, or json_type::null). + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the value is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the value is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the value is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * Performance note: if you call this function systematically + * before parsing a number, you may have fallen for a performance + * anti-pattern. + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + * + * Performance note: this is designed with performance in mind. When + * calling 'get_number()', you scan the number string only once, determining + * efficiently the type and storing it in an efficient manner. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. However, if this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view is guaranteed to be + * a non-space token. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + * + * See also value::raw_json(). + */ + simdjson_inline std::string_view raw_json_token() noexcept; + + /** + * Get a string_view pointing at this value in the JSON document. + * If this element is an array or an object, it consumes the array or the object + * and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + * If this element is a scalar (string, number, Boolean, null), it returns what + * raw_json_token() would return. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + simdjson_inline simdjson_result current_location() noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. + * + * Calling at_pointer() on non-document instances (e.g., arrays and objects) is not + * standardized (by RFC 6901). We provide some experimental support for JSON pointers + * on non-document instances. Yet it is not the case when calling at_pointer on an array + * or an object instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + +protected: + /** + * Create a value. + */ + simdjson_inline value(const value_iterator &iter) noexcept; + + /** + * Skip this value, allowing iteration to continue. + */ + simdjson_inline void skip() noexcept; + + /** + * Start a value at the current position. + * + * (It should already be started; this is just a self-documentation method.) + */ + static simdjson_inline value start(const value_iterator &iter) noexcept; + + /** + * Resume a value. + */ + static simdjson_inline value resume(const value_iterator &iter) noexcept; + + /** + * Get the object, starting or resuming it as necessary + */ + simdjson_inline simdjson_result start_or_resume_object() noexcept; + + // simdjson_inline void log_value(const char *type) const noexcept; + // simdjson_inline void log_error(const char *message) const noexcept; + + value_iterator iter{}; + + friend class document; + friend class array_iterator; + friend class field; + friend class object; + friend struct simdjson_result; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::value &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result get_array() noexcept; + simdjson_inline simdjson_result get_object() noexcept; + + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() noexcept; + + template simdjson_inline error_code get(T &out) noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator haswell::ondemand::array() noexcept(false); + simdjson_inline operator haswell::ondemand::object() noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator haswell::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + */ + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + + /** @copydoc simdjson_inline std::string_view value::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + + /** @copydoc simdjson_inline simdjson_result current_location() noexcept */ + simdjson_inline simdjson_result current_location() noexcept; + /** @copydoc simdjson_inline int32_t current_depth() const noexcept */ + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H +/* end file simdjson/generic/ondemand/value.h for haswell */ +/* including simdjson/generic/ondemand/logger.h for haswell: #include "simdjson/generic/ondemand/logger.h" */ +/* begin file simdjson/generic/ondemand/logger.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +// Logging should be free unless SIMDJSON_VERBOSE_LOGGING is set. Importantly, it is critical +// that the call to the log functions be side-effect free. Thus, for example, you should not +// create temporary std::string instances. +namespace logger { + +enum class log_level : int32_t { + info = 0, + error = 1 +}; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + +// We do not want these functions to be 'really inlined' since real inlining is +// for performance purposes and if you are using the loggers, you do not care about +// performance (or should not). +static inline void log_headers() noexcept; +// If args are provided, title will be treated as format string +template +static inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +template +static inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; +static inline void log_event(const json_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_value(const json_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_start_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; + +static inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail="") noexcept; +static inline void log_error(const json_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +static inline void log_event(const value_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const value_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_error(const value_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +} // namespace logger +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_H +/* end file simdjson/generic/ondemand/logger.h for haswell */ +/* including simdjson/generic/ondemand/token_iterator.h for haswell: #include "simdjson/generic/ondemand/token_iterator.h" */ +/* begin file simdjson/generic/ondemand/token_iterator.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * Iterates through JSON tokens (`{` `}` `[` `]` `,` `:` `""` `123` `true` `false` `null`) + * detected by stage 1. + * + * @private This is not intended for external use. + */ +class token_iterator { +public: + /** + * Create a new invalid token_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline token_iterator() noexcept = default; + simdjson_inline token_iterator(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator &operator=(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator(const token_iterator &other) noexcept = default; + simdjson_inline token_iterator &operator=(const token_iterator &other) noexcept = default; + + /** + * Advance to the next token (returning the current one). + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + /** + * Reports the current offset in bytes from the start of the underlying buffer. + */ + simdjson_inline uint32_t current_offset() const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + + /** + * Return the current index. + */ + simdjson_inline token_position position() const noexcept; + /** + * Reset to a previously saved index. + */ + simdjson_inline void set_position(token_position target_position) noexcept; + + // NOTE: we don't support a full C++ iterator interface, because we expect people to make + // different calls to advance the iterator based on *their own* state. + + simdjson_inline bool operator==(const token_iterator &other) const noexcept; + simdjson_inline bool operator!=(const token_iterator &other) const noexcept; + simdjson_inline bool operator>(const token_iterator &other) const noexcept; + simdjson_inline bool operator>=(const token_iterator &other) const noexcept; + simdjson_inline bool operator<(const token_iterator &other) const noexcept; + simdjson_inline bool operator<=(const token_iterator &other) const noexcept; + +protected: + simdjson_inline token_iterator(const uint8_t *buf, token_position position) noexcept; + + /** + * Get the index of the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_index(int32_t delta=0) const noexcept; + /** + * Get the index of the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline uint32_t peek_index(token_position position) const noexcept; + + const uint8_t *buf{}; + token_position _position{}; + + friend class json_iterator; + friend class value_iterator; + friend class object; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::token_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H +/* end file simdjson/generic/ondemand/token_iterator.h for haswell */ +/* including simdjson/generic/ondemand/json_iterator.h for haswell: #include "simdjson/generic/ondemand/json_iterator.h" */ +/* begin file simdjson/generic/ondemand/json_iterator.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * Iterates through JSON tokens, keeping track of depth and string buffer. + * + * @private This is not intended for external use. + */ +class json_iterator { +protected: + token_iterator token{}; + ondemand::parser *parser{}; + /** + * Next free location in the string buffer. + * + * Used by raw_json_string::unescape() to have a place to unescape strings to. + */ + uint8_t *_string_buf_loc{}; + /** + * JSON error, if there is one. + * + * INCORRECT_TYPE and NO_SUCH_FIELD are *not* stored here, ever. + * + * PERF NOTE: we *hope* this will be elided into control flow, as it is only used (a) in the first + * iteration of the loop, or (b) for the final iteration after a missing comma is found in ++. If + * this is not elided, we should make sure it's at least not using up a register. Failing that, + * we should store it in document so there's only one of them. + */ + error_code error{SUCCESS}; + /** + * Depth of the current token in the JSON. + * + * - 0 = finished with document + * - 1 = document root value (could be [ or {, not yet known) + * - 2 = , or } inside root array/object + * - 3 = key or value inside root array/object. + */ + depth_t _depth{}; + /** + * Beginning of the document indexes. + * Normally we have root == parser->implementation->structural_indexes.get() + * but this may differ, especially in streaming mode (where we have several + * documents); + */ + token_position _root{}; + /** + * Normally, a json_iterator operates over a single document, but in + * some cases, we may have a stream of documents. This attribute is meant + * as meta-data: the json_iterator works the same irrespective of the + * value of this attribute. + */ + bool _streaming{false}; + +public: + simdjson_inline json_iterator() noexcept = default; + simdjson_inline json_iterator(json_iterator &&other) noexcept; + simdjson_inline json_iterator &operator=(json_iterator &&other) noexcept; + simdjson_inline explicit json_iterator(const json_iterator &other) noexcept = default; + simdjson_inline json_iterator &operator=(const json_iterator &other) noexcept = default; + /** + * Skips a JSON value, whether it is a scalar, array or object. + */ + simdjson_warn_unused simdjson_inline error_code skip_child(depth_t parent_depth) noexcept; + + /** + * Tell whether the iterator is still at the start + */ + simdjson_inline bool at_root() const noexcept; + + /** + * Tell whether we should be expected to run in streaming + * mode (iterating over many documents). It is pure metadata + * that does not affect how the iterator works. It is used by + * start_root_array() and start_root_object(). + */ + simdjson_inline bool streaming() const noexcept; + + /** + * Get the root value iterator + */ + simdjson_inline token_position root_position() const noexcept; + /** + * Assert that we are at the document depth (== 1) + */ + simdjson_inline void assert_at_document_depth() const noexcept; + /** + * Assert that we are at the root of the document + */ + simdjson_inline void assert_at_root() const noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is live (has not been moved). + */ + simdjson_inline bool is_alive() const noexcept; + + /** + * Abandon this iterator, setting depth to 0 (as if the document is finished). + */ + simdjson_inline void abandon() noexcept; + + /** + * Advance the current token without modifying depth. + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + + /** + * Returns true if there is a single token in the index (i.e., it is + * a JSON with a scalar value such as a single number). + * + * @return whether there is a single token + */ + simdjson_inline bool is_single_token() const noexcept; + + /** + * Assert that there are at least the given number of tokens left. + * + * Has no effect in release builds. + */ + simdjson_inline void assert_more_tokens(uint32_t required_tokens=1) const noexcept; + /** + * Assert that the given position addresses an actual token (is within bounds). + * + * Has no effect in release builds. + */ + simdjson_inline void assert_valid_position(token_position position) const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + /** + * Get a pointer to the current location in the input buffer. + * + * This is not null-terminated; it is a view into the JSON. + * + * You may be pointing outside of the input buffer: it is not generally + * safe to dereference this pointer. + */ + simdjson_inline const uint8_t *unsafe_pointer() const noexcept; + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token to retrieve. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token to retrieve. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + /** + * Get the JSON text for the last token in the document. + * + * This is not null-terminated; it is a view into the JSON. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek_last() const noexcept; + + /** + * Ascend one level. + * + * Validates that the depth - 1 == parent_depth. + * + * @param parent_depth the expected parent depth. + */ + simdjson_inline void ascend_to(depth_t parent_depth) noexcept; + + /** + * Descend one level. + * + * Validates that the new depth == child_depth. + * + * @param child_depth the expected child depth. + */ + simdjson_inline void descend_to(depth_t child_depth) noexcept; + simdjson_inline void descend_to(depth_t child_depth, int32_t delta) noexcept; + + /** + * Get current depth. + */ + simdjson_inline depth_t depth() const noexcept; + + /** + * Get current (writeable) location in the string buffer. + */ + simdjson_inline uint8_t *&string_buf_loc() noexcept; + + /** + * Report an unrecoverable error, preventing further iteration. + * + * @param error The error to report. Must not be SUCCESS, UNINITIALIZED, INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + /** + * Log error, but don't stop iteration. + * @param error The error to report. Must be INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code optional_error(error_code error, const char *message) noexcept; + + /** + * Take an input in json containing max_len characters and attempt to copy it over to tmpbuf, a buffer with + * N bytes of capacity. It will return false if N is too small (smaller than max_len) of if it is zero. + * The buffer (tmpbuf) is padded with space characters. + */ + simdjson_warn_unused simdjson_inline bool copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept; + + simdjson_inline token_position position() const noexcept; + /** + * Write the raw_json_string to the string buffer and return a string_view. + * Each raw_json_string should be unescaped once, or else the string buffer might + * overflow. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, bool allow_replacement) noexcept; + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in) noexcept; + + simdjson_inline void reenter_child(token_position position, depth_t child_depth) noexcept; + + simdjson_inline error_code consume_character(char c) noexcept; +#if SIMDJSON_DEVELOPMENT_CHECKS + simdjson_inline token_position start_position(depth_t depth) const noexcept; + simdjson_inline void set_start_position(depth_t depth, token_position position) noexcept; +#endif + + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Updates this json iterator so that it is back at the beginning of the document, + * as if it had just been created. + */ + inline void rewind() noexcept; + /** + * This checks whether the {,},[,] are balanced so that the document + * ends with proper zero depth. This requires scanning the whole document + * and it may be expensive. It is expected that it will be rarely called. + * It does not attempt to match { with } and [ with ]. + */ + inline bool balanced() const noexcept; +protected: + simdjson_inline json_iterator(const uint8_t *buf, ondemand::parser *parser) noexcept; + /// The last token before the end + simdjson_inline token_position last_position() const noexcept; + /// The token *at* the end. This points at gibberish and should only be used for comparison. + simdjson_inline token_position end_position() const noexcept; + /// The end of the buffer. + simdjson_inline token_position end() const noexcept; + + friend class document; + friend class document_stream; + friend class object; + friend class array; + friend class value; + friend class raw_json_string; + friend class parser; + friend class value_iterator; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; // json_iterator + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::json_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H +/* end file simdjson/generic/ondemand/json_iterator.h for haswell */ +/* including simdjson/generic/ondemand/json_type.h for haswell: #include "simdjson/generic/ondemand/json_type.h" */ +/* begin file simdjson/generic/ondemand/json_type.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * The type of a JSON value. + */ +enum class json_type { + // Start at 1 to catch uninitialized / default values more easily + array=1, ///< A JSON array ( [ 1, 2, 3 ... ] ) + object, ///< A JSON object ( { "a": 1, "b" 2, ... } ) + number, ///< A JSON number ( 1 or -2.3 or 4.5e6 ...) + string, ///< A JSON string ( "a" or "hello world\n" ...) + boolean, ///< A JSON boolean (true or false) + null ///< A JSON null (null) +}; + +/** + * A type representing a JSON number. + * The design of the struct is deliberately straight-forward. All + * functions return standard values with no error check. + */ +struct number { + + /** + * return the automatically determined type of + * the number: number_type::floating_point_number, + * number_type::signed_integer or number_type::unsigned_integer. + * + * enum class number_type { + * floating_point_number=1, /// a binary64 number + * signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + * unsigned_integer /// a positive integer larger or equal to 1<<63 + * }; + */ + simdjson_inline ondemand::number_type get_number_type() const noexcept; + /** + * return true if the automatically determined type of + * the number is number_type::unsigned_integer. + */ + simdjson_inline bool is_uint64() const noexcept; + /** + * return the value as a uint64_t, only valid if is_uint64() is true. + */ + simdjson_inline uint64_t get_uint64() const noexcept; + simdjson_inline operator uint64_t() const noexcept; + + /** + * return true if the automatically determined type of + * the number is number_type::signed_integer. + */ + simdjson_inline bool is_int64() const noexcept; + /** + * return the value as a int64_t, only valid if is_int64() is true. + */ + simdjson_inline int64_t get_int64() const noexcept; + simdjson_inline operator int64_t() const noexcept; + + + /** + * return true if the automatically determined type of + * the number is number_type::floating_point_number. + */ + simdjson_inline bool is_double() const noexcept; + /** + * return the value as a double, only valid if is_double() is true. + */ + simdjson_inline double get_double() const noexcept; + simdjson_inline operator double() const noexcept; + + /** + * Convert the number to a double. Though it always succeed, the conversion + * may be lossy if the number cannot be represented exactly. + */ + simdjson_inline double as_double() const noexcept; + + +protected: + /** + * The next block of declaration is designed so that we can call the number parsing + * functions on a number type. They are protected and should never be used outside + * of the core simdjson library. + */ + friend class value_iterator; + template + friend error_code numberparsing::slow_float_parsing(simdjson_unused const uint8_t * src, W writer); + template + friend error_code numberparsing::write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer); + template + friend error_code numberparsing::parse_number(const uint8_t *const src, W &writer); + /** Store a signed 64-bit value to the number. */ + simdjson_inline void append_s64(int64_t value) noexcept; + /** Store an unsigned 64-bit value to the number. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + /** Store a double value to the number. */ + simdjson_inline void append_double(double value) noexcept; + /** Specifies that the value is a double, but leave it undefined. */ + simdjson_inline void skip_double() noexcept; + /** + * End of friend declarations. + */ + + /** + * Our attributes are a union type (size = 64 bits) + * followed by a type indicator. + */ + union { + double floating_point_number; + int64_t signed_integer; + uint64_t unsigned_integer; + } payload{0}; + number_type type{number_type::signed_integer}; +}; + +/** + * Write the JSON type to the output stream + * + * @param out The output stream. + * @param type The json_type. + */ +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept; + +#if SIMDJSON_EXCEPTIONS +/** + * Send JSON type to an output stream. + * + * @param out The output stream. + * @param type The json_type. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false); +#endif + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::json_type &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H +/* end file simdjson/generic/ondemand/json_type.h for haswell */ +/* including simdjson/generic/ondemand/raw_json_string.h for haswell: #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * A string escaped per JSON rules, terminated with quote ("). They are used to represent + * unescaped keys inside JSON documents. + * + * (In other words, a pointer to the beginning of a string, just after the start quote, inside a + * JSON file.) + * + * This class is deliberately simplistic and has little functionality. You can + * compare a raw_json_string instance with an unescaped C string, but + * that is nearly all you can do. + * + * The raw_json_string is unescaped. If you wish to write an unescaped version of it to your own + * buffer, you may do so using the parser.unescape(string, buff) method, using an ondemand::parser + * instance. Doing so requires you to have a sufficiently large buffer. + * + * The raw_json_string instances originate typically from field instance which in turn represent + * key-value pairs from object instances. From a field instance, you get the raw_json_string + * instance by calling key(). You can, if you want a more usable string_view instance, call + * the unescaped_key() method on the field instance. You may also create a raw_json_string from + * any other string value, with the value.get_raw_json_string() method. Again, you can get + * a more usable string_view instance by calling get_string(). + * + */ +class raw_json_string { +public: + /** + * Create a new invalid raw_json_string. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline raw_json_string() noexcept = default; + + /** + * Create a new invalid raw_json_string pointed at the given location in the JSON. + * + * The given location must be just *after* the beginning quote (") in the JSON file. + * + * It *must* be terminated by a ", and be a valid JSON string. + */ + simdjson_inline raw_json_string(const uint8_t * _buf) noexcept; + /** + * Get the raw pointer to the beginning of the string in the JSON (just after the "). + * + * It is possible for this function to return a null pointer if the instance + * has outlived its existence. + */ + simdjson_inline const char * raw() const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done) on target.size() characters, + * and if the raw_json_string instance has a quote character at byte index target.size(). + * We never read more than length + 1 bytes in the raw_json_string instance. + * If length is smaller than target.size(), this will return false. + * + * The std::string_view instance may contain any characters. However, the caller + * is responsible for setting length so that length bytes may be read in the + * raw_json_string. + * + * Performance: the comparison may be done using memcmp which may be efficient + * for long strings. + */ + simdjson_inline bool unsafe_is_equal(size_t length, std::string_view target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The std::string_view instance should not contain unescaped quote characters: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * Performance: the comparison is done byte-by-byte which might be inefficient for + * long strings. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The provided C string should not contain an unescaped quote character: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(const char* target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(const char* target) const noexcept; + + /** + * Returns true if target is free from unescaped quote. If target is known at + * compile-time, we might expect the computation to happen at compile time with + * many compilers (not all!). + */ + static simdjson_inline bool is_free_from_unescaped_quote(std::string_view target) noexcept; + static simdjson_inline bool is_free_from_unescaped_quote(const char* target) noexcept; + +private: + + + /** + * This will set the inner pointer to zero, effectively making + * this instance unusable. + */ + simdjson_inline void consume() noexcept { buf = nullptr; } + + /** + * Checks whether the inner pointer is non-null and thus usable. + */ + simdjson_inline simdjson_warn_unused bool alive() const noexcept { return buf != nullptr; } + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result will be a valid UTF-8. + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + * @param allow_replacement Whether we allow replacement of invalid surrogate pairs. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape(json_iterator &iter, bool allow_replacement) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result may not be a valid UTF-8. https://simonsapin.github.io/wtf-8/ + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(json_iterator &iter) const noexcept; + const uint8_t * buf{}; + friend class object; + friend class field; + friend class parser; + friend struct simdjson_result; +}; + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &, const raw_json_string &) noexcept; + +/** + * Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible + * for providing a string with no unescaped quote. Note that unescaped quotes cannot be present in valid JSON strings. + */ +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept; +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept; + + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::raw_json_string &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private + + simdjson_inline simdjson_result raw() const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape(haswell::ondemand::json_iterator &iter, bool allow_replacement) const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(haswell::ondemand::json_iterator &iter) const noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H +/* end file simdjson/generic/ondemand/raw_json_string.h for haswell */ +/* including simdjson/generic/ondemand/parser.h for haswell: #include "simdjson/generic/ondemand/parser.h" */ +/* begin file simdjson/generic/ondemand/parser.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * The default batch size for document_stream instances for this On Demand kernel. + * Note that different On Demand kernel may use a different DEFAULT_BATCH_SIZE value + * in the future. + */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * A JSON fragment iterator. + * + * This holds the actual iterator as well as the buffer for writing strings. + */ +class parser { +public: + /** + * Create a JSON parser. + * + * The new parser will have zero capacity. + */ + inline explicit parser(size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept; + + inline parser(parser &&other) noexcept = default; + simdjson_inline parser(const parser &other) = delete; + simdjson_inline parser &operator=(const parser &other) = delete; + simdjson_inline parser &operator=(parser &&other) noexcept = default; + + /** Deallocate the JSON parser. */ + inline ~parser() noexcept = default; + + /** + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * document doc = parser.iterate(json); + * + * It is expected that the content is a valid UTF-8 file, containing a valid JSON document. + * Otherwise the iterate method may return an error. In particular, the whole input should be + * valid: we do not attempt to tolerate incorrect content either before or after a JSON + * document. If there is a UTF-8 BOM, the parser skips it. + * + * ### IMPORTANT: Validate what you use + * + * Calling iterate on an invalid JSON document may not immediately trigger an error. The call to + * iterate does not parse and validate the whole document. + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * @param len The length of the JSON. + * @param capacity The number of bytes allocated in the JSON (must be at least len+SIMDJSON_PADDING). + * + * @return The document, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate(padded_string_view json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const char *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const uint8_t *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string_view json, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(padded_string &&json) & noexcept = delete; + + /** + * @private + * + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * json_iterator doc = parser.iterate(json); + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * The ondemand::document instance holds the iterator. The document must remain in scope + * while you are accessing instances of ondemand::value, ondemand::object, ondemand::array. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * + * @return The iterator, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate_raw(padded_string_view json) & noexcept; + + + /** + * Parse a buffer containing many JSON documents. + * + * auto json = R"({ "foo": 1 } { "foo": 2 } { "foo": 3 } )"_padded; + * ondemand::parser parser; + * ondemand::document_stream docs = parser.iterate_many(json); + * for (auto & doc : docs) { + * std::cout << doc["foo"] << std::endl; + * } + * // Prints 1 2 3 + * + * No copy of the input buffer is made. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * + * The caller is responsabile to ensure that the input string data remains unchanged and is + * not deleted during the loop. + * + * ### Format + * + * The buffer must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by ASCII whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. Documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with ASCII whitespace. + * + * The characters inside a JSON document, and between JSON documents, must be valid Unicode (UTF-8). + * If there is a UTF-8 BOM, the parser skips it. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excessively small values may impact negatively the + * performance. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The concatenated JSON to parse. + * @param len The length of the concatenated JSON. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 10MB, which has been a reasonable sweet spot in our tests. + * @param allow_comma_separated (defaults on false) This allows a mode where the documents are + * separated by commas instead of whitespace. It comes with a performance + * penalty because the entire document is indexed at once (and the document must be + * less than 4 GB), and there is no multithreading. In this mode, the batch_size parameter + * is effectively ignored, as it is set to at least the document size. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result iterate_many(const uint8_t *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const char *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const std::string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const std::string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const padded_string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const padded_string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_result iterate_many(const char *buf, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept = delete; + + /** The capacity of this parser (the largest document it can process). */ + simdjson_inline size_t capacity() const noexcept; + /** The maximum capacity of this parser (the largest document it is allowed to process). */ + simdjson_inline size_t max_capacity() const noexcept; + simdjson_inline void set_max_capacity(size_t max_capacity) noexcept; + /** + * The maximum depth of this parser (the most deeply nested objects and arrays it can process). + * This parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * The max_depth parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused error_code allocate(size_t capacity, size_t max_depth=DEFAULT_MAX_DEPTH) noexcept; + + #ifdef SIMDJSON_THREADS_ENABLED + /** + * The parser instance can use threads when they are available to speed up some + * operations. It is enabled by default. Changing this attribute will change the + * behavior of the parser for future operations. + */ + bool threaded{true}; + #endif + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result must be valid UTF-8. + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @param allow_replacement Whether we allow a replacement if the input string contains unmatched surrogate pairs. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement = false) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result may not be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept; + +private: + /** @private [for benchmarking access] The implementation to use */ + std::unique_ptr implementation{}; + size_t _capacity{0}; + size_t _max_capacity; + size_t _max_depth{DEFAULT_MAX_DEPTH}; + std::unique_ptr string_buf{}; +#if SIMDJSON_DEVELOPMENT_CHECKS + std::unique_ptr start_positions{}; +#endif + + friend class json_iterator; + friend class document_stream; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::parser &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_H +/* end file simdjson/generic/ondemand/parser.h for haswell */ + +// All other declarations +/* including simdjson/generic/ondemand/array.h for haswell: #include "simdjson/generic/ondemand/array.h" */ +/* begin file simdjson/generic/ondemand/array.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * A forward-only JSON array. + */ +class array { +public: + /** + * Create a new invalid array. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline array() noexcept = default; + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an array is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the beginning of the array and checks whether the + * array is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result is_empty() & noexcept; + /** + * Reset the iterator so that we are pointing back at the + * beginning of the array. You should still consume values only once even if you + * can iterate through the array more than once. If you unescape a string + * within the array more than once, you have unsafe code. Note that rewinding + * an array means that you may need to reparse it anew: it is not a free + * operation. + * + * @returns true if the array contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/0/foo/a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an array + * instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the array and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Get the value at the given index. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; +protected: + /** + * Go to the end of the array, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + + /** + * Begin array iteration. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + */ + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + /** + * Begin array iteration from the root. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + * @error TAPE_ERROR if there is no closing ] at the end of the document. + */ + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + /** + * Begin array iteration. + * + * This version of the method should be called after the initial [ has been verified, and is + * intended for use by switch statements that check the type of a value. + * + * @param iter The iterator. Must be after the initial [. Will be *moved* into the resulting array. + */ + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + + /** + * Create an array at the given Internal array creation. Call array::start() or array::started() instead of this. + * + * @param iter The iterator. Must either be at the start of the first element with iter.is_alive() + * == true, or past the [] with is_alive() == false if the array is empty. Will be *moved* + * into the resulting array. + */ + simdjson_inline array(const value_iterator &iter) noexcept; + + /** + * Iterator marking current position. + * + * iter.is_alive() == false indicates iteration is complete. + */ + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; + friend struct simdjson_result; + friend class array_iterator; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::array &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + inline simdjson_result count_elements() & noexcept; + inline simdjson_result is_empty() & noexcept; + inline simdjson_result reset() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_H +/* end file simdjson/generic/ondemand/array.h for haswell */ +/* including simdjson/generic/ondemand/array_iterator.h for haswell: #include "simdjson/generic/ondemand/array_iterator.h" */ +/* begin file simdjson/generic/ondemand/array_iterator.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * A forward-only JSON array. + * + * This is an input_iterator, meaning: + * - It is forward-only + * - * must be called exactly once per element. + * - ++ must be called exactly once in between each * (*, ++, *, ++, * ...) + */ +class array_iterator { +public: + /** Create a new, invalid array iterator. */ + simdjson_inline array_iterator() noexcept = default; + + // + // Iterator interface + // + + /** + * Get the current element. + * + * Part of the std::iterator interface. + */ + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + /** + * Check if we are at the end of the JSON. + * + * Part of the std::iterator interface. + * + * @return true if there are no more elements in the JSON array. + */ + simdjson_inline bool operator==(const array_iterator &) const noexcept; + /** + * Check if there are more elements in the JSON array. + * + * Part of the std::iterator interface. + * + * @return true if there are more elements in the JSON array. + */ + simdjson_inline bool operator!=(const array_iterator &) const noexcept; + /** + * Move to the next element. + * + * Part of the std::iterator interface. + */ + simdjson_inline array_iterator &operator++() noexcept; + +private: + value_iterator iter{}; + + simdjson_inline array_iterator(const value_iterator &iter) noexcept; + + friend class array; + friend class value; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::array_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H +/* end file simdjson/generic/ondemand/array_iterator.h for haswell */ +/* including simdjson/generic/ondemand/document.h for haswell: #include "simdjson/generic/ondemand/document.h" */ +/* begin file simdjson/generic/ondemand/document.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * A JSON document. It holds a json_iterator instance. + * + * Used by tokens to get text, and string buffer location. + * + * You must keep the document around during iteration. + */ +class document { +public: + /** + * Create a new invalid document. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline document() noexcept = default; + simdjson_inline document(const document &other) noexcept = delete; // pass your documents by reference, not by copy + simdjson_inline document(document &&other) noexcept = default; + simdjson_inline document &operator=(const document &other) noexcept = delete; + simdjson_inline document &operator=(document &&other) noexcept = default; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() & noexcept; + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() & noexcept; + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + /** + * Cast this JSON value (inside string) to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: Calling get_string() twice on the same document is an error. + * + * @param Whether to allow a replacement character for unmatched surrogate pairs. + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + /** + * Cast this JSON value to a string. + * + * The string is not guaranteed to be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * + * Important: Calling get_wobbly_string() twice on the same document is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + /** + * Cast this JSON value to a value when the document is an object or an array. + * + * @returns A value if a JSON array or object cannot be found. + * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result get_value() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() & noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + /** @overload template simdjson_result get() & noexcept */ + template simdjson_inline simdjson_result get() && noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool, value + * + * Be mindful that the document instance must remain in scope while you are accessing object, array and value instances. + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) & noexcept; + /** @overload template error_code get(T &out) & noexcept */ + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() & noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() & noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); + /** + * Cast this JSON value to a value. + * + * @returns A value value. + * @exception if a JSON value cannot be found + */ + simdjson_inline operator value() noexcept(false); +#endif + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) & noexcept; + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to + * a key a single time. Doing object["mykey"].to_string()and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the document is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the document is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the document is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. If this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view may be the padded buffer. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + /** + * Reset the iterator inside the document instance so we are pointing back at the + * beginning of the document, as if it had just been created. It invalidates all + * values, objects and arrays that you have created so far (including unescaped strings). + */ + inline void rewind() noexcept; + /** + * Returns debugging information. + */ + inline std::string to_debug_string() noexcept; + /** + * Some unrecoverable error conditions may render the document instance unusable. + * The is_alive() method returns true when the document is still suitable. + */ + inline bool is_alive() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Returns true if this document has been fully parsed. + * If you have consumed the whole document and at_end() returns + * false, then there may be trailing content. + */ + inline bool at_end() const noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() automatically calls rewind between each call. Thus + * all values, objects and arrays that you have created so far (including unescaped strings) + * are invalidated. After calling at_pointer, you need to consume the result: string values + * should be stored in your own variables, arrays should be decoded and stored in your own array-like + * structures and so forth. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + * - SCALAR_DOCUMENT_AS_VALUE if the json_pointer is empty and the document is not a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the document and returns a string_view instance corresponding to the + * document as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; +protected: + /** + * Consumes the document. + */ + simdjson_inline error_code consume() noexcept; + + simdjson_inline document(ondemand::json_iterator &&iter) noexcept; + simdjson_inline const uint8_t *text(uint32_t idx) const noexcept; + + simdjson_inline value_iterator resume_value_iterator() noexcept; + simdjson_inline value_iterator get_root_value_iterator() noexcept; + simdjson_inline simdjson_result start_or_resume_object() noexcept; + static simdjson_inline document start(ondemand::json_iterator &&iter) noexcept; + + // + // Fields + // + json_iterator iter{}; ///< Current position in the document + static constexpr depth_t DOCUMENT_DEPTH = 0; ///< document depth is always 0 + + friend class array_iterator; + friend class value; + friend class ondemand::parser; + friend class object; + friend class array; + friend class field; + friend class token; + friend class document_stream; + friend class document_reference; +}; + + +/** + * A document_reference is a thin wrapper around a document reference instance. + */ +class document_reference { +public: + simdjson_inline document_reference() noexcept; + simdjson_inline document_reference(document &d) noexcept; + simdjson_inline document_reference(const document_reference &other) noexcept = default; + simdjson_inline document_reference& operator=(const document_reference &other) noexcept = default; + simdjson_inline void rewind() noexcept; + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + + simdjson_inline simdjson_result is_null() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + simdjson_inline operator document&() const noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator array() & noexcept(false); + simdjson_inline operator object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +private: + document *doc{nullptr}; +}; +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::document &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() & noexcept; + template simdjson_inline simdjson_result get() && noexcept; + + template simdjson_inline error_code get(T &out) & noexcept; + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator haswell::ondemand::array() & noexcept(false); + simdjson_inline operator haswell::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator haswell::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator haswell::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool at_end() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + + + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::document_reference value, error_code error) noexcept; + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator haswell::ondemand::array() & noexcept(false); + simdjson_inline operator haswell::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator haswell::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator haswell::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document_reference::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H +/* end file simdjson/generic/ondemand/document.h for haswell */ +/* including simdjson/generic/ondemand/document_stream.h for haswell: #include "simdjson/generic/ondemand/document_stream.h" */ +/* begin file simdjson/generic/ondemand/document_stream.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#ifdef SIMDJSON_THREADS_ENABLED +#include +#include +#include +#endif + +namespace simdjson { +namespace haswell { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED +/** @private Custom worker class **/ +struct stage1_worker { + stage1_worker() noexcept = default; + stage1_worker(const stage1_worker&) = delete; + stage1_worker(stage1_worker&&) = delete; + stage1_worker operator=(const stage1_worker&) = delete; + ~stage1_worker(); + /** + * We only start the thread when it is needed, not at object construction, this may throw. + * You should only call this once. + **/ + void start_thread(); + /** + * Start a stage 1 job. You should first call 'run', then 'finish'. + * You must call start_thread once before. + */ + void run(document_stream * ds, parser * stage1, size_t next_batch_start); + /** Wait for the run to finish (blocking). You should first call 'run', then 'finish'. **/ + void finish(); + +private: + + /** + * Normally, we would never stop the thread. But we do in the destructor. + * This function is only safe assuming that you are not waiting for results. You + * should have called run, then finish, and be done. + **/ + void stop_thread(); + + std::thread thread{}; + /** These three variables define the work done by the thread. **/ + ondemand::parser * stage1_thread_parser{}; + size_t _next_batch_start{}; + document_stream * owner{}; + /** + * We have two state variables. This could be streamlined to one variable in the future but + * we use two for clarity. + */ + bool has_work{false}; + bool can_work{true}; + + /** + * We lock using a mutex. + */ + std::mutex locking_mutex{}; + std::condition_variable cond_var{}; + + friend class document_stream; +}; +#endif // SIMDJSON_THREADS_ENABLED + +/** + * A forward-only stream of documents. + * + * Produced by parser::iterate_many. + * + */ +class document_stream { +public: + /** + * Construct an uninitialized document_stream. + * + * ```c++ + * document_stream docs; + * auto error = parser.iterate_many(json).get(docs); + * ``` + */ + simdjson_inline document_stream() noexcept; + /** Move one document_stream to another. */ + simdjson_inline document_stream(document_stream &&other) noexcept = default; + /** Move one document_stream to another. */ + simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default; + + simdjson_inline ~document_stream() noexcept; + + /** + * Returns the input size in bytes. + */ + inline size_t size_in_bytes() const noexcept; + + /** + * After iterating through the stream, this method + * returns the number of bytes that were not parsed at the end + * of the stream. If truncated_bytes() differs from zero, + * then the input was truncated maybe because incomplete JSON + * documents were found at the end of the stream. You + * may need to process the bytes in the interval [size_in_bytes()-truncated_bytes(), size_in_bytes()). + * + * You should only call truncated_bytes() after streaming through all + * documents, like so: + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto & doc : stream) { + * // do something with doc + * } + * size_t truncated = stream.truncated_bytes(); + * + */ + inline size_t truncated_bytes() const noexcept; + + class iterator { + public: + using value_type = simdjson_result; + using reference = value_type; + + using difference_type = std::ptrdiff_t; + + using iterator_category = std::input_iterator_tag; + + /** + * Default constructor. + */ + simdjson_inline iterator() noexcept; + /** + * Get the current document (or error). + */ + simdjson_inline simdjson_result operator*() noexcept; + /** + * Advance to the next document (prefix). + */ + inline iterator& operator++() noexcept; + /** + * Check if we're at the end yet. + * @param other the end iterator to compare to. + */ + simdjson_inline bool operator!=(const iterator &other) const noexcept; + /** + * @private + * + * Gives the current index in the input document in bytes. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * size_t index = i.current_index(); + * } + * + * This function (current_index()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline size_t current_index() const noexcept; + + /** + * @private + * + * Gives a view of the current document at the current position. + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * std::string_view v = i.source(); + * } + * + * The returned string_view instance is simply a map to the (unparsed) + * source string: it may thus include white-space characters and all manner + * of padding. + * + * This function (source()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + * + */ + simdjson_inline std::string_view source() const noexcept; + + /** + * Returns error of the stream (if any). + */ + inline error_code error() const noexcept; + + private: + simdjson_inline iterator(document_stream *s, bool finished) noexcept; + /** The document_stream we're iterating through. */ + document_stream* stream; + /** Whether we're finished or not. */ + bool finished; + + friend class document; + friend class document_stream; + friend class json_iterator; + }; + + /** + * Start iterating the documents in the stream. + */ + simdjson_inline iterator begin() noexcept; + /** + * The end of the stream, for iterator comparison purposes. + */ + simdjson_inline iterator end() noexcept; + +private: + + document_stream &operator=(const document_stream &) = delete; // Disallow copying + document_stream(const document_stream &other) = delete; // Disallow copying + + /** + * Construct a document_stream. Does not allocate or parse anything until the iterator is + * used. + * + * @param parser is a reference to the parser instance used to generate this document_stream + * @param buf is the raw byte buffer we need to process + * @param len is the length of the raw byte buffer in bytes + * @param batch_size is the size of the windows (must be strictly greater or equal to the largest JSON document) + */ + simdjson_inline document_stream( + ondemand::parser &parser, + const uint8_t *buf, + size_t len, + size_t batch_size, + bool allow_comma_separated + ) noexcept; + + /** + * Parse the first document in the buffer. Used by begin(), to handle allocation and + * initialization. + */ + inline void start() noexcept; + + /** + * Parse the next document found in the buffer previously given to document_stream. + * + * The content should be a valid JSON document encoded as UTF-8. If there is a + * UTF-8 BOM, the parser skips it. + * + * You do NOT need to pre-allocate a parser. This function takes care of + * pre-allocating a capacity defined by the batch_size defined when creating the + * document_stream object. + * + * The function returns simdjson::EMPTY if there is no more data to be parsed. + * + * The function returns simdjson::SUCCESS (as integer = 0) in case of success + * and indicates that the buffer has successfully been parsed to the end. + * Every document it contained has been parsed without error. + * + * The function returns an error code from simdjson/simdjson.h in case of failure + * such as simdjson::CAPACITY, simdjson::MEMALLOC, simdjson::DEPTH_ERROR and so forth; + * the simdjson::error_message function converts these error codes into a string). + * + * You can also check validity by calling parser.is_valid(). The same parser can + * and should be reused for the other documents in the buffer. + */ + inline void next() noexcept; + + /** Move the json_iterator of the document to the location of the next document in the stream. */ + inline void next_document() noexcept; + + /** Get the next document index. */ + inline size_t next_batch_start() const noexcept; + + /** Pass the next batch through stage 1 with the given parser. */ + inline error_code run_stage1(ondemand::parser &p, size_t batch_start) noexcept; + + // Fields + ondemand::parser *parser; + const uint8_t *buf; + size_t len; + size_t batch_size; + bool allow_comma_separated; + /** + * We are going to use just one document instance. The document owns + * the json_iterator. It implies that we only ever pass a reference + * to the document to the users. + */ + document doc{}; + /** The error (or lack thereof) from the current document. */ + error_code error; + size_t batch_start{0}; + size_t doc_index{}; + + #ifdef SIMDJSON_THREADS_ENABLED + /** Indicates whether we use threads. Note that this needs to be a constant during the execution of the parsing. */ + bool use_thread; + + inline void load_from_stage1_thread() noexcept; + + /** Start a thread to run stage 1 on the next batch. */ + inline void start_stage1_thread() noexcept; + + /** Wait for the stage 1 thread to finish and capture the results. */ + inline void finish_stage1_thread() noexcept; + + /** The error returned from the stage 1 thread. */ + error_code stage1_thread_error{UNINITIALIZED}; + /** The thread used to run stage 1 against the next batch in the background. */ + std::unique_ptr worker{new(std::nothrow) stage1_worker()}; + /** + * The parser used to run stage 1 in the background. Will be swapped + * with the regular parser when finished. + */ + ondemand::parser stage1_thread_parser{}; + + friend struct stage1_worker; + #endif // SIMDJSON_THREADS_ENABLED + + friend class parser; + friend class document; + friend class json_iterator; + friend struct simdjson_result; + friend struct internal::simdjson_result_base; +}; // document_stream + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::document_stream &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H +/* end file simdjson/generic/ondemand/document_stream.h for haswell */ +/* including simdjson/generic/ondemand/field.h for haswell: #include "simdjson/generic/ondemand/field.h" */ +/* begin file simdjson/generic/ondemand/field.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * A JSON field (key/value pair) in an object. + * + * Returned from object iteration. + * + * Extends from std::pair so you can use C++ algorithms that rely on pairs. + */ +class field : public std::pair { +public: + /** + * Create a new invalid field. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline field() noexcept; + + /** + * Get the key as a string_view (for higher speed, consider raw_key). + * We deliberately use a more cumbersome name (unescaped_key) to force users + * to think twice about using it. + * + * This consumes the key: once you have called unescaped_key(), you cannot + * call it again nor can you call key(). + */ + simdjson_inline simdjson_warn_unused simdjson_result unescaped_key(bool allow_replacement) noexcept; + /** + * Get the key as a raw_json_string. Can be used for direct comparison with + * an unescaped C string: e.g., key() == "test". + */ + simdjson_inline raw_json_string key() const noexcept; + /** + * Get the field value. + */ + simdjson_inline ondemand::value &value() & noexcept; + /** + * @overload ondemand::value &ondemand::value() & noexcept + */ + simdjson_inline ondemand::value value() && noexcept; + +protected: + simdjson_inline field(raw_json_string key, ondemand::value &&value) noexcept; + static simdjson_inline simdjson_result start(value_iterator &parent_iter) noexcept; + static simdjson_inline simdjson_result start(const value_iterator &parent_iter, raw_json_string key) noexcept; + friend struct simdjson_result; + friend class object_iterator; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::field &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result unescaped_key(bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result key() noexcept; + simdjson_inline simdjson_result value() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_H +/* end file simdjson/generic/ondemand/field.h for haswell */ +/* including simdjson/generic/ondemand/object.h for haswell: #include "simdjson/generic/ondemand/object.h" */ +/* begin file simdjson/generic/ondemand/object.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +/** + * A forward-only JSON object field iterator. + */ +class object { +public: + /** + * Create a new invalid object. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a + * key a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an object + * instance: there is no rewind and no invalidation. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + + /** + * Reset the iterator so that we are pointing back at the + * beginning of the object. You should still consume values only once even if you + * can iterate through the object more than once. If you unescape a string within + * the object more than once, you have unsafe code. Note that rewinding an object + * means that you may need to reparse it anew: it is not a free operation. + * + * @returns true if the object contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * This method scans the beginning of the object and checks whether the + * object is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + inline simdjson_result is_empty() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Consumes the object and returns a string_view instance corresponding to the + * object as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + +protected: + /** + * Go to the end of the object, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + static simdjson_inline object resume(const value_iterator &iter) noexcept; + simdjson_inline object(const value_iterator &iter) noexcept; + + simdjson_warn_unused simdjson_inline error_code find_field_raw(const std::string_view key) noexcept; + + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::object &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + inline simdjson_result reset() noexcept; + inline simdjson_result is_empty() noexcept; + inline simdjson_result count_fields() & noexcept; + inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_H +/* end file simdjson/generic/ondemand/object.h for haswell */ +/* including simdjson/generic/ondemand/object_iterator.h for haswell: #include "simdjson/generic/ondemand/object_iterator.h" */ +/* begin file simdjson/generic/ondemand/object_iterator.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +class object_iterator { +public: + /** + * Create a new invalid object_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object_iterator() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline simdjson_result operator*() noexcept; + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const object_iterator &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const object_iterator &) const noexcept; + // Checks for ']' and ',' + simdjson_inline object_iterator &operator++() noexcept; + +private: + /** + * The underlying JSON iterator. + * + * PERF NOTE: expected to be elided in favor of the parent document: this is set when the object + * is first used, and never changes afterwards. + */ + value_iterator iter{}; + + simdjson_inline object_iterator(const value_iterator &iter) noexcept; + friend struct simdjson_result; + friend class object; +}; + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public haswell::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(haswell::ondemand::object_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + // Checks for ']' and ',' + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H +/* end file simdjson/generic/ondemand/object_iterator.h for haswell */ +/* including simdjson/generic/ondemand/serialization.h for haswell: #include "simdjson/generic/ondemand/serialization.h" */ +/* begin file simdjson/generic/ondemand/serialization.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Create a string-view instance out of a document instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(haswell::ondemand::document& x) noexcept; +/** + * Create a string-view instance out of a value instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. The value must + * not have been accessed previously. It does not + * validate the content. + */ +inline simdjson_result to_json_string(haswell::ondemand::value& x) noexcept; +/** + * Create a string-view instance out of an object instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(haswell::ondemand::object& x) noexcept; +/** + * Create a string-view instance out of an array instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(haswell::ondemand::array& x) noexcept; +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +} // namespace simdjson + +/** + * We want to support argument-dependent lookup (ADL). + * Hence we should define operator<< in the namespace + * where the argument (here value, object, etc.) resides. + * Credit: @madhur4127 + * See https://github.com/simdjson/simdjson/issues/1768 + */ +namespace simdjson { namespace haswell { namespace ondemand { + +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The element. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::value x); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::array value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::document& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::document_reference& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The object. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::object value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +}}} // namespace simdjson::haswell::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H +/* end file simdjson/generic/ondemand/serialization.h for haswell */ + +// Inline definitions +/* including simdjson/generic/ondemand/array-inl.h for haswell: #include "simdjson/generic/ondemand/array-inl.h" */ +/* begin file simdjson/generic/ondemand/array-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter->depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the array is first found and the iterator is just past the `{`. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the `,` before the next value (or `]`). In this state, +// depth == iter->depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter->depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter->depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the array iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet element may be missing or not be an +// array--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter->depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between elements, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter->depth == depth, and at_start == false. +// +// ## Terminal State +// +// The terminal state has iter->depth < depth. at_start is always false. +// +// - Finished: When we have reached a `]` or have reported an error, we are finished. We signal this +// by decrementing depth. In this state, iter->depth < depth, at_start == false, and +// error == SUCCESS. +// + +simdjson_inline array::array(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result array::start(value_iterator &iter) noexcept { + // We don't need to know if the array is empty to start iteration, but we do want to know if there + // is an error--thus `simdjson_unused`. + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::start_root(value_iterator &iter) noexcept { + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_root_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::started(value_iterator &iter) noexcept { + bool has_value; + SIMDJSON_TRY(iter.started_array().get(has_value)); + return array(iter); +} + +simdjson_inline simdjson_result array::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return array_iterator(iter); +} +simdjson_inline simdjson_result array::end() noexcept { + return array_iterator(iter); +} +simdjson_inline error_code array::consume() noexcept { + auto error = iter.json_iter().skip_child(iter.depth()-1); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result array::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter._json_iter->unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline simdjson_result array::count_elements() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the array after counting the number of elements. + iter.reset_array(); + return count; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline simdjson_result array::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_array().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +inline simdjson_result array::reset() & noexcept { + return iter.reset_array(); +} + +inline simdjson_result array::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + // - means "the append position" or "the element after the end of the array" + // We don't support this, because we're returning a real element, not a position. + if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; } + + // Read the array index + size_t array_index = 0; + size_t i; + for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) { + uint8_t digit = uint8_t(json_pointer[i] - '0'); + // Check for non-digit in array index. If it's there, we're trying to get a field in an object + if (digit > 9) { return INCORRECT_TYPE; } + array_index = array_index*10 + digit; + } + + // 0 followed by other digits is invalid + if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0" + + // Empty string is invalid; so is a "/" with no digits before it + if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index" + // Get the child + auto child = at(array_index); + // If there is an error, it ends here + if(child.error()) { + return child; + } + + // If there is a /, we're not done yet, call recursively. + if (i < json_pointer.length()) { + child = child.at_pointer(json_pointer.substr(i)); + } + return child; +} + +simdjson_inline simdjson_result array::at(size_t index) noexcept { + size_t i = 0; + for (auto value : *this) { + if (i == index) { return value; } + i++; + } + return INDEX_OUT_OF_BOUNDS; +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + haswell::ondemand::array &&value +) noexcept + : implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept + : implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::is_empty() & noexcept { + if (error()) { return error(); } + return first.is_empty(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H +/* end file simdjson/generic/ondemand/array-inl.h for haswell */ +/* including simdjson/generic/ondemand/array_iterator-inl.h for haswell: #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/array_iterator-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline array_iterator::array_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result array_iterator::operator*() noexcept { + if (iter.error()) { iter.abandon(); return iter.error(); } + return value(iter.child()); +} +simdjson_inline bool array_iterator::operator==(const array_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept { + return iter.is_open(); +} +simdjson_inline array_iterator &array_iterator::operator++() noexcept { + error_code error; + // PERF NOTE this is a safety rail ... users should exit loops as soon as they receive an error, so we'll never get here. + // However, it does not seem to make a perf difference, so we add it out of an abundance of caution. + if (( error = iter.error() )) { return *this; } + if (( error = iter.skip_child() )) { return *this; } + if (( error = iter.has_next_element().error() )) { return *this; } + return *this; +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + haswell::ondemand::array_iterator &&value +) noexcept + : haswell::implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : haswell::implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++(first); + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/array_iterator-inl.h for haswell */ +/* including simdjson/generic/ondemand/document-inl.h for haswell: #include "simdjson/generic/ondemand/document-inl.h" */ +/* begin file simdjson/generic/ondemand/document-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline document::document(ondemand::json_iterator &&_iter) noexcept + : iter{std::forward(_iter)} +{ + logger::log_start_value(iter, "document"); +} + +simdjson_inline document document::start(json_iterator &&iter) noexcept { + return document(std::forward(iter)); +} + +inline void document::rewind() noexcept { + iter.rewind(); +} + +inline std::string document::to_debug_string() noexcept { + return iter.to_string(); +} + +inline simdjson_result document::current_location() const noexcept { + return iter.current_location(); +} + +inline int32_t document::current_depth() const noexcept { + return iter.depth(); +} + +inline bool document::at_end() const noexcept { + return iter.at_end(); +} + + +inline bool document::is_alive() noexcept { + return iter.is_alive(); +} +simdjson_inline value_iterator document::resume_value_iterator() noexcept { + return value_iterator(&iter, 1, iter.root_position()); +} +simdjson_inline value_iterator document::get_root_value_iterator() noexcept { + return resume_value_iterator(); +} +simdjson_inline simdjson_result document::start_or_resume_object() noexcept { + if (iter.at_root()) { + return get_object(); + } else { + return object::resume(resume_value_iterator()); + } +} +simdjson_inline simdjson_result document::get_value() noexcept { + // Make sure we start any arrays or objects before returning, so that start_root_() + // gets called. + iter.assert_at_document_depth(); + switch (*iter.peek()) { + case '[': { + // The following lines check that the document ends with ]. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_array(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + case '{': { + // The following lines would check that the document ends with }. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_object(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + default: + // Unfortunately, scalar documents are a special case in simdjson and they cannot + // be safely converted to value instances. + return SCALAR_DOCUMENT_AS_VALUE; + } +} +simdjson_inline simdjson_result document::get_array() & noexcept { + auto value = get_root_value_iterator(); + return array::start_root(value); +} +simdjson_inline simdjson_result document::get_object() & noexcept { + auto value = get_root_value_iterator(); + return object::start_root(value); +} + +/** + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. We want to disallow trailing + * content. + * Thus, in several implementations below, we pass a 'true' parameter value to + * a get_root_value_iterator() method: this indicates that we disallow trailing content. + */ + +simdjson_inline simdjson_result document::get_uint64() noexcept { + return get_root_value_iterator().get_root_uint64(true); +} +simdjson_inline simdjson_result document::get_uint64_in_string() noexcept { + return get_root_value_iterator().get_root_uint64_in_string(true); +} +simdjson_inline simdjson_result document::get_int64() noexcept { + return get_root_value_iterator().get_root_int64(true); +} +simdjson_inline simdjson_result document::get_int64_in_string() noexcept { + return get_root_value_iterator().get_root_int64_in_string(true); +} +simdjson_inline simdjson_result document::get_double() noexcept { + return get_root_value_iterator().get_root_double(true); +} +simdjson_inline simdjson_result document::get_double_in_string() noexcept { + return get_root_value_iterator().get_root_double_in_string(true); +} +simdjson_inline simdjson_result document::get_string(bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(true, allow_replacement); +} +template +simdjson_inline error_code document::get_string(string_type& receiver, bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(receiver, true, allow_replacement); +} +simdjson_inline simdjson_result document::get_wobbly_string() noexcept { + return get_root_value_iterator().get_root_wobbly_string(true); +} +simdjson_inline simdjson_result document::get_raw_json_string() noexcept { + return get_root_value_iterator().get_root_raw_json_string(true); +} +simdjson_inline simdjson_result document::get_bool() noexcept { + return get_root_value_iterator().get_root_bool(true); +} +simdjson_inline simdjson_result document::is_null() noexcept { + return get_root_value_iterator().is_root_null(true); +} + +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_array(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_object(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_double(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_bool(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_value(); } + +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_double(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_uint64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_int64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_bool(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_value(); } + +template simdjson_inline error_code document::get(T &out) & noexcept { + return get().get(out); +} +template simdjson_inline error_code document::get(T &out) && noexcept { + return std::forward(*this).get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document::operator array() & noexcept(false) { return get_array(); } +simdjson_inline document::operator object() & noexcept(false) { return get_object(); } +simdjson_inline document::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document::operator double() noexcept(false) { return get_double(); } +simdjson_inline document::operator std::string_view() noexcept(false) { return get_string(false); } +simdjson_inline document::operator raw_json_string() noexcept(false) { return get_raw_json_string(); } +simdjson_inline document::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document::operator value() noexcept(false) { return get_value(); } + +#endif +simdjson_inline simdjson_result document::count_elements() & noexcept { + auto a = get_array(); + simdjson_result answer = a.count_elements(); + /* If there was an array, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::count_fields() & noexcept { + auto a = get_object(); + simdjson_result answer = a.count_fields(); + /* If there was an object, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::at(size_t index) & noexcept { + auto a = get_array(); + return a.at(index); +} +simdjson_inline simdjson_result document::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result document::end() & noexcept { + return {}; +} + +simdjson_inline simdjson_result document::find_field(std::string_view key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field(const char *key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field_unordered(std::string_view key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::find_field_unordered(const char *key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::operator[](std::string_view key) & noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result document::operator[](const char *key) & noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline error_code document::consume() noexcept { + auto error = iter.skip_child(0); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result document::raw_json() noexcept { + auto _iter = get_root_value_iterator(); + const uint8_t * starting_point{_iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter.unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result document::type() noexcept { + return get_root_value_iterator().type(); +} + +simdjson_inline simdjson_result document::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool document::is_negative() noexcept { + return get_root_value_iterator().is_root_negative(); +} + +simdjson_inline simdjson_result document::is_integer() noexcept { + return get_root_value_iterator().is_root_integer(true); +} + +simdjson_inline simdjson_result document::get_number_type() noexcept { + return get_root_value_iterator().get_root_number_type(true); +} + +simdjson_inline simdjson_result document::get_number() noexcept { + return get_root_value_iterator().get_root_number(true); +} + + +simdjson_inline simdjson_result document::raw_json_token() noexcept { + auto _iter = get_root_value_iterator(); + return std::string_view(reinterpret_cast(_iter.peek_start()), _iter.peek_start_length()); +} + +simdjson_inline simdjson_result document::at_pointer(std::string_view json_pointer) noexcept { + rewind(); // Rewind the document each time at_pointer is called + if (json_pointer.empty()) { + return this->get_value(); + } + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + haswell::ondemand::document &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base( + error + ) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template +simdjson_inline simdjson_result simdjson_result::get() & noexcept { + if (error()) { return error(); } + return first.get(); +} +template +simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first).get(); +} +template +simdjson_inline error_code simdjson_result::get(T &out) & noexcept { + if (error()) { return error(); } + return first.get(out); +} +template +simdjson_inline error_code simdjson_result::get(T &out) && noexcept { + if (error()) { return error(); } + return std::forward(first).get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() & noexcept = delete; +template<> simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first); +} +template<> simdjson_inline error_code simdjson_result::get(haswell::ondemand::document &out) & noexcept = delete; +template<> simdjson_inline error_code simdjson_result::get(haswell::ondemand::document &out) && noexcept { + if (error()) { return error(); } + out = std::forward(first); + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} + +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} + + +simdjson_inline bool simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} + +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} + +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} + +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} + + +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator haswell::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline bool simdjson_result::at_end() const noexcept { + if (error()) { return error(); } + return first.at_end(); +} + + +simdjson_inline int32_t simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline document_reference::document_reference() noexcept : doc{nullptr} {} +simdjson_inline document_reference::document_reference(document &d) noexcept : doc(&d) {} +simdjson_inline void document_reference::rewind() noexcept { doc->rewind(); } +simdjson_inline simdjson_result document_reference::get_array() & noexcept { return doc->get_array(); } +simdjson_inline simdjson_result document_reference::get_object() & noexcept { return doc->get_object(); } +/** + * The document_reference instances are used primarily/solely for streams of JSON + * documents. + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. + * + * However, for streams of JSON documents, we want to be able to start from + * "321" "321" "321" + * and parse it successfully as a stream of JSON documents, calling get_uint64_in_string() + * successfully each time. + * + * To achieve this result, we pass a 'false' to a get_root_value_iterator() method: + * this indicates that we allow trailing content. + */ +simdjson_inline simdjson_result document_reference::get_uint64() noexcept { return doc->get_root_value_iterator().get_root_uint64(false); } +simdjson_inline simdjson_result document_reference::get_uint64_in_string() noexcept { return doc->get_root_value_iterator().get_root_uint64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_int64() noexcept { return doc->get_root_value_iterator().get_root_int64(false); } +simdjson_inline simdjson_result document_reference::get_int64_in_string() noexcept { return doc->get_root_value_iterator().get_root_int64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_double() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_double_in_string() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_string(bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(false, allow_replacement); } +template +simdjson_inline error_code document_reference::get_string(string_type& receiver, bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(receiver, false, allow_replacement); } +simdjson_inline simdjson_result document_reference::get_wobbly_string() noexcept { return doc->get_root_value_iterator().get_root_wobbly_string(false); } +simdjson_inline simdjson_result document_reference::get_raw_json_string() noexcept { return doc->get_root_value_iterator().get_root_raw_json_string(false); } +simdjson_inline simdjson_result document_reference::get_bool() noexcept { return doc->get_root_value_iterator().get_root_bool(false); } +simdjson_inline simdjson_result document_reference::get_value() noexcept { return doc->get_value(); } +simdjson_inline simdjson_result document_reference::is_null() noexcept { return doc->get_root_value_iterator().is_root_null(false); } + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document_reference::operator array() & noexcept(false) { return array(*doc); } +simdjson_inline document_reference::operator object() & noexcept(false) { return object(*doc); } +simdjson_inline document_reference::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document_reference::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document_reference::operator double() noexcept(false) { return get_double(); } +simdjson_inline document_reference::operator std::string_view() noexcept(false) { return std::string_view(*doc); } +simdjson_inline document_reference::operator raw_json_string() noexcept(false) { return raw_json_string(*doc); } +simdjson_inline document_reference::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document_reference::operator value() noexcept(false) { return value(*doc); } +#endif +simdjson_inline simdjson_result document_reference::count_elements() & noexcept { return doc->count_elements(); } +simdjson_inline simdjson_result document_reference::count_fields() & noexcept { return doc->count_fields(); } +simdjson_inline simdjson_result document_reference::at(size_t index) & noexcept { return doc->at(index); } +simdjson_inline simdjson_result document_reference::begin() & noexcept { return doc->begin(); } +simdjson_inline simdjson_result document_reference::end() & noexcept { return doc->end(); } +simdjson_inline simdjson_result document_reference::find_field(std::string_view key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::find_field(const char *key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::operator[](std::string_view key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::operator[](const char *key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::find_field_unordered(std::string_view key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::find_field_unordered(const char *key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::type() noexcept { return doc->type(); } +simdjson_inline simdjson_result document_reference::is_scalar() noexcept { return doc->is_scalar(); } +simdjson_inline simdjson_result document_reference::current_location() noexcept { return doc->current_location(); } +simdjson_inline int32_t document_reference::current_depth() const noexcept { return doc->current_depth(); } +simdjson_inline bool document_reference::is_negative() noexcept { return doc->is_negative(); } +simdjson_inline simdjson_result document_reference::is_integer() noexcept { return doc->get_root_value_iterator().is_root_integer(false); } +simdjson_inline simdjson_result document_reference::get_number_type() noexcept { return doc->get_root_value_iterator().get_root_number_type(false); } +simdjson_inline simdjson_result document_reference::get_number() noexcept { return doc->get_root_value_iterator().get_root_number(false); } +simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } +simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } +simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} +simdjson_inline document_reference::operator document&() const noexcept { return *doc; } + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + + + +namespace simdjson { +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::document_reference value, error_code error) + noexcept : implementation_simdjson_result_base(std::forward(value), error) {} + + +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator haswell::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H +/* end file simdjson/generic/ondemand/document-inl.h for haswell */ +/* including simdjson/generic/ondemand/document_stream-inl.h for haswell: #include "simdjson/generic/ondemand/document_stream-inl.h" */ +/* begin file simdjson/generic/ondemand/document_stream-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace haswell { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void stage1_worker::finish() { + // After calling "run" someone would call finish() to wait + // for the end of the processing. + // This function will wait until either the thread has done + // the processing or, else, the destructor has been called. + std::unique_lock lock(locking_mutex); + cond_var.wait(lock, [this]{return has_work == false;}); +} + +inline stage1_worker::~stage1_worker() { + // The thread may never outlive the stage1_worker instance + // and will always be stopped/joined before the stage1_worker + // instance is gone. + stop_thread(); +} + +inline void stage1_worker::start_thread() { + std::unique_lock lock(locking_mutex); + if(thread.joinable()) { + return; // This should never happen but we never want to create more than one thread. + } + thread = std::thread([this]{ + while(true) { + std::unique_lock thread_lock(locking_mutex); + // We wait for either "run" or "stop_thread" to be called. + cond_var.wait(thread_lock, [this]{return has_work || !can_work;}); + // If, for some reason, the stop_thread() method was called (i.e., the + // destructor of stage1_worker is called, then we want to immediately destroy + // the thread (and not do any more processing). + if(!can_work) { + break; + } + this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser, + this->_next_batch_start); + this->has_work = false; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify "finish" + thread_lock.unlock(); + } + } + ); +} + + +inline void stage1_worker::stop_thread() { + std::unique_lock lock(locking_mutex); + // We have to make sure that all locks can be released. + can_work = false; + has_work = false; + cond_var.notify_all(); + lock.unlock(); + if(thread.joinable()) { + thread.join(); + } +} + +inline void stage1_worker::run(document_stream * ds, parser * stage1, size_t next_batch_start) { + std::unique_lock lock(locking_mutex); + owner = ds; + _next_batch_start = next_batch_start; + stage1_thread_parser = stage1; + has_work = true; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify the thread lock that we have work + lock.unlock(); +} + +#endif // SIMDJSON_THREADS_ENABLED + +simdjson_inline document_stream::document_stream( + ondemand::parser &_parser, + const uint8_t *_buf, + size_t _len, + size_t _batch_size, + bool _allow_comma_separated +) noexcept + : parser{&_parser}, + buf{_buf}, + len{_len}, + batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size}, + allow_comma_separated{_allow_comma_separated}, + error{SUCCESS} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change + #endif +{ +#ifdef SIMDJSON_THREADS_ENABLED + if(worker.get() == nullptr) { + error = MEMALLOC; + } +#endif +} + +simdjson_inline document_stream::document_stream() noexcept + : parser{nullptr}, + buf{nullptr}, + len{0}, + batch_size{0}, + allow_comma_separated{false}, + error{UNINITIALIZED} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(false) + #endif +{ +} + +simdjson_inline document_stream::~document_stream() noexcept +{ + #ifdef SIMDJSON_THREADS_ENABLED + worker.reset(); + #endif +} + +inline size_t document_stream::size_in_bytes() const noexcept { + return len; +} + +inline size_t document_stream::truncated_bytes() const noexcept { + if(error == CAPACITY) { return len - batch_start; } + return parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] - parser->implementation->structural_indexes[parser->implementation->n_structural_indexes + 1]; +} + +simdjson_inline document_stream::iterator::iterator() noexcept + : stream{nullptr}, finished{true} { +} + +simdjson_inline document_stream::iterator::iterator(document_stream* _stream, bool is_end) noexcept + : stream{_stream}, finished{is_end} { +} + +simdjson_inline simdjson_result document_stream::iterator::operator*() noexcept { + //if(stream->error) { return stream->error; } + return simdjson_result(stream->doc, stream->error); +} + +simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept { + // If there is an error, then we want the iterator + // to be finished, no matter what. (E.g., we do not + // keep generating documents with errors, or go beyond + // a document with errors.) + // + // Users do not have to call "operator*()" when they use operator++, + // so we need to end the stream in the operator++ function. + // + // Note that setting finished = true is essential otherwise + // we would enter an infinite loop. + if (stream->error) { finished = true; } + // Note that stream->error() is guarded against error conditions + // (it will immediately return if stream->error casts to false). + // In effect, this next function does nothing when (stream->error) + // is true (hence the risk of an infinite loop). + stream->next(); + // If that was the last document, we're finished. + // It is the only type of error we do not want to appear + // in operator*. + if (stream->error == EMPTY) { finished = true; } + // If we had any other kind of error (not EMPTY) then we want + // to pass it along to the operator* and we cannot mark the result + // as "finished" just yet. + return *this; +} + +simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept { + return finished != other.finished; +} + +simdjson_inline document_stream::iterator document_stream::begin() noexcept { + start(); + // If there are no documents, we're finished. + return iterator(this, error == EMPTY); +} + +simdjson_inline document_stream::iterator document_stream::end() noexcept { + return iterator(this, true); +} + +inline void document_stream::start() noexcept { + if (error) { return; } + error = parser->allocate(batch_size); + if (error) { return; } + // Always run the first stage 1 parse immediately + batch_start = 0; + error = run_stage1(*parser, batch_start); + while(error == EMPTY) { + // In exceptional cases, we may start with an empty block + batch_start = next_batch_start(); + if (batch_start >= len) { return; } + error = run_stage1(*parser, batch_start); + } + if (error) { return; } + doc_index = batch_start; + doc = document(json_iterator(&buf[batch_start], parser)); + doc.iter._streaming = true; + + #ifdef SIMDJSON_THREADS_ENABLED + if (use_thread && next_batch_start() < len) { + // Kick off the first thread on next batch if needed + error = stage1_thread_parser.allocate(batch_size); + if (error) { return; } + worker->start_thread(); + start_stage1_thread(); + if (error) { return; } + } + #endif // SIMDJSON_THREADS_ENABLED +} + +inline void document_stream::next() noexcept { + // We always enter at once once in an error condition. + if (error) { return; } + next_document(); + if (error) { return; } + auto cur_struct_index = doc.iter._root - parser->implementation->structural_indexes.get(); + doc_index = batch_start + parser->implementation->structural_indexes[cur_struct_index]; + + // Check if at end of structural indexes (i.e. at end of batch) + if(cur_struct_index >= static_cast(parser->implementation->n_structural_indexes)) { + error = EMPTY; + // Load another batch (if available) + while (error == EMPTY) { + batch_start = next_batch_start(); + if (batch_start >= len) { break; } + #ifdef SIMDJSON_THREADS_ENABLED + if(use_thread) { + load_from_stage1_thread(); + } else { + error = run_stage1(*parser, batch_start); + } + #else + error = run_stage1(*parser, batch_start); + #endif + /** + * Whenever we move to another window, we need to update all pointers to make + * it appear as if the input buffer started at the beginning of the window. + * + * Take this input: + * + * {"z":5} {"1":1,"2":2,"4":4} [7, 10, 9] [15, 11, 12, 13] [154, 110, 112, 1311] + * + * Say you process the following window... + * + * '{"z":5} {"1":1,"2":2,"4":4} [7, 10, 9]' + * + * When you do so, the json_iterator has a pointer at the beginning of the memory region + * (pointing at the beginning of '{"z"...'. + * + * When you move to the window that starts at... + * + * '[7, 10, 9] [15, 11, 12, 13] ... + * + * then it is not sufficient to just run stage 1. You also need to re-anchor the + * json_iterator so that it believes we are starting at '[7, 10, 9]...'. + * + * Under the DOM front-end, this gets done automatically because the parser owns + * the pointer the data, and when you call stage1 and then stage2 on the same + * parser, then stage2 will run on the pointer acquired by stage1. + * + * That is, stage1 calls "this->buf = _buf" so the parser remembers the buffer that + * we used. But json_iterator has no callback when stage1 is called on the parser. + * In fact, I think that the parser is unaware of json_iterator. + * + * + * So we need to re-anchor the json_iterator after each call to stage 1 so that + * all of the pointers are in sync. + */ + doc.iter = json_iterator(&buf[batch_start], parser); + doc.iter._streaming = true; + /** + * End of resync. + */ + + if (error) { continue; } // If the error was EMPTY, we may want to load another batch. + doc_index = batch_start; + } + } +} + +inline void document_stream::next_document() noexcept { + // Go to next place where depth=0 (document depth) + error = doc.iter.skip_child(0); + if (error) { return; } + // Always set depth=1 at the start of document + doc.iter._depth = 1; + // consume comma if comma separated is allowed + if (allow_comma_separated) { doc.iter.consume_character(','); } + // Resets the string buffer at the beginning, thus invalidating the strings. + doc.iter._string_buf_loc = parser->string_buf.get(); + doc.iter._root = doc.iter.position(); +} + +inline size_t document_stream::next_batch_start() const noexcept { + return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes]; +} + +inline error_code document_stream::run_stage1(ondemand::parser &p, size_t _batch_start) noexcept { + // This code only updates the structural index in the parser, it does not update any json_iterator + // instance. + size_t remaining = len - _batch_start; + if (remaining <= batch_size) { + return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final); + } else { + return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial); + } +} + +simdjson_inline size_t document_stream::iterator::current_index() const noexcept { + return stream->doc_index; +} + +simdjson_inline std::string_view document_stream::iterator::source() const noexcept { + auto depth = stream->doc.iter.depth(); + auto cur_struct_index = stream->doc.iter._root - stream->parser->implementation->structural_indexes.get(); + + // If at root, process the first token to determine if scalar value + if (stream->doc.iter.at_root()) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': // Depth=1 already at start of document + break; + case '}': case ']': + depth--; + break; + default: // Scalar value document + // TODO: Remove any trailing whitespaces + // This returns a string spanning from start of value to the beginning of the next document (excluded) + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[++cur_struct_index] - current_index() - 1); + } + cur_struct_index++; + } + + while (cur_struct_index <= static_cast(stream->parser->implementation->n_structural_indexes)) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': + depth++; + break; + case '}': case ']': + depth--; + break; + } + if (depth == 0) { break; } + cur_struct_index++; + } + + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[cur_struct_index] - current_index() + stream->batch_start + 1);; +} + +inline error_code document_stream::iterator::error() const noexcept { + return stream->error; +} + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void document_stream::load_from_stage1_thread() noexcept { + worker->finish(); + // Swap to the parser that was loaded up in the thread. Make sure the parser has + // enough memory to swap to, as well. + std::swap(stage1_thread_parser,*parser); + error = stage1_thread_error; + if (error) { return; } + + // If there's anything left, start the stage 1 thread! + if (next_batch_start() < len) { + start_stage1_thread(); + } +} + +inline void document_stream::start_stage1_thread() noexcept { + // we call the thread on a lambda that will update + // this->stage1_thread_error + // there is only one thread that may write to this value + // TODO this is NOT exception-safe. + this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error + size_t _next_batch_start = this->next_batch_start(); + + worker->run(this, & this->stage1_thread_parser, _next_batch_start); +} + +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result::simdjson_result( + haswell::ondemand::document_stream &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} + +} + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H +/* end file simdjson/generic/ondemand/document_stream-inl.h for haswell */ +/* including simdjson/generic/ondemand/field-inl.h for haswell: #include "simdjson/generic/ondemand/field-inl.h" */ +/* begin file simdjson/generic/ondemand/field-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +// clang 6 doesn't think the default constructor can be noexcept, so we make it explicit +simdjson_inline field::field() noexcept : std::pair() {} + +simdjson_inline field::field(raw_json_string key, ondemand::value &&value) noexcept + : std::pair(key, std::forward(value)) +{ +} + +simdjson_inline simdjson_result field::start(value_iterator &parent_iter) noexcept { + raw_json_string key; + SIMDJSON_TRY( parent_iter.field_key().get(key) ); + SIMDJSON_TRY( parent_iter.field_value() ); + return field::start(parent_iter, key); +} + +simdjson_inline simdjson_result field::start(const value_iterator &parent_iter, raw_json_string key) noexcept { + return field(key, parent_iter.child()); +} + +simdjson_inline simdjson_warn_unused simdjson_result field::unescaped_key(bool allow_replacement) noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() but Visual Studio won't let us. + simdjson_result answer = first.unescape(second.iter.json_iter(), allow_replacement); + first.consume(); + return answer; +} + +simdjson_inline raw_json_string field::key() const noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() by Visual Studio won't let us. + return first; +} + +simdjson_inline value &field::value() & noexcept { + return second; +} + +simdjson_inline value field::value() && noexcept { + return std::forward(*this).second; +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + haswell::ondemand::field &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::key() noexcept { + if (error()) { return error(); } + return first.key(); +} +simdjson_inline simdjson_result simdjson_result::unescaped_key(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.unescaped_key(allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::value() noexcept { + if (error()) { return error(); } + return std::move(first.value()); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H +/* end file simdjson/generic/ondemand/field-inl.h for haswell */ +/* including simdjson/generic/ondemand/json_iterator-inl.h for haswell: #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/json_iterator-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline json_iterator::json_iterator(json_iterator &&other) noexcept + : token(std::forward(other.token)), + parser{other.parser}, + _string_buf_loc{other._string_buf_loc}, + error{other.error}, + _depth{other._depth}, + _root{other._root}, + _streaming{other._streaming} +{ + other.parser = nullptr; +} +simdjson_inline json_iterator &json_iterator::operator=(json_iterator &&other) noexcept { + token = other.token; + parser = other.parser; + _string_buf_loc = other._string_buf_loc; + error = other.error; + _depth = other._depth; + _root = other._root; + _streaming = other._streaming; + other.parser = nullptr; + return *this; +} + +simdjson_inline json_iterator::json_iterator(const uint8_t *buf, ondemand::parser *_parser) noexcept + : token(buf, &_parser->implementation->structural_indexes[0]), + parser{_parser}, + _string_buf_loc{parser->string_buf.get()}, + _depth{1}, + _root{parser->implementation->structural_indexes.get()}, + _streaming{false} + +{ + logger::log_headers(); +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif +} + +inline void json_iterator::rewind() noexcept { + token.set_position( root_position() ); + logger::log_headers(); // We start again + _string_buf_loc = parser->string_buf.get(); + _depth = 1; +} + +inline bool json_iterator::balanced() const noexcept { + token_iterator ti(token); + int32_t count{0}; + ti.set_position( root_position() ); + while(ti.peek() <= peek_last()) { + switch (*ti.return_current_and_advance()) + { + case '[': case '{': + count++; + break; + case ']': case '}': + count--; + break; + default: + break; + } + } + return count == 0; +} + + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and parent_depth, which is a desired effect. The warning does not show up if the +// skip_child() function is not marked inline). +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept { + if (depth() <= parent_depth) { return SUCCESS; } + switch (*return_current_and_advance()) { + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + + // For the first open array/object in a value, we've already incremented depth, so keep it the same + // We never stop at colon, but if we did, it wouldn't affect depth + case '[': case '{': case ':': + logger::log_start_value(*this, "skip"); + break; + // If there is a comma, we have just finished a value in an array/object, and need to get back in + case ',': + logger::log_value(*this, "skip"); + break; + // ] or } means we just finished a value and need to jump out of the array/object + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } +#if SIMDJSON_CHECK_EOF + // If there are no more tokens, the parent is incomplete. + if (at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "Missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + break; + case '"': + if(*peek() == ':') { + // We are at a key!!! + // This might happen if you just started an object and you skip it immediately. + // Performance note: it would be nice to get rid of this check as it is somewhat + // expensive. + // https://github.com/simdjson/simdjson/issues/1742 + logger::log_value(*this, "key"); + return_current_and_advance(); // eat up the ':' + break; // important!!! + } + simdjson_fallthrough; + // Anything else must be a scalar value + default: + // For the first scalar, we will have incremented depth already, so we decrement it here. + logger::log_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + } + + // Now that we've considered the first value, we only increment/decrement for arrays/objects + while (position() < end_position()) { + switch (*return_current_and_advance()) { + case '[': case '{': + logger::log_start_value(*this, "skip"); + _depth++; + break; + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + default: + logger::log_value(*this, "skip", ""); + break; + } + } + + return report_error(TAPE_ERROR, "not enough close braces"); +} + +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool json_iterator::at_root() const noexcept { + return position() == root_position(); +} + +simdjson_inline bool json_iterator::is_single_token() const noexcept { + return parser->implementation->n_structural_indexes == 1; +} + +simdjson_inline bool json_iterator::streaming() const noexcept { + return _streaming; +} + +simdjson_inline token_position json_iterator::root_position() const noexcept { + return _root; +} + +simdjson_inline void json_iterator::assert_at_document_depth() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +} + +simdjson_inline void json_iterator::assert_at_root() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + // Under Visual Studio, the next SIMDJSON_ASSUME fails with: the argument + // has side effects that will be discarded. + SIMDJSON_ASSUME( token.position() == _root ); +#endif +} + +simdjson_inline void json_iterator::assert_more_tokens(uint32_t required_tokens) const noexcept { + assert_valid_position(token._position + required_tokens - 1); +} + +simdjson_inline void json_iterator::assert_valid_position(token_position position) const noexcept { +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME( position >= &parser->implementation->structural_indexes[0] ); + SIMDJSON_ASSUME( position < &parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] ); +#endif +} + +simdjson_inline bool json_iterator::at_end() const noexcept { + return position() == end_position(); +} +simdjson_inline token_position json_iterator::end_position() const noexcept { + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + return &parser->implementation->structural_indexes[n_structural_indexes]; +} + +inline std::string json_iterator::to_string() const noexcept { + if( !is_alive() ) { return "dead json_iterator instance"; } + const char * current_structural = reinterpret_cast(token.peek()); + return std::string("json_iterator [ depth : ") + std::to_string(_depth) + + std::string(", structural : '") + std::string(current_structural,1) + + std::string("', offset : ") + std::to_string(token.current_offset()) + + std::string("', error : ") + error_message(error) + + std::string(" ]"); +} + +inline simdjson_result json_iterator::current_location() const noexcept { + if (!is_alive()) { // Unrecoverable error + if (!at_root()) { + return reinterpret_cast(token.peek(-1)); + } else { + return reinterpret_cast(token.peek()); + } + } + if (at_end()) { + return OUT_OF_BOUNDS; + } + return reinterpret_cast(token.peek()); +} + +simdjson_inline bool json_iterator::is_alive() const noexcept { + return parser; +} + +simdjson_inline void json_iterator::abandon() noexcept { + parser = nullptr; + _depth = 0; +} + +simdjson_inline const uint8_t *json_iterator::return_current_and_advance() noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif // SIMDJSON_CHECK_EOF + return token.return_current_and_advance(); +} + +simdjson_inline const uint8_t *json_iterator::unsafe_pointer() const noexcept { + // deliberately done without safety guard: + return token.peek(); +} + +simdjson_inline const uint8_t *json_iterator::peek(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // SIMDJSON_CHECK_EOF + return token.peek(delta); +} + +simdjson_inline uint32_t json_iterator::peek_length(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // #if SIMDJSON_CHECK_EOF + return token.peek_length(delta); +} + +simdjson_inline const uint8_t *json_iterator::peek(token_position position) const noexcept { + // todo: currently we require end-of-string buffering, but the following + // assert_valid_position should be turned on if/when we lift that condition. + // assert_valid_position(position); + // This is almost surely related to SIMDJSON_CHECK_EOF but given that SIMDJSON_CHECK_EOF + // is ON by default, we have no choice but to disable it for real with a comment. + return token.peek(position); +} + +simdjson_inline uint32_t json_iterator::peek_length(token_position position) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_valid_position(position); +#endif // SIMDJSON_CHECK_EOF + return token.peek_length(position); +} + +simdjson_inline token_position json_iterator::last_position() const noexcept { + // The following line fails under some compilers... + // SIMDJSON_ASSUME(parser->implementation->n_structural_indexes > 0); + // since it has side-effects. + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + SIMDJSON_ASSUME(n_structural_indexes > 0); + return &parser->implementation->structural_indexes[n_structural_indexes - 1]; +} +simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept { + return token.peek(last_position()); +} + +simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept { + SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1); + SIMDJSON_ASSUME(_depth == parent_depth + 1); + _depth = parent_depth; +} + +simdjson_inline void json_iterator::descend_to(depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); + _depth = child_depth; +} + +simdjson_inline depth_t json_iterator::depth() const noexcept { + return _depth; +} + +simdjson_inline uint8_t *&json_iterator::string_buf_loc() noexcept { + return _string_buf_loc; +} + +simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD); + logger::log_error(*this, message); + error = _error; + return error; +} + +simdjson_inline token_position json_iterator::position() const noexcept { + return token.position(); +} + +simdjson_inline simdjson_result json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept { + return parser->unescape(in, _string_buf_loc, allow_replacement); +} + +simdjson_inline simdjson_result json_iterator::unescape_wobbly(raw_json_string in) noexcept { + return parser->unescape_wobbly(in, _string_buf_loc); +} + +simdjson_inline void json_iterator::reenter_child(token_position position, depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); +#if SIMDJSON_DEVELOPMENT_CHECKS +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME(size_t(child_depth) < parser->max_depth()); + SIMDJSON_ASSUME(position >= parser->start_positions[child_depth]); +#endif +#endif + token.set_position(position); + _depth = child_depth; +} + +simdjson_inline error_code json_iterator::consume_character(char c) noexcept { + if (*peek() == c) { + return_current_and_advance(); + return SUCCESS; + } + return TAPE_ERROR; +} + +#if SIMDJSON_DEVELOPMENT_CHECKS + +simdjson_inline token_position json_iterator::start_position(depth_t depth) const noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + return size_t(depth) < parser->max_depth() ? parser->start_positions[depth] : 0; +} + +simdjson_inline void json_iterator::set_start_position(depth_t depth, token_position position) noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + if(size_t(depth) < parser->max_depth()) { parser->start_positions[depth] = position; } +} + +#endif + + +simdjson_inline error_code json_iterator::optional_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error == INCORRECT_TYPE || _error == NO_SUCH_FIELD); + logger::log_error(*this, message); + return _error; +} + + +simdjson_warn_unused simdjson_inline bool json_iterator::copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept { + // This function is not expected to be called in performance-sensitive settings. + // Let us guard against silly cases: + if((N < max_len) || (N == 0)) { return false; } + // Copy to the buffer. + std::memcpy(tmpbuf, json, max_len); + if(N > max_len) { // We pad whatever remains with ' '. + std::memset(tmpbuf + max_len, ' ', N - max_len); + } + return true; +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::json_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/json_iterator-inl.h for haswell */ +/* including simdjson/generic/ondemand/json_type-inl.h for haswell: #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* begin file simdjson/generic/ondemand/json_type-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept { + switch (type) { + case json_type::array: out << "array"; break; + case json_type::object: out << "object"; break; + case json_type::number: out << "number"; break; + case json_type::string: out << "string"; break; + case json_type::boolean: out << "boolean"; break; + case json_type::null: out << "null"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false) { + return out << type.value(); +} +#endif + + + +simdjson_inline number_type number::get_number_type() const noexcept { + return type; +} + +simdjson_inline bool number::is_uint64() const noexcept { + return get_number_type() == number_type::unsigned_integer; +} + +simdjson_inline uint64_t number::get_uint64() const noexcept { + return payload.unsigned_integer; +} + +simdjson_inline number::operator uint64_t() const noexcept { + return get_uint64(); +} + + +simdjson_inline bool number::is_int64() const noexcept { + return get_number_type() == number_type::signed_integer; +} + +simdjson_inline int64_t number::get_int64() const noexcept { + return payload.signed_integer; +} + +simdjson_inline number::operator int64_t() const noexcept { + return get_int64(); +} + +simdjson_inline bool number::is_double() const noexcept { + return get_number_type() == number_type::floating_point_number; +} + +simdjson_inline double number::get_double() const noexcept { + return payload.floating_point_number; +} + +simdjson_inline number::operator double() const noexcept { + return get_double(); +} + +simdjson_inline double number::as_double() const noexcept { + if(is_double()) { + return payload.floating_point_number; + } + if(is_int64()) { + return double(payload.signed_integer); + } + return double(payload.unsigned_integer); +} + +simdjson_inline void number::append_s64(int64_t value) noexcept { + payload.signed_integer = value; + type = number_type::signed_integer; +} + +simdjson_inline void number::append_u64(uint64_t value) noexcept { + payload.unsigned_integer = value; + type = number_type::unsigned_integer; +} + +simdjson_inline void number::append_double(double value) noexcept { + payload.floating_point_number = value; + type = number_type::floating_point_number; +} + +simdjson_inline void number::skip_double() noexcept { + type = number_type::floating_point_number; +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::json_type &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H +/* end file simdjson/generic/ondemand/json_type-inl.h for haswell */ +/* including simdjson/generic/ondemand/logger-inl.h for haswell: #include "simdjson/generic/ondemand/logger-inl.h" */ +/* begin file simdjson/generic/ondemand/logger-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace haswell { +namespace ondemand { +namespace logger { + +static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; +static constexpr const int LOG_EVENT_LEN = 20; +static constexpr const int LOG_BUFFER_LEN = 30; +static constexpr const int LOG_SMALL_BUFFER_LEN = 10; +static int log_depth = 0; // Not threadsafe. Log only. + +// Helper to turn unprintable or newline characters into spaces +static inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } +} + +template +static inline std::string string_format(const std::string& format, const Args&... args) +{ + SIMDJSON_PUSH_DISABLE_ALL_WARNINGS + int size_s = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; + auto size = static_cast(size_s); + if (size <= 0) return std::string(); + std::unique_ptr buf(new char[size]); + std::snprintf(buf.get(), size, format.c_str(), args...); + SIMDJSON_POP_DISABLE_WARNINGS + return std::string(buf.get(), buf.get() + size - 1); +} + +static inline log_level get_log_level_from_env() +{ + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + char *lvl = getenv("SIMDJSON_LOG_LEVEL"); + SIMDJSON_POP_DISABLE_WARNINGS + if (lvl && simdjson_strcasecmp(lvl, "ERROR") == 0) { return log_level::error; } + return log_level::info; +} + +static inline log_level log_threshold() +{ + static log_level threshold = get_log_level_from_env(); + return threshold; +} + +static inline bool should_log(log_level level) +{ + return level >= log_threshold(); +} + +inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "", type, detail, log_level::info); +} +inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "+", type, detail, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} +inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_line(iter, "+", type, "", delta, depth_delta, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} + +inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + if (LOG_ENABLED) { log_depth--; } + log_line(iter, "-", type, "", delta, depth_delta, log_level::info); +} + +inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_line(iter, "ERROR: ", error, detail, delta, depth_delta, log_level::error); +} +inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept { + log_line(iter, index, depth, "ERROR: ", error, detail, log_level::error); +} + +inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_event(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_value(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_value(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_start_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_start_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_end_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_end_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_error(const value_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_error(iter.json_iter(), error, detail, delta, depth_delta); +} + +inline void log_headers() noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(log_level::info))) { + // Technically a static variable is not thread-safe, but if you are using threads and logging... well... + static bool displayed_hint{false}; + log_depth = 0; + printf("\n"); + if (!displayed_hint) { + // We only print this helpful header once. + printf("# Logging provides the depth and position of the iterator user-visible steps:\n"); + printf("# +array says 'this is where we were when we discovered the start array'\n"); + printf( + "# -array says 'this is where we were when we ended the array'\n"); + printf("# skip says 'this is a structural or value I am skipping'\n"); + printf("# +/-skip says 'this is a start/end array or object I am skipping'\n"); + printf("#\n"); + printf("# The indentation of the terms (array, string,...) indicates the depth,\n"); + printf("# in addition to the depth being displayed.\n"); + printf("#\n"); + printf("# Every token in the document has a single depth determined by the tokens before it,\n"); + printf("# and is not affected by what the token actually is.\n"); + printf("#\n"); + printf("# Not all structural elements are presented as tokens in the logs.\n"); + printf("#\n"); + printf("# We never give control to the user within an empty array or an empty object.\n"); + printf("#\n"); + printf("# Inside an array, having a depth greater than the array's depth means that\n"); + printf("# we are pointing inside a value.\n"); + printf("# Having a depth equal to the array means that we are pointing right before a value.\n"); + printf("# Having a depth smaller than the array means that we have moved beyond the array.\n"); + displayed_hint = true; + } + printf("\n"); + printf("| %-*s ", LOG_EVENT_LEN, "Event"); + printf("| %-*s ", LOG_BUFFER_LEN, "Buffer"); + printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next"); + // printf("| %-*s ", 5, "Next#"); + printf("| %-*s ", 5, "Depth"); + printf("| Detail "); + printf("|\n"); + + printf("|%.*s", LOG_EVENT_LEN + 2, DASHES); + printf("|%.*s", LOG_BUFFER_LEN + 2, DASHES); + printf("|%.*s", LOG_SMALL_BUFFER_LEN + 2, DASHES); + // printf("|%.*s", 5+2, DASHES); + printf("|%.*s", 5 + 2, DASHES); + printf("|--------"); + printf("|\n"); + fflush(stdout); + } + } +} + +template +inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, log_level level, Args&&... args) noexcept { + log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail, level, std::forward(args)...); +} + +template +inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, log_level level, Args&&... args) noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(level))) { + const int indent = depth * 2; + const auto buf = iter.token.buf; + auto msg = string_format(title, std::forward(args)...); + printf("| %*s%s%-*s ", indent, "", title_prefix, + LOG_EVENT_LEN - indent - int(strlen(title_prefix)), msg.c_str()); + { + // Print the current structural. + printf("| "); + // Before we begin, the index might point right before the document. + // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938 + if (index < iter._root) { + printf("%*s", LOG_BUFFER_LEN, ""); + } else { + auto current_structural = &buf[*index]; + for (int i = 0; i < LOG_BUFFER_LEN; i++) { + printf("%c", printable_char(current_structural[i])); + } + } + printf(" "); + } + { + // Print the next structural. + printf("| "); + auto next_structural = &buf[*(index + 1)]; + for (int i = 0; i < LOG_SMALL_BUFFER_LEN; i++) { + printf("%c", printable_char(next_structural[i])); + } + printf(" "); + } + // printf("| %5u ", *(index+1)); + printf("| %5i ", depth); + printf("| %6.*s ", int(detail.size()), detail.data()); + printf("|\n"); + fflush(stdout); + } + } +} + +} // namespace logger +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H +/* end file simdjson/generic/ondemand/logger-inl.h for haswell */ +/* including simdjson/generic/ondemand/object-inl.h for haswell: #include "simdjson/generic/ondemand/object-inl.h" */ +/* begin file simdjson/generic/ondemand/object-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) & noexcept { + return find_field_unordered(key); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) && noexcept { + return std::forward(*this).find_field_unordered(key); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} + +simdjson_inline simdjson_result object::start(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_object().error() ); + return object(iter); +} +simdjson_inline simdjson_result object::start_root(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_root_object().error() ); + return object(iter); +} +simdjson_inline error_code object::consume() noexcept { + if(iter.is_at_key()) { + /** + * whenever you are pointing at a key, calling skip_child() is + * unsafe because you will hit a string and you will assume that + * it is string value, and this mistake will lead you to make bad + * depth computation. + */ + /** + * We want to 'consume' the key. We could really + * just do _json_iter->return_current_and_advance(); at this + * point, but, for clarity, we will use the high-level API to + * eat the key. We assume that the compiler optimizes away + * most of the work. + */ + simdjson_unused raw_json_string actual_key; + auto error = iter.field_key().get(actual_key); + if (error) { iter.abandon(); return error; }; + // Let us move to the value while we are at it. + if ((error = iter.field_value())) { iter.abandon(); return error; } + } + auto error_skip = iter.json_iter().skip_child(iter.depth()-1); + if(error_skip) { iter.abandon(); } + return error_skip; +} + +simdjson_inline simdjson_result object::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + const uint8_t * final_point{iter._json_iter->peek()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result object::started(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.started_object().error() ); + return object(iter); +} + +simdjson_inline object object::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline object::object(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result object::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return object_iterator(iter); +} +simdjson_inline simdjson_result object::end() noexcept { + return object_iterator(iter); +} + +inline simdjson_result object::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + size_t slash = json_pointer.find('/'); + std::string_view key = json_pointer.substr(0, slash); + // Grab the child with the given key + simdjson_result child; + + // If there is an escape character in the key, unescape it and then get the child. + size_t escape = key.find('~'); + if (escape != std::string_view::npos) { + // Unescape the key + std::string unescaped(key); + do { + switch (unescaped[escape+1]) { + case '0': + unescaped.replace(escape, 2, "~"); + break; + case '1': + unescaped.replace(escape, 2, "/"); + break; + default: + return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer"); + } + escape = unescaped.find('~', escape+1); + } while (escape != std::string::npos); + child = find_field(unescaped); // Take note find_field does not unescape keys when matching + } else { + child = find_field(key); + } + if(child.error()) { + return child; // we do not continue if there was an error + } + // If there is a /, we have to recurse and look up more of the path + if (slash != std::string_view::npos) { + child = child.at_pointer(json_pointer.substr(slash)); + } + return child; +} + +simdjson_inline simdjson_result object::count_fields() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the object after counting the number of elements. + iter.reset_object(); + return count; +} + +simdjson_inline simdjson_result object::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_object().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +simdjson_inline simdjson_result object::reset() & noexcept { + return iter.reset_object(); +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::object &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first)[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +inline simdjson_result simdjson_result::reset() noexcept { + if (error()) { return error(); } + return first.reset(); +} + +inline simdjson_result simdjson_result::is_empty() noexcept { + if (error()) { return error(); } + return first.is_empty(); +} + +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H +/* end file simdjson/generic/ondemand/object-inl.h for haswell */ +/* including simdjson/generic/ondemand/object_iterator-inl.h for haswell: #include "simdjson/generic/ondemand/object_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/object_iterator-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +// +// object_iterator +// + +simdjson_inline object_iterator::object_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result object_iterator::operator*() noexcept { + error_code error = iter.error(); + if (error) { iter.abandon(); return error; } + auto result = field::start(iter); + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (result.error()) { iter.abandon(); } + return result; +} +simdjson_inline bool object_iterator::operator==(const object_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool object_iterator::operator!=(const object_iterator &) const noexcept { + return iter.is_open(); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline object_iterator &object_iterator::operator++() noexcept { + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (!iter.is_open()) { return *this; } // Iterator will be released if there is an error + + simdjson_unused error_code error; + if ((error = iter.skip_child() )) { return *this; } + + simdjson_unused bool has_value; + if ((error = iter.has_next_field().get(has_value) )) { return *this; }; + return *this; +} +SIMDJSON_POP_DISABLE_WARNINGS + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter.depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the object is first found and the iterator is just past the {. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the , or } before the next value. In this state, +// depth == iter.depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter.depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter.depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the object iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet field may be missing or not be an +// object--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter.depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between fields, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter.depth == depth, and at_start == false. +// +// Errors that occur while reading a field to give to the user (such as when the key is not a +// string or the field is missing a colon) are yielded immediately. Depth is then decremented, +// moving to the Finished state without transitioning through an Error state at all. +// +// ## Terminal State +// +// The terminal state has iter.depth < depth. at_start is always false. +// +// - Finished: When we have reached a }, we are finished. We signal this by decrementing depth. +// In this state, iter.depth < depth, at_start == false, and error == SUCCESS. +// + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + haswell::ondemand::object_iterator &&value +) noexcept + : implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +// Checks for ']' and ',' +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++first; + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/object_iterator-inl.h for haswell */ +/* including simdjson/generic/ondemand/parser-inl.h for haswell: #include "simdjson/generic/ondemand/parser-inl.h" */ +/* begin file simdjson/generic/ondemand/parser-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string_view.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/dom/base.h" // for MINIMAL_DOCUMENT_CAPACITY */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline parser::parser(size_t max_capacity) noexcept + : _max_capacity{max_capacity} { +} + +simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept { + if (new_capacity > max_capacity()) { return CAPACITY; } + if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; } + + // string_capacity copied from document::allocate + _capacity = 0; + size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * new_capacity / 3 + SIMDJSON_PADDING, 64); + string_buf.reset(new (std::nothrow) uint8_t[string_capacity]); +#if SIMDJSON_DEVELOPMENT_CHECKS + start_positions.reset(new (std::nothrow) token_position[new_max_depth]); +#endif + if (implementation) { + SIMDJSON_TRY( implementation->set_capacity(new_capacity) ); + SIMDJSON_TRY( implementation->set_max_depth(new_max_depth) ); + } else { + SIMDJSON_TRY( simdjson::get_active_implementation()->create_dom_parser_implementation(new_capacity, new_max_depth, implementation) ); + } + _capacity = new_capacity; + _max_depth = new_max_depth; + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length() || !string_buf) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return document::start({ reinterpret_cast(json.data()), this }); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const char *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const uint8_t *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string_view json, size_t allocated) & noexcept { + return iterate(padded_string_view(json, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string &json) & noexcept { + if(json.capacity() - json.size() < SIMDJSON_PADDING) { + json.reserve(json.size() + SIMDJSON_PADDING); + } + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const std::string &json) & noexcept { + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + padded_string_view json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + const padded_string &json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate_raw(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length()) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return json_iterator(reinterpret_cast(json.data()), this); +} + +inline simdjson_result parser::iterate_many(const uint8_t *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + if(allow_comma_separated && batch_size < len) { batch_size = len; } + return document_stream(*this, buf, len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const char *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(reinterpret_cast(buf), len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const std::string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const padded_string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} + +simdjson_inline size_t parser::capacity() const noexcept { + return _capacity; +} +simdjson_inline size_t parser::max_capacity() const noexcept { + return _max_capacity; +} +simdjson_inline size_t parser::max_depth() const noexcept { + return _max_depth; +} + +simdjson_inline void parser::set_max_capacity(size_t max_capacity) noexcept { + if(max_capacity < dom::MINIMAL_DOCUMENT_CAPACITY) { + _max_capacity = max_capacity; + } else { + _max_capacity = dom::MINIMAL_DOCUMENT_CAPACITY; + } +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement) const noexcept { + uint8_t *end = implementation->parse_string(in.buf, dst, allow_replacement); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept { + uint8_t *end = implementation->parse_wobbly_string(in.buf, dst); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::parser &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H +/* end file simdjson/generic/ondemand/parser-inl.h for haswell */ +/* including simdjson/generic/ondemand/raw_json_string-inl.h for haswell: #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +namespace haswell { +namespace ondemand { + +simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {} + +simdjson_inline const char * raw_json_string::raw() const noexcept { return reinterpret_cast(buf); } + + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;pos < target.size() && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;pos < target.size();pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;target[pos] && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;target[pos];pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string_view target) const noexcept { + // If we are going to call memcmp, then we must know something about the length of the raw_json_string. + return (length >= target.size()) && (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); +} + +simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + if(target.size() <= SIMDJSON_PADDING) { + return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); + } + const char * r{raw()}; + size_t pos{0}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(std::string_view target) const noexcept { + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(const char * target) const noexcept { + // Assumptions: 'target' does not contain unescaped quote characters, is null terminated and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(const char* target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept { + return a.unsafe_is_equal(c); +} + +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept { + return a == c; +} + +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept { + return !(a == c); +} + +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept { + return !(a == c); +} + + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept { + return iter.unescape(*this, allow_replacement); +} + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape_wobbly(json_iterator &iter) const noexcept { + return iter.unescape_wobbly(*this); +} + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &out, const raw_json_string &str) noexcept { + bool in_escape = false; + const char *s = str.raw(); + while (true) { + switch (*s) { + case '\\': in_escape = !in_escape; break; + case '"': if (in_escape) { in_escape = false; } else { return out; } break; + default: if (in_escape) { in_escape = false; } + } + out << *s; + s++; + } +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::raw_json_string &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::raw() const noexcept { + if (error()) { return error(); } + return first.raw(); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape(haswell::ondemand::json_iterator &iter, bool allow_replacement) const noexcept { + if (error()) { return error(); } + return first.unescape(iter, allow_replacement); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape_wobbly(haswell::ondemand::json_iterator &iter) const noexcept { + if (error()) { return error(); } + return first.unescape_wobbly(iter); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H +/* end file simdjson/generic/ondemand/raw_json_string-inl.h for haswell */ +/* including simdjson/generic/ondemand/serialization-inl.h for haswell: #include "simdjson/generic/ondemand/serialization-inl.h" */ +/* begin file simdjson/generic/ondemand/serialization-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/serialization.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +inline std::string_view trim(const std::string_view str) noexcept { + // We can almost surely do better by rolling our own find_first_not_of function. + size_t first = str.find_first_not_of(" \t\n\r"); + // If we have the empty string (just white space), then no trimming is possible, and + // we return the empty string_view. + if (std::string_view::npos == first) { return std::string_view(); } + size_t last = str.find_last_not_of(" \t\n\r"); + return str.substr(first, (last - first + 1)); +} + + +inline simdjson_result to_json_string(haswell::ondemand::document& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(haswell::ondemand::document_reference& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(haswell::ondemand::value& x) noexcept { + /** + * If we somehow receive a value that has already been consumed, + * then the following code could be in trouble. E.g., we create + * an array as needed, but if an array was already created, then + * it could be bad. + */ + using namespace haswell::ondemand; + haswell::ondemand::json_type t; + auto error = x.type().get(t); + if(error != SUCCESS) { return error; } + switch (t) + { + case json_type::array: + { + haswell::ondemand::array array; + error = x.get_array().get(array); + if(error) { return error; } + return to_json_string(array); + } + case json_type::object: + { + haswell::ondemand::object object; + error = x.get_object().get(object); + if(error) { return error; } + return to_json_string(object); + } + default: + return trim(x.raw_json_token()); + } +} + +inline simdjson_result to_json_string(haswell::ondemand::object& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(haswell::ondemand::array& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} +} // namespace simdjson + +namespace simdjson { namespace haswell { namespace ondemand { + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::document_reference& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::haswell::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif +}}} // namespace simdjson::haswell::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H +/* end file simdjson/generic/ondemand/serialization-inl.h for haswell */ +/* including simdjson/generic/ondemand/token_iterator-inl.h for haswell: #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/token_iterator-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline token_iterator::token_iterator( + const uint8_t *_buf, + token_position position +) noexcept : buf{_buf}, _position{position} +{ +} + +simdjson_inline uint32_t token_iterator::current_offset() const noexcept { + return *(_position); +} + + +simdjson_inline const uint8_t *token_iterator::return_current_and_advance() noexcept { + return &buf[*(_position++)]; +} + +simdjson_inline const uint8_t *token_iterator::peek(token_position position) const noexcept { + return &buf[*position]; +} +simdjson_inline uint32_t token_iterator::peek_index(token_position position) const noexcept { + return *position; +} +simdjson_inline uint32_t token_iterator::peek_length(token_position position) const noexcept { + return *(position+1) - *position; +} + +simdjson_inline const uint8_t *token_iterator::peek(int32_t delta) const noexcept { + return &buf[*(_position+delta)]; +} +simdjson_inline uint32_t token_iterator::peek_index(int32_t delta) const noexcept { + return *(_position+delta); +} +simdjson_inline uint32_t token_iterator::peek_length(int32_t delta) const noexcept { + return *(_position+delta+1) - *(_position+delta); +} + +simdjson_inline token_position token_iterator::position() const noexcept { + return _position; +} +simdjson_inline void token_iterator::set_position(token_position target_position) noexcept { + _position = target_position; +} + +simdjson_inline bool token_iterator::operator==(const token_iterator &other) const noexcept { + return _position == other._position; +} +simdjson_inline bool token_iterator::operator!=(const token_iterator &other) const noexcept { + return _position != other._position; +} +simdjson_inline bool token_iterator::operator>(const token_iterator &other) const noexcept { + return _position > other._position; +} +simdjson_inline bool token_iterator::operator>=(const token_iterator &other) const noexcept { + return _position >= other._position; +} +simdjson_inline bool token_iterator::operator<(const token_iterator &other) const noexcept { + return _position < other._position; +} +simdjson_inline bool token_iterator::operator<=(const token_iterator &other) const noexcept { + return _position <= other._position; +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::token_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/token_iterator-inl.h for haswell */ +/* including simdjson/generic/ondemand/value-inl.h for haswell: #include "simdjson/generic/ondemand/value-inl.h" */ +/* begin file simdjson/generic/ondemand/value-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline value::value(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} +simdjson_inline value value::start(const value_iterator &iter) noexcept { + return iter; +} +simdjson_inline value value::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline simdjson_result value::get_array() noexcept { + return array::start(iter); +} +simdjson_inline simdjson_result value::get_object() noexcept { + return object::start(iter); +} +simdjson_inline simdjson_result value::start_or_resume_object() noexcept { + if (iter.at_start()) { + return get_object(); + } else { + return object::resume(iter); + } +} + +simdjson_inline simdjson_result value::get_raw_json_string() noexcept { + return iter.get_raw_json_string(); +} +simdjson_inline simdjson_result value::get_string(bool allow_replacement) noexcept { + return iter.get_string(allow_replacement); +} +template +simdjson_inline error_code value::get_string(string_type& receiver, bool allow_replacement) noexcept { + return iter.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result value::get_wobbly_string() noexcept { + return iter.get_wobbly_string(); +} +simdjson_inline simdjson_result value::get_double() noexcept { + return iter.get_double(); +} +simdjson_inline simdjson_result value::get_double_in_string() noexcept { + return iter.get_double_in_string(); +} +simdjson_inline simdjson_result value::get_uint64() noexcept { + return iter.get_uint64(); +} +simdjson_inline simdjson_result value::get_uint64_in_string() noexcept { + return iter.get_uint64_in_string(); +} +simdjson_inline simdjson_result value::get_int64() noexcept { + return iter.get_int64(); +} +simdjson_inline simdjson_result value::get_int64_in_string() noexcept { + return iter.get_int64_in_string(); +} +simdjson_inline simdjson_result value::get_bool() noexcept { + return iter.get_bool(); +} +simdjson_inline simdjson_result value::is_null() noexcept { + return iter.is_null(); +} +template<> simdjson_inline simdjson_result value::get() noexcept { return get_array(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_object(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_number(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_double(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_bool(); } + +template simdjson_inline error_code value::get(T &out) noexcept { + return get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline value::operator array() noexcept(false) { + return get_array(); +} +simdjson_inline value::operator object() noexcept(false) { + return get_object(); +} +simdjson_inline value::operator uint64_t() noexcept(false) { + return get_uint64(); +} +simdjson_inline value::operator int64_t() noexcept(false) { + return get_int64(); +} +simdjson_inline value::operator double() noexcept(false) { + return get_double(); +} +simdjson_inline value::operator std::string_view() noexcept(false) { + return get_string(false); +} +simdjson_inline value::operator raw_json_string() noexcept(false) { + return get_raw_json_string(); +} +simdjson_inline value::operator bool() noexcept(false) { + return get_bool(); +} +#endif + +simdjson_inline simdjson_result value::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result value::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result value::count_elements() & noexcept { + simdjson_result answer; + auto a = get_array(); + answer = a.count_elements(); + // count_elements leaves you pointing inside the array, at the first element. + // We need to move back so that the user can create a new array (which requires that + // we point at '['). + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::count_fields() & noexcept { + simdjson_result answer; + auto a = get_object(); + answer = a.count_fields(); + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::at(size_t index) noexcept { + auto a = get_array(); + return a.at(index); +} + +simdjson_inline simdjson_result value::find_field(std::string_view key) noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result value::find_field(const char *key) noexcept { + return start_or_resume_object().find_field(key); +} + +simdjson_inline simdjson_result value::find_field_unordered(std::string_view key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result value::find_field_unordered(const char *key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} + +simdjson_inline simdjson_result value::operator[](std::string_view key) noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result value::operator[](const char *key) noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline simdjson_result value::type() noexcept { + return iter.type(); +} + +simdjson_inline simdjson_result value::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool value::is_negative() noexcept { + return iter.is_negative(); +} + +simdjson_inline simdjson_result value::is_integer() noexcept { + return iter.is_integer(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number_type() noexcept { + return iter.get_number_type(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number() noexcept { + return iter.get_number(); +} + +simdjson_inline std::string_view value::raw_json_token() noexcept { + return std::string_view(reinterpret_cast(iter.peek_start()), iter.peek_start_length()); +} + +simdjson_inline simdjson_result value::raw_json() noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: { + ondemand::array array; + SIMDJSON_TRY(get_array().get(array)); + return array.raw_json(); + } + case json_type::object: { + ondemand::object object; + SIMDJSON_TRY(get_object().get(object)); + return object.raw_json(); + } + default: + return raw_json_token(); + } +} + +simdjson_inline simdjson_result value::current_location() noexcept { + return iter.json_iter().current_location(); +} + +simdjson_inline int32_t value::current_depth() const noexcept{ + return iter.json_iter().depth(); +} + +simdjson_inline simdjson_result value::at_pointer(std::string_view json_pointer) noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + haswell::ondemand::value &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + if (error()) { return error(); } + return {}; +} + +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} + +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) noexcept { + if (error()) { return error(); } + return first[key]; +} + +simdjson_inline simdjson_result simdjson_result::get_array() noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return first.get(); +} +template simdjson_inline error_code simdjson_result::get(T &out) noexcept { + if (error()) { return error(); } + return first.get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return std::move(first); +} +template<> simdjson_inline error_code simdjson_result::get(haswell::ondemand::value &out) noexcept { + if (error()) { return error(); } + out = first; + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator haswell::ondemand::array() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::object() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator haswell::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H +/* end file simdjson/generic/ondemand/value-inl.h for haswell */ +/* including simdjson/generic/ondemand/value_iterator-inl.h for haswell: #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/value_iterator-inl.h for haswell */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/atomparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace haswell { +namespace ondemand { + +simdjson_inline value_iterator::value_iterator( + json_iterator *json_iter, + depth_t depth, + token_position start_position +) noexcept : _json_iter{json_iter}, _depth{depth}, _start_position{start_position} +{ +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_root_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_object() noexcept { + assert_at_container_start(); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + if (*_json_iter->peek() == '}') { + logger::log_value(*_json_iter, "empty object"); + _json_iter->return_current_and_advance(); + end_container(); + return false; + } + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_object() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // object: e.g., `{"a":2} foo }`. Users concerned with garbage content should + // call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != '}') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing } at end"); + } + // If the last character is } *and* the first gibberish character is also '}' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == '}') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed object. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_object() noexcept { + auto error = check_root_object(); + if(error) { return error; } + return started_object(); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept { +#if SIMDJSON_CHECK_EOF + if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); } + // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + _json_iter->ascend_to(depth()-1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_field() noexcept { + assert_at_next(); + + // It's illegal to call this unless there are more tokens: anything that ends in } or ] is + // obligated to verify there are more tokens if they are not the top level. + switch (*_json_iter->return_current_and_advance()) { + case '}': + logger::log_end_value(*_json_iter, "object"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between object fields"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_raw(const std::string_view key) noexcept { + error_code error; + bool has_value; + // + // Initially, the object can be in one of a few different places: + // + // 1. The start of the object, at the first field: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + if (at_first_field()) { + has_value = true; + + // + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + return false; + + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + if ((error = skip_child() )) { abandon(); return error; } + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + while (has_value) { + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + //if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); // Skip the value entirely + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + + // If the loop ended, we're out of fields to look at. + return false; +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_unordered_raw(const std::string_view key) noexcept { + /** + * When find_field_unordered_raw is called, we can either be pointing at the + * first key, pointing outside (at the closing brace) or if a key was matched + * we can be either pointing right afterthe ':' right before the value (that we need skip), + * or we may have consumed the value and we might be at a comma or at the + * final brace (ready for a call to has_next_field()). + */ + error_code error; + bool has_value; + + // First, we scan from that point to the end. + // If we don't find a match, we may loop back around, and scan from the beginning to that point. + token_position search_start = _json_iter->position(); + + // We want to know whether we need to go back to the beginning. + bool at_first = at_first_field(); + /////////////// + // Initially, the object can be in one of a few different places: + // + // 1. At the first key: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + // + if (at_first) { + has_value = true; + + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { + +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + SIMDJSON_TRY(reset_object().get(has_value)); + at_first = true; + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + // If someone queried a key but they not did access the value, then we are left pointing + // at the ':' and we need to move forward through the value... If the value was + // processed then skip_child() does not move the iterator (but may adjust the depth). + if ((error = skip_child() )) { abandon(); return error; } + search_start = _json_iter->position(); + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + + // After initial processing, we will be in one of two states: + // + // ``` + // // At the beginning of a field + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // At the end of the object + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // ``` + // + // Next, we find a match starting from the current position. + while (has_value) { + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + // Performance note: it maybe wasteful to rewind to the beginning when there might be + // no other query following. Indeed, it would require reskipping the whole object. + // Instead, you can just stay where you are. If there is a new query, there is always time + // to rewind. + if(at_first) { return false; } + + // If we reach the end without finding a match, search the rest of the fields starting at the + // beginning of the object. + // (We have already run through the object before, so we've already validated its structure. We + // don't check errors in this bit.) + SIMDJSON_TRY(reset_object().get(has_value)); + while (true) { + SIMDJSON_ASSUME(has_value); // we should reach search_start before ever reaching the end of the object + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + error = field_key().get(actual_key); SIMDJSON_ASSUME(!error); + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + error = field_value(); SIMDJSON_ASSUME(!error); + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // If we reached the end of the key-value pair we started from, then we know + // that the key is not there so we return false. We are either right before + // the next comma or the final brace. + if(_json_iter->position() == search_start) { return false; } + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + error = has_next_field().get(has_value); SIMDJSON_ASSUME(!error); + // If we make the mistake of exiting here, then we could be left pointing at a key + // in the middle of an object. That's not an allowable state. + } + // If the loop ended, we're out of fields to look at. The program should + // never reach this point. + return false; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::field_key() noexcept { + assert_at_next(); + + const uint8_t *key = _json_iter->return_current_and_advance(); + if (*(key++) != '"') { return report_error(TAPE_ERROR, "Object key is not a string"); } + return raw_json_string(key); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::field_value() noexcept { + assert_at_next(); + + if (*_json_iter->return_current_and_advance() != ':') { return report_error(TAPE_ERROR, "Missing colon in object field"); } + _json_iter->descend_to(depth()+1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_root_array(); +} + +inline std::string value_iterator::to_string() const noexcept { + auto answer = std::string("value_iterator [ depth : ") + std::to_string(_depth) + std::string(", "); + if(_json_iter != nullptr) { answer += _json_iter->to_string(); } + answer += std::string(" ]"); + return answer; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_array() noexcept { + assert_at_container_start(); + if (*_json_iter->peek() == ']') { + logger::log_value(*_json_iter, "empty array"); + _json_iter->return_current_and_advance(); + SIMDJSON_TRY( end_container() ); + return false; + } + _json_iter->descend_to(depth()+1); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // array: e.g., `[1, 2] foo]`. Users concerned with garbage content should + // also call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != ']') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end"); + } + // If the last character is ] *and* the first gibberish character is also ']' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed array. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_array() noexcept { + auto error = check_root_array(); + if (error) { return error; } + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_element() noexcept { + assert_at_next(); + + logger::log_event(*this, "has_next_element"); + switch (*_json_iter->return_current_and_advance()) { + case ']': + logger::log_end_value(*_json_iter, "array"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + _json_iter->descend_to(depth()+1); + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between array elements"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_bool(const uint8_t *json) const noexcept { + auto not_true = atomparsing::str4ncmp(json, "true"); + auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e'); + bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]); + if (error) { return incorrect_type_error("Not a boolean"); } + return simdjson_result(!not_true); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_null(const uint8_t *json) const noexcept { + bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]); + // if we start with 'n', we must be a null + if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); } + return is_null_string; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_string(bool allow_replacement) noexcept { + return get_raw_json_string().unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_string(string_type& receiver, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_string(allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_wobbly_string() noexcept { + return get_raw_json_string().unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_raw_json_string() noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64() noexcept { + auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64_in_string() noexcept { + auto result = numberparsing::parse_unsigned_in_string(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64() noexcept { + auto result = numberparsing::parse_integer(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64_in_string() noexcept { + auto result = numberparsing::parse_integer_in_string(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double() noexcept { + auto result = numberparsing::parse_double(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double_in_string() noexcept { + auto result = numberparsing::parse_double_in_string(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_bool() noexcept { + auto result = parse_bool(peek_non_root_scalar("bool")); + if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); } + return result; +} +simdjson_inline simdjson_result value_iterator::is_null() noexcept { + bool is_null_value; + SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value)); + if(is_null_value) { advance_non_root_scalar("null"); } + return is_null_value; +} +simdjson_inline bool value_iterator::is_negative() noexcept { + return numberparsing::is_negative(peek_non_root_scalar("numbersign")); +} +simdjson_inline bool value_iterator::is_root_negative() noexcept { + return numberparsing::is_negative(peek_root_scalar("numbersign")); +} +simdjson_inline simdjson_result value_iterator::is_integer() noexcept { + return numberparsing::is_integer(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number_type() noexcept { + return numberparsing::get_number_type(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number() noexcept { + number num; + error_code error = numberparsing::parse_number(peek_non_root_scalar("number"), num); + if(error) { return error; } + return num; +} + +simdjson_inline simdjson_result value_iterator::is_root_integer(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("is_root_integer"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + return false; // if there are more than 20 characters, it cannot be represented as an integer. + } + auto answer = numberparsing::is_integer(tmpbuf); + // If the parsing was a success, we must still check that it is + // a single scalar. Note that we parse first because of cases like '[]' where + // getting TRAILING_CONTENT is wrong. + if(check_trailing && (answer.error() == SUCCESS) && (!_json_iter->is_single_token())) { return TRAILING_CONTENT; } + return answer; +} + +simdjson_inline simdjson_result value_iterator::get_root_number_type(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto answer = numberparsing::get_number_type(tmpbuf); + if (check_trailing && (answer.error() == SUCCESS) && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + return answer; +} +simdjson_inline simdjson_result value_iterator::get_root_number(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + number num; + error_code error = numberparsing::parse_number(tmpbuf, num); + if(error) { return error; } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("number"); + return num; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_string(bool check_trailing, bool allow_replacement) noexcept { + return get_root_raw_json_string(check_trailing).unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_root_string(check_trailing, allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_wobbly_string(bool check_trailing) noexcept { + return get_root_raw_json_string(check_trailing).unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_raw_json_string(bool check_trailing) noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_bool(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("bool"); + uint8_t tmpbuf[5+1+1]; // +1 for null termination + tmpbuf[5+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 5+1)) { return incorrect_type_error("Not a boolean"); } + auto result = parse_bool(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("bool"); + } + return result; +} +simdjson_inline simdjson_result value_iterator::is_root_null(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("null"); + bool result = (max_len >= 4 && !atomparsing::str4ncmp(json, "null") && + (max_len == 4 || jsoncharutils::is_structural_or_whitespace(json[4]))); + if(result) { // we have something that looks like a null. + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("null"); + } + return result; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth >= _depth ); + + return _json_iter->skip_child(depth()); +} + +simdjson_inline value_iterator value_iterator::child() const noexcept { + assert_at_child(); + return { _json_iter, depth()+1, _json_iter->token.position() }; +} + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and iterator depth, which is a desired effect. It does not happen if is_open is +// marked non-inline. +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline bool value_iterator::is_open() const noexcept { + return _json_iter->depth() >= depth(); +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool value_iterator::at_end() const noexcept { + return _json_iter->at_end(); +} + +simdjson_inline bool value_iterator::at_start() const noexcept { + return _json_iter->token.position() == start_position(); +} + +simdjson_inline bool value_iterator::at_first_field() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + return _json_iter->token.position() == start_position() + 1; +} + +simdjson_inline void value_iterator::abandon() noexcept { + _json_iter->abandon(); +} + +simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept { + return _depth; +} +simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept { + return _json_iter->error; +} +simdjson_warn_unused simdjson_inline uint8_t *&value_iterator::string_buf_loc() noexcept { + return _json_iter->string_buf_loc(); +} +simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept { + return *_json_iter; +} +simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept { + return *_json_iter; +} + +simdjson_inline const uint8_t *value_iterator::peek_start() const noexcept { + return _json_iter->peek(start_position()); +} +simdjson_inline uint32_t value_iterator::peek_start_length() const noexcept { + return _json_iter->peek_length(start_position()); +} + +simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return peek_start(); } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return; } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept { + logger::log_start_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + const uint8_t *json; + if (!is_at_start()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + json = peek_start(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + } else { + assert_at_start(); + /** + * We should be prudent. Let us peek. If it is not the right type, we + * return an error. Only once we have determined that we have the right + * type are we allowed to advance! + */ + json = _json_iter->peek(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + _json_iter->return_current_and_advance(); + } + + + return SUCCESS; +} + + +simdjson_inline const uint8_t *value_iterator::peek_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_root(); + return _json_iter->peek(); +} +simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_non_root_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_root(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} +simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_non_root_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept { + logger::log_error(*_json_iter, start_position(), depth(), message); + return INCORRECT_TYPE; +} + +simdjson_inline bool value_iterator::is_at_start() const noexcept { + return position() == start_position(); +} + +simdjson_inline bool value_iterator::is_at_key() const noexcept { + // Keys are at the same depth as the object. + // Note here that we could be safer and check that we are within an object, + // but we do not. + return _depth == _json_iter->_depth && *_json_iter->peek() == '"'; +} + +simdjson_inline bool value_iterator::is_at_iterator_start() const noexcept { + // We can legitimately be either at the first value ([1]), or after the array if it's empty ([]). + auto delta = position() - start_position(); + return delta == 1 || delta == 2; +} + +inline void value_iterator::assert_at_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_container_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_next() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +simdjson_inline void value_iterator::move_at_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position); +} + +simdjson_inline void value_iterator::move_at_container_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position + 1); +} + +simdjson_inline simdjson_result value_iterator::reset_array() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_array(); +} + +simdjson_inline simdjson_result value_iterator::reset_object() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_object(); +} + +inline void value_iterator::assert_at_child() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_root() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth == 1 ); +} + +inline void value_iterator::assert_at_non_root_start() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth > 1 ); +} + +inline void value_iterator::assert_is_valid() const noexcept { + SIMDJSON_ASSUME( _json_iter != nullptr ); +} + +simdjson_inline bool value_iterator::is_valid() const noexcept { + return _json_iter != nullptr; +} + +simdjson_inline simdjson_result value_iterator::type() const noexcept { + switch (*peek_start()) { + case '{': + return json_type::object; + case '[': + return json_type::array; + case '"': + return json_type::string; + case 'n': + return json_type::null; + case 't': case 'f': + return json_type::boolean; + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return json_type::number; + default: + return TAPE_ERROR; + } +} + +simdjson_inline token_position value_iterator::start_position() const noexcept { + return _start_position; +} + +simdjson_inline token_position value_iterator::position() const noexcept { + return _json_iter->position(); +} + +simdjson_inline token_position value_iterator::end_position() const noexcept { + return _json_iter->end_position(); +} + +simdjson_inline token_position value_iterator::last_position() const noexcept { + return _json_iter->last_position(); +} + +simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept { + return _json_iter->report_error(error, message); +} + +} // namespace ondemand +} // namespace haswell +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(haswell::ondemand::value_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/value_iterator-inl.h for haswell */ +/* end file simdjson/generic/ondemand/amalgamated.h for haswell */ +/* including simdjson/haswell/end.h: #include "simdjson/haswell/end.h" */ +/* begin file simdjson/haswell/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/haswell/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_HASWELL +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "haswell" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/haswell/end.h */ + +#endif // SIMDJSON_HASWELL_ONDEMAND_H +/* end file simdjson/haswell/ondemand.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(icelake) +/* including simdjson/icelake/ondemand.h: #include "simdjson/icelake/ondemand.h" */ +/* begin file simdjson/icelake/ondemand.h */ +#ifndef SIMDJSON_ICELAKE_ONDEMAND_H +#define SIMDJSON_ICELAKE_ONDEMAND_H + +/* including simdjson/icelake/begin.h: #include "simdjson/icelake/begin.h" */ +/* begin file simdjson/icelake/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "icelake" */ +#define SIMDJSON_IMPLEMENTATION icelake +/* including simdjson/icelake/base.h: #include "simdjson/icelake/base.h" */ +/* begin file simdjson/icelake/base.h */ +#ifndef SIMDJSON_ICELAKE_BASE_H +#define SIMDJSON_ICELAKE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_ICELAKE +namespace simdjson { +/** + * Implementation for Icelake (Intel AVX512). + */ +namespace icelake { + +class implementation; + +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BASE_H +/* end file simdjson/icelake/base.h */ +/* including simdjson/icelake/intrinsics.h: #include "simdjson/icelake/intrinsics.h" */ +/* begin file simdjson/icelake/intrinsics.h */ +#ifndef SIMDJSON_ICELAKE_INTRINSICS_H +#define SIMDJSON_ICELAKE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. In simdjson, we + * want to compile the whole program for a generic target, + * and only target our specific kernels. As a workaround, + * we directly include the needed headers. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include // for _mm_clmulepi64_si128 +// Important: we need the AVX-512 headers: +#include +#include +#include +#include +#include +#include +#include +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + +static_assert(sizeof(__m512i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for icelake"); + +#endif // SIMDJSON_ICELAKE_INTRINSICS_H +/* end file simdjson/icelake/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_TARGET_REGION("avx512f,avx512dq,avx512cd,avx512bw,avx512vbmi,avx512vbmi2,avx512vl,avx2,bmi,pclmul,lzcnt,popcnt") +#endif + +/* including simdjson/icelake/bitmanipulation.h: #include "simdjson/icelake/bitmanipulation.h" */ +/* begin file simdjson/icelake/bitmanipulation.h */ +#ifndef SIMDJSON_ICELAKE_BITMANIPULATION_H +#define SIMDJSON_ICELAKE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return (int)_tzcnt_u64(input_num); +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + //////// + // You might expect the next line to be equivalent to + // return (int)_tzcnt_u64(input_num); + // but the generated code differs and might be less efficient? + //////// + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return _blsr_u64(input_num); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { + return int(_lzcnt_u64(input_num)); +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMANIPULATION_H +/* end file simdjson/icelake/bitmanipulation.h */ +/* including simdjson/icelake/bitmask.h: #include "simdjson/icelake/bitmask.h" */ +/* begin file simdjson/icelake/bitmask.h */ +#ifndef SIMDJSON_ICELAKE_BITMASK_H +#define SIMDJSON_ICELAKE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processor supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_BITMASK_H +/* end file simdjson/icelake/bitmask.h */ +/* including simdjson/icelake/simd.h: #include "simdjson/icelake/simd.h" */ +/* begin file simdjson/icelake/simd.h */ +#ifndef SIMDJSON_ICELAKE_SIMD_H +#define SIMDJSON_ICELAKE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if defined(__GNUC__) && !defined(__clang__) +#if __GNUC__ == 8 +#define SIMDJSON_GCC8 1 +#endif // __GNUC__ == 8 +#endif // defined(__GNUC__) && !defined(__clang__) + +#if SIMDJSON_GCC8 +/** + * GCC 8 fails to provide _mm512_set_epi8. We roll our own. + */ +inline __m512i _mm512_set_epi8(uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6, uint8_t a7, uint8_t a8, uint8_t a9, uint8_t a10, uint8_t a11, uint8_t a12, uint8_t a13, uint8_t a14, uint8_t a15, uint8_t a16, uint8_t a17, uint8_t a18, uint8_t a19, uint8_t a20, uint8_t a21, uint8_t a22, uint8_t a23, uint8_t a24, uint8_t a25, uint8_t a26, uint8_t a27, uint8_t a28, uint8_t a29, uint8_t a30, uint8_t a31, uint8_t a32, uint8_t a33, uint8_t a34, uint8_t a35, uint8_t a36, uint8_t a37, uint8_t a38, uint8_t a39, uint8_t a40, uint8_t a41, uint8_t a42, uint8_t a43, uint8_t a44, uint8_t a45, uint8_t a46, uint8_t a47, uint8_t a48, uint8_t a49, uint8_t a50, uint8_t a51, uint8_t a52, uint8_t a53, uint8_t a54, uint8_t a55, uint8_t a56, uint8_t a57, uint8_t a58, uint8_t a59, uint8_t a60, uint8_t a61, uint8_t a62, uint8_t a63) { + return _mm512_set_epi64(uint64_t(a7) + (uint64_t(a6) << 8) + (uint64_t(a5) << 16) + (uint64_t(a4) << 24) + (uint64_t(a3) << 32) + (uint64_t(a2) << 40) + (uint64_t(a1) << 48) + (uint64_t(a0) << 56), + uint64_t(a15) + (uint64_t(a14) << 8) + (uint64_t(a13) << 16) + (uint64_t(a12) << 24) + (uint64_t(a11) << 32) + (uint64_t(a10) << 40) + (uint64_t(a9) << 48) + (uint64_t(a8) << 56), + uint64_t(a23) + (uint64_t(a22) << 8) + (uint64_t(a21) << 16) + (uint64_t(a20) << 24) + (uint64_t(a19) << 32) + (uint64_t(a18) << 40) + (uint64_t(a17) << 48) + (uint64_t(a16) << 56), + uint64_t(a31) + (uint64_t(a30) << 8) + (uint64_t(a29) << 16) + (uint64_t(a28) << 24) + (uint64_t(a27) << 32) + (uint64_t(a26) << 40) + (uint64_t(a25) << 48) + (uint64_t(a24) << 56), + uint64_t(a39) + (uint64_t(a38) << 8) + (uint64_t(a37) << 16) + (uint64_t(a36) << 24) + (uint64_t(a35) << 32) + (uint64_t(a34) << 40) + (uint64_t(a33) << 48) + (uint64_t(a32) << 56), + uint64_t(a47) + (uint64_t(a46) << 8) + (uint64_t(a45) << 16) + (uint64_t(a44) << 24) + (uint64_t(a43) << 32) + (uint64_t(a42) << 40) + (uint64_t(a41) << 48) + (uint64_t(a40) << 56), + uint64_t(a55) + (uint64_t(a54) << 8) + (uint64_t(a53) << 16) + (uint64_t(a52) << 24) + (uint64_t(a51) << 32) + (uint64_t(a50) << 40) + (uint64_t(a49) << 48) + (uint64_t(a48) << 56), + uint64_t(a63) + (uint64_t(a62) << 8) + (uint64_t(a61) << 16) + (uint64_t(a60) << 24) + (uint64_t(a59) << 32) + (uint64_t(a58) << 40) + (uint64_t(a57) << 48) + (uint64_t(a56) << 56)); +} +#endif // SIMDJSON_GCC8 + + + +namespace simdjson { +namespace icelake { +namespace { +namespace simd { + + // Forward-declared so they can be used by splat and friends. + template + struct base { + __m512i value; + + // Zero constructor + simdjson_inline base() : value{__m512i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m512i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m512i&() const { return this->value; } + simdjson_inline operator __m512i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm512_or_si512(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm512_and_si512(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm512_xor_si512(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm512_andnot_si512(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + // Forward-declared so they can be used by splat and friends. + template + struct simd8; + + template> + struct base8: base> { + typedef uint32_t bitmask_t; + typedef uint64_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m512i _value) : base>(_value) {} + + friend simdjson_really_inline uint64_t operator==(const simd8 lhs, const simd8 rhs) { + return _mm512_cmpeq_epi8_mask(lhs, rhs); + } + + static const int SIZE = sizeof(base::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + // workaround for compilers unable to figure out that 16 - N is a constant (GCC 8) + constexpr int shift = 16 - N; + return _mm512_alignr_epi8(*this, _mm512_permutex2var_epi64(prev_chunk, _mm512_set_epi64(13, 12, 11, 10, 9, 8, 7, 6), *this), shift); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm512_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m512i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + simdjson_inline bool any() const { return !!_mm512_test_epi8_mask (*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm512_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm512_setzero_si512(); } + static simdjson_inline simd8 load(const T values[64]) { + return _mm512_loadu_si512(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m512i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[64]) const { return _mm512_storeu_si512(reinterpret_cast<__m512i *>(dst), *this); } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm512_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm512_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm512_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 32 - count_ones(mask) bytes of the result are significant but 32 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint64_t mask, L * output) const { + _mm512_mask_compressstoreu_epi8 (output,~mask,*this); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15, + int8_t v16, int8_t v17, int8_t v18, int8_t v19, int8_t v20, int8_t v21, int8_t v22, int8_t v23, + int8_t v24, int8_t v25, int8_t v26, int8_t v27, int8_t v28, int8_t v29, int8_t v30, int8_t v31, + int8_t v32, int8_t v33, int8_t v34, int8_t v35, int8_t v36, int8_t v37, int8_t v38, int8_t v39, + int8_t v40, int8_t v41, int8_t v42, int8_t v43, int8_t v44, int8_t v45, int8_t v46, int8_t v47, + int8_t v48, int8_t v49, int8_t v50, int8_t v51, int8_t v52, int8_t v53, int8_t v54, int8_t v55, + int8_t v56, int8_t v57, int8_t v58, int8_t v59, int8_t v60, int8_t v61, int8_t v62, int8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epi8(*this, other); } + + simdjson_inline simd8 operator>(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(*this, other),_mm512_set1_epi8(uint8_t(0x80))); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm512_maskz_abs_epi8(_mm512_cmpgt_epi8_mask(other, *this),_mm512_set1_epi8(uint8_t(0x80))); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m512i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t values[64]) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15, + uint8_t v16, uint8_t v17, uint8_t v18, uint8_t v19, uint8_t v20, uint8_t v21, uint8_t v22, uint8_t v23, + uint8_t v24, uint8_t v25, uint8_t v26, uint8_t v27, uint8_t v28, uint8_t v29, uint8_t v30, uint8_t v31, + uint8_t v32, uint8_t v33, uint8_t v34, uint8_t v35, uint8_t v36, uint8_t v37, uint8_t v38, uint8_t v39, + uint8_t v40, uint8_t v41, uint8_t v42, uint8_t v43, uint8_t v44, uint8_t v45, uint8_t v46, uint8_t v47, + uint8_t v48, uint8_t v49, uint8_t v50, uint8_t v51, uint8_t v52, uint8_t v53, uint8_t v54, uint8_t v55, + uint8_t v56, uint8_t v57, uint8_t v58, uint8_t v59, uint8_t v60, uint8_t v61, uint8_t v62, uint8_t v63 + ) : simd8(_mm512_set_epi8( + v63, v62, v61, v60, v59, v58, v57, v56, + v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, + v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, + v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, + v7, v6, v5, v4, v3, v2, v1, v0 + )) {} + + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15, + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm512_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm512_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm512_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm512_min_epu8(other, *this); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline uint64_t operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline uint64_t operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->lt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return _mm512_mask_blend_epi8(*this == uint8_t(0), _mm512_set1_epi8(0), _mm512_set1_epi8(-1)); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + + simdjson_inline bool is_ascii() const { return _mm512_movepi8_mask(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { + return !_mm512_test_epi8_mask(*this, *this); + } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return !_mm512_test_epi8_mask(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm512_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm512_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline uint64_t get_bit() const { return _mm512_movepi8_mask(_mm512_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 1, "Icelake kernel should use one register per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1) : chunks{chunk0, chunk1} {} + simdjson_inline simd8x64(const simd8 chunk0) : chunks{chunk0} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr)} {} + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(mask, output); + return 64 - count_ones(mask); + } + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + } + + simdjson_inline simd8 reduce_or() const { + return this->chunks[0]; + } + + simdjson_inline simd8x64 bit_or(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] | mask + ); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] == mask; + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return this->chunks[0] == other.chunks[0]; + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return this->chunks[0] <= mask; + } + }; // struct simd8x64 + +} // namespace simd + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_SIMD_H +/* end file simdjson/icelake/simd.h */ +/* including simdjson/icelake/stringparsing_defs.h: #include "simdjson/icelake/stringparsing_defs.h" */ +/* begin file simdjson/icelake/stringparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +#define SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/simd.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 64; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint64_t bs_bits; + uint64_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 15 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v(src); + // store to dest unconditionally - we can overwrite the bits we don't like later + v.store(dst); + return { + static_cast(v == '\\'), // bs_bits + static_cast(v == '"'), // quote_bits + }; +} + +} // unnamed namespace +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_ICELAKE_STRINGPARSING_DEFS_H +/* end file simdjson/icelake/stringparsing_defs.h */ +/* including simdjson/icelake/numberparsing_defs.h: #include "simdjson/icelake/numberparsing_defs.h" */ +/* begin file simdjson/icelake/numberparsing_defs.h */ +#ifndef SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +#define SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace numberparsing { + +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace icelake +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_ICELAKE_NUMBERPARSING_DEFS_H +/* end file simdjson/icelake/numberparsing_defs.h */ +/* end file simdjson/icelake/begin.h */ +/* including simdjson/generic/ondemand/amalgamated.h for icelake: #include "simdjson/generic/ondemand/amalgamated.h" */ +/* begin file simdjson/generic/ondemand/amalgamated.h for icelake */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H) +#error simdjson/generic/ondemand/dependencies.h must be included before simdjson/generic/ondemand/amalgamated.h! +#endif + +// Stuff other things depend on +/* including simdjson/generic/ondemand/base.h for icelake: #include "simdjson/generic/ondemand/base.h" */ +/* begin file simdjson/generic/ondemand/base.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +/** + * A fast, simple, DOM-like interface that parses JSON as you use it. + * + * Designed for maximum speed and a lower memory profile. + */ +namespace ondemand { + +/** Represents the depth of a JSON value (number of nested arrays/objects). */ +using depth_t = int32_t; + +/** @copydoc simdjson::icelake::number_type */ +using number_type = simdjson::icelake::number_type; + +/** @private Position in the JSON buffer indexes */ +using token_position = const uint32_t *; + +class array; +class array_iterator; +class document; +class document_reference; +class document_stream; +class field; +class json_iterator; +enum class json_type; +struct number; +class object; +class object_iterator; +class parser; +class raw_json_string; +class token_iterator; +class value; +class value_iterator; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_BASE_H +/* end file simdjson/generic/ondemand/base.h for icelake */ +/* including simdjson/generic/ondemand/value_iterator.h for icelake: #include "simdjson/generic/ondemand/value_iterator.h" */ +/* begin file simdjson/generic/ondemand/value_iterator.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * Iterates through a single JSON value at a particular depth. + * + * Does not keep track of the type of value: provides methods for objects, arrays and scalars and expects + * the caller to call the right ones. + * + * @private This is not intended for external use. + */ +class value_iterator { +protected: + /** The underlying JSON iterator */ + json_iterator *_json_iter{}; + /** The depth of this value */ + depth_t _depth{}; + /** + * The starting token index for this value + */ + token_position _start_position{}; + +public: + simdjson_inline value_iterator() noexcept = default; + + /** + * Denote that we're starting a document. + */ + simdjson_inline void start_document() noexcept; + + /** + * Skips a non-iterated or partially-iterated JSON value, whether it is a scalar, array or object. + * + * Optimized for scalars. + */ + simdjson_warn_unused simdjson_inline error_code skip_child() noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is at the start of the value + */ + simdjson_inline bool at_start() const noexcept; + + /** + * Tell whether the value is open--if the value has not been used, or the array/object is still open. + */ + simdjson_inline bool is_open() const noexcept; + + /** + * Tell whether the value is at an object's first field (just after the {). + */ + simdjson_inline bool at_first_field() const noexcept; + + /** + * Abandon all iteration. + */ + simdjson_inline void abandon() noexcept; + + /** + * Get the child value as a value_iterator. + */ + simdjson_inline value_iterator child_value() const noexcept; + + /** + * Get the depth of this value. + */ + simdjson_inline int32_t depth() const noexcept; + + /** + * Get the JSON type of this value. + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() const noexcept; + + /** + * @addtogroup object Object iteration + * + * Methods to iterate and find object fields. These methods generally *assume* the value is + * actually an object; the caller is responsible for keeping track of that fact. + * + * @{ + */ + + /** + * Start an object iteration. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + */ + simdjson_warn_unused simdjson_inline simdjson_result start_object() noexcept; + /** + * Start an object iteration from the root. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_object() noexcept; + /** + * Checks whether an object could be started from the root. May be called by start_root_object. + * + * @returns SUCCESS if it is possible to safely start an object from the root (document level). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_object() noexcept; + /** + * Start an object iteration after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_object() noexcept; + /** + * Start an object iteration from the root, after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_object() noexcept; + + /** + * Moves to the next field in an object. + * + * Looks for , and }. If } is found, the object is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return whether there is another field in the object. + * @error TAPE_ERROR If there is a comma missing between fields. + * @error TAPE_ERROR If there is a comma, but not enough tokens remaining to have a key, :, and value. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_field() noexcept; + + /** + * Get the current field's key. + */ + simdjson_warn_unused simdjson_inline simdjson_result field_key() noexcept; + + /** + * Pass the : in the field and move to its value. + */ + simdjson_warn_unused simdjson_inline error_code field_value() noexcept; + + /** + * Find the next field with the given key. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline error_code find_field(const std::string_view key) noexcept; + + /** + * Find the next field with the given key, *without* unescaping. This assumes object order: it + * will not find the field if it was already passed when looking for some *other* field. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_raw(const std::string_view key) noexcept; + + /** + * Find the field with the given key without regard to order, and *without* unescaping. + * + * This is an unordered object lookup: if the field is not found initially, it will cycle around and scan from the beginning. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_unordered_raw(const std::string_view key) noexcept; + + /** @} */ + + /** + * @addtogroup array Array iteration + * Methods to iterate over array elements. These methods generally *assume* the value is actually + * an object; the caller is responsible for keeping track of that fact. + * @{ + */ + + /** + * Check for an opening [ and start an array iteration. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + */ + simdjson_warn_unused simdjson_inline simdjson_result start_array() noexcept; + /** + * Check for an opening [ and start an array iteration while at the root. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_array() noexcept; + /** + * Checks whether an array could be started from the root. May be called by start_root_array. + * + * @returns SUCCESS if it is possible to safely start an array from the root (document level). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_array() noexcept; + /** + * Start an array iteration, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_array() noexcept; + /** + * Start an array iteration from the root, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_array() noexcept; + + /** + * Moves to the next element in an array. + * + * Looks for , and ]. If ] is found, the array is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return Whether there is another element in the array. + * @error TAPE_ERROR If there is a comma missing between elements. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_element() noexcept; + + /** + * Get a child value iterator. + */ + simdjson_warn_unused simdjson_inline value_iterator child() const noexcept; + + /** @} */ + + /** + * @defgroup scalar Scalar values + * @addtogroup scalar + * @{ + */ + + simdjson_warn_unused simdjson_inline simdjson_result get_string(bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_bool() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_null() noexcept; + simdjson_warn_unused simdjson_inline bool is_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_integer() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + simdjson_warn_unused simdjson_inline simdjson_result get_root_string(bool check_trailing, bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_wobbly_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_raw_json_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_bool(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline bool is_root_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_integer(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number_type(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_null(bool check_trailing) noexcept; + + simdjson_inline error_code error() const noexcept; + simdjson_inline uint8_t *&string_buf_loc() noexcept; + simdjson_inline const json_iterator &json_iter() const noexcept; + simdjson_inline json_iterator &json_iter() noexcept; + + simdjson_inline void assert_is_valid() const noexcept; + simdjson_inline bool is_valid() const noexcept; + + /** @} */ +protected: + /** + * Restarts an array iteration. + * @returns Whether the array has any elements (returns false for empty). + */ + simdjson_inline simdjson_result reset_array() noexcept; + /** + * Restarts an object iteration. + * @returns Whether the object has any fields (returns false for empty). + */ + simdjson_inline simdjson_result reset_object() noexcept; + /** + * move_at_start(): moves us so that we are pointing at the beginning of + * the container. It updates the index so that at_start() is true and it + * syncs the depth. The user can then create a new container instance. + * + * Usage: used with value::count_elements(). + **/ + simdjson_inline void move_at_start() noexcept; + + /** + * move_at_container_start(): moves us so that we are pointing at the beginning of + * the container so that assert_at_container_start() passes. + * + * Usage: used with reset_array() and reset_object(). + **/ + simdjson_inline void move_at_container_start() noexcept; + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + simdjson_inline value_iterator(json_iterator *json_iter, depth_t depth, token_position start_index) noexcept; + + simdjson_inline simdjson_result parse_null(const uint8_t *json) const noexcept; + simdjson_inline simdjson_result parse_bool(const uint8_t *json) const noexcept; + simdjson_inline const uint8_t *peek_start() const noexcept; + simdjson_inline uint32_t peek_start_length() const noexcept; + + /** + * The general idea of the advance_... methods and the peek_* methods + * is that you first peek and check that you have desired type. If you do, + * and only if you do, then you advance. + * + * We used to unconditionally advance. But this made reasoning about our + * current state difficult. + * Suppose you always advance. Look at the 'value' matching the key + * "shadowable" in the following example... + * + * ({"globals":{"a":{"shadowable":[}}}}) + * + * If the user thinks it is a Boolean and asks for it, then we check the '[', + * decide it is not a Boolean, but still move into the next character ('}'). Now + * we are left pointing at '}' right after a '['. And we have not yet reported + * an error, only that we do not have a Boolean. + * + * If, instead, you just stand your ground until it is content that you know, then + * you will only even move beyond the '[' if the user tells you that you have an + * array. So you will be at the '}' character inside the array and, hopefully, you + * will then catch the error because an array cannot start with '}', but the code + * processing Boolean values does not know this. + * + * So the contract is: first call 'peek_...' and then call 'advance_...' only + * if you have determined that it is a type you can handle. + * + * Unfortunately, it makes the code more verbose, longer and maybe more error prone. + */ + + simdjson_inline void advance_scalar(const char *type) noexcept; + simdjson_inline void advance_root_scalar(const char *type) noexcept; + simdjson_inline void advance_non_root_scalar(const char *type) noexcept; + + simdjson_inline const uint8_t *peek_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_root_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_non_root_scalar(const char *type) noexcept; + + + simdjson_inline error_code start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept; + simdjson_inline error_code end_container() noexcept; + + /** + * Advance to a place expecting a value (increasing depth). + * + * @return The current token (the one left behind). + * @error TAPE_ERROR If the document ended early. + */ + simdjson_inline simdjson_result advance_to_value() noexcept; + + simdjson_inline error_code incorrect_type_error(const char *message) const noexcept; + simdjson_inline error_code error_unless_more_tokens(uint32_t tokens=1) const noexcept; + + simdjson_inline bool is_at_start() const noexcept; + /** + * is_at_iterator_start() returns true on an array or object after it has just been + * created, whether the instance is empty or not. + * + * Usage: used by array::begin() in debug mode (SIMDJSON_DEVELOPMENT_CHECKS) + */ + simdjson_inline bool is_at_iterator_start() const noexcept; + + /** + * Assuming that we are within an object, this returns true if we + * are pointing at a key. + * + * Usage: the skip_child() method should never be used while we are pointing + * at a key inside an object. + */ + simdjson_inline bool is_at_key() const noexcept; + + inline void assert_at_start() const noexcept; + inline void assert_at_container_start() const noexcept; + inline void assert_at_root() const noexcept; + inline void assert_at_child() const noexcept; + inline void assert_at_next() const noexcept; + inline void assert_at_non_root_start() const noexcept; + + /** Get the starting position of this value */ + simdjson_inline token_position start_position() const noexcept; + + /** @copydoc error_code json_iterator::position() const noexcept; */ + simdjson_inline token_position position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position last_position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position end_position() const noexcept; + /** @copydoc error_code json_iterator::report_error(error_code error, const char *message) noexcept; */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + friend class document; + friend class object; + friend class array; + friend class value; +}; // value_iterator + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::value_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H +/* end file simdjson/generic/ondemand/value_iterator.h for icelake */ +/* including simdjson/generic/ondemand/value.h for icelake: #include "simdjson/generic/ondemand/value.h" */ +/* begin file simdjson/generic/ondemand/value.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * An ephemeral JSON value returned during iteration. It is only valid for as long as you do + * not access more data in the JSON document. + */ +class value { +public: + /** + * Create a new invalid value. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline value() noexcept = default; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) noexcept; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() noexcept; + + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() noexcept; + + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + + /** + * Cast this JSON value (inside string) to a unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + + /** + * Cast this JSON value to a "wobbly" string. + * + * The string is may not be a valid UTF-8 string. + * See https://simonsapin.github.io/wtf-8/ + * + * Important: a value should be consumed once. Calling get_wobbly_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); +#endif + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + * + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * Performance hint: You should only call count_elements() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method on the object instance. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @return The type of JSON value (json_type::array, json_type::object, json_type::string, + * json_type::number, json_type::boolean, or json_type::null). + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the value is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the value is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the value is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * Performance note: if you call this function systematically + * before parsing a number, you may have fallen for a performance + * anti-pattern. + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + * + * Performance note: this is designed with performance in mind. When + * calling 'get_number()', you scan the number string only once, determining + * efficiently the type and storing it in an efficient manner. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. However, if this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view is guaranteed to be + * a non-space token. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + * + * See also value::raw_json(). + */ + simdjson_inline std::string_view raw_json_token() noexcept; + + /** + * Get a string_view pointing at this value in the JSON document. + * If this element is an array or an object, it consumes the array or the object + * and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + * If this element is a scalar (string, number, Boolean, null), it returns what + * raw_json_token() would return. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + simdjson_inline simdjson_result current_location() noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. + * + * Calling at_pointer() on non-document instances (e.g., arrays and objects) is not + * standardized (by RFC 6901). We provide some experimental support for JSON pointers + * on non-document instances. Yet it is not the case when calling at_pointer on an array + * or an object instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + +protected: + /** + * Create a value. + */ + simdjson_inline value(const value_iterator &iter) noexcept; + + /** + * Skip this value, allowing iteration to continue. + */ + simdjson_inline void skip() noexcept; + + /** + * Start a value at the current position. + * + * (It should already be started; this is just a self-documentation method.) + */ + static simdjson_inline value start(const value_iterator &iter) noexcept; + + /** + * Resume a value. + */ + static simdjson_inline value resume(const value_iterator &iter) noexcept; + + /** + * Get the object, starting or resuming it as necessary + */ + simdjson_inline simdjson_result start_or_resume_object() noexcept; + + // simdjson_inline void log_value(const char *type) const noexcept; + // simdjson_inline void log_error(const char *message) const noexcept; + + value_iterator iter{}; + + friend class document; + friend class array_iterator; + friend class field; + friend class object; + friend struct simdjson_result; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::value &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result get_array() noexcept; + simdjson_inline simdjson_result get_object() noexcept; + + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() noexcept; + + template simdjson_inline error_code get(T &out) noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator icelake::ondemand::array() noexcept(false); + simdjson_inline operator icelake::ondemand::object() noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator icelake::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + */ + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + + /** @copydoc simdjson_inline std::string_view value::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + + /** @copydoc simdjson_inline simdjson_result current_location() noexcept */ + simdjson_inline simdjson_result current_location() noexcept; + /** @copydoc simdjson_inline int32_t current_depth() const noexcept */ + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H +/* end file simdjson/generic/ondemand/value.h for icelake */ +/* including simdjson/generic/ondemand/logger.h for icelake: #include "simdjson/generic/ondemand/logger.h" */ +/* begin file simdjson/generic/ondemand/logger.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +// Logging should be free unless SIMDJSON_VERBOSE_LOGGING is set. Importantly, it is critical +// that the call to the log functions be side-effect free. Thus, for example, you should not +// create temporary std::string instances. +namespace logger { + +enum class log_level : int32_t { + info = 0, + error = 1 +}; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + +// We do not want these functions to be 'really inlined' since real inlining is +// for performance purposes and if you are using the loggers, you do not care about +// performance (or should not). +static inline void log_headers() noexcept; +// If args are provided, title will be treated as format string +template +static inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +template +static inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; +static inline void log_event(const json_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_value(const json_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_start_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; + +static inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail="") noexcept; +static inline void log_error(const json_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +static inline void log_event(const value_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const value_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_error(const value_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +} // namespace logger +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_H +/* end file simdjson/generic/ondemand/logger.h for icelake */ +/* including simdjson/generic/ondemand/token_iterator.h for icelake: #include "simdjson/generic/ondemand/token_iterator.h" */ +/* begin file simdjson/generic/ondemand/token_iterator.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * Iterates through JSON tokens (`{` `}` `[` `]` `,` `:` `""` `123` `true` `false` `null`) + * detected by stage 1. + * + * @private This is not intended for external use. + */ +class token_iterator { +public: + /** + * Create a new invalid token_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline token_iterator() noexcept = default; + simdjson_inline token_iterator(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator &operator=(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator(const token_iterator &other) noexcept = default; + simdjson_inline token_iterator &operator=(const token_iterator &other) noexcept = default; + + /** + * Advance to the next token (returning the current one). + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + /** + * Reports the current offset in bytes from the start of the underlying buffer. + */ + simdjson_inline uint32_t current_offset() const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + + /** + * Return the current index. + */ + simdjson_inline token_position position() const noexcept; + /** + * Reset to a previously saved index. + */ + simdjson_inline void set_position(token_position target_position) noexcept; + + // NOTE: we don't support a full C++ iterator interface, because we expect people to make + // different calls to advance the iterator based on *their own* state. + + simdjson_inline bool operator==(const token_iterator &other) const noexcept; + simdjson_inline bool operator!=(const token_iterator &other) const noexcept; + simdjson_inline bool operator>(const token_iterator &other) const noexcept; + simdjson_inline bool operator>=(const token_iterator &other) const noexcept; + simdjson_inline bool operator<(const token_iterator &other) const noexcept; + simdjson_inline bool operator<=(const token_iterator &other) const noexcept; + +protected: + simdjson_inline token_iterator(const uint8_t *buf, token_position position) noexcept; + + /** + * Get the index of the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_index(int32_t delta=0) const noexcept; + /** + * Get the index of the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline uint32_t peek_index(token_position position) const noexcept; + + const uint8_t *buf{}; + token_position _position{}; + + friend class json_iterator; + friend class value_iterator; + friend class object; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::token_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H +/* end file simdjson/generic/ondemand/token_iterator.h for icelake */ +/* including simdjson/generic/ondemand/json_iterator.h for icelake: #include "simdjson/generic/ondemand/json_iterator.h" */ +/* begin file simdjson/generic/ondemand/json_iterator.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * Iterates through JSON tokens, keeping track of depth and string buffer. + * + * @private This is not intended for external use. + */ +class json_iterator { +protected: + token_iterator token{}; + ondemand::parser *parser{}; + /** + * Next free location in the string buffer. + * + * Used by raw_json_string::unescape() to have a place to unescape strings to. + */ + uint8_t *_string_buf_loc{}; + /** + * JSON error, if there is one. + * + * INCORRECT_TYPE and NO_SUCH_FIELD are *not* stored here, ever. + * + * PERF NOTE: we *hope* this will be elided into control flow, as it is only used (a) in the first + * iteration of the loop, or (b) for the final iteration after a missing comma is found in ++. If + * this is not elided, we should make sure it's at least not using up a register. Failing that, + * we should store it in document so there's only one of them. + */ + error_code error{SUCCESS}; + /** + * Depth of the current token in the JSON. + * + * - 0 = finished with document + * - 1 = document root value (could be [ or {, not yet known) + * - 2 = , or } inside root array/object + * - 3 = key or value inside root array/object. + */ + depth_t _depth{}; + /** + * Beginning of the document indexes. + * Normally we have root == parser->implementation->structural_indexes.get() + * but this may differ, especially in streaming mode (where we have several + * documents); + */ + token_position _root{}; + /** + * Normally, a json_iterator operates over a single document, but in + * some cases, we may have a stream of documents. This attribute is meant + * as meta-data: the json_iterator works the same irrespective of the + * value of this attribute. + */ + bool _streaming{false}; + +public: + simdjson_inline json_iterator() noexcept = default; + simdjson_inline json_iterator(json_iterator &&other) noexcept; + simdjson_inline json_iterator &operator=(json_iterator &&other) noexcept; + simdjson_inline explicit json_iterator(const json_iterator &other) noexcept = default; + simdjson_inline json_iterator &operator=(const json_iterator &other) noexcept = default; + /** + * Skips a JSON value, whether it is a scalar, array or object. + */ + simdjson_warn_unused simdjson_inline error_code skip_child(depth_t parent_depth) noexcept; + + /** + * Tell whether the iterator is still at the start + */ + simdjson_inline bool at_root() const noexcept; + + /** + * Tell whether we should be expected to run in streaming + * mode (iterating over many documents). It is pure metadata + * that does not affect how the iterator works. It is used by + * start_root_array() and start_root_object(). + */ + simdjson_inline bool streaming() const noexcept; + + /** + * Get the root value iterator + */ + simdjson_inline token_position root_position() const noexcept; + /** + * Assert that we are at the document depth (== 1) + */ + simdjson_inline void assert_at_document_depth() const noexcept; + /** + * Assert that we are at the root of the document + */ + simdjson_inline void assert_at_root() const noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is live (has not been moved). + */ + simdjson_inline bool is_alive() const noexcept; + + /** + * Abandon this iterator, setting depth to 0 (as if the document is finished). + */ + simdjson_inline void abandon() noexcept; + + /** + * Advance the current token without modifying depth. + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + + /** + * Returns true if there is a single token in the index (i.e., it is + * a JSON with a scalar value such as a single number). + * + * @return whether there is a single token + */ + simdjson_inline bool is_single_token() const noexcept; + + /** + * Assert that there are at least the given number of tokens left. + * + * Has no effect in release builds. + */ + simdjson_inline void assert_more_tokens(uint32_t required_tokens=1) const noexcept; + /** + * Assert that the given position addresses an actual token (is within bounds). + * + * Has no effect in release builds. + */ + simdjson_inline void assert_valid_position(token_position position) const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + /** + * Get a pointer to the current location in the input buffer. + * + * This is not null-terminated; it is a view into the JSON. + * + * You may be pointing outside of the input buffer: it is not generally + * safe to dereference this pointer. + */ + simdjson_inline const uint8_t *unsafe_pointer() const noexcept; + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token to retrieve. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token to retrieve. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + /** + * Get the JSON text for the last token in the document. + * + * This is not null-terminated; it is a view into the JSON. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek_last() const noexcept; + + /** + * Ascend one level. + * + * Validates that the depth - 1 == parent_depth. + * + * @param parent_depth the expected parent depth. + */ + simdjson_inline void ascend_to(depth_t parent_depth) noexcept; + + /** + * Descend one level. + * + * Validates that the new depth == child_depth. + * + * @param child_depth the expected child depth. + */ + simdjson_inline void descend_to(depth_t child_depth) noexcept; + simdjson_inline void descend_to(depth_t child_depth, int32_t delta) noexcept; + + /** + * Get current depth. + */ + simdjson_inline depth_t depth() const noexcept; + + /** + * Get current (writeable) location in the string buffer. + */ + simdjson_inline uint8_t *&string_buf_loc() noexcept; + + /** + * Report an unrecoverable error, preventing further iteration. + * + * @param error The error to report. Must not be SUCCESS, UNINITIALIZED, INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + /** + * Log error, but don't stop iteration. + * @param error The error to report. Must be INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code optional_error(error_code error, const char *message) noexcept; + + /** + * Take an input in json containing max_len characters and attempt to copy it over to tmpbuf, a buffer with + * N bytes of capacity. It will return false if N is too small (smaller than max_len) of if it is zero. + * The buffer (tmpbuf) is padded with space characters. + */ + simdjson_warn_unused simdjson_inline bool copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept; + + simdjson_inline token_position position() const noexcept; + /** + * Write the raw_json_string to the string buffer and return a string_view. + * Each raw_json_string should be unescaped once, or else the string buffer might + * overflow. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, bool allow_replacement) noexcept; + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in) noexcept; + + simdjson_inline void reenter_child(token_position position, depth_t child_depth) noexcept; + + simdjson_inline error_code consume_character(char c) noexcept; +#if SIMDJSON_DEVELOPMENT_CHECKS + simdjson_inline token_position start_position(depth_t depth) const noexcept; + simdjson_inline void set_start_position(depth_t depth, token_position position) noexcept; +#endif + + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Updates this json iterator so that it is back at the beginning of the document, + * as if it had just been created. + */ + inline void rewind() noexcept; + /** + * This checks whether the {,},[,] are balanced so that the document + * ends with proper zero depth. This requires scanning the whole document + * and it may be expensive. It is expected that it will be rarely called. + * It does not attempt to match { with } and [ with ]. + */ + inline bool balanced() const noexcept; +protected: + simdjson_inline json_iterator(const uint8_t *buf, ondemand::parser *parser) noexcept; + /// The last token before the end + simdjson_inline token_position last_position() const noexcept; + /// The token *at* the end. This points at gibberish and should only be used for comparison. + simdjson_inline token_position end_position() const noexcept; + /// The end of the buffer. + simdjson_inline token_position end() const noexcept; + + friend class document; + friend class document_stream; + friend class object; + friend class array; + friend class value; + friend class raw_json_string; + friend class parser; + friend class value_iterator; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; // json_iterator + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::json_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H +/* end file simdjson/generic/ondemand/json_iterator.h for icelake */ +/* including simdjson/generic/ondemand/json_type.h for icelake: #include "simdjson/generic/ondemand/json_type.h" */ +/* begin file simdjson/generic/ondemand/json_type.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * The type of a JSON value. + */ +enum class json_type { + // Start at 1 to catch uninitialized / default values more easily + array=1, ///< A JSON array ( [ 1, 2, 3 ... ] ) + object, ///< A JSON object ( { "a": 1, "b" 2, ... } ) + number, ///< A JSON number ( 1 or -2.3 or 4.5e6 ...) + string, ///< A JSON string ( "a" or "hello world\n" ...) + boolean, ///< A JSON boolean (true or false) + null ///< A JSON null (null) +}; + +/** + * A type representing a JSON number. + * The design of the struct is deliberately straight-forward. All + * functions return standard values with no error check. + */ +struct number { + + /** + * return the automatically determined type of + * the number: number_type::floating_point_number, + * number_type::signed_integer or number_type::unsigned_integer. + * + * enum class number_type { + * floating_point_number=1, /// a binary64 number + * signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + * unsigned_integer /// a positive integer larger or equal to 1<<63 + * }; + */ + simdjson_inline ondemand::number_type get_number_type() const noexcept; + /** + * return true if the automatically determined type of + * the number is number_type::unsigned_integer. + */ + simdjson_inline bool is_uint64() const noexcept; + /** + * return the value as a uint64_t, only valid if is_uint64() is true. + */ + simdjson_inline uint64_t get_uint64() const noexcept; + simdjson_inline operator uint64_t() const noexcept; + + /** + * return true if the automatically determined type of + * the number is number_type::signed_integer. + */ + simdjson_inline bool is_int64() const noexcept; + /** + * return the value as a int64_t, only valid if is_int64() is true. + */ + simdjson_inline int64_t get_int64() const noexcept; + simdjson_inline operator int64_t() const noexcept; + + + /** + * return true if the automatically determined type of + * the number is number_type::floating_point_number. + */ + simdjson_inline bool is_double() const noexcept; + /** + * return the value as a double, only valid if is_double() is true. + */ + simdjson_inline double get_double() const noexcept; + simdjson_inline operator double() const noexcept; + + /** + * Convert the number to a double. Though it always succeed, the conversion + * may be lossy if the number cannot be represented exactly. + */ + simdjson_inline double as_double() const noexcept; + + +protected: + /** + * The next block of declaration is designed so that we can call the number parsing + * functions on a number type. They are protected and should never be used outside + * of the core simdjson library. + */ + friend class value_iterator; + template + friend error_code numberparsing::slow_float_parsing(simdjson_unused const uint8_t * src, W writer); + template + friend error_code numberparsing::write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer); + template + friend error_code numberparsing::parse_number(const uint8_t *const src, W &writer); + /** Store a signed 64-bit value to the number. */ + simdjson_inline void append_s64(int64_t value) noexcept; + /** Store an unsigned 64-bit value to the number. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + /** Store a double value to the number. */ + simdjson_inline void append_double(double value) noexcept; + /** Specifies that the value is a double, but leave it undefined. */ + simdjson_inline void skip_double() noexcept; + /** + * End of friend declarations. + */ + + /** + * Our attributes are a union type (size = 64 bits) + * followed by a type indicator. + */ + union { + double floating_point_number; + int64_t signed_integer; + uint64_t unsigned_integer; + } payload{0}; + number_type type{number_type::signed_integer}; +}; + +/** + * Write the JSON type to the output stream + * + * @param out The output stream. + * @param type The json_type. + */ +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept; + +#if SIMDJSON_EXCEPTIONS +/** + * Send JSON type to an output stream. + * + * @param out The output stream. + * @param type The json_type. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false); +#endif + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::json_type &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H +/* end file simdjson/generic/ondemand/json_type.h for icelake */ +/* including simdjson/generic/ondemand/raw_json_string.h for icelake: #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * A string escaped per JSON rules, terminated with quote ("). They are used to represent + * unescaped keys inside JSON documents. + * + * (In other words, a pointer to the beginning of a string, just after the start quote, inside a + * JSON file.) + * + * This class is deliberately simplistic and has little functionality. You can + * compare a raw_json_string instance with an unescaped C string, but + * that is nearly all you can do. + * + * The raw_json_string is unescaped. If you wish to write an unescaped version of it to your own + * buffer, you may do so using the parser.unescape(string, buff) method, using an ondemand::parser + * instance. Doing so requires you to have a sufficiently large buffer. + * + * The raw_json_string instances originate typically from field instance which in turn represent + * key-value pairs from object instances. From a field instance, you get the raw_json_string + * instance by calling key(). You can, if you want a more usable string_view instance, call + * the unescaped_key() method on the field instance. You may also create a raw_json_string from + * any other string value, with the value.get_raw_json_string() method. Again, you can get + * a more usable string_view instance by calling get_string(). + * + */ +class raw_json_string { +public: + /** + * Create a new invalid raw_json_string. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline raw_json_string() noexcept = default; + + /** + * Create a new invalid raw_json_string pointed at the given location in the JSON. + * + * The given location must be just *after* the beginning quote (") in the JSON file. + * + * It *must* be terminated by a ", and be a valid JSON string. + */ + simdjson_inline raw_json_string(const uint8_t * _buf) noexcept; + /** + * Get the raw pointer to the beginning of the string in the JSON (just after the "). + * + * It is possible for this function to return a null pointer if the instance + * has outlived its existence. + */ + simdjson_inline const char * raw() const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done) on target.size() characters, + * and if the raw_json_string instance has a quote character at byte index target.size(). + * We never read more than length + 1 bytes in the raw_json_string instance. + * If length is smaller than target.size(), this will return false. + * + * The std::string_view instance may contain any characters. However, the caller + * is responsible for setting length so that length bytes may be read in the + * raw_json_string. + * + * Performance: the comparison may be done using memcmp which may be efficient + * for long strings. + */ + simdjson_inline bool unsafe_is_equal(size_t length, std::string_view target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The std::string_view instance should not contain unescaped quote characters: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * Performance: the comparison is done byte-by-byte which might be inefficient for + * long strings. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The provided C string should not contain an unescaped quote character: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(const char* target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(const char* target) const noexcept; + + /** + * Returns true if target is free from unescaped quote. If target is known at + * compile-time, we might expect the computation to happen at compile time with + * many compilers (not all!). + */ + static simdjson_inline bool is_free_from_unescaped_quote(std::string_view target) noexcept; + static simdjson_inline bool is_free_from_unescaped_quote(const char* target) noexcept; + +private: + + + /** + * This will set the inner pointer to zero, effectively making + * this instance unusable. + */ + simdjson_inline void consume() noexcept { buf = nullptr; } + + /** + * Checks whether the inner pointer is non-null and thus usable. + */ + simdjson_inline simdjson_warn_unused bool alive() const noexcept { return buf != nullptr; } + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result will be a valid UTF-8. + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + * @param allow_replacement Whether we allow replacement of invalid surrogate pairs. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape(json_iterator &iter, bool allow_replacement) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result may not be a valid UTF-8. https://simonsapin.github.io/wtf-8/ + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(json_iterator &iter) const noexcept; + const uint8_t * buf{}; + friend class object; + friend class field; + friend class parser; + friend struct simdjson_result; +}; + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &, const raw_json_string &) noexcept; + +/** + * Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible + * for providing a string with no unescaped quote. Note that unescaped quotes cannot be present in valid JSON strings. + */ +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept; +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept; + + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::raw_json_string &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private + + simdjson_inline simdjson_result raw() const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape(icelake::ondemand::json_iterator &iter, bool allow_replacement) const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(icelake::ondemand::json_iterator &iter) const noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H +/* end file simdjson/generic/ondemand/raw_json_string.h for icelake */ +/* including simdjson/generic/ondemand/parser.h for icelake: #include "simdjson/generic/ondemand/parser.h" */ +/* begin file simdjson/generic/ondemand/parser.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * The default batch size for document_stream instances for this On Demand kernel. + * Note that different On Demand kernel may use a different DEFAULT_BATCH_SIZE value + * in the future. + */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * A JSON fragment iterator. + * + * This holds the actual iterator as well as the buffer for writing strings. + */ +class parser { +public: + /** + * Create a JSON parser. + * + * The new parser will have zero capacity. + */ + inline explicit parser(size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept; + + inline parser(parser &&other) noexcept = default; + simdjson_inline parser(const parser &other) = delete; + simdjson_inline parser &operator=(const parser &other) = delete; + simdjson_inline parser &operator=(parser &&other) noexcept = default; + + /** Deallocate the JSON parser. */ + inline ~parser() noexcept = default; + + /** + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * document doc = parser.iterate(json); + * + * It is expected that the content is a valid UTF-8 file, containing a valid JSON document. + * Otherwise the iterate method may return an error. In particular, the whole input should be + * valid: we do not attempt to tolerate incorrect content either before or after a JSON + * document. If there is a UTF-8 BOM, the parser skips it. + * + * ### IMPORTANT: Validate what you use + * + * Calling iterate on an invalid JSON document may not immediately trigger an error. The call to + * iterate does not parse and validate the whole document. + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * @param len The length of the JSON. + * @param capacity The number of bytes allocated in the JSON (must be at least len+SIMDJSON_PADDING). + * + * @return The document, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate(padded_string_view json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const char *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const uint8_t *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string_view json, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(padded_string &&json) & noexcept = delete; + + /** + * @private + * + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * json_iterator doc = parser.iterate(json); + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * The ondemand::document instance holds the iterator. The document must remain in scope + * while you are accessing instances of ondemand::value, ondemand::object, ondemand::array. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * + * @return The iterator, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate_raw(padded_string_view json) & noexcept; + + + /** + * Parse a buffer containing many JSON documents. + * + * auto json = R"({ "foo": 1 } { "foo": 2 } { "foo": 3 } )"_padded; + * ondemand::parser parser; + * ondemand::document_stream docs = parser.iterate_many(json); + * for (auto & doc : docs) { + * std::cout << doc["foo"] << std::endl; + * } + * // Prints 1 2 3 + * + * No copy of the input buffer is made. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * + * The caller is responsabile to ensure that the input string data remains unchanged and is + * not deleted during the loop. + * + * ### Format + * + * The buffer must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by ASCII whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. Documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with ASCII whitespace. + * + * The characters inside a JSON document, and between JSON documents, must be valid Unicode (UTF-8). + * If there is a UTF-8 BOM, the parser skips it. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excessively small values may impact negatively the + * performance. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The concatenated JSON to parse. + * @param len The length of the concatenated JSON. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 10MB, which has been a reasonable sweet spot in our tests. + * @param allow_comma_separated (defaults on false) This allows a mode where the documents are + * separated by commas instead of whitespace. It comes with a performance + * penalty because the entire document is indexed at once (and the document must be + * less than 4 GB), and there is no multithreading. In this mode, the batch_size parameter + * is effectively ignored, as it is set to at least the document size. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result iterate_many(const uint8_t *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const char *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const std::string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const std::string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const padded_string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const padded_string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_result iterate_many(const char *buf, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept = delete; + + /** The capacity of this parser (the largest document it can process). */ + simdjson_inline size_t capacity() const noexcept; + /** The maximum capacity of this parser (the largest document it is allowed to process). */ + simdjson_inline size_t max_capacity() const noexcept; + simdjson_inline void set_max_capacity(size_t max_capacity) noexcept; + /** + * The maximum depth of this parser (the most deeply nested objects and arrays it can process). + * This parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * The max_depth parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused error_code allocate(size_t capacity, size_t max_depth=DEFAULT_MAX_DEPTH) noexcept; + + #ifdef SIMDJSON_THREADS_ENABLED + /** + * The parser instance can use threads when they are available to speed up some + * operations. It is enabled by default. Changing this attribute will change the + * behavior of the parser for future operations. + */ + bool threaded{true}; + #endif + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result must be valid UTF-8. + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @param allow_replacement Whether we allow a replacement if the input string contains unmatched surrogate pairs. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement = false) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result may not be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept; + +private: + /** @private [for benchmarking access] The implementation to use */ + std::unique_ptr implementation{}; + size_t _capacity{0}; + size_t _max_capacity; + size_t _max_depth{DEFAULT_MAX_DEPTH}; + std::unique_ptr string_buf{}; +#if SIMDJSON_DEVELOPMENT_CHECKS + std::unique_ptr start_positions{}; +#endif + + friend class json_iterator; + friend class document_stream; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::parser &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_H +/* end file simdjson/generic/ondemand/parser.h for icelake */ + +// All other declarations +/* including simdjson/generic/ondemand/array.h for icelake: #include "simdjson/generic/ondemand/array.h" */ +/* begin file simdjson/generic/ondemand/array.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * A forward-only JSON array. + */ +class array { +public: + /** + * Create a new invalid array. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline array() noexcept = default; + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an array is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the beginning of the array and checks whether the + * array is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result is_empty() & noexcept; + /** + * Reset the iterator so that we are pointing back at the + * beginning of the array. You should still consume values only once even if you + * can iterate through the array more than once. If you unescape a string + * within the array more than once, you have unsafe code. Note that rewinding + * an array means that you may need to reparse it anew: it is not a free + * operation. + * + * @returns true if the array contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/0/foo/a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an array + * instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the array and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Get the value at the given index. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; +protected: + /** + * Go to the end of the array, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + + /** + * Begin array iteration. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + */ + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + /** + * Begin array iteration from the root. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + * @error TAPE_ERROR if there is no closing ] at the end of the document. + */ + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + /** + * Begin array iteration. + * + * This version of the method should be called after the initial [ has been verified, and is + * intended for use by switch statements that check the type of a value. + * + * @param iter The iterator. Must be after the initial [. Will be *moved* into the resulting array. + */ + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + + /** + * Create an array at the given Internal array creation. Call array::start() or array::started() instead of this. + * + * @param iter The iterator. Must either be at the start of the first element with iter.is_alive() + * == true, or past the [] with is_alive() == false if the array is empty. Will be *moved* + * into the resulting array. + */ + simdjson_inline array(const value_iterator &iter) noexcept; + + /** + * Iterator marking current position. + * + * iter.is_alive() == false indicates iteration is complete. + */ + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; + friend struct simdjson_result; + friend class array_iterator; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::array &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + inline simdjson_result count_elements() & noexcept; + inline simdjson_result is_empty() & noexcept; + inline simdjson_result reset() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_H +/* end file simdjson/generic/ondemand/array.h for icelake */ +/* including simdjson/generic/ondemand/array_iterator.h for icelake: #include "simdjson/generic/ondemand/array_iterator.h" */ +/* begin file simdjson/generic/ondemand/array_iterator.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * A forward-only JSON array. + * + * This is an input_iterator, meaning: + * - It is forward-only + * - * must be called exactly once per element. + * - ++ must be called exactly once in between each * (*, ++, *, ++, * ...) + */ +class array_iterator { +public: + /** Create a new, invalid array iterator. */ + simdjson_inline array_iterator() noexcept = default; + + // + // Iterator interface + // + + /** + * Get the current element. + * + * Part of the std::iterator interface. + */ + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + /** + * Check if we are at the end of the JSON. + * + * Part of the std::iterator interface. + * + * @return true if there are no more elements in the JSON array. + */ + simdjson_inline bool operator==(const array_iterator &) const noexcept; + /** + * Check if there are more elements in the JSON array. + * + * Part of the std::iterator interface. + * + * @return true if there are more elements in the JSON array. + */ + simdjson_inline bool operator!=(const array_iterator &) const noexcept; + /** + * Move to the next element. + * + * Part of the std::iterator interface. + */ + simdjson_inline array_iterator &operator++() noexcept; + +private: + value_iterator iter{}; + + simdjson_inline array_iterator(const value_iterator &iter) noexcept; + + friend class array; + friend class value; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::array_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H +/* end file simdjson/generic/ondemand/array_iterator.h for icelake */ +/* including simdjson/generic/ondemand/document.h for icelake: #include "simdjson/generic/ondemand/document.h" */ +/* begin file simdjson/generic/ondemand/document.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * A JSON document. It holds a json_iterator instance. + * + * Used by tokens to get text, and string buffer location. + * + * You must keep the document around during iteration. + */ +class document { +public: + /** + * Create a new invalid document. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline document() noexcept = default; + simdjson_inline document(const document &other) noexcept = delete; // pass your documents by reference, not by copy + simdjson_inline document(document &&other) noexcept = default; + simdjson_inline document &operator=(const document &other) noexcept = delete; + simdjson_inline document &operator=(document &&other) noexcept = default; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() & noexcept; + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() & noexcept; + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + /** + * Cast this JSON value (inside string) to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: Calling get_string() twice on the same document is an error. + * + * @param Whether to allow a replacement character for unmatched surrogate pairs. + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + /** + * Cast this JSON value to a string. + * + * The string is not guaranteed to be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * + * Important: Calling get_wobbly_string() twice on the same document is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + /** + * Cast this JSON value to a value when the document is an object or an array. + * + * @returns A value if a JSON array or object cannot be found. + * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result get_value() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() & noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + /** @overload template simdjson_result get() & noexcept */ + template simdjson_inline simdjson_result get() && noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool, value + * + * Be mindful that the document instance must remain in scope while you are accessing object, array and value instances. + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) & noexcept; + /** @overload template error_code get(T &out) & noexcept */ + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() & noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() & noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); + /** + * Cast this JSON value to a value. + * + * @returns A value value. + * @exception if a JSON value cannot be found + */ + simdjson_inline operator value() noexcept(false); +#endif + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) & noexcept; + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to + * a key a single time. Doing object["mykey"].to_string()and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the document is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the document is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the document is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. If this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view may be the padded buffer. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + /** + * Reset the iterator inside the document instance so we are pointing back at the + * beginning of the document, as if it had just been created. It invalidates all + * values, objects and arrays that you have created so far (including unescaped strings). + */ + inline void rewind() noexcept; + /** + * Returns debugging information. + */ + inline std::string to_debug_string() noexcept; + /** + * Some unrecoverable error conditions may render the document instance unusable. + * The is_alive() method returns true when the document is still suitable. + */ + inline bool is_alive() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Returns true if this document has been fully parsed. + * If you have consumed the whole document and at_end() returns + * false, then there may be trailing content. + */ + inline bool at_end() const noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() automatically calls rewind between each call. Thus + * all values, objects and arrays that you have created so far (including unescaped strings) + * are invalidated. After calling at_pointer, you need to consume the result: string values + * should be stored in your own variables, arrays should be decoded and stored in your own array-like + * structures and so forth. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + * - SCALAR_DOCUMENT_AS_VALUE if the json_pointer is empty and the document is not a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the document and returns a string_view instance corresponding to the + * document as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; +protected: + /** + * Consumes the document. + */ + simdjson_inline error_code consume() noexcept; + + simdjson_inline document(ondemand::json_iterator &&iter) noexcept; + simdjson_inline const uint8_t *text(uint32_t idx) const noexcept; + + simdjson_inline value_iterator resume_value_iterator() noexcept; + simdjson_inline value_iterator get_root_value_iterator() noexcept; + simdjson_inline simdjson_result start_or_resume_object() noexcept; + static simdjson_inline document start(ondemand::json_iterator &&iter) noexcept; + + // + // Fields + // + json_iterator iter{}; ///< Current position in the document + static constexpr depth_t DOCUMENT_DEPTH = 0; ///< document depth is always 0 + + friend class array_iterator; + friend class value; + friend class ondemand::parser; + friend class object; + friend class array; + friend class field; + friend class token; + friend class document_stream; + friend class document_reference; +}; + + +/** + * A document_reference is a thin wrapper around a document reference instance. + */ +class document_reference { +public: + simdjson_inline document_reference() noexcept; + simdjson_inline document_reference(document &d) noexcept; + simdjson_inline document_reference(const document_reference &other) noexcept = default; + simdjson_inline document_reference& operator=(const document_reference &other) noexcept = default; + simdjson_inline void rewind() noexcept; + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + + simdjson_inline simdjson_result is_null() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + simdjson_inline operator document&() const noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator array() & noexcept(false); + simdjson_inline operator object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +private: + document *doc{nullptr}; +}; +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::document &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() & noexcept; + template simdjson_inline simdjson_result get() && noexcept; + + template simdjson_inline error_code get(T &out) & noexcept; + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator icelake::ondemand::array() & noexcept(false); + simdjson_inline operator icelake::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator icelake::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator icelake::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool at_end() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + + + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::document_reference value, error_code error) noexcept; + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator icelake::ondemand::array() & noexcept(false); + simdjson_inline operator icelake::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator icelake::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator icelake::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document_reference::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H +/* end file simdjson/generic/ondemand/document.h for icelake */ +/* including simdjson/generic/ondemand/document_stream.h for icelake: #include "simdjson/generic/ondemand/document_stream.h" */ +/* begin file simdjson/generic/ondemand/document_stream.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#ifdef SIMDJSON_THREADS_ENABLED +#include +#include +#include +#endif + +namespace simdjson { +namespace icelake { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED +/** @private Custom worker class **/ +struct stage1_worker { + stage1_worker() noexcept = default; + stage1_worker(const stage1_worker&) = delete; + stage1_worker(stage1_worker&&) = delete; + stage1_worker operator=(const stage1_worker&) = delete; + ~stage1_worker(); + /** + * We only start the thread when it is needed, not at object construction, this may throw. + * You should only call this once. + **/ + void start_thread(); + /** + * Start a stage 1 job. You should first call 'run', then 'finish'. + * You must call start_thread once before. + */ + void run(document_stream * ds, parser * stage1, size_t next_batch_start); + /** Wait for the run to finish (blocking). You should first call 'run', then 'finish'. **/ + void finish(); + +private: + + /** + * Normally, we would never stop the thread. But we do in the destructor. + * This function is only safe assuming that you are not waiting for results. You + * should have called run, then finish, and be done. + **/ + void stop_thread(); + + std::thread thread{}; + /** These three variables define the work done by the thread. **/ + ondemand::parser * stage1_thread_parser{}; + size_t _next_batch_start{}; + document_stream * owner{}; + /** + * We have two state variables. This could be streamlined to one variable in the future but + * we use two for clarity. + */ + bool has_work{false}; + bool can_work{true}; + + /** + * We lock using a mutex. + */ + std::mutex locking_mutex{}; + std::condition_variable cond_var{}; + + friend class document_stream; +}; +#endif // SIMDJSON_THREADS_ENABLED + +/** + * A forward-only stream of documents. + * + * Produced by parser::iterate_many. + * + */ +class document_stream { +public: + /** + * Construct an uninitialized document_stream. + * + * ```c++ + * document_stream docs; + * auto error = parser.iterate_many(json).get(docs); + * ``` + */ + simdjson_inline document_stream() noexcept; + /** Move one document_stream to another. */ + simdjson_inline document_stream(document_stream &&other) noexcept = default; + /** Move one document_stream to another. */ + simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default; + + simdjson_inline ~document_stream() noexcept; + + /** + * Returns the input size in bytes. + */ + inline size_t size_in_bytes() const noexcept; + + /** + * After iterating through the stream, this method + * returns the number of bytes that were not parsed at the end + * of the stream. If truncated_bytes() differs from zero, + * then the input was truncated maybe because incomplete JSON + * documents were found at the end of the stream. You + * may need to process the bytes in the interval [size_in_bytes()-truncated_bytes(), size_in_bytes()). + * + * You should only call truncated_bytes() after streaming through all + * documents, like so: + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto & doc : stream) { + * // do something with doc + * } + * size_t truncated = stream.truncated_bytes(); + * + */ + inline size_t truncated_bytes() const noexcept; + + class iterator { + public: + using value_type = simdjson_result; + using reference = value_type; + + using difference_type = std::ptrdiff_t; + + using iterator_category = std::input_iterator_tag; + + /** + * Default constructor. + */ + simdjson_inline iterator() noexcept; + /** + * Get the current document (or error). + */ + simdjson_inline simdjson_result operator*() noexcept; + /** + * Advance to the next document (prefix). + */ + inline iterator& operator++() noexcept; + /** + * Check if we're at the end yet. + * @param other the end iterator to compare to. + */ + simdjson_inline bool operator!=(const iterator &other) const noexcept; + /** + * @private + * + * Gives the current index in the input document in bytes. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * size_t index = i.current_index(); + * } + * + * This function (current_index()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline size_t current_index() const noexcept; + + /** + * @private + * + * Gives a view of the current document at the current position. + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * std::string_view v = i.source(); + * } + * + * The returned string_view instance is simply a map to the (unparsed) + * source string: it may thus include white-space characters and all manner + * of padding. + * + * This function (source()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + * + */ + simdjson_inline std::string_view source() const noexcept; + + /** + * Returns error of the stream (if any). + */ + inline error_code error() const noexcept; + + private: + simdjson_inline iterator(document_stream *s, bool finished) noexcept; + /** The document_stream we're iterating through. */ + document_stream* stream; + /** Whether we're finished or not. */ + bool finished; + + friend class document; + friend class document_stream; + friend class json_iterator; + }; + + /** + * Start iterating the documents in the stream. + */ + simdjson_inline iterator begin() noexcept; + /** + * The end of the stream, for iterator comparison purposes. + */ + simdjson_inline iterator end() noexcept; + +private: + + document_stream &operator=(const document_stream &) = delete; // Disallow copying + document_stream(const document_stream &other) = delete; // Disallow copying + + /** + * Construct a document_stream. Does not allocate or parse anything until the iterator is + * used. + * + * @param parser is a reference to the parser instance used to generate this document_stream + * @param buf is the raw byte buffer we need to process + * @param len is the length of the raw byte buffer in bytes + * @param batch_size is the size of the windows (must be strictly greater or equal to the largest JSON document) + */ + simdjson_inline document_stream( + ondemand::parser &parser, + const uint8_t *buf, + size_t len, + size_t batch_size, + bool allow_comma_separated + ) noexcept; + + /** + * Parse the first document in the buffer. Used by begin(), to handle allocation and + * initialization. + */ + inline void start() noexcept; + + /** + * Parse the next document found in the buffer previously given to document_stream. + * + * The content should be a valid JSON document encoded as UTF-8. If there is a + * UTF-8 BOM, the parser skips it. + * + * You do NOT need to pre-allocate a parser. This function takes care of + * pre-allocating a capacity defined by the batch_size defined when creating the + * document_stream object. + * + * The function returns simdjson::EMPTY if there is no more data to be parsed. + * + * The function returns simdjson::SUCCESS (as integer = 0) in case of success + * and indicates that the buffer has successfully been parsed to the end. + * Every document it contained has been parsed without error. + * + * The function returns an error code from simdjson/simdjson.h in case of failure + * such as simdjson::CAPACITY, simdjson::MEMALLOC, simdjson::DEPTH_ERROR and so forth; + * the simdjson::error_message function converts these error codes into a string). + * + * You can also check validity by calling parser.is_valid(). The same parser can + * and should be reused for the other documents in the buffer. + */ + inline void next() noexcept; + + /** Move the json_iterator of the document to the location of the next document in the stream. */ + inline void next_document() noexcept; + + /** Get the next document index. */ + inline size_t next_batch_start() const noexcept; + + /** Pass the next batch through stage 1 with the given parser. */ + inline error_code run_stage1(ondemand::parser &p, size_t batch_start) noexcept; + + // Fields + ondemand::parser *parser; + const uint8_t *buf; + size_t len; + size_t batch_size; + bool allow_comma_separated; + /** + * We are going to use just one document instance. The document owns + * the json_iterator. It implies that we only ever pass a reference + * to the document to the users. + */ + document doc{}; + /** The error (or lack thereof) from the current document. */ + error_code error; + size_t batch_start{0}; + size_t doc_index{}; + + #ifdef SIMDJSON_THREADS_ENABLED + /** Indicates whether we use threads. Note that this needs to be a constant during the execution of the parsing. */ + bool use_thread; + + inline void load_from_stage1_thread() noexcept; + + /** Start a thread to run stage 1 on the next batch. */ + inline void start_stage1_thread() noexcept; + + /** Wait for the stage 1 thread to finish and capture the results. */ + inline void finish_stage1_thread() noexcept; + + /** The error returned from the stage 1 thread. */ + error_code stage1_thread_error{UNINITIALIZED}; + /** The thread used to run stage 1 against the next batch in the background. */ + std::unique_ptr worker{new(std::nothrow) stage1_worker()}; + /** + * The parser used to run stage 1 in the background. Will be swapped + * with the regular parser when finished. + */ + ondemand::parser stage1_thread_parser{}; + + friend struct stage1_worker; + #endif // SIMDJSON_THREADS_ENABLED + + friend class parser; + friend class document; + friend class json_iterator; + friend struct simdjson_result; + friend struct internal::simdjson_result_base; +}; // document_stream + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::document_stream &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H +/* end file simdjson/generic/ondemand/document_stream.h for icelake */ +/* including simdjson/generic/ondemand/field.h for icelake: #include "simdjson/generic/ondemand/field.h" */ +/* begin file simdjson/generic/ondemand/field.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * A JSON field (key/value pair) in an object. + * + * Returned from object iteration. + * + * Extends from std::pair so you can use C++ algorithms that rely on pairs. + */ +class field : public std::pair { +public: + /** + * Create a new invalid field. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline field() noexcept; + + /** + * Get the key as a string_view (for higher speed, consider raw_key). + * We deliberately use a more cumbersome name (unescaped_key) to force users + * to think twice about using it. + * + * This consumes the key: once you have called unescaped_key(), you cannot + * call it again nor can you call key(). + */ + simdjson_inline simdjson_warn_unused simdjson_result unescaped_key(bool allow_replacement) noexcept; + /** + * Get the key as a raw_json_string. Can be used for direct comparison with + * an unescaped C string: e.g., key() == "test". + */ + simdjson_inline raw_json_string key() const noexcept; + /** + * Get the field value. + */ + simdjson_inline ondemand::value &value() & noexcept; + /** + * @overload ondemand::value &ondemand::value() & noexcept + */ + simdjson_inline ondemand::value value() && noexcept; + +protected: + simdjson_inline field(raw_json_string key, ondemand::value &&value) noexcept; + static simdjson_inline simdjson_result start(value_iterator &parent_iter) noexcept; + static simdjson_inline simdjson_result start(const value_iterator &parent_iter, raw_json_string key) noexcept; + friend struct simdjson_result; + friend class object_iterator; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::field &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result unescaped_key(bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result key() noexcept; + simdjson_inline simdjson_result value() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_H +/* end file simdjson/generic/ondemand/field.h for icelake */ +/* including simdjson/generic/ondemand/object.h for icelake: #include "simdjson/generic/ondemand/object.h" */ +/* begin file simdjson/generic/ondemand/object.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +/** + * A forward-only JSON object field iterator. + */ +class object { +public: + /** + * Create a new invalid object. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a + * key a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an object + * instance: there is no rewind and no invalidation. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + + /** + * Reset the iterator so that we are pointing back at the + * beginning of the object. You should still consume values only once even if you + * can iterate through the object more than once. If you unescape a string within + * the object more than once, you have unsafe code. Note that rewinding an object + * means that you may need to reparse it anew: it is not a free operation. + * + * @returns true if the object contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * This method scans the beginning of the object and checks whether the + * object is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + inline simdjson_result is_empty() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Consumes the object and returns a string_view instance corresponding to the + * object as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + +protected: + /** + * Go to the end of the object, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + static simdjson_inline object resume(const value_iterator &iter) noexcept; + simdjson_inline object(const value_iterator &iter) noexcept; + + simdjson_warn_unused simdjson_inline error_code find_field_raw(const std::string_view key) noexcept; + + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::object &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + inline simdjson_result reset() noexcept; + inline simdjson_result is_empty() noexcept; + inline simdjson_result count_fields() & noexcept; + inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_H +/* end file simdjson/generic/ondemand/object.h for icelake */ +/* including simdjson/generic/ondemand/object_iterator.h for icelake: #include "simdjson/generic/ondemand/object_iterator.h" */ +/* begin file simdjson/generic/ondemand/object_iterator.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +class object_iterator { +public: + /** + * Create a new invalid object_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object_iterator() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline simdjson_result operator*() noexcept; + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const object_iterator &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const object_iterator &) const noexcept; + // Checks for ']' and ',' + simdjson_inline object_iterator &operator++() noexcept; + +private: + /** + * The underlying JSON iterator. + * + * PERF NOTE: expected to be elided in favor of the parent document: this is set when the object + * is first used, and never changes afterwards. + */ + value_iterator iter{}; + + simdjson_inline object_iterator(const value_iterator &iter) noexcept; + friend struct simdjson_result; + friend class object; +}; + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public icelake::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(icelake::ondemand::object_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + // Checks for ']' and ',' + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H +/* end file simdjson/generic/ondemand/object_iterator.h for icelake */ +/* including simdjson/generic/ondemand/serialization.h for icelake: #include "simdjson/generic/ondemand/serialization.h" */ +/* begin file simdjson/generic/ondemand/serialization.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Create a string-view instance out of a document instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(icelake::ondemand::document& x) noexcept; +/** + * Create a string-view instance out of a value instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. The value must + * not have been accessed previously. It does not + * validate the content. + */ +inline simdjson_result to_json_string(icelake::ondemand::value& x) noexcept; +/** + * Create a string-view instance out of an object instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(icelake::ondemand::object& x) noexcept; +/** + * Create a string-view instance out of an array instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(icelake::ondemand::array& x) noexcept; +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +} // namespace simdjson + +/** + * We want to support argument-dependent lookup (ADL). + * Hence we should define operator<< in the namespace + * where the argument (here value, object, etc.) resides. + * Credit: @madhur4127 + * See https://github.com/simdjson/simdjson/issues/1768 + */ +namespace simdjson { namespace icelake { namespace ondemand { + +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The element. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::value x); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::array value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::document& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::document_reference& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The object. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::object value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +}}} // namespace simdjson::icelake::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H +/* end file simdjson/generic/ondemand/serialization.h for icelake */ + +// Inline definitions +/* including simdjson/generic/ondemand/array-inl.h for icelake: #include "simdjson/generic/ondemand/array-inl.h" */ +/* begin file simdjson/generic/ondemand/array-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter->depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the array is first found and the iterator is just past the `{`. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the `,` before the next value (or `]`). In this state, +// depth == iter->depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter->depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter->depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the array iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet element may be missing or not be an +// array--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter->depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between elements, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter->depth == depth, and at_start == false. +// +// ## Terminal State +// +// The terminal state has iter->depth < depth. at_start is always false. +// +// - Finished: When we have reached a `]` or have reported an error, we are finished. We signal this +// by decrementing depth. In this state, iter->depth < depth, at_start == false, and +// error == SUCCESS. +// + +simdjson_inline array::array(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result array::start(value_iterator &iter) noexcept { + // We don't need to know if the array is empty to start iteration, but we do want to know if there + // is an error--thus `simdjson_unused`. + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::start_root(value_iterator &iter) noexcept { + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_root_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::started(value_iterator &iter) noexcept { + bool has_value; + SIMDJSON_TRY(iter.started_array().get(has_value)); + return array(iter); +} + +simdjson_inline simdjson_result array::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return array_iterator(iter); +} +simdjson_inline simdjson_result array::end() noexcept { + return array_iterator(iter); +} +simdjson_inline error_code array::consume() noexcept { + auto error = iter.json_iter().skip_child(iter.depth()-1); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result array::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter._json_iter->unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline simdjson_result array::count_elements() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the array after counting the number of elements. + iter.reset_array(); + return count; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline simdjson_result array::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_array().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +inline simdjson_result array::reset() & noexcept { + return iter.reset_array(); +} + +inline simdjson_result array::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + // - means "the append position" or "the element after the end of the array" + // We don't support this, because we're returning a real element, not a position. + if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; } + + // Read the array index + size_t array_index = 0; + size_t i; + for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) { + uint8_t digit = uint8_t(json_pointer[i] - '0'); + // Check for non-digit in array index. If it's there, we're trying to get a field in an object + if (digit > 9) { return INCORRECT_TYPE; } + array_index = array_index*10 + digit; + } + + // 0 followed by other digits is invalid + if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0" + + // Empty string is invalid; so is a "/" with no digits before it + if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index" + // Get the child + auto child = at(array_index); + // If there is an error, it ends here + if(child.error()) { + return child; + } + + // If there is a /, we're not done yet, call recursively. + if (i < json_pointer.length()) { + child = child.at_pointer(json_pointer.substr(i)); + } + return child; +} + +simdjson_inline simdjson_result array::at(size_t index) noexcept { + size_t i = 0; + for (auto value : *this) { + if (i == index) { return value; } + i++; + } + return INDEX_OUT_OF_BOUNDS; +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + icelake::ondemand::array &&value +) noexcept + : implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept + : implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::is_empty() & noexcept { + if (error()) { return error(); } + return first.is_empty(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H +/* end file simdjson/generic/ondemand/array-inl.h for icelake */ +/* including simdjson/generic/ondemand/array_iterator-inl.h for icelake: #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/array_iterator-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline array_iterator::array_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result array_iterator::operator*() noexcept { + if (iter.error()) { iter.abandon(); return iter.error(); } + return value(iter.child()); +} +simdjson_inline bool array_iterator::operator==(const array_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept { + return iter.is_open(); +} +simdjson_inline array_iterator &array_iterator::operator++() noexcept { + error_code error; + // PERF NOTE this is a safety rail ... users should exit loops as soon as they receive an error, so we'll never get here. + // However, it does not seem to make a perf difference, so we add it out of an abundance of caution. + if (( error = iter.error() )) { return *this; } + if (( error = iter.skip_child() )) { return *this; } + if (( error = iter.has_next_element().error() )) { return *this; } + return *this; +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + icelake::ondemand::array_iterator &&value +) noexcept + : icelake::implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : icelake::implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++(first); + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/array_iterator-inl.h for icelake */ +/* including simdjson/generic/ondemand/document-inl.h for icelake: #include "simdjson/generic/ondemand/document-inl.h" */ +/* begin file simdjson/generic/ondemand/document-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline document::document(ondemand::json_iterator &&_iter) noexcept + : iter{std::forward(_iter)} +{ + logger::log_start_value(iter, "document"); +} + +simdjson_inline document document::start(json_iterator &&iter) noexcept { + return document(std::forward(iter)); +} + +inline void document::rewind() noexcept { + iter.rewind(); +} + +inline std::string document::to_debug_string() noexcept { + return iter.to_string(); +} + +inline simdjson_result document::current_location() const noexcept { + return iter.current_location(); +} + +inline int32_t document::current_depth() const noexcept { + return iter.depth(); +} + +inline bool document::at_end() const noexcept { + return iter.at_end(); +} + + +inline bool document::is_alive() noexcept { + return iter.is_alive(); +} +simdjson_inline value_iterator document::resume_value_iterator() noexcept { + return value_iterator(&iter, 1, iter.root_position()); +} +simdjson_inline value_iterator document::get_root_value_iterator() noexcept { + return resume_value_iterator(); +} +simdjson_inline simdjson_result document::start_or_resume_object() noexcept { + if (iter.at_root()) { + return get_object(); + } else { + return object::resume(resume_value_iterator()); + } +} +simdjson_inline simdjson_result document::get_value() noexcept { + // Make sure we start any arrays or objects before returning, so that start_root_() + // gets called. + iter.assert_at_document_depth(); + switch (*iter.peek()) { + case '[': { + // The following lines check that the document ends with ]. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_array(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + case '{': { + // The following lines would check that the document ends with }. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_object(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + default: + // Unfortunately, scalar documents are a special case in simdjson and they cannot + // be safely converted to value instances. + return SCALAR_DOCUMENT_AS_VALUE; + } +} +simdjson_inline simdjson_result document::get_array() & noexcept { + auto value = get_root_value_iterator(); + return array::start_root(value); +} +simdjson_inline simdjson_result document::get_object() & noexcept { + auto value = get_root_value_iterator(); + return object::start_root(value); +} + +/** + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. We want to disallow trailing + * content. + * Thus, in several implementations below, we pass a 'true' parameter value to + * a get_root_value_iterator() method: this indicates that we disallow trailing content. + */ + +simdjson_inline simdjson_result document::get_uint64() noexcept { + return get_root_value_iterator().get_root_uint64(true); +} +simdjson_inline simdjson_result document::get_uint64_in_string() noexcept { + return get_root_value_iterator().get_root_uint64_in_string(true); +} +simdjson_inline simdjson_result document::get_int64() noexcept { + return get_root_value_iterator().get_root_int64(true); +} +simdjson_inline simdjson_result document::get_int64_in_string() noexcept { + return get_root_value_iterator().get_root_int64_in_string(true); +} +simdjson_inline simdjson_result document::get_double() noexcept { + return get_root_value_iterator().get_root_double(true); +} +simdjson_inline simdjson_result document::get_double_in_string() noexcept { + return get_root_value_iterator().get_root_double_in_string(true); +} +simdjson_inline simdjson_result document::get_string(bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(true, allow_replacement); +} +template +simdjson_inline error_code document::get_string(string_type& receiver, bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(receiver, true, allow_replacement); +} +simdjson_inline simdjson_result document::get_wobbly_string() noexcept { + return get_root_value_iterator().get_root_wobbly_string(true); +} +simdjson_inline simdjson_result document::get_raw_json_string() noexcept { + return get_root_value_iterator().get_root_raw_json_string(true); +} +simdjson_inline simdjson_result document::get_bool() noexcept { + return get_root_value_iterator().get_root_bool(true); +} +simdjson_inline simdjson_result document::is_null() noexcept { + return get_root_value_iterator().is_root_null(true); +} + +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_array(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_object(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_double(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_bool(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_value(); } + +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_double(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_uint64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_int64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_bool(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_value(); } + +template simdjson_inline error_code document::get(T &out) & noexcept { + return get().get(out); +} +template simdjson_inline error_code document::get(T &out) && noexcept { + return std::forward(*this).get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document::operator array() & noexcept(false) { return get_array(); } +simdjson_inline document::operator object() & noexcept(false) { return get_object(); } +simdjson_inline document::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document::operator double() noexcept(false) { return get_double(); } +simdjson_inline document::operator std::string_view() noexcept(false) { return get_string(false); } +simdjson_inline document::operator raw_json_string() noexcept(false) { return get_raw_json_string(); } +simdjson_inline document::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document::operator value() noexcept(false) { return get_value(); } + +#endif +simdjson_inline simdjson_result document::count_elements() & noexcept { + auto a = get_array(); + simdjson_result answer = a.count_elements(); + /* If there was an array, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::count_fields() & noexcept { + auto a = get_object(); + simdjson_result answer = a.count_fields(); + /* If there was an object, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::at(size_t index) & noexcept { + auto a = get_array(); + return a.at(index); +} +simdjson_inline simdjson_result document::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result document::end() & noexcept { + return {}; +} + +simdjson_inline simdjson_result document::find_field(std::string_view key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field(const char *key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field_unordered(std::string_view key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::find_field_unordered(const char *key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::operator[](std::string_view key) & noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result document::operator[](const char *key) & noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline error_code document::consume() noexcept { + auto error = iter.skip_child(0); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result document::raw_json() noexcept { + auto _iter = get_root_value_iterator(); + const uint8_t * starting_point{_iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter.unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result document::type() noexcept { + return get_root_value_iterator().type(); +} + +simdjson_inline simdjson_result document::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool document::is_negative() noexcept { + return get_root_value_iterator().is_root_negative(); +} + +simdjson_inline simdjson_result document::is_integer() noexcept { + return get_root_value_iterator().is_root_integer(true); +} + +simdjson_inline simdjson_result document::get_number_type() noexcept { + return get_root_value_iterator().get_root_number_type(true); +} + +simdjson_inline simdjson_result document::get_number() noexcept { + return get_root_value_iterator().get_root_number(true); +} + + +simdjson_inline simdjson_result document::raw_json_token() noexcept { + auto _iter = get_root_value_iterator(); + return std::string_view(reinterpret_cast(_iter.peek_start()), _iter.peek_start_length()); +} + +simdjson_inline simdjson_result document::at_pointer(std::string_view json_pointer) noexcept { + rewind(); // Rewind the document each time at_pointer is called + if (json_pointer.empty()) { + return this->get_value(); + } + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + icelake::ondemand::document &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base( + error + ) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template +simdjson_inline simdjson_result simdjson_result::get() & noexcept { + if (error()) { return error(); } + return first.get(); +} +template +simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first).get(); +} +template +simdjson_inline error_code simdjson_result::get(T &out) & noexcept { + if (error()) { return error(); } + return first.get(out); +} +template +simdjson_inline error_code simdjson_result::get(T &out) && noexcept { + if (error()) { return error(); } + return std::forward(first).get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() & noexcept = delete; +template<> simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first); +} +template<> simdjson_inline error_code simdjson_result::get(icelake::ondemand::document &out) & noexcept = delete; +template<> simdjson_inline error_code simdjson_result::get(icelake::ondemand::document &out) && noexcept { + if (error()) { return error(); } + out = std::forward(first); + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} + +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} + + +simdjson_inline bool simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} + +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} + +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} + +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} + + +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator icelake::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline bool simdjson_result::at_end() const noexcept { + if (error()) { return error(); } + return first.at_end(); +} + + +simdjson_inline int32_t simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline document_reference::document_reference() noexcept : doc{nullptr} {} +simdjson_inline document_reference::document_reference(document &d) noexcept : doc(&d) {} +simdjson_inline void document_reference::rewind() noexcept { doc->rewind(); } +simdjson_inline simdjson_result document_reference::get_array() & noexcept { return doc->get_array(); } +simdjson_inline simdjson_result document_reference::get_object() & noexcept { return doc->get_object(); } +/** + * The document_reference instances are used primarily/solely for streams of JSON + * documents. + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. + * + * However, for streams of JSON documents, we want to be able to start from + * "321" "321" "321" + * and parse it successfully as a stream of JSON documents, calling get_uint64_in_string() + * successfully each time. + * + * To achieve this result, we pass a 'false' to a get_root_value_iterator() method: + * this indicates that we allow trailing content. + */ +simdjson_inline simdjson_result document_reference::get_uint64() noexcept { return doc->get_root_value_iterator().get_root_uint64(false); } +simdjson_inline simdjson_result document_reference::get_uint64_in_string() noexcept { return doc->get_root_value_iterator().get_root_uint64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_int64() noexcept { return doc->get_root_value_iterator().get_root_int64(false); } +simdjson_inline simdjson_result document_reference::get_int64_in_string() noexcept { return doc->get_root_value_iterator().get_root_int64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_double() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_double_in_string() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_string(bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(false, allow_replacement); } +template +simdjson_inline error_code document_reference::get_string(string_type& receiver, bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(receiver, false, allow_replacement); } +simdjson_inline simdjson_result document_reference::get_wobbly_string() noexcept { return doc->get_root_value_iterator().get_root_wobbly_string(false); } +simdjson_inline simdjson_result document_reference::get_raw_json_string() noexcept { return doc->get_root_value_iterator().get_root_raw_json_string(false); } +simdjson_inline simdjson_result document_reference::get_bool() noexcept { return doc->get_root_value_iterator().get_root_bool(false); } +simdjson_inline simdjson_result document_reference::get_value() noexcept { return doc->get_value(); } +simdjson_inline simdjson_result document_reference::is_null() noexcept { return doc->get_root_value_iterator().is_root_null(false); } + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document_reference::operator array() & noexcept(false) { return array(*doc); } +simdjson_inline document_reference::operator object() & noexcept(false) { return object(*doc); } +simdjson_inline document_reference::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document_reference::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document_reference::operator double() noexcept(false) { return get_double(); } +simdjson_inline document_reference::operator std::string_view() noexcept(false) { return std::string_view(*doc); } +simdjson_inline document_reference::operator raw_json_string() noexcept(false) { return raw_json_string(*doc); } +simdjson_inline document_reference::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document_reference::operator value() noexcept(false) { return value(*doc); } +#endif +simdjson_inline simdjson_result document_reference::count_elements() & noexcept { return doc->count_elements(); } +simdjson_inline simdjson_result document_reference::count_fields() & noexcept { return doc->count_fields(); } +simdjson_inline simdjson_result document_reference::at(size_t index) & noexcept { return doc->at(index); } +simdjson_inline simdjson_result document_reference::begin() & noexcept { return doc->begin(); } +simdjson_inline simdjson_result document_reference::end() & noexcept { return doc->end(); } +simdjson_inline simdjson_result document_reference::find_field(std::string_view key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::find_field(const char *key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::operator[](std::string_view key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::operator[](const char *key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::find_field_unordered(std::string_view key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::find_field_unordered(const char *key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::type() noexcept { return doc->type(); } +simdjson_inline simdjson_result document_reference::is_scalar() noexcept { return doc->is_scalar(); } +simdjson_inline simdjson_result document_reference::current_location() noexcept { return doc->current_location(); } +simdjson_inline int32_t document_reference::current_depth() const noexcept { return doc->current_depth(); } +simdjson_inline bool document_reference::is_negative() noexcept { return doc->is_negative(); } +simdjson_inline simdjson_result document_reference::is_integer() noexcept { return doc->get_root_value_iterator().is_root_integer(false); } +simdjson_inline simdjson_result document_reference::get_number_type() noexcept { return doc->get_root_value_iterator().get_root_number_type(false); } +simdjson_inline simdjson_result document_reference::get_number() noexcept { return doc->get_root_value_iterator().get_root_number(false); } +simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } +simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } +simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} +simdjson_inline document_reference::operator document&() const noexcept { return *doc; } + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + + + +namespace simdjson { +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::document_reference value, error_code error) + noexcept : implementation_simdjson_result_base(std::forward(value), error) {} + + +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator icelake::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H +/* end file simdjson/generic/ondemand/document-inl.h for icelake */ +/* including simdjson/generic/ondemand/document_stream-inl.h for icelake: #include "simdjson/generic/ondemand/document_stream-inl.h" */ +/* begin file simdjson/generic/ondemand/document_stream-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace icelake { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void stage1_worker::finish() { + // After calling "run" someone would call finish() to wait + // for the end of the processing. + // This function will wait until either the thread has done + // the processing or, else, the destructor has been called. + std::unique_lock lock(locking_mutex); + cond_var.wait(lock, [this]{return has_work == false;}); +} + +inline stage1_worker::~stage1_worker() { + // The thread may never outlive the stage1_worker instance + // and will always be stopped/joined before the stage1_worker + // instance is gone. + stop_thread(); +} + +inline void stage1_worker::start_thread() { + std::unique_lock lock(locking_mutex); + if(thread.joinable()) { + return; // This should never happen but we never want to create more than one thread. + } + thread = std::thread([this]{ + while(true) { + std::unique_lock thread_lock(locking_mutex); + // We wait for either "run" or "stop_thread" to be called. + cond_var.wait(thread_lock, [this]{return has_work || !can_work;}); + // If, for some reason, the stop_thread() method was called (i.e., the + // destructor of stage1_worker is called, then we want to immediately destroy + // the thread (and not do any more processing). + if(!can_work) { + break; + } + this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser, + this->_next_batch_start); + this->has_work = false; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify "finish" + thread_lock.unlock(); + } + } + ); +} + + +inline void stage1_worker::stop_thread() { + std::unique_lock lock(locking_mutex); + // We have to make sure that all locks can be released. + can_work = false; + has_work = false; + cond_var.notify_all(); + lock.unlock(); + if(thread.joinable()) { + thread.join(); + } +} + +inline void stage1_worker::run(document_stream * ds, parser * stage1, size_t next_batch_start) { + std::unique_lock lock(locking_mutex); + owner = ds; + _next_batch_start = next_batch_start; + stage1_thread_parser = stage1; + has_work = true; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify the thread lock that we have work + lock.unlock(); +} + +#endif // SIMDJSON_THREADS_ENABLED + +simdjson_inline document_stream::document_stream( + ondemand::parser &_parser, + const uint8_t *_buf, + size_t _len, + size_t _batch_size, + bool _allow_comma_separated +) noexcept + : parser{&_parser}, + buf{_buf}, + len{_len}, + batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size}, + allow_comma_separated{_allow_comma_separated}, + error{SUCCESS} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change + #endif +{ +#ifdef SIMDJSON_THREADS_ENABLED + if(worker.get() == nullptr) { + error = MEMALLOC; + } +#endif +} + +simdjson_inline document_stream::document_stream() noexcept + : parser{nullptr}, + buf{nullptr}, + len{0}, + batch_size{0}, + allow_comma_separated{false}, + error{UNINITIALIZED} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(false) + #endif +{ +} + +simdjson_inline document_stream::~document_stream() noexcept +{ + #ifdef SIMDJSON_THREADS_ENABLED + worker.reset(); + #endif +} + +inline size_t document_stream::size_in_bytes() const noexcept { + return len; +} + +inline size_t document_stream::truncated_bytes() const noexcept { + if(error == CAPACITY) { return len - batch_start; } + return parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] - parser->implementation->structural_indexes[parser->implementation->n_structural_indexes + 1]; +} + +simdjson_inline document_stream::iterator::iterator() noexcept + : stream{nullptr}, finished{true} { +} + +simdjson_inline document_stream::iterator::iterator(document_stream* _stream, bool is_end) noexcept + : stream{_stream}, finished{is_end} { +} + +simdjson_inline simdjson_result document_stream::iterator::operator*() noexcept { + //if(stream->error) { return stream->error; } + return simdjson_result(stream->doc, stream->error); +} + +simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept { + // If there is an error, then we want the iterator + // to be finished, no matter what. (E.g., we do not + // keep generating documents with errors, or go beyond + // a document with errors.) + // + // Users do not have to call "operator*()" when they use operator++, + // so we need to end the stream in the operator++ function. + // + // Note that setting finished = true is essential otherwise + // we would enter an infinite loop. + if (stream->error) { finished = true; } + // Note that stream->error() is guarded against error conditions + // (it will immediately return if stream->error casts to false). + // In effect, this next function does nothing when (stream->error) + // is true (hence the risk of an infinite loop). + stream->next(); + // If that was the last document, we're finished. + // It is the only type of error we do not want to appear + // in operator*. + if (stream->error == EMPTY) { finished = true; } + // If we had any other kind of error (not EMPTY) then we want + // to pass it along to the operator* and we cannot mark the result + // as "finished" just yet. + return *this; +} + +simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept { + return finished != other.finished; +} + +simdjson_inline document_stream::iterator document_stream::begin() noexcept { + start(); + // If there are no documents, we're finished. + return iterator(this, error == EMPTY); +} + +simdjson_inline document_stream::iterator document_stream::end() noexcept { + return iterator(this, true); +} + +inline void document_stream::start() noexcept { + if (error) { return; } + error = parser->allocate(batch_size); + if (error) { return; } + // Always run the first stage 1 parse immediately + batch_start = 0; + error = run_stage1(*parser, batch_start); + while(error == EMPTY) { + // In exceptional cases, we may start with an empty block + batch_start = next_batch_start(); + if (batch_start >= len) { return; } + error = run_stage1(*parser, batch_start); + } + if (error) { return; } + doc_index = batch_start; + doc = document(json_iterator(&buf[batch_start], parser)); + doc.iter._streaming = true; + + #ifdef SIMDJSON_THREADS_ENABLED + if (use_thread && next_batch_start() < len) { + // Kick off the first thread on next batch if needed + error = stage1_thread_parser.allocate(batch_size); + if (error) { return; } + worker->start_thread(); + start_stage1_thread(); + if (error) { return; } + } + #endif // SIMDJSON_THREADS_ENABLED +} + +inline void document_stream::next() noexcept { + // We always enter at once once in an error condition. + if (error) { return; } + next_document(); + if (error) { return; } + auto cur_struct_index = doc.iter._root - parser->implementation->structural_indexes.get(); + doc_index = batch_start + parser->implementation->structural_indexes[cur_struct_index]; + + // Check if at end of structural indexes (i.e. at end of batch) + if(cur_struct_index >= static_cast(parser->implementation->n_structural_indexes)) { + error = EMPTY; + // Load another batch (if available) + while (error == EMPTY) { + batch_start = next_batch_start(); + if (batch_start >= len) { break; } + #ifdef SIMDJSON_THREADS_ENABLED + if(use_thread) { + load_from_stage1_thread(); + } else { + error = run_stage1(*parser, batch_start); + } + #else + error = run_stage1(*parser, batch_start); + #endif + /** + * Whenever we move to another window, we need to update all pointers to make + * it appear as if the input buffer started at the beginning of the window. + * + * Take this input: + * + * {"z":5} {"1":1,"2":2,"4":4} [7, 10, 9] [15, 11, 12, 13] [154, 110, 112, 1311] + * + * Say you process the following window... + * + * '{"z":5} {"1":1,"2":2,"4":4} [7, 10, 9]' + * + * When you do so, the json_iterator has a pointer at the beginning of the memory region + * (pointing at the beginning of '{"z"...'. + * + * When you move to the window that starts at... + * + * '[7, 10, 9] [15, 11, 12, 13] ... + * + * then it is not sufficient to just run stage 1. You also need to re-anchor the + * json_iterator so that it believes we are starting at '[7, 10, 9]...'. + * + * Under the DOM front-end, this gets done automatically because the parser owns + * the pointer the data, and when you call stage1 and then stage2 on the same + * parser, then stage2 will run on the pointer acquired by stage1. + * + * That is, stage1 calls "this->buf = _buf" so the parser remembers the buffer that + * we used. But json_iterator has no callback when stage1 is called on the parser. + * In fact, I think that the parser is unaware of json_iterator. + * + * + * So we need to re-anchor the json_iterator after each call to stage 1 so that + * all of the pointers are in sync. + */ + doc.iter = json_iterator(&buf[batch_start], parser); + doc.iter._streaming = true; + /** + * End of resync. + */ + + if (error) { continue; } // If the error was EMPTY, we may want to load another batch. + doc_index = batch_start; + } + } +} + +inline void document_stream::next_document() noexcept { + // Go to next place where depth=0 (document depth) + error = doc.iter.skip_child(0); + if (error) { return; } + // Always set depth=1 at the start of document + doc.iter._depth = 1; + // consume comma if comma separated is allowed + if (allow_comma_separated) { doc.iter.consume_character(','); } + // Resets the string buffer at the beginning, thus invalidating the strings. + doc.iter._string_buf_loc = parser->string_buf.get(); + doc.iter._root = doc.iter.position(); +} + +inline size_t document_stream::next_batch_start() const noexcept { + return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes]; +} + +inline error_code document_stream::run_stage1(ondemand::parser &p, size_t _batch_start) noexcept { + // This code only updates the structural index in the parser, it does not update any json_iterator + // instance. + size_t remaining = len - _batch_start; + if (remaining <= batch_size) { + return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final); + } else { + return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial); + } +} + +simdjson_inline size_t document_stream::iterator::current_index() const noexcept { + return stream->doc_index; +} + +simdjson_inline std::string_view document_stream::iterator::source() const noexcept { + auto depth = stream->doc.iter.depth(); + auto cur_struct_index = stream->doc.iter._root - stream->parser->implementation->structural_indexes.get(); + + // If at root, process the first token to determine if scalar value + if (stream->doc.iter.at_root()) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': // Depth=1 already at start of document + break; + case '}': case ']': + depth--; + break; + default: // Scalar value document + // TODO: Remove any trailing whitespaces + // This returns a string spanning from start of value to the beginning of the next document (excluded) + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[++cur_struct_index] - current_index() - 1); + } + cur_struct_index++; + } + + while (cur_struct_index <= static_cast(stream->parser->implementation->n_structural_indexes)) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': + depth++; + break; + case '}': case ']': + depth--; + break; + } + if (depth == 0) { break; } + cur_struct_index++; + } + + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[cur_struct_index] - current_index() + stream->batch_start + 1);; +} + +inline error_code document_stream::iterator::error() const noexcept { + return stream->error; +} + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void document_stream::load_from_stage1_thread() noexcept { + worker->finish(); + // Swap to the parser that was loaded up in the thread. Make sure the parser has + // enough memory to swap to, as well. + std::swap(stage1_thread_parser,*parser); + error = stage1_thread_error; + if (error) { return; } + + // If there's anything left, start the stage 1 thread! + if (next_batch_start() < len) { + start_stage1_thread(); + } +} + +inline void document_stream::start_stage1_thread() noexcept { + // we call the thread on a lambda that will update + // this->stage1_thread_error + // there is only one thread that may write to this value + // TODO this is NOT exception-safe. + this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error + size_t _next_batch_start = this->next_batch_start(); + + worker->run(this, & this->stage1_thread_parser, _next_batch_start); +} + +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result::simdjson_result( + icelake::ondemand::document_stream &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} + +} + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H +/* end file simdjson/generic/ondemand/document_stream-inl.h for icelake */ +/* including simdjson/generic/ondemand/field-inl.h for icelake: #include "simdjson/generic/ondemand/field-inl.h" */ +/* begin file simdjson/generic/ondemand/field-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +// clang 6 doesn't think the default constructor can be noexcept, so we make it explicit +simdjson_inline field::field() noexcept : std::pair() {} + +simdjson_inline field::field(raw_json_string key, ondemand::value &&value) noexcept + : std::pair(key, std::forward(value)) +{ +} + +simdjson_inline simdjson_result field::start(value_iterator &parent_iter) noexcept { + raw_json_string key; + SIMDJSON_TRY( parent_iter.field_key().get(key) ); + SIMDJSON_TRY( parent_iter.field_value() ); + return field::start(parent_iter, key); +} + +simdjson_inline simdjson_result field::start(const value_iterator &parent_iter, raw_json_string key) noexcept { + return field(key, parent_iter.child()); +} + +simdjson_inline simdjson_warn_unused simdjson_result field::unescaped_key(bool allow_replacement) noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() but Visual Studio won't let us. + simdjson_result answer = first.unescape(second.iter.json_iter(), allow_replacement); + first.consume(); + return answer; +} + +simdjson_inline raw_json_string field::key() const noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() by Visual Studio won't let us. + return first; +} + +simdjson_inline value &field::value() & noexcept { + return second; +} + +simdjson_inline value field::value() && noexcept { + return std::forward(*this).second; +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + icelake::ondemand::field &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::key() noexcept { + if (error()) { return error(); } + return first.key(); +} +simdjson_inline simdjson_result simdjson_result::unescaped_key(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.unescaped_key(allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::value() noexcept { + if (error()) { return error(); } + return std::move(first.value()); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H +/* end file simdjson/generic/ondemand/field-inl.h for icelake */ +/* including simdjson/generic/ondemand/json_iterator-inl.h for icelake: #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/json_iterator-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline json_iterator::json_iterator(json_iterator &&other) noexcept + : token(std::forward(other.token)), + parser{other.parser}, + _string_buf_loc{other._string_buf_loc}, + error{other.error}, + _depth{other._depth}, + _root{other._root}, + _streaming{other._streaming} +{ + other.parser = nullptr; +} +simdjson_inline json_iterator &json_iterator::operator=(json_iterator &&other) noexcept { + token = other.token; + parser = other.parser; + _string_buf_loc = other._string_buf_loc; + error = other.error; + _depth = other._depth; + _root = other._root; + _streaming = other._streaming; + other.parser = nullptr; + return *this; +} + +simdjson_inline json_iterator::json_iterator(const uint8_t *buf, ondemand::parser *_parser) noexcept + : token(buf, &_parser->implementation->structural_indexes[0]), + parser{_parser}, + _string_buf_loc{parser->string_buf.get()}, + _depth{1}, + _root{parser->implementation->structural_indexes.get()}, + _streaming{false} + +{ + logger::log_headers(); +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif +} + +inline void json_iterator::rewind() noexcept { + token.set_position( root_position() ); + logger::log_headers(); // We start again + _string_buf_loc = parser->string_buf.get(); + _depth = 1; +} + +inline bool json_iterator::balanced() const noexcept { + token_iterator ti(token); + int32_t count{0}; + ti.set_position( root_position() ); + while(ti.peek() <= peek_last()) { + switch (*ti.return_current_and_advance()) + { + case '[': case '{': + count++; + break; + case ']': case '}': + count--; + break; + default: + break; + } + } + return count == 0; +} + + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and parent_depth, which is a desired effect. The warning does not show up if the +// skip_child() function is not marked inline). +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept { + if (depth() <= parent_depth) { return SUCCESS; } + switch (*return_current_and_advance()) { + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + + // For the first open array/object in a value, we've already incremented depth, so keep it the same + // We never stop at colon, but if we did, it wouldn't affect depth + case '[': case '{': case ':': + logger::log_start_value(*this, "skip"); + break; + // If there is a comma, we have just finished a value in an array/object, and need to get back in + case ',': + logger::log_value(*this, "skip"); + break; + // ] or } means we just finished a value and need to jump out of the array/object + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } +#if SIMDJSON_CHECK_EOF + // If there are no more tokens, the parent is incomplete. + if (at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "Missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + break; + case '"': + if(*peek() == ':') { + // We are at a key!!! + // This might happen if you just started an object and you skip it immediately. + // Performance note: it would be nice to get rid of this check as it is somewhat + // expensive. + // https://github.com/simdjson/simdjson/issues/1742 + logger::log_value(*this, "key"); + return_current_and_advance(); // eat up the ':' + break; // important!!! + } + simdjson_fallthrough; + // Anything else must be a scalar value + default: + // For the first scalar, we will have incremented depth already, so we decrement it here. + logger::log_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + } + + // Now that we've considered the first value, we only increment/decrement for arrays/objects + while (position() < end_position()) { + switch (*return_current_and_advance()) { + case '[': case '{': + logger::log_start_value(*this, "skip"); + _depth++; + break; + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + default: + logger::log_value(*this, "skip", ""); + break; + } + } + + return report_error(TAPE_ERROR, "not enough close braces"); +} + +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool json_iterator::at_root() const noexcept { + return position() == root_position(); +} + +simdjson_inline bool json_iterator::is_single_token() const noexcept { + return parser->implementation->n_structural_indexes == 1; +} + +simdjson_inline bool json_iterator::streaming() const noexcept { + return _streaming; +} + +simdjson_inline token_position json_iterator::root_position() const noexcept { + return _root; +} + +simdjson_inline void json_iterator::assert_at_document_depth() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +} + +simdjson_inline void json_iterator::assert_at_root() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + // Under Visual Studio, the next SIMDJSON_ASSUME fails with: the argument + // has side effects that will be discarded. + SIMDJSON_ASSUME( token.position() == _root ); +#endif +} + +simdjson_inline void json_iterator::assert_more_tokens(uint32_t required_tokens) const noexcept { + assert_valid_position(token._position + required_tokens - 1); +} + +simdjson_inline void json_iterator::assert_valid_position(token_position position) const noexcept { +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME( position >= &parser->implementation->structural_indexes[0] ); + SIMDJSON_ASSUME( position < &parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] ); +#endif +} + +simdjson_inline bool json_iterator::at_end() const noexcept { + return position() == end_position(); +} +simdjson_inline token_position json_iterator::end_position() const noexcept { + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + return &parser->implementation->structural_indexes[n_structural_indexes]; +} + +inline std::string json_iterator::to_string() const noexcept { + if( !is_alive() ) { return "dead json_iterator instance"; } + const char * current_structural = reinterpret_cast(token.peek()); + return std::string("json_iterator [ depth : ") + std::to_string(_depth) + + std::string(", structural : '") + std::string(current_structural,1) + + std::string("', offset : ") + std::to_string(token.current_offset()) + + std::string("', error : ") + error_message(error) + + std::string(" ]"); +} + +inline simdjson_result json_iterator::current_location() const noexcept { + if (!is_alive()) { // Unrecoverable error + if (!at_root()) { + return reinterpret_cast(token.peek(-1)); + } else { + return reinterpret_cast(token.peek()); + } + } + if (at_end()) { + return OUT_OF_BOUNDS; + } + return reinterpret_cast(token.peek()); +} + +simdjson_inline bool json_iterator::is_alive() const noexcept { + return parser; +} + +simdjson_inline void json_iterator::abandon() noexcept { + parser = nullptr; + _depth = 0; +} + +simdjson_inline const uint8_t *json_iterator::return_current_and_advance() noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif // SIMDJSON_CHECK_EOF + return token.return_current_and_advance(); +} + +simdjson_inline const uint8_t *json_iterator::unsafe_pointer() const noexcept { + // deliberately done without safety guard: + return token.peek(); +} + +simdjson_inline const uint8_t *json_iterator::peek(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // SIMDJSON_CHECK_EOF + return token.peek(delta); +} + +simdjson_inline uint32_t json_iterator::peek_length(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // #if SIMDJSON_CHECK_EOF + return token.peek_length(delta); +} + +simdjson_inline const uint8_t *json_iterator::peek(token_position position) const noexcept { + // todo: currently we require end-of-string buffering, but the following + // assert_valid_position should be turned on if/when we lift that condition. + // assert_valid_position(position); + // This is almost surely related to SIMDJSON_CHECK_EOF but given that SIMDJSON_CHECK_EOF + // is ON by default, we have no choice but to disable it for real with a comment. + return token.peek(position); +} + +simdjson_inline uint32_t json_iterator::peek_length(token_position position) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_valid_position(position); +#endif // SIMDJSON_CHECK_EOF + return token.peek_length(position); +} + +simdjson_inline token_position json_iterator::last_position() const noexcept { + // The following line fails under some compilers... + // SIMDJSON_ASSUME(parser->implementation->n_structural_indexes > 0); + // since it has side-effects. + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + SIMDJSON_ASSUME(n_structural_indexes > 0); + return &parser->implementation->structural_indexes[n_structural_indexes - 1]; +} +simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept { + return token.peek(last_position()); +} + +simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept { + SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1); + SIMDJSON_ASSUME(_depth == parent_depth + 1); + _depth = parent_depth; +} + +simdjson_inline void json_iterator::descend_to(depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); + _depth = child_depth; +} + +simdjson_inline depth_t json_iterator::depth() const noexcept { + return _depth; +} + +simdjson_inline uint8_t *&json_iterator::string_buf_loc() noexcept { + return _string_buf_loc; +} + +simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD); + logger::log_error(*this, message); + error = _error; + return error; +} + +simdjson_inline token_position json_iterator::position() const noexcept { + return token.position(); +} + +simdjson_inline simdjson_result json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept { + return parser->unescape(in, _string_buf_loc, allow_replacement); +} + +simdjson_inline simdjson_result json_iterator::unescape_wobbly(raw_json_string in) noexcept { + return parser->unescape_wobbly(in, _string_buf_loc); +} + +simdjson_inline void json_iterator::reenter_child(token_position position, depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); +#if SIMDJSON_DEVELOPMENT_CHECKS +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME(size_t(child_depth) < parser->max_depth()); + SIMDJSON_ASSUME(position >= parser->start_positions[child_depth]); +#endif +#endif + token.set_position(position); + _depth = child_depth; +} + +simdjson_inline error_code json_iterator::consume_character(char c) noexcept { + if (*peek() == c) { + return_current_and_advance(); + return SUCCESS; + } + return TAPE_ERROR; +} + +#if SIMDJSON_DEVELOPMENT_CHECKS + +simdjson_inline token_position json_iterator::start_position(depth_t depth) const noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + return size_t(depth) < parser->max_depth() ? parser->start_positions[depth] : 0; +} + +simdjson_inline void json_iterator::set_start_position(depth_t depth, token_position position) noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + if(size_t(depth) < parser->max_depth()) { parser->start_positions[depth] = position; } +} + +#endif + + +simdjson_inline error_code json_iterator::optional_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error == INCORRECT_TYPE || _error == NO_SUCH_FIELD); + logger::log_error(*this, message); + return _error; +} + + +simdjson_warn_unused simdjson_inline bool json_iterator::copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept { + // This function is not expected to be called in performance-sensitive settings. + // Let us guard against silly cases: + if((N < max_len) || (N == 0)) { return false; } + // Copy to the buffer. + std::memcpy(tmpbuf, json, max_len); + if(N > max_len) { // We pad whatever remains with ' '. + std::memset(tmpbuf + max_len, ' ', N - max_len); + } + return true; +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::json_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/json_iterator-inl.h for icelake */ +/* including simdjson/generic/ondemand/json_type-inl.h for icelake: #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* begin file simdjson/generic/ondemand/json_type-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept { + switch (type) { + case json_type::array: out << "array"; break; + case json_type::object: out << "object"; break; + case json_type::number: out << "number"; break; + case json_type::string: out << "string"; break; + case json_type::boolean: out << "boolean"; break; + case json_type::null: out << "null"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false) { + return out << type.value(); +} +#endif + + + +simdjson_inline number_type number::get_number_type() const noexcept { + return type; +} + +simdjson_inline bool number::is_uint64() const noexcept { + return get_number_type() == number_type::unsigned_integer; +} + +simdjson_inline uint64_t number::get_uint64() const noexcept { + return payload.unsigned_integer; +} + +simdjson_inline number::operator uint64_t() const noexcept { + return get_uint64(); +} + + +simdjson_inline bool number::is_int64() const noexcept { + return get_number_type() == number_type::signed_integer; +} + +simdjson_inline int64_t number::get_int64() const noexcept { + return payload.signed_integer; +} + +simdjson_inline number::operator int64_t() const noexcept { + return get_int64(); +} + +simdjson_inline bool number::is_double() const noexcept { + return get_number_type() == number_type::floating_point_number; +} + +simdjson_inline double number::get_double() const noexcept { + return payload.floating_point_number; +} + +simdjson_inline number::operator double() const noexcept { + return get_double(); +} + +simdjson_inline double number::as_double() const noexcept { + if(is_double()) { + return payload.floating_point_number; + } + if(is_int64()) { + return double(payload.signed_integer); + } + return double(payload.unsigned_integer); +} + +simdjson_inline void number::append_s64(int64_t value) noexcept { + payload.signed_integer = value; + type = number_type::signed_integer; +} + +simdjson_inline void number::append_u64(uint64_t value) noexcept { + payload.unsigned_integer = value; + type = number_type::unsigned_integer; +} + +simdjson_inline void number::append_double(double value) noexcept { + payload.floating_point_number = value; + type = number_type::floating_point_number; +} + +simdjson_inline void number::skip_double() noexcept { + type = number_type::floating_point_number; +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::json_type &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H +/* end file simdjson/generic/ondemand/json_type-inl.h for icelake */ +/* including simdjson/generic/ondemand/logger-inl.h for icelake: #include "simdjson/generic/ondemand/logger-inl.h" */ +/* begin file simdjson/generic/ondemand/logger-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace icelake { +namespace ondemand { +namespace logger { + +static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; +static constexpr const int LOG_EVENT_LEN = 20; +static constexpr const int LOG_BUFFER_LEN = 30; +static constexpr const int LOG_SMALL_BUFFER_LEN = 10; +static int log_depth = 0; // Not threadsafe. Log only. + +// Helper to turn unprintable or newline characters into spaces +static inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } +} + +template +static inline std::string string_format(const std::string& format, const Args&... args) +{ + SIMDJSON_PUSH_DISABLE_ALL_WARNINGS + int size_s = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; + auto size = static_cast(size_s); + if (size <= 0) return std::string(); + std::unique_ptr buf(new char[size]); + std::snprintf(buf.get(), size, format.c_str(), args...); + SIMDJSON_POP_DISABLE_WARNINGS + return std::string(buf.get(), buf.get() + size - 1); +} + +static inline log_level get_log_level_from_env() +{ + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + char *lvl = getenv("SIMDJSON_LOG_LEVEL"); + SIMDJSON_POP_DISABLE_WARNINGS + if (lvl && simdjson_strcasecmp(lvl, "ERROR") == 0) { return log_level::error; } + return log_level::info; +} + +static inline log_level log_threshold() +{ + static log_level threshold = get_log_level_from_env(); + return threshold; +} + +static inline bool should_log(log_level level) +{ + return level >= log_threshold(); +} + +inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "", type, detail, log_level::info); +} +inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "+", type, detail, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} +inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_line(iter, "+", type, "", delta, depth_delta, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} + +inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + if (LOG_ENABLED) { log_depth--; } + log_line(iter, "-", type, "", delta, depth_delta, log_level::info); +} + +inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_line(iter, "ERROR: ", error, detail, delta, depth_delta, log_level::error); +} +inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept { + log_line(iter, index, depth, "ERROR: ", error, detail, log_level::error); +} + +inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_event(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_value(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_value(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_start_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_start_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_end_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_end_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_error(const value_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_error(iter.json_iter(), error, detail, delta, depth_delta); +} + +inline void log_headers() noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(log_level::info))) { + // Technically a static variable is not thread-safe, but if you are using threads and logging... well... + static bool displayed_hint{false}; + log_depth = 0; + printf("\n"); + if (!displayed_hint) { + // We only print this helpful header once. + printf("# Logging provides the depth and position of the iterator user-visible steps:\n"); + printf("# +array says 'this is where we were when we discovered the start array'\n"); + printf( + "# -array says 'this is where we were when we ended the array'\n"); + printf("# skip says 'this is a structural or value I am skipping'\n"); + printf("# +/-skip says 'this is a start/end array or object I am skipping'\n"); + printf("#\n"); + printf("# The indentation of the terms (array, string,...) indicates the depth,\n"); + printf("# in addition to the depth being displayed.\n"); + printf("#\n"); + printf("# Every token in the document has a single depth determined by the tokens before it,\n"); + printf("# and is not affected by what the token actually is.\n"); + printf("#\n"); + printf("# Not all structural elements are presented as tokens in the logs.\n"); + printf("#\n"); + printf("# We never give control to the user within an empty array or an empty object.\n"); + printf("#\n"); + printf("# Inside an array, having a depth greater than the array's depth means that\n"); + printf("# we are pointing inside a value.\n"); + printf("# Having a depth equal to the array means that we are pointing right before a value.\n"); + printf("# Having a depth smaller than the array means that we have moved beyond the array.\n"); + displayed_hint = true; + } + printf("\n"); + printf("| %-*s ", LOG_EVENT_LEN, "Event"); + printf("| %-*s ", LOG_BUFFER_LEN, "Buffer"); + printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next"); + // printf("| %-*s ", 5, "Next#"); + printf("| %-*s ", 5, "Depth"); + printf("| Detail "); + printf("|\n"); + + printf("|%.*s", LOG_EVENT_LEN + 2, DASHES); + printf("|%.*s", LOG_BUFFER_LEN + 2, DASHES); + printf("|%.*s", LOG_SMALL_BUFFER_LEN + 2, DASHES); + // printf("|%.*s", 5+2, DASHES); + printf("|%.*s", 5 + 2, DASHES); + printf("|--------"); + printf("|\n"); + fflush(stdout); + } + } +} + +template +inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, log_level level, Args&&... args) noexcept { + log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail, level, std::forward(args)...); +} + +template +inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, log_level level, Args&&... args) noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(level))) { + const int indent = depth * 2; + const auto buf = iter.token.buf; + auto msg = string_format(title, std::forward(args)...); + printf("| %*s%s%-*s ", indent, "", title_prefix, + LOG_EVENT_LEN - indent - int(strlen(title_prefix)), msg.c_str()); + { + // Print the current structural. + printf("| "); + // Before we begin, the index might point right before the document. + // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938 + if (index < iter._root) { + printf("%*s", LOG_BUFFER_LEN, ""); + } else { + auto current_structural = &buf[*index]; + for (int i = 0; i < LOG_BUFFER_LEN; i++) { + printf("%c", printable_char(current_structural[i])); + } + } + printf(" "); + } + { + // Print the next structural. + printf("| "); + auto next_structural = &buf[*(index + 1)]; + for (int i = 0; i < LOG_SMALL_BUFFER_LEN; i++) { + printf("%c", printable_char(next_structural[i])); + } + printf(" "); + } + // printf("| %5u ", *(index+1)); + printf("| %5i ", depth); + printf("| %6.*s ", int(detail.size()), detail.data()); + printf("|\n"); + fflush(stdout); + } + } +} + +} // namespace logger +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H +/* end file simdjson/generic/ondemand/logger-inl.h for icelake */ +/* including simdjson/generic/ondemand/object-inl.h for icelake: #include "simdjson/generic/ondemand/object-inl.h" */ +/* begin file simdjson/generic/ondemand/object-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) & noexcept { + return find_field_unordered(key); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) && noexcept { + return std::forward(*this).find_field_unordered(key); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} + +simdjson_inline simdjson_result object::start(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_object().error() ); + return object(iter); +} +simdjson_inline simdjson_result object::start_root(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_root_object().error() ); + return object(iter); +} +simdjson_inline error_code object::consume() noexcept { + if(iter.is_at_key()) { + /** + * whenever you are pointing at a key, calling skip_child() is + * unsafe because you will hit a string and you will assume that + * it is string value, and this mistake will lead you to make bad + * depth computation. + */ + /** + * We want to 'consume' the key. We could really + * just do _json_iter->return_current_and_advance(); at this + * point, but, for clarity, we will use the high-level API to + * eat the key. We assume that the compiler optimizes away + * most of the work. + */ + simdjson_unused raw_json_string actual_key; + auto error = iter.field_key().get(actual_key); + if (error) { iter.abandon(); return error; }; + // Let us move to the value while we are at it. + if ((error = iter.field_value())) { iter.abandon(); return error; } + } + auto error_skip = iter.json_iter().skip_child(iter.depth()-1); + if(error_skip) { iter.abandon(); } + return error_skip; +} + +simdjson_inline simdjson_result object::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + const uint8_t * final_point{iter._json_iter->peek()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result object::started(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.started_object().error() ); + return object(iter); +} + +simdjson_inline object object::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline object::object(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result object::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return object_iterator(iter); +} +simdjson_inline simdjson_result object::end() noexcept { + return object_iterator(iter); +} + +inline simdjson_result object::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + size_t slash = json_pointer.find('/'); + std::string_view key = json_pointer.substr(0, slash); + // Grab the child with the given key + simdjson_result child; + + // If there is an escape character in the key, unescape it and then get the child. + size_t escape = key.find('~'); + if (escape != std::string_view::npos) { + // Unescape the key + std::string unescaped(key); + do { + switch (unescaped[escape+1]) { + case '0': + unescaped.replace(escape, 2, "~"); + break; + case '1': + unescaped.replace(escape, 2, "/"); + break; + default: + return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer"); + } + escape = unescaped.find('~', escape+1); + } while (escape != std::string::npos); + child = find_field(unescaped); // Take note find_field does not unescape keys when matching + } else { + child = find_field(key); + } + if(child.error()) { + return child; // we do not continue if there was an error + } + // If there is a /, we have to recurse and look up more of the path + if (slash != std::string_view::npos) { + child = child.at_pointer(json_pointer.substr(slash)); + } + return child; +} + +simdjson_inline simdjson_result object::count_fields() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the object after counting the number of elements. + iter.reset_object(); + return count; +} + +simdjson_inline simdjson_result object::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_object().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +simdjson_inline simdjson_result object::reset() & noexcept { + return iter.reset_object(); +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::object &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first)[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +inline simdjson_result simdjson_result::reset() noexcept { + if (error()) { return error(); } + return first.reset(); +} + +inline simdjson_result simdjson_result::is_empty() noexcept { + if (error()) { return error(); } + return first.is_empty(); +} + +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H +/* end file simdjson/generic/ondemand/object-inl.h for icelake */ +/* including simdjson/generic/ondemand/object_iterator-inl.h for icelake: #include "simdjson/generic/ondemand/object_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/object_iterator-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +// +// object_iterator +// + +simdjson_inline object_iterator::object_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result object_iterator::operator*() noexcept { + error_code error = iter.error(); + if (error) { iter.abandon(); return error; } + auto result = field::start(iter); + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (result.error()) { iter.abandon(); } + return result; +} +simdjson_inline bool object_iterator::operator==(const object_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool object_iterator::operator!=(const object_iterator &) const noexcept { + return iter.is_open(); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline object_iterator &object_iterator::operator++() noexcept { + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (!iter.is_open()) { return *this; } // Iterator will be released if there is an error + + simdjson_unused error_code error; + if ((error = iter.skip_child() )) { return *this; } + + simdjson_unused bool has_value; + if ((error = iter.has_next_field().get(has_value) )) { return *this; }; + return *this; +} +SIMDJSON_POP_DISABLE_WARNINGS + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter.depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the object is first found and the iterator is just past the {. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the , or } before the next value. In this state, +// depth == iter.depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter.depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter.depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the object iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet field may be missing or not be an +// object--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter.depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between fields, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter.depth == depth, and at_start == false. +// +// Errors that occur while reading a field to give to the user (such as when the key is not a +// string or the field is missing a colon) are yielded immediately. Depth is then decremented, +// moving to the Finished state without transitioning through an Error state at all. +// +// ## Terminal State +// +// The terminal state has iter.depth < depth. at_start is always false. +// +// - Finished: When we have reached a }, we are finished. We signal this by decrementing depth. +// In this state, iter.depth < depth, at_start == false, and error == SUCCESS. +// + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + icelake::ondemand::object_iterator &&value +) noexcept + : implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +// Checks for ']' and ',' +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++first; + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/object_iterator-inl.h for icelake */ +/* including simdjson/generic/ondemand/parser-inl.h for icelake: #include "simdjson/generic/ondemand/parser-inl.h" */ +/* begin file simdjson/generic/ondemand/parser-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string_view.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/dom/base.h" // for MINIMAL_DOCUMENT_CAPACITY */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline parser::parser(size_t max_capacity) noexcept + : _max_capacity{max_capacity} { +} + +simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept { + if (new_capacity > max_capacity()) { return CAPACITY; } + if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; } + + // string_capacity copied from document::allocate + _capacity = 0; + size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * new_capacity / 3 + SIMDJSON_PADDING, 64); + string_buf.reset(new (std::nothrow) uint8_t[string_capacity]); +#if SIMDJSON_DEVELOPMENT_CHECKS + start_positions.reset(new (std::nothrow) token_position[new_max_depth]); +#endif + if (implementation) { + SIMDJSON_TRY( implementation->set_capacity(new_capacity) ); + SIMDJSON_TRY( implementation->set_max_depth(new_max_depth) ); + } else { + SIMDJSON_TRY( simdjson::get_active_implementation()->create_dom_parser_implementation(new_capacity, new_max_depth, implementation) ); + } + _capacity = new_capacity; + _max_depth = new_max_depth; + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length() || !string_buf) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return document::start({ reinterpret_cast(json.data()), this }); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const char *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const uint8_t *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string_view json, size_t allocated) & noexcept { + return iterate(padded_string_view(json, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string &json) & noexcept { + if(json.capacity() - json.size() < SIMDJSON_PADDING) { + json.reserve(json.size() + SIMDJSON_PADDING); + } + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const std::string &json) & noexcept { + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + padded_string_view json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + const padded_string &json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate_raw(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length()) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return json_iterator(reinterpret_cast(json.data()), this); +} + +inline simdjson_result parser::iterate_many(const uint8_t *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + if(allow_comma_separated && batch_size < len) { batch_size = len; } + return document_stream(*this, buf, len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const char *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(reinterpret_cast(buf), len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const std::string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const padded_string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} + +simdjson_inline size_t parser::capacity() const noexcept { + return _capacity; +} +simdjson_inline size_t parser::max_capacity() const noexcept { + return _max_capacity; +} +simdjson_inline size_t parser::max_depth() const noexcept { + return _max_depth; +} + +simdjson_inline void parser::set_max_capacity(size_t max_capacity) noexcept { + if(max_capacity < dom::MINIMAL_DOCUMENT_CAPACITY) { + _max_capacity = max_capacity; + } else { + _max_capacity = dom::MINIMAL_DOCUMENT_CAPACITY; + } +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement) const noexcept { + uint8_t *end = implementation->parse_string(in.buf, dst, allow_replacement); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept { + uint8_t *end = implementation->parse_wobbly_string(in.buf, dst); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::parser &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H +/* end file simdjson/generic/ondemand/parser-inl.h for icelake */ +/* including simdjson/generic/ondemand/raw_json_string-inl.h for icelake: #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +namespace icelake { +namespace ondemand { + +simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {} + +simdjson_inline const char * raw_json_string::raw() const noexcept { return reinterpret_cast(buf); } + + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;pos < target.size() && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;pos < target.size();pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;target[pos] && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;target[pos];pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string_view target) const noexcept { + // If we are going to call memcmp, then we must know something about the length of the raw_json_string. + return (length >= target.size()) && (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); +} + +simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + if(target.size() <= SIMDJSON_PADDING) { + return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); + } + const char * r{raw()}; + size_t pos{0}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(std::string_view target) const noexcept { + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(const char * target) const noexcept { + // Assumptions: 'target' does not contain unescaped quote characters, is null terminated and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(const char* target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept { + return a.unsafe_is_equal(c); +} + +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept { + return a == c; +} + +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept { + return !(a == c); +} + +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept { + return !(a == c); +} + + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept { + return iter.unescape(*this, allow_replacement); +} + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape_wobbly(json_iterator &iter) const noexcept { + return iter.unescape_wobbly(*this); +} + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &out, const raw_json_string &str) noexcept { + bool in_escape = false; + const char *s = str.raw(); + while (true) { + switch (*s) { + case '\\': in_escape = !in_escape; break; + case '"': if (in_escape) { in_escape = false; } else { return out; } break; + default: if (in_escape) { in_escape = false; } + } + out << *s; + s++; + } +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::raw_json_string &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::raw() const noexcept { + if (error()) { return error(); } + return first.raw(); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape(icelake::ondemand::json_iterator &iter, bool allow_replacement) const noexcept { + if (error()) { return error(); } + return first.unescape(iter, allow_replacement); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape_wobbly(icelake::ondemand::json_iterator &iter) const noexcept { + if (error()) { return error(); } + return first.unescape_wobbly(iter); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H +/* end file simdjson/generic/ondemand/raw_json_string-inl.h for icelake */ +/* including simdjson/generic/ondemand/serialization-inl.h for icelake: #include "simdjson/generic/ondemand/serialization-inl.h" */ +/* begin file simdjson/generic/ondemand/serialization-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/serialization.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +inline std::string_view trim(const std::string_view str) noexcept { + // We can almost surely do better by rolling our own find_first_not_of function. + size_t first = str.find_first_not_of(" \t\n\r"); + // If we have the empty string (just white space), then no trimming is possible, and + // we return the empty string_view. + if (std::string_view::npos == first) { return std::string_view(); } + size_t last = str.find_last_not_of(" \t\n\r"); + return str.substr(first, (last - first + 1)); +} + + +inline simdjson_result to_json_string(icelake::ondemand::document& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(icelake::ondemand::document_reference& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(icelake::ondemand::value& x) noexcept { + /** + * If we somehow receive a value that has already been consumed, + * then the following code could be in trouble. E.g., we create + * an array as needed, but if an array was already created, then + * it could be bad. + */ + using namespace icelake::ondemand; + icelake::ondemand::json_type t; + auto error = x.type().get(t); + if(error != SUCCESS) { return error; } + switch (t) + { + case json_type::array: + { + icelake::ondemand::array array; + error = x.get_array().get(array); + if(error) { return error; } + return to_json_string(array); + } + case json_type::object: + { + icelake::ondemand::object object; + error = x.get_object().get(object); + if(error) { return error; } + return to_json_string(object); + } + default: + return trim(x.raw_json_token()); + } +} + +inline simdjson_result to_json_string(icelake::ondemand::object& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(icelake::ondemand::array& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} +} // namespace simdjson + +namespace simdjson { namespace icelake { namespace ondemand { + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::document_reference& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::icelake::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif +}}} // namespace simdjson::icelake::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H +/* end file simdjson/generic/ondemand/serialization-inl.h for icelake */ +/* including simdjson/generic/ondemand/token_iterator-inl.h for icelake: #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/token_iterator-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline token_iterator::token_iterator( + const uint8_t *_buf, + token_position position +) noexcept : buf{_buf}, _position{position} +{ +} + +simdjson_inline uint32_t token_iterator::current_offset() const noexcept { + return *(_position); +} + + +simdjson_inline const uint8_t *token_iterator::return_current_and_advance() noexcept { + return &buf[*(_position++)]; +} + +simdjson_inline const uint8_t *token_iterator::peek(token_position position) const noexcept { + return &buf[*position]; +} +simdjson_inline uint32_t token_iterator::peek_index(token_position position) const noexcept { + return *position; +} +simdjson_inline uint32_t token_iterator::peek_length(token_position position) const noexcept { + return *(position+1) - *position; +} + +simdjson_inline const uint8_t *token_iterator::peek(int32_t delta) const noexcept { + return &buf[*(_position+delta)]; +} +simdjson_inline uint32_t token_iterator::peek_index(int32_t delta) const noexcept { + return *(_position+delta); +} +simdjson_inline uint32_t token_iterator::peek_length(int32_t delta) const noexcept { + return *(_position+delta+1) - *(_position+delta); +} + +simdjson_inline token_position token_iterator::position() const noexcept { + return _position; +} +simdjson_inline void token_iterator::set_position(token_position target_position) noexcept { + _position = target_position; +} + +simdjson_inline bool token_iterator::operator==(const token_iterator &other) const noexcept { + return _position == other._position; +} +simdjson_inline bool token_iterator::operator!=(const token_iterator &other) const noexcept { + return _position != other._position; +} +simdjson_inline bool token_iterator::operator>(const token_iterator &other) const noexcept { + return _position > other._position; +} +simdjson_inline bool token_iterator::operator>=(const token_iterator &other) const noexcept { + return _position >= other._position; +} +simdjson_inline bool token_iterator::operator<(const token_iterator &other) const noexcept { + return _position < other._position; +} +simdjson_inline bool token_iterator::operator<=(const token_iterator &other) const noexcept { + return _position <= other._position; +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::token_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/token_iterator-inl.h for icelake */ +/* including simdjson/generic/ondemand/value-inl.h for icelake: #include "simdjson/generic/ondemand/value-inl.h" */ +/* begin file simdjson/generic/ondemand/value-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline value::value(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} +simdjson_inline value value::start(const value_iterator &iter) noexcept { + return iter; +} +simdjson_inline value value::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline simdjson_result value::get_array() noexcept { + return array::start(iter); +} +simdjson_inline simdjson_result value::get_object() noexcept { + return object::start(iter); +} +simdjson_inline simdjson_result value::start_or_resume_object() noexcept { + if (iter.at_start()) { + return get_object(); + } else { + return object::resume(iter); + } +} + +simdjson_inline simdjson_result value::get_raw_json_string() noexcept { + return iter.get_raw_json_string(); +} +simdjson_inline simdjson_result value::get_string(bool allow_replacement) noexcept { + return iter.get_string(allow_replacement); +} +template +simdjson_inline error_code value::get_string(string_type& receiver, bool allow_replacement) noexcept { + return iter.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result value::get_wobbly_string() noexcept { + return iter.get_wobbly_string(); +} +simdjson_inline simdjson_result value::get_double() noexcept { + return iter.get_double(); +} +simdjson_inline simdjson_result value::get_double_in_string() noexcept { + return iter.get_double_in_string(); +} +simdjson_inline simdjson_result value::get_uint64() noexcept { + return iter.get_uint64(); +} +simdjson_inline simdjson_result value::get_uint64_in_string() noexcept { + return iter.get_uint64_in_string(); +} +simdjson_inline simdjson_result value::get_int64() noexcept { + return iter.get_int64(); +} +simdjson_inline simdjson_result value::get_int64_in_string() noexcept { + return iter.get_int64_in_string(); +} +simdjson_inline simdjson_result value::get_bool() noexcept { + return iter.get_bool(); +} +simdjson_inline simdjson_result value::is_null() noexcept { + return iter.is_null(); +} +template<> simdjson_inline simdjson_result value::get() noexcept { return get_array(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_object(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_number(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_double(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_bool(); } + +template simdjson_inline error_code value::get(T &out) noexcept { + return get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline value::operator array() noexcept(false) { + return get_array(); +} +simdjson_inline value::operator object() noexcept(false) { + return get_object(); +} +simdjson_inline value::operator uint64_t() noexcept(false) { + return get_uint64(); +} +simdjson_inline value::operator int64_t() noexcept(false) { + return get_int64(); +} +simdjson_inline value::operator double() noexcept(false) { + return get_double(); +} +simdjson_inline value::operator std::string_view() noexcept(false) { + return get_string(false); +} +simdjson_inline value::operator raw_json_string() noexcept(false) { + return get_raw_json_string(); +} +simdjson_inline value::operator bool() noexcept(false) { + return get_bool(); +} +#endif + +simdjson_inline simdjson_result value::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result value::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result value::count_elements() & noexcept { + simdjson_result answer; + auto a = get_array(); + answer = a.count_elements(); + // count_elements leaves you pointing inside the array, at the first element. + // We need to move back so that the user can create a new array (which requires that + // we point at '['). + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::count_fields() & noexcept { + simdjson_result answer; + auto a = get_object(); + answer = a.count_fields(); + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::at(size_t index) noexcept { + auto a = get_array(); + return a.at(index); +} + +simdjson_inline simdjson_result value::find_field(std::string_view key) noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result value::find_field(const char *key) noexcept { + return start_or_resume_object().find_field(key); +} + +simdjson_inline simdjson_result value::find_field_unordered(std::string_view key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result value::find_field_unordered(const char *key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} + +simdjson_inline simdjson_result value::operator[](std::string_view key) noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result value::operator[](const char *key) noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline simdjson_result value::type() noexcept { + return iter.type(); +} + +simdjson_inline simdjson_result value::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool value::is_negative() noexcept { + return iter.is_negative(); +} + +simdjson_inline simdjson_result value::is_integer() noexcept { + return iter.is_integer(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number_type() noexcept { + return iter.get_number_type(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number() noexcept { + return iter.get_number(); +} + +simdjson_inline std::string_view value::raw_json_token() noexcept { + return std::string_view(reinterpret_cast(iter.peek_start()), iter.peek_start_length()); +} + +simdjson_inline simdjson_result value::raw_json() noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: { + ondemand::array array; + SIMDJSON_TRY(get_array().get(array)); + return array.raw_json(); + } + case json_type::object: { + ondemand::object object; + SIMDJSON_TRY(get_object().get(object)); + return object.raw_json(); + } + default: + return raw_json_token(); + } +} + +simdjson_inline simdjson_result value::current_location() noexcept { + return iter.json_iter().current_location(); +} + +simdjson_inline int32_t value::current_depth() const noexcept{ + return iter.json_iter().depth(); +} + +simdjson_inline simdjson_result value::at_pointer(std::string_view json_pointer) noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + icelake::ondemand::value &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + if (error()) { return error(); } + return {}; +} + +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} + +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) noexcept { + if (error()) { return error(); } + return first[key]; +} + +simdjson_inline simdjson_result simdjson_result::get_array() noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return first.get(); +} +template simdjson_inline error_code simdjson_result::get(T &out) noexcept { + if (error()) { return error(); } + return first.get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return std::move(first); +} +template<> simdjson_inline error_code simdjson_result::get(icelake::ondemand::value &out) noexcept { + if (error()) { return error(); } + out = first; + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator icelake::ondemand::array() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::object() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator icelake::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H +/* end file simdjson/generic/ondemand/value-inl.h for icelake */ +/* including simdjson/generic/ondemand/value_iterator-inl.h for icelake: #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/value_iterator-inl.h for icelake */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/atomparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace icelake { +namespace ondemand { + +simdjson_inline value_iterator::value_iterator( + json_iterator *json_iter, + depth_t depth, + token_position start_position +) noexcept : _json_iter{json_iter}, _depth{depth}, _start_position{start_position} +{ +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_root_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_object() noexcept { + assert_at_container_start(); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + if (*_json_iter->peek() == '}') { + logger::log_value(*_json_iter, "empty object"); + _json_iter->return_current_and_advance(); + end_container(); + return false; + } + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_object() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // object: e.g., `{"a":2} foo }`. Users concerned with garbage content should + // call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != '}') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing } at end"); + } + // If the last character is } *and* the first gibberish character is also '}' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == '}') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed object. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_object() noexcept { + auto error = check_root_object(); + if(error) { return error; } + return started_object(); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept { +#if SIMDJSON_CHECK_EOF + if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); } + // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + _json_iter->ascend_to(depth()-1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_field() noexcept { + assert_at_next(); + + // It's illegal to call this unless there are more tokens: anything that ends in } or ] is + // obligated to verify there are more tokens if they are not the top level. + switch (*_json_iter->return_current_and_advance()) { + case '}': + logger::log_end_value(*_json_iter, "object"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between object fields"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_raw(const std::string_view key) noexcept { + error_code error; + bool has_value; + // + // Initially, the object can be in one of a few different places: + // + // 1. The start of the object, at the first field: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + if (at_first_field()) { + has_value = true; + + // + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + return false; + + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + if ((error = skip_child() )) { abandon(); return error; } + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + while (has_value) { + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + //if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); // Skip the value entirely + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + + // If the loop ended, we're out of fields to look at. + return false; +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_unordered_raw(const std::string_view key) noexcept { + /** + * When find_field_unordered_raw is called, we can either be pointing at the + * first key, pointing outside (at the closing brace) or if a key was matched + * we can be either pointing right afterthe ':' right before the value (that we need skip), + * or we may have consumed the value and we might be at a comma or at the + * final brace (ready for a call to has_next_field()). + */ + error_code error; + bool has_value; + + // First, we scan from that point to the end. + // If we don't find a match, we may loop back around, and scan from the beginning to that point. + token_position search_start = _json_iter->position(); + + // We want to know whether we need to go back to the beginning. + bool at_first = at_first_field(); + /////////////// + // Initially, the object can be in one of a few different places: + // + // 1. At the first key: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + // + if (at_first) { + has_value = true; + + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { + +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + SIMDJSON_TRY(reset_object().get(has_value)); + at_first = true; + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + // If someone queried a key but they not did access the value, then we are left pointing + // at the ':' and we need to move forward through the value... If the value was + // processed then skip_child() does not move the iterator (but may adjust the depth). + if ((error = skip_child() )) { abandon(); return error; } + search_start = _json_iter->position(); + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + + // After initial processing, we will be in one of two states: + // + // ``` + // // At the beginning of a field + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // At the end of the object + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // ``` + // + // Next, we find a match starting from the current position. + while (has_value) { + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + // Performance note: it maybe wasteful to rewind to the beginning when there might be + // no other query following. Indeed, it would require reskipping the whole object. + // Instead, you can just stay where you are. If there is a new query, there is always time + // to rewind. + if(at_first) { return false; } + + // If we reach the end without finding a match, search the rest of the fields starting at the + // beginning of the object. + // (We have already run through the object before, so we've already validated its structure. We + // don't check errors in this bit.) + SIMDJSON_TRY(reset_object().get(has_value)); + while (true) { + SIMDJSON_ASSUME(has_value); // we should reach search_start before ever reaching the end of the object + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + error = field_key().get(actual_key); SIMDJSON_ASSUME(!error); + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + error = field_value(); SIMDJSON_ASSUME(!error); + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // If we reached the end of the key-value pair we started from, then we know + // that the key is not there so we return false. We are either right before + // the next comma or the final brace. + if(_json_iter->position() == search_start) { return false; } + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + error = has_next_field().get(has_value); SIMDJSON_ASSUME(!error); + // If we make the mistake of exiting here, then we could be left pointing at a key + // in the middle of an object. That's not an allowable state. + } + // If the loop ended, we're out of fields to look at. The program should + // never reach this point. + return false; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::field_key() noexcept { + assert_at_next(); + + const uint8_t *key = _json_iter->return_current_and_advance(); + if (*(key++) != '"') { return report_error(TAPE_ERROR, "Object key is not a string"); } + return raw_json_string(key); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::field_value() noexcept { + assert_at_next(); + + if (*_json_iter->return_current_and_advance() != ':') { return report_error(TAPE_ERROR, "Missing colon in object field"); } + _json_iter->descend_to(depth()+1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_root_array(); +} + +inline std::string value_iterator::to_string() const noexcept { + auto answer = std::string("value_iterator [ depth : ") + std::to_string(_depth) + std::string(", "); + if(_json_iter != nullptr) { answer += _json_iter->to_string(); } + answer += std::string(" ]"); + return answer; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_array() noexcept { + assert_at_container_start(); + if (*_json_iter->peek() == ']') { + logger::log_value(*_json_iter, "empty array"); + _json_iter->return_current_and_advance(); + SIMDJSON_TRY( end_container() ); + return false; + } + _json_iter->descend_to(depth()+1); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // array: e.g., `[1, 2] foo]`. Users concerned with garbage content should + // also call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != ']') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end"); + } + // If the last character is ] *and* the first gibberish character is also ']' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed array. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_array() noexcept { + auto error = check_root_array(); + if (error) { return error; } + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_element() noexcept { + assert_at_next(); + + logger::log_event(*this, "has_next_element"); + switch (*_json_iter->return_current_and_advance()) { + case ']': + logger::log_end_value(*_json_iter, "array"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + _json_iter->descend_to(depth()+1); + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between array elements"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_bool(const uint8_t *json) const noexcept { + auto not_true = atomparsing::str4ncmp(json, "true"); + auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e'); + bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]); + if (error) { return incorrect_type_error("Not a boolean"); } + return simdjson_result(!not_true); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_null(const uint8_t *json) const noexcept { + bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]); + // if we start with 'n', we must be a null + if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); } + return is_null_string; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_string(bool allow_replacement) noexcept { + return get_raw_json_string().unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_string(string_type& receiver, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_string(allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_wobbly_string() noexcept { + return get_raw_json_string().unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_raw_json_string() noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64() noexcept { + auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64_in_string() noexcept { + auto result = numberparsing::parse_unsigned_in_string(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64() noexcept { + auto result = numberparsing::parse_integer(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64_in_string() noexcept { + auto result = numberparsing::parse_integer_in_string(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double() noexcept { + auto result = numberparsing::parse_double(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double_in_string() noexcept { + auto result = numberparsing::parse_double_in_string(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_bool() noexcept { + auto result = parse_bool(peek_non_root_scalar("bool")); + if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); } + return result; +} +simdjson_inline simdjson_result value_iterator::is_null() noexcept { + bool is_null_value; + SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value)); + if(is_null_value) { advance_non_root_scalar("null"); } + return is_null_value; +} +simdjson_inline bool value_iterator::is_negative() noexcept { + return numberparsing::is_negative(peek_non_root_scalar("numbersign")); +} +simdjson_inline bool value_iterator::is_root_negative() noexcept { + return numberparsing::is_negative(peek_root_scalar("numbersign")); +} +simdjson_inline simdjson_result value_iterator::is_integer() noexcept { + return numberparsing::is_integer(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number_type() noexcept { + return numberparsing::get_number_type(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number() noexcept { + number num; + error_code error = numberparsing::parse_number(peek_non_root_scalar("number"), num); + if(error) { return error; } + return num; +} + +simdjson_inline simdjson_result value_iterator::is_root_integer(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("is_root_integer"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + return false; // if there are more than 20 characters, it cannot be represented as an integer. + } + auto answer = numberparsing::is_integer(tmpbuf); + // If the parsing was a success, we must still check that it is + // a single scalar. Note that we parse first because of cases like '[]' where + // getting TRAILING_CONTENT is wrong. + if(check_trailing && (answer.error() == SUCCESS) && (!_json_iter->is_single_token())) { return TRAILING_CONTENT; } + return answer; +} + +simdjson_inline simdjson_result value_iterator::get_root_number_type(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto answer = numberparsing::get_number_type(tmpbuf); + if (check_trailing && (answer.error() == SUCCESS) && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + return answer; +} +simdjson_inline simdjson_result value_iterator::get_root_number(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + number num; + error_code error = numberparsing::parse_number(tmpbuf, num); + if(error) { return error; } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("number"); + return num; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_string(bool check_trailing, bool allow_replacement) noexcept { + return get_root_raw_json_string(check_trailing).unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_root_string(check_trailing, allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_wobbly_string(bool check_trailing) noexcept { + return get_root_raw_json_string(check_trailing).unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_raw_json_string(bool check_trailing) noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_bool(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("bool"); + uint8_t tmpbuf[5+1+1]; // +1 for null termination + tmpbuf[5+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 5+1)) { return incorrect_type_error("Not a boolean"); } + auto result = parse_bool(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("bool"); + } + return result; +} +simdjson_inline simdjson_result value_iterator::is_root_null(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("null"); + bool result = (max_len >= 4 && !atomparsing::str4ncmp(json, "null") && + (max_len == 4 || jsoncharutils::is_structural_or_whitespace(json[4]))); + if(result) { // we have something that looks like a null. + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("null"); + } + return result; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth >= _depth ); + + return _json_iter->skip_child(depth()); +} + +simdjson_inline value_iterator value_iterator::child() const noexcept { + assert_at_child(); + return { _json_iter, depth()+1, _json_iter->token.position() }; +} + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and iterator depth, which is a desired effect. It does not happen if is_open is +// marked non-inline. +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline bool value_iterator::is_open() const noexcept { + return _json_iter->depth() >= depth(); +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool value_iterator::at_end() const noexcept { + return _json_iter->at_end(); +} + +simdjson_inline bool value_iterator::at_start() const noexcept { + return _json_iter->token.position() == start_position(); +} + +simdjson_inline bool value_iterator::at_first_field() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + return _json_iter->token.position() == start_position() + 1; +} + +simdjson_inline void value_iterator::abandon() noexcept { + _json_iter->abandon(); +} + +simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept { + return _depth; +} +simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept { + return _json_iter->error; +} +simdjson_warn_unused simdjson_inline uint8_t *&value_iterator::string_buf_loc() noexcept { + return _json_iter->string_buf_loc(); +} +simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept { + return *_json_iter; +} +simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept { + return *_json_iter; +} + +simdjson_inline const uint8_t *value_iterator::peek_start() const noexcept { + return _json_iter->peek(start_position()); +} +simdjson_inline uint32_t value_iterator::peek_start_length() const noexcept { + return _json_iter->peek_length(start_position()); +} + +simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return peek_start(); } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return; } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept { + logger::log_start_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + const uint8_t *json; + if (!is_at_start()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + json = peek_start(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + } else { + assert_at_start(); + /** + * We should be prudent. Let us peek. If it is not the right type, we + * return an error. Only once we have determined that we have the right + * type are we allowed to advance! + */ + json = _json_iter->peek(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + _json_iter->return_current_and_advance(); + } + + + return SUCCESS; +} + + +simdjson_inline const uint8_t *value_iterator::peek_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_root(); + return _json_iter->peek(); +} +simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_non_root_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_root(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} +simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_non_root_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept { + logger::log_error(*_json_iter, start_position(), depth(), message); + return INCORRECT_TYPE; +} + +simdjson_inline bool value_iterator::is_at_start() const noexcept { + return position() == start_position(); +} + +simdjson_inline bool value_iterator::is_at_key() const noexcept { + // Keys are at the same depth as the object. + // Note here that we could be safer and check that we are within an object, + // but we do not. + return _depth == _json_iter->_depth && *_json_iter->peek() == '"'; +} + +simdjson_inline bool value_iterator::is_at_iterator_start() const noexcept { + // We can legitimately be either at the first value ([1]), or after the array if it's empty ([]). + auto delta = position() - start_position(); + return delta == 1 || delta == 2; +} + +inline void value_iterator::assert_at_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_container_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_next() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +simdjson_inline void value_iterator::move_at_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position); +} + +simdjson_inline void value_iterator::move_at_container_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position + 1); +} + +simdjson_inline simdjson_result value_iterator::reset_array() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_array(); +} + +simdjson_inline simdjson_result value_iterator::reset_object() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_object(); +} + +inline void value_iterator::assert_at_child() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_root() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth == 1 ); +} + +inline void value_iterator::assert_at_non_root_start() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth > 1 ); +} + +inline void value_iterator::assert_is_valid() const noexcept { + SIMDJSON_ASSUME( _json_iter != nullptr ); +} + +simdjson_inline bool value_iterator::is_valid() const noexcept { + return _json_iter != nullptr; +} + +simdjson_inline simdjson_result value_iterator::type() const noexcept { + switch (*peek_start()) { + case '{': + return json_type::object; + case '[': + return json_type::array; + case '"': + return json_type::string; + case 'n': + return json_type::null; + case 't': case 'f': + return json_type::boolean; + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return json_type::number; + default: + return TAPE_ERROR; + } +} + +simdjson_inline token_position value_iterator::start_position() const noexcept { + return _start_position; +} + +simdjson_inline token_position value_iterator::position() const noexcept { + return _json_iter->position(); +} + +simdjson_inline token_position value_iterator::end_position() const noexcept { + return _json_iter->end_position(); +} + +simdjson_inline token_position value_iterator::last_position() const noexcept { + return _json_iter->last_position(); +} + +simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept { + return _json_iter->report_error(error, message); +} + +} // namespace ondemand +} // namespace icelake +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(icelake::ondemand::value_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/value_iterator-inl.h for icelake */ +/* end file simdjson/generic/ondemand/amalgamated.h for icelake */ +/* including simdjson/icelake/end.h: #include "simdjson/icelake/end.h" */ +/* begin file simdjson/icelake/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/icelake/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_ICELAKE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "icelake" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/icelake/end.h */ + +#endif // SIMDJSON_ICELAKE_ONDEMAND_H +/* end file simdjson/icelake/ondemand.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(ppc64) +/* including simdjson/ppc64/ondemand.h: #include "simdjson/ppc64/ondemand.h" */ +/* begin file simdjson/ppc64/ondemand.h */ +#ifndef SIMDJSON_PPC64_ONDEMAND_H +#define SIMDJSON_PPC64_ONDEMAND_H + +/* including simdjson/ppc64/begin.h: #include "simdjson/ppc64/begin.h" */ +/* begin file simdjson/ppc64/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "ppc64" */ +#define SIMDJSON_IMPLEMENTATION ppc64 +/* including simdjson/ppc64/base.h: #include "simdjson/ppc64/base.h" */ +/* begin file simdjson/ppc64/base.h */ +#ifndef SIMDJSON_PPC64_BASE_H +#define SIMDJSON_PPC64_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Implementation for ALTIVEC (PPC64). + */ +namespace ppc64 { + +class implementation; + +namespace { +namespace simd { +template struct simd8; +template struct simd8x64; +} // namespace simd +} // unnamed namespace + +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BASE_H +/* end file simdjson/ppc64/base.h */ +/* including simdjson/ppc64/intrinsics.h: #include "simdjson/ppc64/intrinsics.h" */ +/* begin file simdjson/ppc64/intrinsics.h */ +#ifndef SIMDJSON_PPC64_INTRINSICS_H +#define SIMDJSON_PPC64_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// This should be the correct header whether +// you use visual studio or other compilers. +#include + +// These are defined by altivec.h in GCC toolchain, it is safe to undef them. +#ifdef bool +#undef bool +#endif + +#ifdef vector +#undef vector +#endif + +static_assert(sizeof(__vector unsigned char) <= simdjson::SIMDJSON_PADDING, "insufficient padding for ppc64"); + +#endif // SIMDJSON_PPC64_INTRINSICS_H +/* end file simdjson/ppc64/intrinsics.h */ +/* including simdjson/ppc64/bitmanipulation.h: #include "simdjson/ppc64/bitmanipulation.h" */ +/* begin file simdjson/ppc64/bitmanipulation.h */ +#ifndef SIMDJSON_PPC64_BITMANIPULATION_H +#define SIMDJSON_PPC64_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num - 1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline int count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num); // Visual Studio wants two underscores +} +#else +simdjson_inline int count_ones(uint64_t input_num) { + return __builtin_popcountll(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + *result = value1 + value2; + return *result < value1; +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_BITMANIPULATION_H +/* end file simdjson/ppc64/bitmanipulation.h */ +/* including simdjson/ppc64/bitmask.h: #include "simdjson/ppc64/bitmask.h" */ +/* begin file simdjson/ppc64/bitmask.h */ +#ifndef SIMDJSON_PPC64_BITMASK_H +#define SIMDJSON_PPC64_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is +// encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(uint64_t bitmask) { + // You can use the version below, however gcc sometimes miscompiles + // vec_pmsum_be, it happens somewhere around between 8 and 9th version. + // The performance boost was not noticeable, falling back to a usual + // implementation. + // __vector unsigned long long all_ones = {~0ull, ~0ull}; + // __vector unsigned long long mask = {bitmask, 0}; + // // Clang and GCC return different values for pmsum for ull so cast it to one. + // // Generally it is not specified by ALTIVEC ISA what is returned by + // // vec_pmsum_be. + // #if defined(__LITTLE_ENDIAN__) + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[0]); + // #else + // return (uint64_t)(((__vector unsigned long long)vec_pmsum_be(all_ones, mask))[1]); + // #endif + bitmask ^= bitmask << 1; + bitmask ^= bitmask << 2; + bitmask ^= bitmask << 4; + bitmask ^= bitmask << 8; + bitmask ^= bitmask << 16; + bitmask ^= bitmask << 32; + return bitmask; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif +/* end file simdjson/ppc64/bitmask.h */ +/* including simdjson/ppc64/numberparsing_defs.h: #include "simdjson/ppc64/numberparsing_defs.h" */ +/* begin file simdjson/ppc64/numberparsing_defs.h */ +#ifndef SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +#define SIMDJSON_PPC64_NUMBERPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/intrinsics.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +#if defined(__linux__) +#include +#elif defined(__FreeBSD__) +#include +#endif + +namespace simdjson { +namespace ppc64 { +namespace numberparsing { + +// we don't have appropriate instructions, so let us use a scalar function +// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/ +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + uint64_t val; + std::memcpy(&val, chars, sizeof(uint64_t)); +#ifdef __BIG_ENDIAN__ +#if defined(__linux__) + val = bswap_64(val); +#elif defined(__FreeBSD__) + val = bswap64(val); +#endif +#endif + val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; + val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; + return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace ppc64 +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_PPC64_NUMBERPARSING_DEFS_H +/* end file simdjson/ppc64/numberparsing_defs.h */ +/* including simdjson/ppc64/simd.h: #include "simdjson/ppc64/simd.h" */ +/* begin file simdjson/ppc64/simd.h */ +#ifndef SIMDJSON_PPC64_SIMD_H +#define SIMDJSON_PPC64_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace { +namespace simd { + +using __m128i = __vector unsigned char; + +template struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i &() const { + return this->value; + } + simdjson_inline operator __m128i &() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { + return vec_or(this->value, (__m128i)other); + } + simdjson_inline Child operator&(const Child other) const { + return vec_and(this->value, (__m128i)other); + } + simdjson_inline Child operator^(const Child other) const { + return vec_xor(this->value, (__m128i)other); + } + simdjson_inline Child bit_andnot(const Child other) const { + return vec_andc(this->value, (__m128i)other); + } + simdjson_inline Child &operator|=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast | other; + return *this_cast; + } + simdjson_inline Child &operator&=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast & other; + return *this_cast; + } + simdjson_inline Child &operator^=(const Child other) { + auto this_cast = static_cast(this); + *this_cast = *this_cast ^ other; + return *this_cast; + } +}; + +template > +struct base8 : base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { + return (__m128i)vec_cmpeq(lhs.value, (__m128i)rhs); + } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(simd8 prev_chunk) const { + __m128i chunk = this->value; +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve(this->value); + prev_chunk = (__m128i)vec_reve((__m128i)prev_chunk); +#endif + chunk = (__m128i)vec_sld((__m128i)prev_chunk, (__m128i)chunk, 16 - N); +#ifdef __LITTLE_ENDIAN__ + chunk = (__m128i)vec_reve((__m128i)chunk); +#endif + return chunk; + } +}; + +// SIMD byte mask type (returned by things like eq and gt) +template <> struct simd8 : base8 { + static simdjson_inline simd8 splat(bool _value) { + return (__m128i)vec_splats((unsigned char)(-(!!_value))); + } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) + : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) + : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { + __vector unsigned long long result; + const __m128i perm_mask = {0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40, + 0x38, 0x30, 0x28, 0x20, 0x18, 0x10, 0x08, 0x00}; + + result = ((__vector unsigned long long)vec_vbpermq((__m128i)this->value, + (__m128i)perm_mask)); +#ifdef __LITTLE_ENDIAN__ + return static_cast(result[1]); +#else + return static_cast(result[0]); +#endif + } + simdjson_inline bool any() const { + return !vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline simd8 operator~() const { + return this->value ^ (__m128i)splat(true); + } +}; + +template struct base8_numeric : base8 { + static simdjson_inline simd8 splat(T value) { + (void)value; + return (__m128i)vec_splats(value); + } + static simdjson_inline simd8 zero() { return splat(0); } + static simdjson_inline simd8 load(const T values[16]) { + return (__m128i)(vec_vsx_ld(0, reinterpret_cast(values))); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16(T v0, T v1, T v2, T v3, T v4, + T v5, T v6, T v7, T v8, T v9, + T v10, T v11, T v12, T v13, + T v14, T v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, + v14, v15); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) + : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { + vec_vsx_st(this->value, 0, reinterpret_cast<__m128i *>(dst)); + } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { + return (__m128i)((__m128i)this->value + (__m128i)other); + } + simdjson_inline simd8 operator-(const simd8 other) const { + return (__m128i)((__m128i)this->value - (__m128i)other); + } + simdjson_inline simd8 &operator+=(const simd8 other) { + *this = *this + other; + return *static_cast *>(this); + } + simdjson_inline simd8 &operator-=(const simd8 other) { + *this = *this - other; + return *static_cast *>(this); + } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior + // for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return (__m128i)vec_perm((__m128i)lookup_table, (__m128i)lookup_table, this->value); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted + // as a bitset). Passing a 0 value for mask would be equivalent to writing out + // every byte to output. Only the first 16 - count_ones(mask) bytes of the + // result are significant but 16 bytes get written. Design consideration: it + // seems like a function with the signature simd8 compress(uint32_t mask) + // would be sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L *output) const { + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + using internal::thintable_epi8; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. +#ifdef __LITTLE_ENDIAN__ + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask1], thintable_epi8[mask2]}; +#else + __m128i shufmask = (__m128i)(__vector unsigned long long){ + thintable_epi8[mask2], thintable_epi8[mask1]}; + shufmask = (__m128i)vec_reve((__m128i)shufmask); +#endif + // we increment by 0x08 the second half of the mask + shufmask = ((__m128i)shufmask) + + ((__m128i)(__vector int){0, 0, 0x08080808, 0x08080808}); + + // this is the version "nearly pruned" + __m128i pruned = vec_perm(this->value, this->value, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + vec_vsx_ld(0, reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = vec_perm(pruned, (__m128i)vec_splats(0), compactmask); + vec_vsx_st(answer, 0, reinterpret_cast<__m128i *>(output)); + } + + template + simdjson_inline simd8 + lookup_16(L replace0, L replace1, L replace2, L replace3, L replace4, + L replace5, L replace6, L replace7, L replace8, L replace9, + L replace10, L replace11, L replace12, L replace13, L replace14, + L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, replace4, replace5, replace6, + replace7, replace8, replace9, replace10, replace11, replace12, + replace13, replace14, replace15)); + } +}; + +// Signed bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8(int8_t v0, int8_t v1, int8_t v2, int8_t v3, + int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) + : simd8((__m128i)(__vector signed char){v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, + v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, + int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, + int8_t v12, int8_t v13, int8_t v14, int8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Order-sensitive comparisons + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return (__m128i)vec_cmpgt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return (__m128i)vec_cmplt((__vector signed char)this->value, + (__vector signed char)(__m128i)other); + } +}; + +// Unsigned bytes +template <> struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) + : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t *values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline + simd8(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, + uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, + uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15) + : simd8((__m128i){v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15}) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 + repeat_16(uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, + uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, + uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, + uint8_t v15) { + return simd8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); + } + + // Saturated math + simdjson_inline simd8 + saturating_add(const simd8 other) const { + return (__m128i)vec_adds(this->value, (__m128i)other); + } + simdjson_inline simd8 + saturating_sub(const simd8 other) const { + return (__m128i)vec_subs(this->value, (__m128i)other); + } + + // Order-specific operations + simdjson_inline simd8 + max_val(const simd8 other) const { + return (__m128i)vec_max(this->value, (__m128i)other); + } + simdjson_inline simd8 + min_val(const simd8 other) const { + return (__m128i)vec_min(this->value, (__m128i)other); + } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + gt_bits(const simd8 other) const { + return this->saturating_sub(other); + } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 + lt_bits(const simd8 other) const { + return other.saturating_sub(*this); + } + simdjson_inline simd8 + operator<=(const simd8 other) const { + return other.max_val(*this) == other; + } + simdjson_inline simd8 + operator>=(const simd8 other) const { + return other.min_val(*this) == other; + } + simdjson_inline simd8 + operator>(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + simdjson_inline simd8 + operator<(const simd8 other) const { + return this->gt_bits(other).any_bits_set(); + } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { + return (__m128i)vec_cmpeq(this->value, (__m128i)vec_splats(uint8_t(0))); + } + simdjson_inline simd8 bits_not_set(simd8 bits) const { + return (*this & bits).bits_not_set(); + } + simdjson_inline simd8 any_bits_set() const { + return ~this->bits_not_set(); + } + simdjson_inline simd8 any_bits_set(simd8 bits) const { + return ~this->bits_not_set(bits); + } + simdjson_inline bool bits_not_set_anywhere() const { + return vec_all_eq(this->value, (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere() const { + return !bits_not_set_anywhere(); + } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { + return vec_all_eq(vec_and(this->value, (__m128i)bits), + (__m128i)vec_splats(0)); + } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { + return !bits_not_set_anywhere(bits); + } + template simdjson_inline simd8 shr() const { + return simd8( + (__m128i)vec_sr(this->value, (__m128i)vec_splat_u8(N))); + } + template simdjson_inline simd8 shl() const { + return simd8( + (__m128i)vec_sl(this->value, (__m128i)vec_splat_u8(N))); + } +}; + +template struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, + "PPC64 kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64 &o) = delete; // no copy allowed + simd8x64 & + operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, + const simd8 chunk2, const simd8 chunk3) + : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) + : chunks{simd8::load(ptr), simd8::load(ptr + 16), + simd8::load(ptr + 32), simd8::load(ptr + 48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr + sizeof(simd8) * 0); + this->chunks[1].store(ptr + sizeof(simd8) * 1); + this->chunks[2].store(ptr + sizeof(simd8) * 2); + this->chunks[3].store(ptr + sizeof(simd8) * 3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | + (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T *output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), + output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), + output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), + output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask()); + uint64_t r1 = this->chunks[1].to_bitmask(); + uint64_t r2 = this->chunks[2].to_bitmask(); + uint64_t r3 = this->chunks[3].to_bitmask(); + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] == mask, this->chunks[1] == mask, + this->chunks[2] == mask, this->chunks[3] == mask) + .to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64(this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3]) + .to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64(this->chunks[0] <= mask, this->chunks[1] <= mask, + this->chunks[2] <= mask, this->chunks[3] <= mask) + .to_bitmask(); + } +}; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_SIMD_INPUT_H +/* end file simdjson/ppc64/simd.h */ +/* including simdjson/ppc64/stringparsing_defs.h: #include "simdjson/ppc64/stringparsing_defs.h" */ +/* begin file simdjson/ppc64/stringparsing_defs.h */ +#ifndef SIMDJSON_PPC64_STRINGPARSING_DEFS_H +#define SIMDJSON_PPC64_STRINGPARSING_DEFS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/simd.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote + copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { + return ((bs_bits - 1) & quote_bits) != 0; + } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { + return trailing_zeroes(quote_bits); + } + simdjson_inline int backslash_index() { + return trailing_zeroes(bs_bits); + } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote +backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), + "backslash and quote finder must process fewer than " + "SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + sizeof(v0)); + v0.store(dst); + v1.store(dst + sizeof(v0)); + + // Getting a 64-bit bitmask is much cheaper than multiple 16-bit bitmasks on + // PPC; therefore, we smash them together into a 64-byte mask and get the + // bitmask from there. + uint64_t bs_and_quote = + simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_PPC64_STRINGPARSING_DEFS_H +/* end file simdjson/ppc64/stringparsing_defs.h */ + +#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 +/* end file simdjson/ppc64/begin.h */ +/* including simdjson/generic/ondemand/amalgamated.h for ppc64: #include "simdjson/generic/ondemand/amalgamated.h" */ +/* begin file simdjson/generic/ondemand/amalgamated.h for ppc64 */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H) +#error simdjson/generic/ondemand/dependencies.h must be included before simdjson/generic/ondemand/amalgamated.h! +#endif + +// Stuff other things depend on +/* including simdjson/generic/ondemand/base.h for ppc64: #include "simdjson/generic/ondemand/base.h" */ +/* begin file simdjson/generic/ondemand/base.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +/** + * A fast, simple, DOM-like interface that parses JSON as you use it. + * + * Designed for maximum speed and a lower memory profile. + */ +namespace ondemand { + +/** Represents the depth of a JSON value (number of nested arrays/objects). */ +using depth_t = int32_t; + +/** @copydoc simdjson::ppc64::number_type */ +using number_type = simdjson::ppc64::number_type; + +/** @private Position in the JSON buffer indexes */ +using token_position = const uint32_t *; + +class array; +class array_iterator; +class document; +class document_reference; +class document_stream; +class field; +class json_iterator; +enum class json_type; +struct number; +class object; +class object_iterator; +class parser; +class raw_json_string; +class token_iterator; +class value; +class value_iterator; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_BASE_H +/* end file simdjson/generic/ondemand/base.h for ppc64 */ +/* including simdjson/generic/ondemand/value_iterator.h for ppc64: #include "simdjson/generic/ondemand/value_iterator.h" */ +/* begin file simdjson/generic/ondemand/value_iterator.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * Iterates through a single JSON value at a particular depth. + * + * Does not keep track of the type of value: provides methods for objects, arrays and scalars and expects + * the caller to call the right ones. + * + * @private This is not intended for external use. + */ +class value_iterator { +protected: + /** The underlying JSON iterator */ + json_iterator *_json_iter{}; + /** The depth of this value */ + depth_t _depth{}; + /** + * The starting token index for this value + */ + token_position _start_position{}; + +public: + simdjson_inline value_iterator() noexcept = default; + + /** + * Denote that we're starting a document. + */ + simdjson_inline void start_document() noexcept; + + /** + * Skips a non-iterated or partially-iterated JSON value, whether it is a scalar, array or object. + * + * Optimized for scalars. + */ + simdjson_warn_unused simdjson_inline error_code skip_child() noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is at the start of the value + */ + simdjson_inline bool at_start() const noexcept; + + /** + * Tell whether the value is open--if the value has not been used, or the array/object is still open. + */ + simdjson_inline bool is_open() const noexcept; + + /** + * Tell whether the value is at an object's first field (just after the {). + */ + simdjson_inline bool at_first_field() const noexcept; + + /** + * Abandon all iteration. + */ + simdjson_inline void abandon() noexcept; + + /** + * Get the child value as a value_iterator. + */ + simdjson_inline value_iterator child_value() const noexcept; + + /** + * Get the depth of this value. + */ + simdjson_inline int32_t depth() const noexcept; + + /** + * Get the JSON type of this value. + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() const noexcept; + + /** + * @addtogroup object Object iteration + * + * Methods to iterate and find object fields. These methods generally *assume* the value is + * actually an object; the caller is responsible for keeping track of that fact. + * + * @{ + */ + + /** + * Start an object iteration. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + */ + simdjson_warn_unused simdjson_inline simdjson_result start_object() noexcept; + /** + * Start an object iteration from the root. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_object() noexcept; + /** + * Checks whether an object could be started from the root. May be called by start_root_object. + * + * @returns SUCCESS if it is possible to safely start an object from the root (document level). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_object() noexcept; + /** + * Start an object iteration after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_object() noexcept; + /** + * Start an object iteration from the root, after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_object() noexcept; + + /** + * Moves to the next field in an object. + * + * Looks for , and }. If } is found, the object is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return whether there is another field in the object. + * @error TAPE_ERROR If there is a comma missing between fields. + * @error TAPE_ERROR If there is a comma, but not enough tokens remaining to have a key, :, and value. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_field() noexcept; + + /** + * Get the current field's key. + */ + simdjson_warn_unused simdjson_inline simdjson_result field_key() noexcept; + + /** + * Pass the : in the field and move to its value. + */ + simdjson_warn_unused simdjson_inline error_code field_value() noexcept; + + /** + * Find the next field with the given key. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline error_code find_field(const std::string_view key) noexcept; + + /** + * Find the next field with the given key, *without* unescaping. This assumes object order: it + * will not find the field if it was already passed when looking for some *other* field. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_raw(const std::string_view key) noexcept; + + /** + * Find the field with the given key without regard to order, and *without* unescaping. + * + * This is an unordered object lookup: if the field is not found initially, it will cycle around and scan from the beginning. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_unordered_raw(const std::string_view key) noexcept; + + /** @} */ + + /** + * @addtogroup array Array iteration + * Methods to iterate over array elements. These methods generally *assume* the value is actually + * an object; the caller is responsible for keeping track of that fact. + * @{ + */ + + /** + * Check for an opening [ and start an array iteration. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + */ + simdjson_warn_unused simdjson_inline simdjson_result start_array() noexcept; + /** + * Check for an opening [ and start an array iteration while at the root. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_array() noexcept; + /** + * Checks whether an array could be started from the root. May be called by start_root_array. + * + * @returns SUCCESS if it is possible to safely start an array from the root (document level). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_array() noexcept; + /** + * Start an array iteration, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_array() noexcept; + /** + * Start an array iteration from the root, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_array() noexcept; + + /** + * Moves to the next element in an array. + * + * Looks for , and ]. If ] is found, the array is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return Whether there is another element in the array. + * @error TAPE_ERROR If there is a comma missing between elements. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_element() noexcept; + + /** + * Get a child value iterator. + */ + simdjson_warn_unused simdjson_inline value_iterator child() const noexcept; + + /** @} */ + + /** + * @defgroup scalar Scalar values + * @addtogroup scalar + * @{ + */ + + simdjson_warn_unused simdjson_inline simdjson_result get_string(bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_bool() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_null() noexcept; + simdjson_warn_unused simdjson_inline bool is_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_integer() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + simdjson_warn_unused simdjson_inline simdjson_result get_root_string(bool check_trailing, bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_wobbly_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_raw_json_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_bool(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline bool is_root_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_integer(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number_type(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_null(bool check_trailing) noexcept; + + simdjson_inline error_code error() const noexcept; + simdjson_inline uint8_t *&string_buf_loc() noexcept; + simdjson_inline const json_iterator &json_iter() const noexcept; + simdjson_inline json_iterator &json_iter() noexcept; + + simdjson_inline void assert_is_valid() const noexcept; + simdjson_inline bool is_valid() const noexcept; + + /** @} */ +protected: + /** + * Restarts an array iteration. + * @returns Whether the array has any elements (returns false for empty). + */ + simdjson_inline simdjson_result reset_array() noexcept; + /** + * Restarts an object iteration. + * @returns Whether the object has any fields (returns false for empty). + */ + simdjson_inline simdjson_result reset_object() noexcept; + /** + * move_at_start(): moves us so that we are pointing at the beginning of + * the container. It updates the index so that at_start() is true and it + * syncs the depth. The user can then create a new container instance. + * + * Usage: used with value::count_elements(). + **/ + simdjson_inline void move_at_start() noexcept; + + /** + * move_at_container_start(): moves us so that we are pointing at the beginning of + * the container so that assert_at_container_start() passes. + * + * Usage: used with reset_array() and reset_object(). + **/ + simdjson_inline void move_at_container_start() noexcept; + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + simdjson_inline value_iterator(json_iterator *json_iter, depth_t depth, token_position start_index) noexcept; + + simdjson_inline simdjson_result parse_null(const uint8_t *json) const noexcept; + simdjson_inline simdjson_result parse_bool(const uint8_t *json) const noexcept; + simdjson_inline const uint8_t *peek_start() const noexcept; + simdjson_inline uint32_t peek_start_length() const noexcept; + + /** + * The general idea of the advance_... methods and the peek_* methods + * is that you first peek and check that you have desired type. If you do, + * and only if you do, then you advance. + * + * We used to unconditionally advance. But this made reasoning about our + * current state difficult. + * Suppose you always advance. Look at the 'value' matching the key + * "shadowable" in the following example... + * + * ({"globals":{"a":{"shadowable":[}}}}) + * + * If the user thinks it is a Boolean and asks for it, then we check the '[', + * decide it is not a Boolean, but still move into the next character ('}'). Now + * we are left pointing at '}' right after a '['. And we have not yet reported + * an error, only that we do not have a Boolean. + * + * If, instead, you just stand your ground until it is content that you know, then + * you will only even move beyond the '[' if the user tells you that you have an + * array. So you will be at the '}' character inside the array and, hopefully, you + * will then catch the error because an array cannot start with '}', but the code + * processing Boolean values does not know this. + * + * So the contract is: first call 'peek_...' and then call 'advance_...' only + * if you have determined that it is a type you can handle. + * + * Unfortunately, it makes the code more verbose, longer and maybe more error prone. + */ + + simdjson_inline void advance_scalar(const char *type) noexcept; + simdjson_inline void advance_root_scalar(const char *type) noexcept; + simdjson_inline void advance_non_root_scalar(const char *type) noexcept; + + simdjson_inline const uint8_t *peek_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_root_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_non_root_scalar(const char *type) noexcept; + + + simdjson_inline error_code start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept; + simdjson_inline error_code end_container() noexcept; + + /** + * Advance to a place expecting a value (increasing depth). + * + * @return The current token (the one left behind). + * @error TAPE_ERROR If the document ended early. + */ + simdjson_inline simdjson_result advance_to_value() noexcept; + + simdjson_inline error_code incorrect_type_error(const char *message) const noexcept; + simdjson_inline error_code error_unless_more_tokens(uint32_t tokens=1) const noexcept; + + simdjson_inline bool is_at_start() const noexcept; + /** + * is_at_iterator_start() returns true on an array or object after it has just been + * created, whether the instance is empty or not. + * + * Usage: used by array::begin() in debug mode (SIMDJSON_DEVELOPMENT_CHECKS) + */ + simdjson_inline bool is_at_iterator_start() const noexcept; + + /** + * Assuming that we are within an object, this returns true if we + * are pointing at a key. + * + * Usage: the skip_child() method should never be used while we are pointing + * at a key inside an object. + */ + simdjson_inline bool is_at_key() const noexcept; + + inline void assert_at_start() const noexcept; + inline void assert_at_container_start() const noexcept; + inline void assert_at_root() const noexcept; + inline void assert_at_child() const noexcept; + inline void assert_at_next() const noexcept; + inline void assert_at_non_root_start() const noexcept; + + /** Get the starting position of this value */ + simdjson_inline token_position start_position() const noexcept; + + /** @copydoc error_code json_iterator::position() const noexcept; */ + simdjson_inline token_position position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position last_position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position end_position() const noexcept; + /** @copydoc error_code json_iterator::report_error(error_code error, const char *message) noexcept; */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + friend class document; + friend class object; + friend class array; + friend class value; +}; // value_iterator + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::value_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H +/* end file simdjson/generic/ondemand/value_iterator.h for ppc64 */ +/* including simdjson/generic/ondemand/value.h for ppc64: #include "simdjson/generic/ondemand/value.h" */ +/* begin file simdjson/generic/ondemand/value.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * An ephemeral JSON value returned during iteration. It is only valid for as long as you do + * not access more data in the JSON document. + */ +class value { +public: + /** + * Create a new invalid value. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline value() noexcept = default; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) noexcept; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() noexcept; + + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() noexcept; + + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + + /** + * Cast this JSON value (inside string) to a unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + + /** + * Cast this JSON value to a "wobbly" string. + * + * The string is may not be a valid UTF-8 string. + * See https://simonsapin.github.io/wtf-8/ + * + * Important: a value should be consumed once. Calling get_wobbly_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); +#endif + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + * + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * Performance hint: You should only call count_elements() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method on the object instance. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @return The type of JSON value (json_type::array, json_type::object, json_type::string, + * json_type::number, json_type::boolean, or json_type::null). + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the value is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the value is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the value is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * Performance note: if you call this function systematically + * before parsing a number, you may have fallen for a performance + * anti-pattern. + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + * + * Performance note: this is designed with performance in mind. When + * calling 'get_number()', you scan the number string only once, determining + * efficiently the type and storing it in an efficient manner. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. However, if this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view is guaranteed to be + * a non-space token. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + * + * See also value::raw_json(). + */ + simdjson_inline std::string_view raw_json_token() noexcept; + + /** + * Get a string_view pointing at this value in the JSON document. + * If this element is an array or an object, it consumes the array or the object + * and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + * If this element is a scalar (string, number, Boolean, null), it returns what + * raw_json_token() would return. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + simdjson_inline simdjson_result current_location() noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. + * + * Calling at_pointer() on non-document instances (e.g., arrays and objects) is not + * standardized (by RFC 6901). We provide some experimental support for JSON pointers + * on non-document instances. Yet it is not the case when calling at_pointer on an array + * or an object instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + +protected: + /** + * Create a value. + */ + simdjson_inline value(const value_iterator &iter) noexcept; + + /** + * Skip this value, allowing iteration to continue. + */ + simdjson_inline void skip() noexcept; + + /** + * Start a value at the current position. + * + * (It should already be started; this is just a self-documentation method.) + */ + static simdjson_inline value start(const value_iterator &iter) noexcept; + + /** + * Resume a value. + */ + static simdjson_inline value resume(const value_iterator &iter) noexcept; + + /** + * Get the object, starting or resuming it as necessary + */ + simdjson_inline simdjson_result start_or_resume_object() noexcept; + + // simdjson_inline void log_value(const char *type) const noexcept; + // simdjson_inline void log_error(const char *message) const noexcept; + + value_iterator iter{}; + + friend class document; + friend class array_iterator; + friend class field; + friend class object; + friend struct simdjson_result; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::value &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result get_array() noexcept; + simdjson_inline simdjson_result get_object() noexcept; + + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() noexcept; + + template simdjson_inline error_code get(T &out) noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator ppc64::ondemand::array() noexcept(false); + simdjson_inline operator ppc64::ondemand::object() noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator ppc64::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + */ + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + + /** @copydoc simdjson_inline std::string_view value::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + + /** @copydoc simdjson_inline simdjson_result current_location() noexcept */ + simdjson_inline simdjson_result current_location() noexcept; + /** @copydoc simdjson_inline int32_t current_depth() const noexcept */ + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H +/* end file simdjson/generic/ondemand/value.h for ppc64 */ +/* including simdjson/generic/ondemand/logger.h for ppc64: #include "simdjson/generic/ondemand/logger.h" */ +/* begin file simdjson/generic/ondemand/logger.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +// Logging should be free unless SIMDJSON_VERBOSE_LOGGING is set. Importantly, it is critical +// that the call to the log functions be side-effect free. Thus, for example, you should not +// create temporary std::string instances. +namespace logger { + +enum class log_level : int32_t { + info = 0, + error = 1 +}; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + +// We do not want these functions to be 'really inlined' since real inlining is +// for performance purposes and if you are using the loggers, you do not care about +// performance (or should not). +static inline void log_headers() noexcept; +// If args are provided, title will be treated as format string +template +static inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +template +static inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; +static inline void log_event(const json_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_value(const json_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_start_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; + +static inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail="") noexcept; +static inline void log_error(const json_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +static inline void log_event(const value_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const value_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_error(const value_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +} // namespace logger +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_H +/* end file simdjson/generic/ondemand/logger.h for ppc64 */ +/* including simdjson/generic/ondemand/token_iterator.h for ppc64: #include "simdjson/generic/ondemand/token_iterator.h" */ +/* begin file simdjson/generic/ondemand/token_iterator.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * Iterates through JSON tokens (`{` `}` `[` `]` `,` `:` `""` `123` `true` `false` `null`) + * detected by stage 1. + * + * @private This is not intended for external use. + */ +class token_iterator { +public: + /** + * Create a new invalid token_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline token_iterator() noexcept = default; + simdjson_inline token_iterator(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator &operator=(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator(const token_iterator &other) noexcept = default; + simdjson_inline token_iterator &operator=(const token_iterator &other) noexcept = default; + + /** + * Advance to the next token (returning the current one). + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + /** + * Reports the current offset in bytes from the start of the underlying buffer. + */ + simdjson_inline uint32_t current_offset() const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + + /** + * Return the current index. + */ + simdjson_inline token_position position() const noexcept; + /** + * Reset to a previously saved index. + */ + simdjson_inline void set_position(token_position target_position) noexcept; + + // NOTE: we don't support a full C++ iterator interface, because we expect people to make + // different calls to advance the iterator based on *their own* state. + + simdjson_inline bool operator==(const token_iterator &other) const noexcept; + simdjson_inline bool operator!=(const token_iterator &other) const noexcept; + simdjson_inline bool operator>(const token_iterator &other) const noexcept; + simdjson_inline bool operator>=(const token_iterator &other) const noexcept; + simdjson_inline bool operator<(const token_iterator &other) const noexcept; + simdjson_inline bool operator<=(const token_iterator &other) const noexcept; + +protected: + simdjson_inline token_iterator(const uint8_t *buf, token_position position) noexcept; + + /** + * Get the index of the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_index(int32_t delta=0) const noexcept; + /** + * Get the index of the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline uint32_t peek_index(token_position position) const noexcept; + + const uint8_t *buf{}; + token_position _position{}; + + friend class json_iterator; + friend class value_iterator; + friend class object; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::token_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H +/* end file simdjson/generic/ondemand/token_iterator.h for ppc64 */ +/* including simdjson/generic/ondemand/json_iterator.h for ppc64: #include "simdjson/generic/ondemand/json_iterator.h" */ +/* begin file simdjson/generic/ondemand/json_iterator.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * Iterates through JSON tokens, keeping track of depth and string buffer. + * + * @private This is not intended for external use. + */ +class json_iterator { +protected: + token_iterator token{}; + ondemand::parser *parser{}; + /** + * Next free location in the string buffer. + * + * Used by raw_json_string::unescape() to have a place to unescape strings to. + */ + uint8_t *_string_buf_loc{}; + /** + * JSON error, if there is one. + * + * INCORRECT_TYPE and NO_SUCH_FIELD are *not* stored here, ever. + * + * PERF NOTE: we *hope* this will be elided into control flow, as it is only used (a) in the first + * iteration of the loop, or (b) for the final iteration after a missing comma is found in ++. If + * this is not elided, we should make sure it's at least not using up a register. Failing that, + * we should store it in document so there's only one of them. + */ + error_code error{SUCCESS}; + /** + * Depth of the current token in the JSON. + * + * - 0 = finished with document + * - 1 = document root value (could be [ or {, not yet known) + * - 2 = , or } inside root array/object + * - 3 = key or value inside root array/object. + */ + depth_t _depth{}; + /** + * Beginning of the document indexes. + * Normally we have root == parser->implementation->structural_indexes.get() + * but this may differ, especially in streaming mode (where we have several + * documents); + */ + token_position _root{}; + /** + * Normally, a json_iterator operates over a single document, but in + * some cases, we may have a stream of documents. This attribute is meant + * as meta-data: the json_iterator works the same irrespective of the + * value of this attribute. + */ + bool _streaming{false}; + +public: + simdjson_inline json_iterator() noexcept = default; + simdjson_inline json_iterator(json_iterator &&other) noexcept; + simdjson_inline json_iterator &operator=(json_iterator &&other) noexcept; + simdjson_inline explicit json_iterator(const json_iterator &other) noexcept = default; + simdjson_inline json_iterator &operator=(const json_iterator &other) noexcept = default; + /** + * Skips a JSON value, whether it is a scalar, array or object. + */ + simdjson_warn_unused simdjson_inline error_code skip_child(depth_t parent_depth) noexcept; + + /** + * Tell whether the iterator is still at the start + */ + simdjson_inline bool at_root() const noexcept; + + /** + * Tell whether we should be expected to run in streaming + * mode (iterating over many documents). It is pure metadata + * that does not affect how the iterator works. It is used by + * start_root_array() and start_root_object(). + */ + simdjson_inline bool streaming() const noexcept; + + /** + * Get the root value iterator + */ + simdjson_inline token_position root_position() const noexcept; + /** + * Assert that we are at the document depth (== 1) + */ + simdjson_inline void assert_at_document_depth() const noexcept; + /** + * Assert that we are at the root of the document + */ + simdjson_inline void assert_at_root() const noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is live (has not been moved). + */ + simdjson_inline bool is_alive() const noexcept; + + /** + * Abandon this iterator, setting depth to 0 (as if the document is finished). + */ + simdjson_inline void abandon() noexcept; + + /** + * Advance the current token without modifying depth. + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + + /** + * Returns true if there is a single token in the index (i.e., it is + * a JSON with a scalar value such as a single number). + * + * @return whether there is a single token + */ + simdjson_inline bool is_single_token() const noexcept; + + /** + * Assert that there are at least the given number of tokens left. + * + * Has no effect in release builds. + */ + simdjson_inline void assert_more_tokens(uint32_t required_tokens=1) const noexcept; + /** + * Assert that the given position addresses an actual token (is within bounds). + * + * Has no effect in release builds. + */ + simdjson_inline void assert_valid_position(token_position position) const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + /** + * Get a pointer to the current location in the input buffer. + * + * This is not null-terminated; it is a view into the JSON. + * + * You may be pointing outside of the input buffer: it is not generally + * safe to dereference this pointer. + */ + simdjson_inline const uint8_t *unsafe_pointer() const noexcept; + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token to retrieve. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token to retrieve. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + /** + * Get the JSON text for the last token in the document. + * + * This is not null-terminated; it is a view into the JSON. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek_last() const noexcept; + + /** + * Ascend one level. + * + * Validates that the depth - 1 == parent_depth. + * + * @param parent_depth the expected parent depth. + */ + simdjson_inline void ascend_to(depth_t parent_depth) noexcept; + + /** + * Descend one level. + * + * Validates that the new depth == child_depth. + * + * @param child_depth the expected child depth. + */ + simdjson_inline void descend_to(depth_t child_depth) noexcept; + simdjson_inline void descend_to(depth_t child_depth, int32_t delta) noexcept; + + /** + * Get current depth. + */ + simdjson_inline depth_t depth() const noexcept; + + /** + * Get current (writeable) location in the string buffer. + */ + simdjson_inline uint8_t *&string_buf_loc() noexcept; + + /** + * Report an unrecoverable error, preventing further iteration. + * + * @param error The error to report. Must not be SUCCESS, UNINITIALIZED, INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + /** + * Log error, but don't stop iteration. + * @param error The error to report. Must be INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code optional_error(error_code error, const char *message) noexcept; + + /** + * Take an input in json containing max_len characters and attempt to copy it over to tmpbuf, a buffer with + * N bytes of capacity. It will return false if N is too small (smaller than max_len) of if it is zero. + * The buffer (tmpbuf) is padded with space characters. + */ + simdjson_warn_unused simdjson_inline bool copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept; + + simdjson_inline token_position position() const noexcept; + /** + * Write the raw_json_string to the string buffer and return a string_view. + * Each raw_json_string should be unescaped once, or else the string buffer might + * overflow. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, bool allow_replacement) noexcept; + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in) noexcept; + + simdjson_inline void reenter_child(token_position position, depth_t child_depth) noexcept; + + simdjson_inline error_code consume_character(char c) noexcept; +#if SIMDJSON_DEVELOPMENT_CHECKS + simdjson_inline token_position start_position(depth_t depth) const noexcept; + simdjson_inline void set_start_position(depth_t depth, token_position position) noexcept; +#endif + + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Updates this json iterator so that it is back at the beginning of the document, + * as if it had just been created. + */ + inline void rewind() noexcept; + /** + * This checks whether the {,},[,] are balanced so that the document + * ends with proper zero depth. This requires scanning the whole document + * and it may be expensive. It is expected that it will be rarely called. + * It does not attempt to match { with } and [ with ]. + */ + inline bool balanced() const noexcept; +protected: + simdjson_inline json_iterator(const uint8_t *buf, ondemand::parser *parser) noexcept; + /// The last token before the end + simdjson_inline token_position last_position() const noexcept; + /// The token *at* the end. This points at gibberish and should only be used for comparison. + simdjson_inline token_position end_position() const noexcept; + /// The end of the buffer. + simdjson_inline token_position end() const noexcept; + + friend class document; + friend class document_stream; + friend class object; + friend class array; + friend class value; + friend class raw_json_string; + friend class parser; + friend class value_iterator; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; // json_iterator + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::json_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H +/* end file simdjson/generic/ondemand/json_iterator.h for ppc64 */ +/* including simdjson/generic/ondemand/json_type.h for ppc64: #include "simdjson/generic/ondemand/json_type.h" */ +/* begin file simdjson/generic/ondemand/json_type.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * The type of a JSON value. + */ +enum class json_type { + // Start at 1 to catch uninitialized / default values more easily + array=1, ///< A JSON array ( [ 1, 2, 3 ... ] ) + object, ///< A JSON object ( { "a": 1, "b" 2, ... } ) + number, ///< A JSON number ( 1 or -2.3 or 4.5e6 ...) + string, ///< A JSON string ( "a" or "hello world\n" ...) + boolean, ///< A JSON boolean (true or false) + null ///< A JSON null (null) +}; + +/** + * A type representing a JSON number. + * The design of the struct is deliberately straight-forward. All + * functions return standard values with no error check. + */ +struct number { + + /** + * return the automatically determined type of + * the number: number_type::floating_point_number, + * number_type::signed_integer or number_type::unsigned_integer. + * + * enum class number_type { + * floating_point_number=1, /// a binary64 number + * signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + * unsigned_integer /// a positive integer larger or equal to 1<<63 + * }; + */ + simdjson_inline ondemand::number_type get_number_type() const noexcept; + /** + * return true if the automatically determined type of + * the number is number_type::unsigned_integer. + */ + simdjson_inline bool is_uint64() const noexcept; + /** + * return the value as a uint64_t, only valid if is_uint64() is true. + */ + simdjson_inline uint64_t get_uint64() const noexcept; + simdjson_inline operator uint64_t() const noexcept; + + /** + * return true if the automatically determined type of + * the number is number_type::signed_integer. + */ + simdjson_inline bool is_int64() const noexcept; + /** + * return the value as a int64_t, only valid if is_int64() is true. + */ + simdjson_inline int64_t get_int64() const noexcept; + simdjson_inline operator int64_t() const noexcept; + + + /** + * return true if the automatically determined type of + * the number is number_type::floating_point_number. + */ + simdjson_inline bool is_double() const noexcept; + /** + * return the value as a double, only valid if is_double() is true. + */ + simdjson_inline double get_double() const noexcept; + simdjson_inline operator double() const noexcept; + + /** + * Convert the number to a double. Though it always succeed, the conversion + * may be lossy if the number cannot be represented exactly. + */ + simdjson_inline double as_double() const noexcept; + + +protected: + /** + * The next block of declaration is designed so that we can call the number parsing + * functions on a number type. They are protected and should never be used outside + * of the core simdjson library. + */ + friend class value_iterator; + template + friend error_code numberparsing::slow_float_parsing(simdjson_unused const uint8_t * src, W writer); + template + friend error_code numberparsing::write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer); + template + friend error_code numberparsing::parse_number(const uint8_t *const src, W &writer); + /** Store a signed 64-bit value to the number. */ + simdjson_inline void append_s64(int64_t value) noexcept; + /** Store an unsigned 64-bit value to the number. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + /** Store a double value to the number. */ + simdjson_inline void append_double(double value) noexcept; + /** Specifies that the value is a double, but leave it undefined. */ + simdjson_inline void skip_double() noexcept; + /** + * End of friend declarations. + */ + + /** + * Our attributes are a union type (size = 64 bits) + * followed by a type indicator. + */ + union { + double floating_point_number; + int64_t signed_integer; + uint64_t unsigned_integer; + } payload{0}; + number_type type{number_type::signed_integer}; +}; + +/** + * Write the JSON type to the output stream + * + * @param out The output stream. + * @param type The json_type. + */ +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept; + +#if SIMDJSON_EXCEPTIONS +/** + * Send JSON type to an output stream. + * + * @param out The output stream. + * @param type The json_type. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false); +#endif + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::json_type &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H +/* end file simdjson/generic/ondemand/json_type.h for ppc64 */ +/* including simdjson/generic/ondemand/raw_json_string.h for ppc64: #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * A string escaped per JSON rules, terminated with quote ("). They are used to represent + * unescaped keys inside JSON documents. + * + * (In other words, a pointer to the beginning of a string, just after the start quote, inside a + * JSON file.) + * + * This class is deliberately simplistic and has little functionality. You can + * compare a raw_json_string instance with an unescaped C string, but + * that is nearly all you can do. + * + * The raw_json_string is unescaped. If you wish to write an unescaped version of it to your own + * buffer, you may do so using the parser.unescape(string, buff) method, using an ondemand::parser + * instance. Doing so requires you to have a sufficiently large buffer. + * + * The raw_json_string instances originate typically from field instance which in turn represent + * key-value pairs from object instances. From a field instance, you get the raw_json_string + * instance by calling key(). You can, if you want a more usable string_view instance, call + * the unescaped_key() method on the field instance. You may also create a raw_json_string from + * any other string value, with the value.get_raw_json_string() method. Again, you can get + * a more usable string_view instance by calling get_string(). + * + */ +class raw_json_string { +public: + /** + * Create a new invalid raw_json_string. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline raw_json_string() noexcept = default; + + /** + * Create a new invalid raw_json_string pointed at the given location in the JSON. + * + * The given location must be just *after* the beginning quote (") in the JSON file. + * + * It *must* be terminated by a ", and be a valid JSON string. + */ + simdjson_inline raw_json_string(const uint8_t * _buf) noexcept; + /** + * Get the raw pointer to the beginning of the string in the JSON (just after the "). + * + * It is possible for this function to return a null pointer if the instance + * has outlived its existence. + */ + simdjson_inline const char * raw() const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done) on target.size() characters, + * and if the raw_json_string instance has a quote character at byte index target.size(). + * We never read more than length + 1 bytes in the raw_json_string instance. + * If length is smaller than target.size(), this will return false. + * + * The std::string_view instance may contain any characters. However, the caller + * is responsible for setting length so that length bytes may be read in the + * raw_json_string. + * + * Performance: the comparison may be done using memcmp which may be efficient + * for long strings. + */ + simdjson_inline bool unsafe_is_equal(size_t length, std::string_view target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The std::string_view instance should not contain unescaped quote characters: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * Performance: the comparison is done byte-by-byte which might be inefficient for + * long strings. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The provided C string should not contain an unescaped quote character: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(const char* target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(const char* target) const noexcept; + + /** + * Returns true if target is free from unescaped quote. If target is known at + * compile-time, we might expect the computation to happen at compile time with + * many compilers (not all!). + */ + static simdjson_inline bool is_free_from_unescaped_quote(std::string_view target) noexcept; + static simdjson_inline bool is_free_from_unescaped_quote(const char* target) noexcept; + +private: + + + /** + * This will set the inner pointer to zero, effectively making + * this instance unusable. + */ + simdjson_inline void consume() noexcept { buf = nullptr; } + + /** + * Checks whether the inner pointer is non-null and thus usable. + */ + simdjson_inline simdjson_warn_unused bool alive() const noexcept { return buf != nullptr; } + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result will be a valid UTF-8. + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + * @param allow_replacement Whether we allow replacement of invalid surrogate pairs. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape(json_iterator &iter, bool allow_replacement) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result may not be a valid UTF-8. https://simonsapin.github.io/wtf-8/ + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(json_iterator &iter) const noexcept; + const uint8_t * buf{}; + friend class object; + friend class field; + friend class parser; + friend struct simdjson_result; +}; + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &, const raw_json_string &) noexcept; + +/** + * Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible + * for providing a string with no unescaped quote. Note that unescaped quotes cannot be present in valid JSON strings. + */ +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept; +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept; + + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::raw_json_string &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private + + simdjson_inline simdjson_result raw() const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape(ppc64::ondemand::json_iterator &iter, bool allow_replacement) const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(ppc64::ondemand::json_iterator &iter) const noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H +/* end file simdjson/generic/ondemand/raw_json_string.h for ppc64 */ +/* including simdjson/generic/ondemand/parser.h for ppc64: #include "simdjson/generic/ondemand/parser.h" */ +/* begin file simdjson/generic/ondemand/parser.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * The default batch size for document_stream instances for this On Demand kernel. + * Note that different On Demand kernel may use a different DEFAULT_BATCH_SIZE value + * in the future. + */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * A JSON fragment iterator. + * + * This holds the actual iterator as well as the buffer for writing strings. + */ +class parser { +public: + /** + * Create a JSON parser. + * + * The new parser will have zero capacity. + */ + inline explicit parser(size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept; + + inline parser(parser &&other) noexcept = default; + simdjson_inline parser(const parser &other) = delete; + simdjson_inline parser &operator=(const parser &other) = delete; + simdjson_inline parser &operator=(parser &&other) noexcept = default; + + /** Deallocate the JSON parser. */ + inline ~parser() noexcept = default; + + /** + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * document doc = parser.iterate(json); + * + * It is expected that the content is a valid UTF-8 file, containing a valid JSON document. + * Otherwise the iterate method may return an error. In particular, the whole input should be + * valid: we do not attempt to tolerate incorrect content either before or after a JSON + * document. If there is a UTF-8 BOM, the parser skips it. + * + * ### IMPORTANT: Validate what you use + * + * Calling iterate on an invalid JSON document may not immediately trigger an error. The call to + * iterate does not parse and validate the whole document. + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * @param len The length of the JSON. + * @param capacity The number of bytes allocated in the JSON (must be at least len+SIMDJSON_PADDING). + * + * @return The document, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate(padded_string_view json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const char *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const uint8_t *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string_view json, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(padded_string &&json) & noexcept = delete; + + /** + * @private + * + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * json_iterator doc = parser.iterate(json); + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * The ondemand::document instance holds the iterator. The document must remain in scope + * while you are accessing instances of ondemand::value, ondemand::object, ondemand::array. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * + * @return The iterator, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate_raw(padded_string_view json) & noexcept; + + + /** + * Parse a buffer containing many JSON documents. + * + * auto json = R"({ "foo": 1 } { "foo": 2 } { "foo": 3 } )"_padded; + * ondemand::parser parser; + * ondemand::document_stream docs = parser.iterate_many(json); + * for (auto & doc : docs) { + * std::cout << doc["foo"] << std::endl; + * } + * // Prints 1 2 3 + * + * No copy of the input buffer is made. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * + * The caller is responsabile to ensure that the input string data remains unchanged and is + * not deleted during the loop. + * + * ### Format + * + * The buffer must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by ASCII whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. Documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with ASCII whitespace. + * + * The characters inside a JSON document, and between JSON documents, must be valid Unicode (UTF-8). + * If there is a UTF-8 BOM, the parser skips it. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excessively small values may impact negatively the + * performance. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The concatenated JSON to parse. + * @param len The length of the concatenated JSON. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 10MB, which has been a reasonable sweet spot in our tests. + * @param allow_comma_separated (defaults on false) This allows a mode where the documents are + * separated by commas instead of whitespace. It comes with a performance + * penalty because the entire document is indexed at once (and the document must be + * less than 4 GB), and there is no multithreading. In this mode, the batch_size parameter + * is effectively ignored, as it is set to at least the document size. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result iterate_many(const uint8_t *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const char *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const std::string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const std::string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const padded_string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const padded_string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_result iterate_many(const char *buf, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept = delete; + + /** The capacity of this parser (the largest document it can process). */ + simdjson_inline size_t capacity() const noexcept; + /** The maximum capacity of this parser (the largest document it is allowed to process). */ + simdjson_inline size_t max_capacity() const noexcept; + simdjson_inline void set_max_capacity(size_t max_capacity) noexcept; + /** + * The maximum depth of this parser (the most deeply nested objects and arrays it can process). + * This parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * The max_depth parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused error_code allocate(size_t capacity, size_t max_depth=DEFAULT_MAX_DEPTH) noexcept; + + #ifdef SIMDJSON_THREADS_ENABLED + /** + * The parser instance can use threads when they are available to speed up some + * operations. It is enabled by default. Changing this attribute will change the + * behavior of the parser for future operations. + */ + bool threaded{true}; + #endif + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result must be valid UTF-8. + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @param allow_replacement Whether we allow a replacement if the input string contains unmatched surrogate pairs. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement = false) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result may not be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept; + +private: + /** @private [for benchmarking access] The implementation to use */ + std::unique_ptr implementation{}; + size_t _capacity{0}; + size_t _max_capacity; + size_t _max_depth{DEFAULT_MAX_DEPTH}; + std::unique_ptr string_buf{}; +#if SIMDJSON_DEVELOPMENT_CHECKS + std::unique_ptr start_positions{}; +#endif + + friend class json_iterator; + friend class document_stream; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::parser &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_H +/* end file simdjson/generic/ondemand/parser.h for ppc64 */ + +// All other declarations +/* including simdjson/generic/ondemand/array.h for ppc64: #include "simdjson/generic/ondemand/array.h" */ +/* begin file simdjson/generic/ondemand/array.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * A forward-only JSON array. + */ +class array { +public: + /** + * Create a new invalid array. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline array() noexcept = default; + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an array is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the beginning of the array and checks whether the + * array is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result is_empty() & noexcept; + /** + * Reset the iterator so that we are pointing back at the + * beginning of the array. You should still consume values only once even if you + * can iterate through the array more than once. If you unescape a string + * within the array more than once, you have unsafe code. Note that rewinding + * an array means that you may need to reparse it anew: it is not a free + * operation. + * + * @returns true if the array contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/0/foo/a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an array + * instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the array and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Get the value at the given index. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; +protected: + /** + * Go to the end of the array, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + + /** + * Begin array iteration. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + */ + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + /** + * Begin array iteration from the root. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + * @error TAPE_ERROR if there is no closing ] at the end of the document. + */ + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + /** + * Begin array iteration. + * + * This version of the method should be called after the initial [ has been verified, and is + * intended for use by switch statements that check the type of a value. + * + * @param iter The iterator. Must be after the initial [. Will be *moved* into the resulting array. + */ + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + + /** + * Create an array at the given Internal array creation. Call array::start() or array::started() instead of this. + * + * @param iter The iterator. Must either be at the start of the first element with iter.is_alive() + * == true, or past the [] with is_alive() == false if the array is empty. Will be *moved* + * into the resulting array. + */ + simdjson_inline array(const value_iterator &iter) noexcept; + + /** + * Iterator marking current position. + * + * iter.is_alive() == false indicates iteration is complete. + */ + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; + friend struct simdjson_result; + friend class array_iterator; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::array &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + inline simdjson_result count_elements() & noexcept; + inline simdjson_result is_empty() & noexcept; + inline simdjson_result reset() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_H +/* end file simdjson/generic/ondemand/array.h for ppc64 */ +/* including simdjson/generic/ondemand/array_iterator.h for ppc64: #include "simdjson/generic/ondemand/array_iterator.h" */ +/* begin file simdjson/generic/ondemand/array_iterator.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * A forward-only JSON array. + * + * This is an input_iterator, meaning: + * - It is forward-only + * - * must be called exactly once per element. + * - ++ must be called exactly once in between each * (*, ++, *, ++, * ...) + */ +class array_iterator { +public: + /** Create a new, invalid array iterator. */ + simdjson_inline array_iterator() noexcept = default; + + // + // Iterator interface + // + + /** + * Get the current element. + * + * Part of the std::iterator interface. + */ + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + /** + * Check if we are at the end of the JSON. + * + * Part of the std::iterator interface. + * + * @return true if there are no more elements in the JSON array. + */ + simdjson_inline bool operator==(const array_iterator &) const noexcept; + /** + * Check if there are more elements in the JSON array. + * + * Part of the std::iterator interface. + * + * @return true if there are more elements in the JSON array. + */ + simdjson_inline bool operator!=(const array_iterator &) const noexcept; + /** + * Move to the next element. + * + * Part of the std::iterator interface. + */ + simdjson_inline array_iterator &operator++() noexcept; + +private: + value_iterator iter{}; + + simdjson_inline array_iterator(const value_iterator &iter) noexcept; + + friend class array; + friend class value; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::array_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H +/* end file simdjson/generic/ondemand/array_iterator.h for ppc64 */ +/* including simdjson/generic/ondemand/document.h for ppc64: #include "simdjson/generic/ondemand/document.h" */ +/* begin file simdjson/generic/ondemand/document.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * A JSON document. It holds a json_iterator instance. + * + * Used by tokens to get text, and string buffer location. + * + * You must keep the document around during iteration. + */ +class document { +public: + /** + * Create a new invalid document. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline document() noexcept = default; + simdjson_inline document(const document &other) noexcept = delete; // pass your documents by reference, not by copy + simdjson_inline document(document &&other) noexcept = default; + simdjson_inline document &operator=(const document &other) noexcept = delete; + simdjson_inline document &operator=(document &&other) noexcept = default; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() & noexcept; + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() & noexcept; + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + /** + * Cast this JSON value (inside string) to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: Calling get_string() twice on the same document is an error. + * + * @param Whether to allow a replacement character for unmatched surrogate pairs. + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + /** + * Cast this JSON value to a string. + * + * The string is not guaranteed to be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * + * Important: Calling get_wobbly_string() twice on the same document is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + /** + * Cast this JSON value to a value when the document is an object or an array. + * + * @returns A value if a JSON array or object cannot be found. + * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result get_value() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() & noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + /** @overload template simdjson_result get() & noexcept */ + template simdjson_inline simdjson_result get() && noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool, value + * + * Be mindful that the document instance must remain in scope while you are accessing object, array and value instances. + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) & noexcept; + /** @overload template error_code get(T &out) & noexcept */ + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() & noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() & noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); + /** + * Cast this JSON value to a value. + * + * @returns A value value. + * @exception if a JSON value cannot be found + */ + simdjson_inline operator value() noexcept(false); +#endif + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) & noexcept; + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to + * a key a single time. Doing object["mykey"].to_string()and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the document is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the document is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the document is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. If this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view may be the padded buffer. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + /** + * Reset the iterator inside the document instance so we are pointing back at the + * beginning of the document, as if it had just been created. It invalidates all + * values, objects and arrays that you have created so far (including unescaped strings). + */ + inline void rewind() noexcept; + /** + * Returns debugging information. + */ + inline std::string to_debug_string() noexcept; + /** + * Some unrecoverable error conditions may render the document instance unusable. + * The is_alive() method returns true when the document is still suitable. + */ + inline bool is_alive() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Returns true if this document has been fully parsed. + * If you have consumed the whole document and at_end() returns + * false, then there may be trailing content. + */ + inline bool at_end() const noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() automatically calls rewind between each call. Thus + * all values, objects and arrays that you have created so far (including unescaped strings) + * are invalidated. After calling at_pointer, you need to consume the result: string values + * should be stored in your own variables, arrays should be decoded and stored in your own array-like + * structures and so forth. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + * - SCALAR_DOCUMENT_AS_VALUE if the json_pointer is empty and the document is not a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the document and returns a string_view instance corresponding to the + * document as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; +protected: + /** + * Consumes the document. + */ + simdjson_inline error_code consume() noexcept; + + simdjson_inline document(ondemand::json_iterator &&iter) noexcept; + simdjson_inline const uint8_t *text(uint32_t idx) const noexcept; + + simdjson_inline value_iterator resume_value_iterator() noexcept; + simdjson_inline value_iterator get_root_value_iterator() noexcept; + simdjson_inline simdjson_result start_or_resume_object() noexcept; + static simdjson_inline document start(ondemand::json_iterator &&iter) noexcept; + + // + // Fields + // + json_iterator iter{}; ///< Current position in the document + static constexpr depth_t DOCUMENT_DEPTH = 0; ///< document depth is always 0 + + friend class array_iterator; + friend class value; + friend class ondemand::parser; + friend class object; + friend class array; + friend class field; + friend class token; + friend class document_stream; + friend class document_reference; +}; + + +/** + * A document_reference is a thin wrapper around a document reference instance. + */ +class document_reference { +public: + simdjson_inline document_reference() noexcept; + simdjson_inline document_reference(document &d) noexcept; + simdjson_inline document_reference(const document_reference &other) noexcept = default; + simdjson_inline document_reference& operator=(const document_reference &other) noexcept = default; + simdjson_inline void rewind() noexcept; + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + + simdjson_inline simdjson_result is_null() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + simdjson_inline operator document&() const noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator array() & noexcept(false); + simdjson_inline operator object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +private: + document *doc{nullptr}; +}; +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::document &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() & noexcept; + template simdjson_inline simdjson_result get() && noexcept; + + template simdjson_inline error_code get(T &out) & noexcept; + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator ppc64::ondemand::array() & noexcept(false); + simdjson_inline operator ppc64::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator ppc64::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator ppc64::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool at_end() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + + + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::document_reference value, error_code error) noexcept; + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator ppc64::ondemand::array() & noexcept(false); + simdjson_inline operator ppc64::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator ppc64::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator ppc64::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document_reference::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H +/* end file simdjson/generic/ondemand/document.h for ppc64 */ +/* including simdjson/generic/ondemand/document_stream.h for ppc64: #include "simdjson/generic/ondemand/document_stream.h" */ +/* begin file simdjson/generic/ondemand/document_stream.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#ifdef SIMDJSON_THREADS_ENABLED +#include +#include +#include +#endif + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED +/** @private Custom worker class **/ +struct stage1_worker { + stage1_worker() noexcept = default; + stage1_worker(const stage1_worker&) = delete; + stage1_worker(stage1_worker&&) = delete; + stage1_worker operator=(const stage1_worker&) = delete; + ~stage1_worker(); + /** + * We only start the thread when it is needed, not at object construction, this may throw. + * You should only call this once. + **/ + void start_thread(); + /** + * Start a stage 1 job. You should first call 'run', then 'finish'. + * You must call start_thread once before. + */ + void run(document_stream * ds, parser * stage1, size_t next_batch_start); + /** Wait for the run to finish (blocking). You should first call 'run', then 'finish'. **/ + void finish(); + +private: + + /** + * Normally, we would never stop the thread. But we do in the destructor. + * This function is only safe assuming that you are not waiting for results. You + * should have called run, then finish, and be done. + **/ + void stop_thread(); + + std::thread thread{}; + /** These three variables define the work done by the thread. **/ + ondemand::parser * stage1_thread_parser{}; + size_t _next_batch_start{}; + document_stream * owner{}; + /** + * We have two state variables. This could be streamlined to one variable in the future but + * we use two for clarity. + */ + bool has_work{false}; + bool can_work{true}; + + /** + * We lock using a mutex. + */ + std::mutex locking_mutex{}; + std::condition_variable cond_var{}; + + friend class document_stream; +}; +#endif // SIMDJSON_THREADS_ENABLED + +/** + * A forward-only stream of documents. + * + * Produced by parser::iterate_many. + * + */ +class document_stream { +public: + /** + * Construct an uninitialized document_stream. + * + * ```c++ + * document_stream docs; + * auto error = parser.iterate_many(json).get(docs); + * ``` + */ + simdjson_inline document_stream() noexcept; + /** Move one document_stream to another. */ + simdjson_inline document_stream(document_stream &&other) noexcept = default; + /** Move one document_stream to another. */ + simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default; + + simdjson_inline ~document_stream() noexcept; + + /** + * Returns the input size in bytes. + */ + inline size_t size_in_bytes() const noexcept; + + /** + * After iterating through the stream, this method + * returns the number of bytes that were not parsed at the end + * of the stream. If truncated_bytes() differs from zero, + * then the input was truncated maybe because incomplete JSON + * documents were found at the end of the stream. You + * may need to process the bytes in the interval [size_in_bytes()-truncated_bytes(), size_in_bytes()). + * + * You should only call truncated_bytes() after streaming through all + * documents, like so: + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto & doc : stream) { + * // do something with doc + * } + * size_t truncated = stream.truncated_bytes(); + * + */ + inline size_t truncated_bytes() const noexcept; + + class iterator { + public: + using value_type = simdjson_result; + using reference = value_type; + + using difference_type = std::ptrdiff_t; + + using iterator_category = std::input_iterator_tag; + + /** + * Default constructor. + */ + simdjson_inline iterator() noexcept; + /** + * Get the current document (or error). + */ + simdjson_inline simdjson_result operator*() noexcept; + /** + * Advance to the next document (prefix). + */ + inline iterator& operator++() noexcept; + /** + * Check if we're at the end yet. + * @param other the end iterator to compare to. + */ + simdjson_inline bool operator!=(const iterator &other) const noexcept; + /** + * @private + * + * Gives the current index in the input document in bytes. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * size_t index = i.current_index(); + * } + * + * This function (current_index()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline size_t current_index() const noexcept; + + /** + * @private + * + * Gives a view of the current document at the current position. + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * std::string_view v = i.source(); + * } + * + * The returned string_view instance is simply a map to the (unparsed) + * source string: it may thus include white-space characters and all manner + * of padding. + * + * This function (source()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + * + */ + simdjson_inline std::string_view source() const noexcept; + + /** + * Returns error of the stream (if any). + */ + inline error_code error() const noexcept; + + private: + simdjson_inline iterator(document_stream *s, bool finished) noexcept; + /** The document_stream we're iterating through. */ + document_stream* stream; + /** Whether we're finished or not. */ + bool finished; + + friend class document; + friend class document_stream; + friend class json_iterator; + }; + + /** + * Start iterating the documents in the stream. + */ + simdjson_inline iterator begin() noexcept; + /** + * The end of the stream, for iterator comparison purposes. + */ + simdjson_inline iterator end() noexcept; + +private: + + document_stream &operator=(const document_stream &) = delete; // Disallow copying + document_stream(const document_stream &other) = delete; // Disallow copying + + /** + * Construct a document_stream. Does not allocate or parse anything until the iterator is + * used. + * + * @param parser is a reference to the parser instance used to generate this document_stream + * @param buf is the raw byte buffer we need to process + * @param len is the length of the raw byte buffer in bytes + * @param batch_size is the size of the windows (must be strictly greater or equal to the largest JSON document) + */ + simdjson_inline document_stream( + ondemand::parser &parser, + const uint8_t *buf, + size_t len, + size_t batch_size, + bool allow_comma_separated + ) noexcept; + + /** + * Parse the first document in the buffer. Used by begin(), to handle allocation and + * initialization. + */ + inline void start() noexcept; + + /** + * Parse the next document found in the buffer previously given to document_stream. + * + * The content should be a valid JSON document encoded as UTF-8. If there is a + * UTF-8 BOM, the parser skips it. + * + * You do NOT need to pre-allocate a parser. This function takes care of + * pre-allocating a capacity defined by the batch_size defined when creating the + * document_stream object. + * + * The function returns simdjson::EMPTY if there is no more data to be parsed. + * + * The function returns simdjson::SUCCESS (as integer = 0) in case of success + * and indicates that the buffer has successfully been parsed to the end. + * Every document it contained has been parsed without error. + * + * The function returns an error code from simdjson/simdjson.h in case of failure + * such as simdjson::CAPACITY, simdjson::MEMALLOC, simdjson::DEPTH_ERROR and so forth; + * the simdjson::error_message function converts these error codes into a string). + * + * You can also check validity by calling parser.is_valid(). The same parser can + * and should be reused for the other documents in the buffer. + */ + inline void next() noexcept; + + /** Move the json_iterator of the document to the location of the next document in the stream. */ + inline void next_document() noexcept; + + /** Get the next document index. */ + inline size_t next_batch_start() const noexcept; + + /** Pass the next batch through stage 1 with the given parser. */ + inline error_code run_stage1(ondemand::parser &p, size_t batch_start) noexcept; + + // Fields + ondemand::parser *parser; + const uint8_t *buf; + size_t len; + size_t batch_size; + bool allow_comma_separated; + /** + * We are going to use just one document instance. The document owns + * the json_iterator. It implies that we only ever pass a reference + * to the document to the users. + */ + document doc{}; + /** The error (or lack thereof) from the current document. */ + error_code error; + size_t batch_start{0}; + size_t doc_index{}; + + #ifdef SIMDJSON_THREADS_ENABLED + /** Indicates whether we use threads. Note that this needs to be a constant during the execution of the parsing. */ + bool use_thread; + + inline void load_from_stage1_thread() noexcept; + + /** Start a thread to run stage 1 on the next batch. */ + inline void start_stage1_thread() noexcept; + + /** Wait for the stage 1 thread to finish and capture the results. */ + inline void finish_stage1_thread() noexcept; + + /** The error returned from the stage 1 thread. */ + error_code stage1_thread_error{UNINITIALIZED}; + /** The thread used to run stage 1 against the next batch in the background. */ + std::unique_ptr worker{new(std::nothrow) stage1_worker()}; + /** + * The parser used to run stage 1 in the background. Will be swapped + * with the regular parser when finished. + */ + ondemand::parser stage1_thread_parser{}; + + friend struct stage1_worker; + #endif // SIMDJSON_THREADS_ENABLED + + friend class parser; + friend class document; + friend class json_iterator; + friend struct simdjson_result; + friend struct internal::simdjson_result_base; +}; // document_stream + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::document_stream &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H +/* end file simdjson/generic/ondemand/document_stream.h for ppc64 */ +/* including simdjson/generic/ondemand/field.h for ppc64: #include "simdjson/generic/ondemand/field.h" */ +/* begin file simdjson/generic/ondemand/field.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * A JSON field (key/value pair) in an object. + * + * Returned from object iteration. + * + * Extends from std::pair so you can use C++ algorithms that rely on pairs. + */ +class field : public std::pair { +public: + /** + * Create a new invalid field. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline field() noexcept; + + /** + * Get the key as a string_view (for higher speed, consider raw_key). + * We deliberately use a more cumbersome name (unescaped_key) to force users + * to think twice about using it. + * + * This consumes the key: once you have called unescaped_key(), you cannot + * call it again nor can you call key(). + */ + simdjson_inline simdjson_warn_unused simdjson_result unescaped_key(bool allow_replacement) noexcept; + /** + * Get the key as a raw_json_string. Can be used for direct comparison with + * an unescaped C string: e.g., key() == "test". + */ + simdjson_inline raw_json_string key() const noexcept; + /** + * Get the field value. + */ + simdjson_inline ondemand::value &value() & noexcept; + /** + * @overload ondemand::value &ondemand::value() & noexcept + */ + simdjson_inline ondemand::value value() && noexcept; + +protected: + simdjson_inline field(raw_json_string key, ondemand::value &&value) noexcept; + static simdjson_inline simdjson_result start(value_iterator &parent_iter) noexcept; + static simdjson_inline simdjson_result start(const value_iterator &parent_iter, raw_json_string key) noexcept; + friend struct simdjson_result; + friend class object_iterator; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::field &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result unescaped_key(bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result key() noexcept; + simdjson_inline simdjson_result value() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_H +/* end file simdjson/generic/ondemand/field.h for ppc64 */ +/* including simdjson/generic/ondemand/object.h for ppc64: #include "simdjson/generic/ondemand/object.h" */ +/* begin file simdjson/generic/ondemand/object.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +/** + * A forward-only JSON object field iterator. + */ +class object { +public: + /** + * Create a new invalid object. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a + * key a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an object + * instance: there is no rewind and no invalidation. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + + /** + * Reset the iterator so that we are pointing back at the + * beginning of the object. You should still consume values only once even if you + * can iterate through the object more than once. If you unescape a string within + * the object more than once, you have unsafe code. Note that rewinding an object + * means that you may need to reparse it anew: it is not a free operation. + * + * @returns true if the object contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * This method scans the beginning of the object and checks whether the + * object is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + inline simdjson_result is_empty() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Consumes the object and returns a string_view instance corresponding to the + * object as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + +protected: + /** + * Go to the end of the object, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + static simdjson_inline object resume(const value_iterator &iter) noexcept; + simdjson_inline object(const value_iterator &iter) noexcept; + + simdjson_warn_unused simdjson_inline error_code find_field_raw(const std::string_view key) noexcept; + + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::object &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + inline simdjson_result reset() noexcept; + inline simdjson_result is_empty() noexcept; + inline simdjson_result count_fields() & noexcept; + inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_H +/* end file simdjson/generic/ondemand/object.h for ppc64 */ +/* including simdjson/generic/ondemand/object_iterator.h for ppc64: #include "simdjson/generic/ondemand/object_iterator.h" */ +/* begin file simdjson/generic/ondemand/object_iterator.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +class object_iterator { +public: + /** + * Create a new invalid object_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object_iterator() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline simdjson_result operator*() noexcept; + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const object_iterator &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const object_iterator &) const noexcept; + // Checks for ']' and ',' + simdjson_inline object_iterator &operator++() noexcept; + +private: + /** + * The underlying JSON iterator. + * + * PERF NOTE: expected to be elided in favor of the parent document: this is set when the object + * is first used, and never changes afterwards. + */ + value_iterator iter{}; + + simdjson_inline object_iterator(const value_iterator &iter) noexcept; + friend struct simdjson_result; + friend class object; +}; + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public ppc64::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(ppc64::ondemand::object_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + // Checks for ']' and ',' + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H +/* end file simdjson/generic/ondemand/object_iterator.h for ppc64 */ +/* including simdjson/generic/ondemand/serialization.h for ppc64: #include "simdjson/generic/ondemand/serialization.h" */ +/* begin file simdjson/generic/ondemand/serialization.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Create a string-view instance out of a document instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(ppc64::ondemand::document& x) noexcept; +/** + * Create a string-view instance out of a value instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. The value must + * not have been accessed previously. It does not + * validate the content. + */ +inline simdjson_result to_json_string(ppc64::ondemand::value& x) noexcept; +/** + * Create a string-view instance out of an object instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(ppc64::ondemand::object& x) noexcept; +/** + * Create a string-view instance out of an array instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(ppc64::ondemand::array& x) noexcept; +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +} // namespace simdjson + +/** + * We want to support argument-dependent lookup (ADL). + * Hence we should define operator<< in the namespace + * where the argument (here value, object, etc.) resides. + * Credit: @madhur4127 + * See https://github.com/simdjson/simdjson/issues/1768 + */ +namespace simdjson { namespace ppc64 { namespace ondemand { + +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The element. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::value x); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::array value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::document& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::document_reference& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The object. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::object value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +}}} // namespace simdjson::ppc64::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H +/* end file simdjson/generic/ondemand/serialization.h for ppc64 */ + +// Inline definitions +/* including simdjson/generic/ondemand/array-inl.h for ppc64: #include "simdjson/generic/ondemand/array-inl.h" */ +/* begin file simdjson/generic/ondemand/array-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter->depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the array is first found and the iterator is just past the `{`. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the `,` before the next value (or `]`). In this state, +// depth == iter->depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter->depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter->depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the array iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet element may be missing or not be an +// array--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter->depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between elements, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter->depth == depth, and at_start == false. +// +// ## Terminal State +// +// The terminal state has iter->depth < depth. at_start is always false. +// +// - Finished: When we have reached a `]` or have reported an error, we are finished. We signal this +// by decrementing depth. In this state, iter->depth < depth, at_start == false, and +// error == SUCCESS. +// + +simdjson_inline array::array(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result array::start(value_iterator &iter) noexcept { + // We don't need to know if the array is empty to start iteration, but we do want to know if there + // is an error--thus `simdjson_unused`. + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::start_root(value_iterator &iter) noexcept { + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_root_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::started(value_iterator &iter) noexcept { + bool has_value; + SIMDJSON_TRY(iter.started_array().get(has_value)); + return array(iter); +} + +simdjson_inline simdjson_result array::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return array_iterator(iter); +} +simdjson_inline simdjson_result array::end() noexcept { + return array_iterator(iter); +} +simdjson_inline error_code array::consume() noexcept { + auto error = iter.json_iter().skip_child(iter.depth()-1); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result array::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter._json_iter->unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline simdjson_result array::count_elements() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the array after counting the number of elements. + iter.reset_array(); + return count; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline simdjson_result array::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_array().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +inline simdjson_result array::reset() & noexcept { + return iter.reset_array(); +} + +inline simdjson_result array::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + // - means "the append position" or "the element after the end of the array" + // We don't support this, because we're returning a real element, not a position. + if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; } + + // Read the array index + size_t array_index = 0; + size_t i; + for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) { + uint8_t digit = uint8_t(json_pointer[i] - '0'); + // Check for non-digit in array index. If it's there, we're trying to get a field in an object + if (digit > 9) { return INCORRECT_TYPE; } + array_index = array_index*10 + digit; + } + + // 0 followed by other digits is invalid + if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0" + + // Empty string is invalid; so is a "/" with no digits before it + if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index" + // Get the child + auto child = at(array_index); + // If there is an error, it ends here + if(child.error()) { + return child; + } + + // If there is a /, we're not done yet, call recursively. + if (i < json_pointer.length()) { + child = child.at_pointer(json_pointer.substr(i)); + } + return child; +} + +simdjson_inline simdjson_result array::at(size_t index) noexcept { + size_t i = 0; + for (auto value : *this) { + if (i == index) { return value; } + i++; + } + return INDEX_OUT_OF_BOUNDS; +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + ppc64::ondemand::array &&value +) noexcept + : implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept + : implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::is_empty() & noexcept { + if (error()) { return error(); } + return first.is_empty(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H +/* end file simdjson/generic/ondemand/array-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/array_iterator-inl.h for ppc64: #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/array_iterator-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline array_iterator::array_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result array_iterator::operator*() noexcept { + if (iter.error()) { iter.abandon(); return iter.error(); } + return value(iter.child()); +} +simdjson_inline bool array_iterator::operator==(const array_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept { + return iter.is_open(); +} +simdjson_inline array_iterator &array_iterator::operator++() noexcept { + error_code error; + // PERF NOTE this is a safety rail ... users should exit loops as soon as they receive an error, so we'll never get here. + // However, it does not seem to make a perf difference, so we add it out of an abundance of caution. + if (( error = iter.error() )) { return *this; } + if (( error = iter.skip_child() )) { return *this; } + if (( error = iter.has_next_element().error() )) { return *this; } + return *this; +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + ppc64::ondemand::array_iterator &&value +) noexcept + : ppc64::implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : ppc64::implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++(first); + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/array_iterator-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/document-inl.h for ppc64: #include "simdjson/generic/ondemand/document-inl.h" */ +/* begin file simdjson/generic/ondemand/document-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline document::document(ondemand::json_iterator &&_iter) noexcept + : iter{std::forward(_iter)} +{ + logger::log_start_value(iter, "document"); +} + +simdjson_inline document document::start(json_iterator &&iter) noexcept { + return document(std::forward(iter)); +} + +inline void document::rewind() noexcept { + iter.rewind(); +} + +inline std::string document::to_debug_string() noexcept { + return iter.to_string(); +} + +inline simdjson_result document::current_location() const noexcept { + return iter.current_location(); +} + +inline int32_t document::current_depth() const noexcept { + return iter.depth(); +} + +inline bool document::at_end() const noexcept { + return iter.at_end(); +} + + +inline bool document::is_alive() noexcept { + return iter.is_alive(); +} +simdjson_inline value_iterator document::resume_value_iterator() noexcept { + return value_iterator(&iter, 1, iter.root_position()); +} +simdjson_inline value_iterator document::get_root_value_iterator() noexcept { + return resume_value_iterator(); +} +simdjson_inline simdjson_result document::start_or_resume_object() noexcept { + if (iter.at_root()) { + return get_object(); + } else { + return object::resume(resume_value_iterator()); + } +} +simdjson_inline simdjson_result document::get_value() noexcept { + // Make sure we start any arrays or objects before returning, so that start_root_() + // gets called. + iter.assert_at_document_depth(); + switch (*iter.peek()) { + case '[': { + // The following lines check that the document ends with ]. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_array(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + case '{': { + // The following lines would check that the document ends with }. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_object(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + default: + // Unfortunately, scalar documents are a special case in simdjson and they cannot + // be safely converted to value instances. + return SCALAR_DOCUMENT_AS_VALUE; + } +} +simdjson_inline simdjson_result document::get_array() & noexcept { + auto value = get_root_value_iterator(); + return array::start_root(value); +} +simdjson_inline simdjson_result document::get_object() & noexcept { + auto value = get_root_value_iterator(); + return object::start_root(value); +} + +/** + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. We want to disallow trailing + * content. + * Thus, in several implementations below, we pass a 'true' parameter value to + * a get_root_value_iterator() method: this indicates that we disallow trailing content. + */ + +simdjson_inline simdjson_result document::get_uint64() noexcept { + return get_root_value_iterator().get_root_uint64(true); +} +simdjson_inline simdjson_result document::get_uint64_in_string() noexcept { + return get_root_value_iterator().get_root_uint64_in_string(true); +} +simdjson_inline simdjson_result document::get_int64() noexcept { + return get_root_value_iterator().get_root_int64(true); +} +simdjson_inline simdjson_result document::get_int64_in_string() noexcept { + return get_root_value_iterator().get_root_int64_in_string(true); +} +simdjson_inline simdjson_result document::get_double() noexcept { + return get_root_value_iterator().get_root_double(true); +} +simdjson_inline simdjson_result document::get_double_in_string() noexcept { + return get_root_value_iterator().get_root_double_in_string(true); +} +simdjson_inline simdjson_result document::get_string(bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(true, allow_replacement); +} +template +simdjson_inline error_code document::get_string(string_type& receiver, bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(receiver, true, allow_replacement); +} +simdjson_inline simdjson_result document::get_wobbly_string() noexcept { + return get_root_value_iterator().get_root_wobbly_string(true); +} +simdjson_inline simdjson_result document::get_raw_json_string() noexcept { + return get_root_value_iterator().get_root_raw_json_string(true); +} +simdjson_inline simdjson_result document::get_bool() noexcept { + return get_root_value_iterator().get_root_bool(true); +} +simdjson_inline simdjson_result document::is_null() noexcept { + return get_root_value_iterator().is_root_null(true); +} + +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_array(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_object(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_double(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_bool(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_value(); } + +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_double(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_uint64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_int64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_bool(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_value(); } + +template simdjson_inline error_code document::get(T &out) & noexcept { + return get().get(out); +} +template simdjson_inline error_code document::get(T &out) && noexcept { + return std::forward(*this).get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document::operator array() & noexcept(false) { return get_array(); } +simdjson_inline document::operator object() & noexcept(false) { return get_object(); } +simdjson_inline document::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document::operator double() noexcept(false) { return get_double(); } +simdjson_inline document::operator std::string_view() noexcept(false) { return get_string(false); } +simdjson_inline document::operator raw_json_string() noexcept(false) { return get_raw_json_string(); } +simdjson_inline document::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document::operator value() noexcept(false) { return get_value(); } + +#endif +simdjson_inline simdjson_result document::count_elements() & noexcept { + auto a = get_array(); + simdjson_result answer = a.count_elements(); + /* If there was an array, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::count_fields() & noexcept { + auto a = get_object(); + simdjson_result answer = a.count_fields(); + /* If there was an object, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::at(size_t index) & noexcept { + auto a = get_array(); + return a.at(index); +} +simdjson_inline simdjson_result document::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result document::end() & noexcept { + return {}; +} + +simdjson_inline simdjson_result document::find_field(std::string_view key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field(const char *key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field_unordered(std::string_view key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::find_field_unordered(const char *key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::operator[](std::string_view key) & noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result document::operator[](const char *key) & noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline error_code document::consume() noexcept { + auto error = iter.skip_child(0); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result document::raw_json() noexcept { + auto _iter = get_root_value_iterator(); + const uint8_t * starting_point{_iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter.unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result document::type() noexcept { + return get_root_value_iterator().type(); +} + +simdjson_inline simdjson_result document::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool document::is_negative() noexcept { + return get_root_value_iterator().is_root_negative(); +} + +simdjson_inline simdjson_result document::is_integer() noexcept { + return get_root_value_iterator().is_root_integer(true); +} + +simdjson_inline simdjson_result document::get_number_type() noexcept { + return get_root_value_iterator().get_root_number_type(true); +} + +simdjson_inline simdjson_result document::get_number() noexcept { + return get_root_value_iterator().get_root_number(true); +} + + +simdjson_inline simdjson_result document::raw_json_token() noexcept { + auto _iter = get_root_value_iterator(); + return std::string_view(reinterpret_cast(_iter.peek_start()), _iter.peek_start_length()); +} + +simdjson_inline simdjson_result document::at_pointer(std::string_view json_pointer) noexcept { + rewind(); // Rewind the document each time at_pointer is called + if (json_pointer.empty()) { + return this->get_value(); + } + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + ppc64::ondemand::document &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base( + error + ) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template +simdjson_inline simdjson_result simdjson_result::get() & noexcept { + if (error()) { return error(); } + return first.get(); +} +template +simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first).get(); +} +template +simdjson_inline error_code simdjson_result::get(T &out) & noexcept { + if (error()) { return error(); } + return first.get(out); +} +template +simdjson_inline error_code simdjson_result::get(T &out) && noexcept { + if (error()) { return error(); } + return std::forward(first).get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() & noexcept = delete; +template<> simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first); +} +template<> simdjson_inline error_code simdjson_result::get(ppc64::ondemand::document &out) & noexcept = delete; +template<> simdjson_inline error_code simdjson_result::get(ppc64::ondemand::document &out) && noexcept { + if (error()) { return error(); } + out = std::forward(first); + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} + +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} + + +simdjson_inline bool simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} + +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} + +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} + +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} + + +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator ppc64::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline bool simdjson_result::at_end() const noexcept { + if (error()) { return error(); } + return first.at_end(); +} + + +simdjson_inline int32_t simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline document_reference::document_reference() noexcept : doc{nullptr} {} +simdjson_inline document_reference::document_reference(document &d) noexcept : doc(&d) {} +simdjson_inline void document_reference::rewind() noexcept { doc->rewind(); } +simdjson_inline simdjson_result document_reference::get_array() & noexcept { return doc->get_array(); } +simdjson_inline simdjson_result document_reference::get_object() & noexcept { return doc->get_object(); } +/** + * The document_reference instances are used primarily/solely for streams of JSON + * documents. + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. + * + * However, for streams of JSON documents, we want to be able to start from + * "321" "321" "321" + * and parse it successfully as a stream of JSON documents, calling get_uint64_in_string() + * successfully each time. + * + * To achieve this result, we pass a 'false' to a get_root_value_iterator() method: + * this indicates that we allow trailing content. + */ +simdjson_inline simdjson_result document_reference::get_uint64() noexcept { return doc->get_root_value_iterator().get_root_uint64(false); } +simdjson_inline simdjson_result document_reference::get_uint64_in_string() noexcept { return doc->get_root_value_iterator().get_root_uint64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_int64() noexcept { return doc->get_root_value_iterator().get_root_int64(false); } +simdjson_inline simdjson_result document_reference::get_int64_in_string() noexcept { return doc->get_root_value_iterator().get_root_int64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_double() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_double_in_string() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_string(bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(false, allow_replacement); } +template +simdjson_inline error_code document_reference::get_string(string_type& receiver, bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(receiver, false, allow_replacement); } +simdjson_inline simdjson_result document_reference::get_wobbly_string() noexcept { return doc->get_root_value_iterator().get_root_wobbly_string(false); } +simdjson_inline simdjson_result document_reference::get_raw_json_string() noexcept { return doc->get_root_value_iterator().get_root_raw_json_string(false); } +simdjson_inline simdjson_result document_reference::get_bool() noexcept { return doc->get_root_value_iterator().get_root_bool(false); } +simdjson_inline simdjson_result document_reference::get_value() noexcept { return doc->get_value(); } +simdjson_inline simdjson_result document_reference::is_null() noexcept { return doc->get_root_value_iterator().is_root_null(false); } + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document_reference::operator array() & noexcept(false) { return array(*doc); } +simdjson_inline document_reference::operator object() & noexcept(false) { return object(*doc); } +simdjson_inline document_reference::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document_reference::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document_reference::operator double() noexcept(false) { return get_double(); } +simdjson_inline document_reference::operator std::string_view() noexcept(false) { return std::string_view(*doc); } +simdjson_inline document_reference::operator raw_json_string() noexcept(false) { return raw_json_string(*doc); } +simdjson_inline document_reference::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document_reference::operator value() noexcept(false) { return value(*doc); } +#endif +simdjson_inline simdjson_result document_reference::count_elements() & noexcept { return doc->count_elements(); } +simdjson_inline simdjson_result document_reference::count_fields() & noexcept { return doc->count_fields(); } +simdjson_inline simdjson_result document_reference::at(size_t index) & noexcept { return doc->at(index); } +simdjson_inline simdjson_result document_reference::begin() & noexcept { return doc->begin(); } +simdjson_inline simdjson_result document_reference::end() & noexcept { return doc->end(); } +simdjson_inline simdjson_result document_reference::find_field(std::string_view key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::find_field(const char *key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::operator[](std::string_view key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::operator[](const char *key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::find_field_unordered(std::string_view key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::find_field_unordered(const char *key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::type() noexcept { return doc->type(); } +simdjson_inline simdjson_result document_reference::is_scalar() noexcept { return doc->is_scalar(); } +simdjson_inline simdjson_result document_reference::current_location() noexcept { return doc->current_location(); } +simdjson_inline int32_t document_reference::current_depth() const noexcept { return doc->current_depth(); } +simdjson_inline bool document_reference::is_negative() noexcept { return doc->is_negative(); } +simdjson_inline simdjson_result document_reference::is_integer() noexcept { return doc->get_root_value_iterator().is_root_integer(false); } +simdjson_inline simdjson_result document_reference::get_number_type() noexcept { return doc->get_root_value_iterator().get_root_number_type(false); } +simdjson_inline simdjson_result document_reference::get_number() noexcept { return doc->get_root_value_iterator().get_root_number(false); } +simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } +simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } +simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} +simdjson_inline document_reference::operator document&() const noexcept { return *doc; } + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + + + +namespace simdjson { +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::document_reference value, error_code error) + noexcept : implementation_simdjson_result_base(std::forward(value), error) {} + + +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator ppc64::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H +/* end file simdjson/generic/ondemand/document-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/document_stream-inl.h for ppc64: #include "simdjson/generic/ondemand/document_stream-inl.h" */ +/* begin file simdjson/generic/ondemand/document_stream-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void stage1_worker::finish() { + // After calling "run" someone would call finish() to wait + // for the end of the processing. + // This function will wait until either the thread has done + // the processing or, else, the destructor has been called. + std::unique_lock lock(locking_mutex); + cond_var.wait(lock, [this]{return has_work == false;}); +} + +inline stage1_worker::~stage1_worker() { + // The thread may never outlive the stage1_worker instance + // and will always be stopped/joined before the stage1_worker + // instance is gone. + stop_thread(); +} + +inline void stage1_worker::start_thread() { + std::unique_lock lock(locking_mutex); + if(thread.joinable()) { + return; // This should never happen but we never want to create more than one thread. + } + thread = std::thread([this]{ + while(true) { + std::unique_lock thread_lock(locking_mutex); + // We wait for either "run" or "stop_thread" to be called. + cond_var.wait(thread_lock, [this]{return has_work || !can_work;}); + // If, for some reason, the stop_thread() method was called (i.e., the + // destructor of stage1_worker is called, then we want to immediately destroy + // the thread (and not do any more processing). + if(!can_work) { + break; + } + this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser, + this->_next_batch_start); + this->has_work = false; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify "finish" + thread_lock.unlock(); + } + } + ); +} + + +inline void stage1_worker::stop_thread() { + std::unique_lock lock(locking_mutex); + // We have to make sure that all locks can be released. + can_work = false; + has_work = false; + cond_var.notify_all(); + lock.unlock(); + if(thread.joinable()) { + thread.join(); + } +} + +inline void stage1_worker::run(document_stream * ds, parser * stage1, size_t next_batch_start) { + std::unique_lock lock(locking_mutex); + owner = ds; + _next_batch_start = next_batch_start; + stage1_thread_parser = stage1; + has_work = true; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify the thread lock that we have work + lock.unlock(); +} + +#endif // SIMDJSON_THREADS_ENABLED + +simdjson_inline document_stream::document_stream( + ondemand::parser &_parser, + const uint8_t *_buf, + size_t _len, + size_t _batch_size, + bool _allow_comma_separated +) noexcept + : parser{&_parser}, + buf{_buf}, + len{_len}, + batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size}, + allow_comma_separated{_allow_comma_separated}, + error{SUCCESS} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change + #endif +{ +#ifdef SIMDJSON_THREADS_ENABLED + if(worker.get() == nullptr) { + error = MEMALLOC; + } +#endif +} + +simdjson_inline document_stream::document_stream() noexcept + : parser{nullptr}, + buf{nullptr}, + len{0}, + batch_size{0}, + allow_comma_separated{false}, + error{UNINITIALIZED} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(false) + #endif +{ +} + +simdjson_inline document_stream::~document_stream() noexcept +{ + #ifdef SIMDJSON_THREADS_ENABLED + worker.reset(); + #endif +} + +inline size_t document_stream::size_in_bytes() const noexcept { + return len; +} + +inline size_t document_stream::truncated_bytes() const noexcept { + if(error == CAPACITY) { return len - batch_start; } + return parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] - parser->implementation->structural_indexes[parser->implementation->n_structural_indexes + 1]; +} + +simdjson_inline document_stream::iterator::iterator() noexcept + : stream{nullptr}, finished{true} { +} + +simdjson_inline document_stream::iterator::iterator(document_stream* _stream, bool is_end) noexcept + : stream{_stream}, finished{is_end} { +} + +simdjson_inline simdjson_result document_stream::iterator::operator*() noexcept { + //if(stream->error) { return stream->error; } + return simdjson_result(stream->doc, stream->error); +} + +simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept { + // If there is an error, then we want the iterator + // to be finished, no matter what. (E.g., we do not + // keep generating documents with errors, or go beyond + // a document with errors.) + // + // Users do not have to call "operator*()" when they use operator++, + // so we need to end the stream in the operator++ function. + // + // Note that setting finished = true is essential otherwise + // we would enter an infinite loop. + if (stream->error) { finished = true; } + // Note that stream->error() is guarded against error conditions + // (it will immediately return if stream->error casts to false). + // In effect, this next function does nothing when (stream->error) + // is true (hence the risk of an infinite loop). + stream->next(); + // If that was the last document, we're finished. + // It is the only type of error we do not want to appear + // in operator*. + if (stream->error == EMPTY) { finished = true; } + // If we had any other kind of error (not EMPTY) then we want + // to pass it along to the operator* and we cannot mark the result + // as "finished" just yet. + return *this; +} + +simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept { + return finished != other.finished; +} + +simdjson_inline document_stream::iterator document_stream::begin() noexcept { + start(); + // If there are no documents, we're finished. + return iterator(this, error == EMPTY); +} + +simdjson_inline document_stream::iterator document_stream::end() noexcept { + return iterator(this, true); +} + +inline void document_stream::start() noexcept { + if (error) { return; } + error = parser->allocate(batch_size); + if (error) { return; } + // Always run the first stage 1 parse immediately + batch_start = 0; + error = run_stage1(*parser, batch_start); + while(error == EMPTY) { + // In exceptional cases, we may start with an empty block + batch_start = next_batch_start(); + if (batch_start >= len) { return; } + error = run_stage1(*parser, batch_start); + } + if (error) { return; } + doc_index = batch_start; + doc = document(json_iterator(&buf[batch_start], parser)); + doc.iter._streaming = true; + + #ifdef SIMDJSON_THREADS_ENABLED + if (use_thread && next_batch_start() < len) { + // Kick off the first thread on next batch if needed + error = stage1_thread_parser.allocate(batch_size); + if (error) { return; } + worker->start_thread(); + start_stage1_thread(); + if (error) { return; } + } + #endif // SIMDJSON_THREADS_ENABLED +} + +inline void document_stream::next() noexcept { + // We always enter at once once in an error condition. + if (error) { return; } + next_document(); + if (error) { return; } + auto cur_struct_index = doc.iter._root - parser->implementation->structural_indexes.get(); + doc_index = batch_start + parser->implementation->structural_indexes[cur_struct_index]; + + // Check if at end of structural indexes (i.e. at end of batch) + if(cur_struct_index >= static_cast(parser->implementation->n_structural_indexes)) { + error = EMPTY; + // Load another batch (if available) + while (error == EMPTY) { + batch_start = next_batch_start(); + if (batch_start >= len) { break; } + #ifdef SIMDJSON_THREADS_ENABLED + if(use_thread) { + load_from_stage1_thread(); + } else { + error = run_stage1(*parser, batch_start); + } + #else + error = run_stage1(*parser, batch_start); + #endif + /** + * Whenever we move to another window, we need to update all pointers to make + * it appear as if the input buffer started at the beginning of the window. + * + * Take this input: + * + * {"z":5} {"1":1,"2":2,"4":4} [7, 10, 9] [15, 11, 12, 13] [154, 110, 112, 1311] + * + * Say you process the following window... + * + * '{"z":5} {"1":1,"2":2,"4":4} [7, 10, 9]' + * + * When you do so, the json_iterator has a pointer at the beginning of the memory region + * (pointing at the beginning of '{"z"...'. + * + * When you move to the window that starts at... + * + * '[7, 10, 9] [15, 11, 12, 13] ... + * + * then it is not sufficient to just run stage 1. You also need to re-anchor the + * json_iterator so that it believes we are starting at '[7, 10, 9]...'. + * + * Under the DOM front-end, this gets done automatically because the parser owns + * the pointer the data, and when you call stage1 and then stage2 on the same + * parser, then stage2 will run on the pointer acquired by stage1. + * + * That is, stage1 calls "this->buf = _buf" so the parser remembers the buffer that + * we used. But json_iterator has no callback when stage1 is called on the parser. + * In fact, I think that the parser is unaware of json_iterator. + * + * + * So we need to re-anchor the json_iterator after each call to stage 1 so that + * all of the pointers are in sync. + */ + doc.iter = json_iterator(&buf[batch_start], parser); + doc.iter._streaming = true; + /** + * End of resync. + */ + + if (error) { continue; } // If the error was EMPTY, we may want to load another batch. + doc_index = batch_start; + } + } +} + +inline void document_stream::next_document() noexcept { + // Go to next place where depth=0 (document depth) + error = doc.iter.skip_child(0); + if (error) { return; } + // Always set depth=1 at the start of document + doc.iter._depth = 1; + // consume comma if comma separated is allowed + if (allow_comma_separated) { doc.iter.consume_character(','); } + // Resets the string buffer at the beginning, thus invalidating the strings. + doc.iter._string_buf_loc = parser->string_buf.get(); + doc.iter._root = doc.iter.position(); +} + +inline size_t document_stream::next_batch_start() const noexcept { + return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes]; +} + +inline error_code document_stream::run_stage1(ondemand::parser &p, size_t _batch_start) noexcept { + // This code only updates the structural index in the parser, it does not update any json_iterator + // instance. + size_t remaining = len - _batch_start; + if (remaining <= batch_size) { + return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final); + } else { + return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial); + } +} + +simdjson_inline size_t document_stream::iterator::current_index() const noexcept { + return stream->doc_index; +} + +simdjson_inline std::string_view document_stream::iterator::source() const noexcept { + auto depth = stream->doc.iter.depth(); + auto cur_struct_index = stream->doc.iter._root - stream->parser->implementation->structural_indexes.get(); + + // If at root, process the first token to determine if scalar value + if (stream->doc.iter.at_root()) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': // Depth=1 already at start of document + break; + case '}': case ']': + depth--; + break; + default: // Scalar value document + // TODO: Remove any trailing whitespaces + // This returns a string spanning from start of value to the beginning of the next document (excluded) + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[++cur_struct_index] - current_index() - 1); + } + cur_struct_index++; + } + + while (cur_struct_index <= static_cast(stream->parser->implementation->n_structural_indexes)) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': + depth++; + break; + case '}': case ']': + depth--; + break; + } + if (depth == 0) { break; } + cur_struct_index++; + } + + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[cur_struct_index] - current_index() + stream->batch_start + 1);; +} + +inline error_code document_stream::iterator::error() const noexcept { + return stream->error; +} + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void document_stream::load_from_stage1_thread() noexcept { + worker->finish(); + // Swap to the parser that was loaded up in the thread. Make sure the parser has + // enough memory to swap to, as well. + std::swap(stage1_thread_parser,*parser); + error = stage1_thread_error; + if (error) { return; } + + // If there's anything left, start the stage 1 thread! + if (next_batch_start() < len) { + start_stage1_thread(); + } +} + +inline void document_stream::start_stage1_thread() noexcept { + // we call the thread on a lambda that will update + // this->stage1_thread_error + // there is only one thread that may write to this value + // TODO this is NOT exception-safe. + this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error + size_t _next_batch_start = this->next_batch_start(); + + worker->run(this, & this->stage1_thread_parser, _next_batch_start); +} + +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result::simdjson_result( + ppc64::ondemand::document_stream &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} + +} + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H +/* end file simdjson/generic/ondemand/document_stream-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/field-inl.h for ppc64: #include "simdjson/generic/ondemand/field-inl.h" */ +/* begin file simdjson/generic/ondemand/field-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +// clang 6 doesn't think the default constructor can be noexcept, so we make it explicit +simdjson_inline field::field() noexcept : std::pair() {} + +simdjson_inline field::field(raw_json_string key, ondemand::value &&value) noexcept + : std::pair(key, std::forward(value)) +{ +} + +simdjson_inline simdjson_result field::start(value_iterator &parent_iter) noexcept { + raw_json_string key; + SIMDJSON_TRY( parent_iter.field_key().get(key) ); + SIMDJSON_TRY( parent_iter.field_value() ); + return field::start(parent_iter, key); +} + +simdjson_inline simdjson_result field::start(const value_iterator &parent_iter, raw_json_string key) noexcept { + return field(key, parent_iter.child()); +} + +simdjson_inline simdjson_warn_unused simdjson_result field::unescaped_key(bool allow_replacement) noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() but Visual Studio won't let us. + simdjson_result answer = first.unescape(second.iter.json_iter(), allow_replacement); + first.consume(); + return answer; +} + +simdjson_inline raw_json_string field::key() const noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() by Visual Studio won't let us. + return first; +} + +simdjson_inline value &field::value() & noexcept { + return second; +} + +simdjson_inline value field::value() && noexcept { + return std::forward(*this).second; +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + ppc64::ondemand::field &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::key() noexcept { + if (error()) { return error(); } + return first.key(); +} +simdjson_inline simdjson_result simdjson_result::unescaped_key(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.unescaped_key(allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::value() noexcept { + if (error()) { return error(); } + return std::move(first.value()); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H +/* end file simdjson/generic/ondemand/field-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/json_iterator-inl.h for ppc64: #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/json_iterator-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline json_iterator::json_iterator(json_iterator &&other) noexcept + : token(std::forward(other.token)), + parser{other.parser}, + _string_buf_loc{other._string_buf_loc}, + error{other.error}, + _depth{other._depth}, + _root{other._root}, + _streaming{other._streaming} +{ + other.parser = nullptr; +} +simdjson_inline json_iterator &json_iterator::operator=(json_iterator &&other) noexcept { + token = other.token; + parser = other.parser; + _string_buf_loc = other._string_buf_loc; + error = other.error; + _depth = other._depth; + _root = other._root; + _streaming = other._streaming; + other.parser = nullptr; + return *this; +} + +simdjson_inline json_iterator::json_iterator(const uint8_t *buf, ondemand::parser *_parser) noexcept + : token(buf, &_parser->implementation->structural_indexes[0]), + parser{_parser}, + _string_buf_loc{parser->string_buf.get()}, + _depth{1}, + _root{parser->implementation->structural_indexes.get()}, + _streaming{false} + +{ + logger::log_headers(); +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif +} + +inline void json_iterator::rewind() noexcept { + token.set_position( root_position() ); + logger::log_headers(); // We start again + _string_buf_loc = parser->string_buf.get(); + _depth = 1; +} + +inline bool json_iterator::balanced() const noexcept { + token_iterator ti(token); + int32_t count{0}; + ti.set_position( root_position() ); + while(ti.peek() <= peek_last()) { + switch (*ti.return_current_and_advance()) + { + case '[': case '{': + count++; + break; + case ']': case '}': + count--; + break; + default: + break; + } + } + return count == 0; +} + + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and parent_depth, which is a desired effect. The warning does not show up if the +// skip_child() function is not marked inline). +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept { + if (depth() <= parent_depth) { return SUCCESS; } + switch (*return_current_and_advance()) { + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + + // For the first open array/object in a value, we've already incremented depth, so keep it the same + // We never stop at colon, but if we did, it wouldn't affect depth + case '[': case '{': case ':': + logger::log_start_value(*this, "skip"); + break; + // If there is a comma, we have just finished a value in an array/object, and need to get back in + case ',': + logger::log_value(*this, "skip"); + break; + // ] or } means we just finished a value and need to jump out of the array/object + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } +#if SIMDJSON_CHECK_EOF + // If there are no more tokens, the parent is incomplete. + if (at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "Missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + break; + case '"': + if(*peek() == ':') { + // We are at a key!!! + // This might happen if you just started an object and you skip it immediately. + // Performance note: it would be nice to get rid of this check as it is somewhat + // expensive. + // https://github.com/simdjson/simdjson/issues/1742 + logger::log_value(*this, "key"); + return_current_and_advance(); // eat up the ':' + break; // important!!! + } + simdjson_fallthrough; + // Anything else must be a scalar value + default: + // For the first scalar, we will have incremented depth already, so we decrement it here. + logger::log_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + } + + // Now that we've considered the first value, we only increment/decrement for arrays/objects + while (position() < end_position()) { + switch (*return_current_and_advance()) { + case '[': case '{': + logger::log_start_value(*this, "skip"); + _depth++; + break; + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + default: + logger::log_value(*this, "skip", ""); + break; + } + } + + return report_error(TAPE_ERROR, "not enough close braces"); +} + +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool json_iterator::at_root() const noexcept { + return position() == root_position(); +} + +simdjson_inline bool json_iterator::is_single_token() const noexcept { + return parser->implementation->n_structural_indexes == 1; +} + +simdjson_inline bool json_iterator::streaming() const noexcept { + return _streaming; +} + +simdjson_inline token_position json_iterator::root_position() const noexcept { + return _root; +} + +simdjson_inline void json_iterator::assert_at_document_depth() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +} + +simdjson_inline void json_iterator::assert_at_root() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + // Under Visual Studio, the next SIMDJSON_ASSUME fails with: the argument + // has side effects that will be discarded. + SIMDJSON_ASSUME( token.position() == _root ); +#endif +} + +simdjson_inline void json_iterator::assert_more_tokens(uint32_t required_tokens) const noexcept { + assert_valid_position(token._position + required_tokens - 1); +} + +simdjson_inline void json_iterator::assert_valid_position(token_position position) const noexcept { +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME( position >= &parser->implementation->structural_indexes[0] ); + SIMDJSON_ASSUME( position < &parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] ); +#endif +} + +simdjson_inline bool json_iterator::at_end() const noexcept { + return position() == end_position(); +} +simdjson_inline token_position json_iterator::end_position() const noexcept { + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + return &parser->implementation->structural_indexes[n_structural_indexes]; +} + +inline std::string json_iterator::to_string() const noexcept { + if( !is_alive() ) { return "dead json_iterator instance"; } + const char * current_structural = reinterpret_cast(token.peek()); + return std::string("json_iterator [ depth : ") + std::to_string(_depth) + + std::string(", structural : '") + std::string(current_structural,1) + + std::string("', offset : ") + std::to_string(token.current_offset()) + + std::string("', error : ") + error_message(error) + + std::string(" ]"); +} + +inline simdjson_result json_iterator::current_location() const noexcept { + if (!is_alive()) { // Unrecoverable error + if (!at_root()) { + return reinterpret_cast(token.peek(-1)); + } else { + return reinterpret_cast(token.peek()); + } + } + if (at_end()) { + return OUT_OF_BOUNDS; + } + return reinterpret_cast(token.peek()); +} + +simdjson_inline bool json_iterator::is_alive() const noexcept { + return parser; +} + +simdjson_inline void json_iterator::abandon() noexcept { + parser = nullptr; + _depth = 0; +} + +simdjson_inline const uint8_t *json_iterator::return_current_and_advance() noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif // SIMDJSON_CHECK_EOF + return token.return_current_and_advance(); +} + +simdjson_inline const uint8_t *json_iterator::unsafe_pointer() const noexcept { + // deliberately done without safety guard: + return token.peek(); +} + +simdjson_inline const uint8_t *json_iterator::peek(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // SIMDJSON_CHECK_EOF + return token.peek(delta); +} + +simdjson_inline uint32_t json_iterator::peek_length(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // #if SIMDJSON_CHECK_EOF + return token.peek_length(delta); +} + +simdjson_inline const uint8_t *json_iterator::peek(token_position position) const noexcept { + // todo: currently we require end-of-string buffering, but the following + // assert_valid_position should be turned on if/when we lift that condition. + // assert_valid_position(position); + // This is almost surely related to SIMDJSON_CHECK_EOF but given that SIMDJSON_CHECK_EOF + // is ON by default, we have no choice but to disable it for real with a comment. + return token.peek(position); +} + +simdjson_inline uint32_t json_iterator::peek_length(token_position position) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_valid_position(position); +#endif // SIMDJSON_CHECK_EOF + return token.peek_length(position); +} + +simdjson_inline token_position json_iterator::last_position() const noexcept { + // The following line fails under some compilers... + // SIMDJSON_ASSUME(parser->implementation->n_structural_indexes > 0); + // since it has side-effects. + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + SIMDJSON_ASSUME(n_structural_indexes > 0); + return &parser->implementation->structural_indexes[n_structural_indexes - 1]; +} +simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept { + return token.peek(last_position()); +} + +simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept { + SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1); + SIMDJSON_ASSUME(_depth == parent_depth + 1); + _depth = parent_depth; +} + +simdjson_inline void json_iterator::descend_to(depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); + _depth = child_depth; +} + +simdjson_inline depth_t json_iterator::depth() const noexcept { + return _depth; +} + +simdjson_inline uint8_t *&json_iterator::string_buf_loc() noexcept { + return _string_buf_loc; +} + +simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD); + logger::log_error(*this, message); + error = _error; + return error; +} + +simdjson_inline token_position json_iterator::position() const noexcept { + return token.position(); +} + +simdjson_inline simdjson_result json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept { + return parser->unescape(in, _string_buf_loc, allow_replacement); +} + +simdjson_inline simdjson_result json_iterator::unescape_wobbly(raw_json_string in) noexcept { + return parser->unescape_wobbly(in, _string_buf_loc); +} + +simdjson_inline void json_iterator::reenter_child(token_position position, depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); +#if SIMDJSON_DEVELOPMENT_CHECKS +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME(size_t(child_depth) < parser->max_depth()); + SIMDJSON_ASSUME(position >= parser->start_positions[child_depth]); +#endif +#endif + token.set_position(position); + _depth = child_depth; +} + +simdjson_inline error_code json_iterator::consume_character(char c) noexcept { + if (*peek() == c) { + return_current_and_advance(); + return SUCCESS; + } + return TAPE_ERROR; +} + +#if SIMDJSON_DEVELOPMENT_CHECKS + +simdjson_inline token_position json_iterator::start_position(depth_t depth) const noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + return size_t(depth) < parser->max_depth() ? parser->start_positions[depth] : 0; +} + +simdjson_inline void json_iterator::set_start_position(depth_t depth, token_position position) noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + if(size_t(depth) < parser->max_depth()) { parser->start_positions[depth] = position; } +} + +#endif + + +simdjson_inline error_code json_iterator::optional_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error == INCORRECT_TYPE || _error == NO_SUCH_FIELD); + logger::log_error(*this, message); + return _error; +} + + +simdjson_warn_unused simdjson_inline bool json_iterator::copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept { + // This function is not expected to be called in performance-sensitive settings. + // Let us guard against silly cases: + if((N < max_len) || (N == 0)) { return false; } + // Copy to the buffer. + std::memcpy(tmpbuf, json, max_len); + if(N > max_len) { // We pad whatever remains with ' '. + std::memset(tmpbuf + max_len, ' ', N - max_len); + } + return true; +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::json_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/json_iterator-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/json_type-inl.h for ppc64: #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* begin file simdjson/generic/ondemand/json_type-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept { + switch (type) { + case json_type::array: out << "array"; break; + case json_type::object: out << "object"; break; + case json_type::number: out << "number"; break; + case json_type::string: out << "string"; break; + case json_type::boolean: out << "boolean"; break; + case json_type::null: out << "null"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false) { + return out << type.value(); +} +#endif + + + +simdjson_inline number_type number::get_number_type() const noexcept { + return type; +} + +simdjson_inline bool number::is_uint64() const noexcept { + return get_number_type() == number_type::unsigned_integer; +} + +simdjson_inline uint64_t number::get_uint64() const noexcept { + return payload.unsigned_integer; +} + +simdjson_inline number::operator uint64_t() const noexcept { + return get_uint64(); +} + + +simdjson_inline bool number::is_int64() const noexcept { + return get_number_type() == number_type::signed_integer; +} + +simdjson_inline int64_t number::get_int64() const noexcept { + return payload.signed_integer; +} + +simdjson_inline number::operator int64_t() const noexcept { + return get_int64(); +} + +simdjson_inline bool number::is_double() const noexcept { + return get_number_type() == number_type::floating_point_number; +} + +simdjson_inline double number::get_double() const noexcept { + return payload.floating_point_number; +} + +simdjson_inline number::operator double() const noexcept { + return get_double(); +} + +simdjson_inline double number::as_double() const noexcept { + if(is_double()) { + return payload.floating_point_number; + } + if(is_int64()) { + return double(payload.signed_integer); + } + return double(payload.unsigned_integer); +} + +simdjson_inline void number::append_s64(int64_t value) noexcept { + payload.signed_integer = value; + type = number_type::signed_integer; +} + +simdjson_inline void number::append_u64(uint64_t value) noexcept { + payload.unsigned_integer = value; + type = number_type::unsigned_integer; +} + +simdjson_inline void number::append_double(double value) noexcept { + payload.floating_point_number = value; + type = number_type::floating_point_number; +} + +simdjson_inline void number::skip_double() noexcept { + type = number_type::floating_point_number; +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::json_type &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H +/* end file simdjson/generic/ondemand/json_type-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/logger-inl.h for ppc64: #include "simdjson/generic/ondemand/logger-inl.h" */ +/* begin file simdjson/generic/ondemand/logger-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace ppc64 { +namespace ondemand { +namespace logger { + +static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; +static constexpr const int LOG_EVENT_LEN = 20; +static constexpr const int LOG_BUFFER_LEN = 30; +static constexpr const int LOG_SMALL_BUFFER_LEN = 10; +static int log_depth = 0; // Not threadsafe. Log only. + +// Helper to turn unprintable or newline characters into spaces +static inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } +} + +template +static inline std::string string_format(const std::string& format, const Args&... args) +{ + SIMDJSON_PUSH_DISABLE_ALL_WARNINGS + int size_s = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; + auto size = static_cast(size_s); + if (size <= 0) return std::string(); + std::unique_ptr buf(new char[size]); + std::snprintf(buf.get(), size, format.c_str(), args...); + SIMDJSON_POP_DISABLE_WARNINGS + return std::string(buf.get(), buf.get() + size - 1); +} + +static inline log_level get_log_level_from_env() +{ + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + char *lvl = getenv("SIMDJSON_LOG_LEVEL"); + SIMDJSON_POP_DISABLE_WARNINGS + if (lvl && simdjson_strcasecmp(lvl, "ERROR") == 0) { return log_level::error; } + return log_level::info; +} + +static inline log_level log_threshold() +{ + static log_level threshold = get_log_level_from_env(); + return threshold; +} + +static inline bool should_log(log_level level) +{ + return level >= log_threshold(); +} + +inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "", type, detail, log_level::info); +} +inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "+", type, detail, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} +inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_line(iter, "+", type, "", delta, depth_delta, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} + +inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + if (LOG_ENABLED) { log_depth--; } + log_line(iter, "-", type, "", delta, depth_delta, log_level::info); +} + +inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_line(iter, "ERROR: ", error, detail, delta, depth_delta, log_level::error); +} +inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept { + log_line(iter, index, depth, "ERROR: ", error, detail, log_level::error); +} + +inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_event(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_value(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_value(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_start_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_start_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_end_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_end_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_error(const value_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_error(iter.json_iter(), error, detail, delta, depth_delta); +} + +inline void log_headers() noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(log_level::info))) { + // Technically a static variable is not thread-safe, but if you are using threads and logging... well... + static bool displayed_hint{false}; + log_depth = 0; + printf("\n"); + if (!displayed_hint) { + // We only print this helpful header once. + printf("# Logging provides the depth and position of the iterator user-visible steps:\n"); + printf("# +array says 'this is where we were when we discovered the start array'\n"); + printf( + "# -array says 'this is where we were when we ended the array'\n"); + printf("# skip says 'this is a structural or value I am skipping'\n"); + printf("# +/-skip says 'this is a start/end array or object I am skipping'\n"); + printf("#\n"); + printf("# The indentation of the terms (array, string,...) indicates the depth,\n"); + printf("# in addition to the depth being displayed.\n"); + printf("#\n"); + printf("# Every token in the document has a single depth determined by the tokens before it,\n"); + printf("# and is not affected by what the token actually is.\n"); + printf("#\n"); + printf("# Not all structural elements are presented as tokens in the logs.\n"); + printf("#\n"); + printf("# We never give control to the user within an empty array or an empty object.\n"); + printf("#\n"); + printf("# Inside an array, having a depth greater than the array's depth means that\n"); + printf("# we are pointing inside a value.\n"); + printf("# Having a depth equal to the array means that we are pointing right before a value.\n"); + printf("# Having a depth smaller than the array means that we have moved beyond the array.\n"); + displayed_hint = true; + } + printf("\n"); + printf("| %-*s ", LOG_EVENT_LEN, "Event"); + printf("| %-*s ", LOG_BUFFER_LEN, "Buffer"); + printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next"); + // printf("| %-*s ", 5, "Next#"); + printf("| %-*s ", 5, "Depth"); + printf("| Detail "); + printf("|\n"); + + printf("|%.*s", LOG_EVENT_LEN + 2, DASHES); + printf("|%.*s", LOG_BUFFER_LEN + 2, DASHES); + printf("|%.*s", LOG_SMALL_BUFFER_LEN + 2, DASHES); + // printf("|%.*s", 5+2, DASHES); + printf("|%.*s", 5 + 2, DASHES); + printf("|--------"); + printf("|\n"); + fflush(stdout); + } + } +} + +template +inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, log_level level, Args&&... args) noexcept { + log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail, level, std::forward(args)...); +} + +template +inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, log_level level, Args&&... args) noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(level))) { + const int indent = depth * 2; + const auto buf = iter.token.buf; + auto msg = string_format(title, std::forward(args)...); + printf("| %*s%s%-*s ", indent, "", title_prefix, + LOG_EVENT_LEN - indent - int(strlen(title_prefix)), msg.c_str()); + { + // Print the current structural. + printf("| "); + // Before we begin, the index might point right before the document. + // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938 + if (index < iter._root) { + printf("%*s", LOG_BUFFER_LEN, ""); + } else { + auto current_structural = &buf[*index]; + for (int i = 0; i < LOG_BUFFER_LEN; i++) { + printf("%c", printable_char(current_structural[i])); + } + } + printf(" "); + } + { + // Print the next structural. + printf("| "); + auto next_structural = &buf[*(index + 1)]; + for (int i = 0; i < LOG_SMALL_BUFFER_LEN; i++) { + printf("%c", printable_char(next_structural[i])); + } + printf(" "); + } + // printf("| %5u ", *(index+1)); + printf("| %5i ", depth); + printf("| %6.*s ", int(detail.size()), detail.data()); + printf("|\n"); + fflush(stdout); + } + } +} + +} // namespace logger +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H +/* end file simdjson/generic/ondemand/logger-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/object-inl.h for ppc64: #include "simdjson/generic/ondemand/object-inl.h" */ +/* begin file simdjson/generic/ondemand/object-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) & noexcept { + return find_field_unordered(key); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) && noexcept { + return std::forward(*this).find_field_unordered(key); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} + +simdjson_inline simdjson_result object::start(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_object().error() ); + return object(iter); +} +simdjson_inline simdjson_result object::start_root(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_root_object().error() ); + return object(iter); +} +simdjson_inline error_code object::consume() noexcept { + if(iter.is_at_key()) { + /** + * whenever you are pointing at a key, calling skip_child() is + * unsafe because you will hit a string and you will assume that + * it is string value, and this mistake will lead you to make bad + * depth computation. + */ + /** + * We want to 'consume' the key. We could really + * just do _json_iter->return_current_and_advance(); at this + * point, but, for clarity, we will use the high-level API to + * eat the key. We assume that the compiler optimizes away + * most of the work. + */ + simdjson_unused raw_json_string actual_key; + auto error = iter.field_key().get(actual_key); + if (error) { iter.abandon(); return error; }; + // Let us move to the value while we are at it. + if ((error = iter.field_value())) { iter.abandon(); return error; } + } + auto error_skip = iter.json_iter().skip_child(iter.depth()-1); + if(error_skip) { iter.abandon(); } + return error_skip; +} + +simdjson_inline simdjson_result object::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + const uint8_t * final_point{iter._json_iter->peek()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result object::started(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.started_object().error() ); + return object(iter); +} + +simdjson_inline object object::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline object::object(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result object::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return object_iterator(iter); +} +simdjson_inline simdjson_result object::end() noexcept { + return object_iterator(iter); +} + +inline simdjson_result object::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + size_t slash = json_pointer.find('/'); + std::string_view key = json_pointer.substr(0, slash); + // Grab the child with the given key + simdjson_result child; + + // If there is an escape character in the key, unescape it and then get the child. + size_t escape = key.find('~'); + if (escape != std::string_view::npos) { + // Unescape the key + std::string unescaped(key); + do { + switch (unescaped[escape+1]) { + case '0': + unescaped.replace(escape, 2, "~"); + break; + case '1': + unescaped.replace(escape, 2, "/"); + break; + default: + return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer"); + } + escape = unescaped.find('~', escape+1); + } while (escape != std::string::npos); + child = find_field(unescaped); // Take note find_field does not unescape keys when matching + } else { + child = find_field(key); + } + if(child.error()) { + return child; // we do not continue if there was an error + } + // If there is a /, we have to recurse and look up more of the path + if (slash != std::string_view::npos) { + child = child.at_pointer(json_pointer.substr(slash)); + } + return child; +} + +simdjson_inline simdjson_result object::count_fields() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the object after counting the number of elements. + iter.reset_object(); + return count; +} + +simdjson_inline simdjson_result object::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_object().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +simdjson_inline simdjson_result object::reset() & noexcept { + return iter.reset_object(); +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::object &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first)[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +inline simdjson_result simdjson_result::reset() noexcept { + if (error()) { return error(); } + return first.reset(); +} + +inline simdjson_result simdjson_result::is_empty() noexcept { + if (error()) { return error(); } + return first.is_empty(); +} + +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H +/* end file simdjson/generic/ondemand/object-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/object_iterator-inl.h for ppc64: #include "simdjson/generic/ondemand/object_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/object_iterator-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +// +// object_iterator +// + +simdjson_inline object_iterator::object_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result object_iterator::operator*() noexcept { + error_code error = iter.error(); + if (error) { iter.abandon(); return error; } + auto result = field::start(iter); + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (result.error()) { iter.abandon(); } + return result; +} +simdjson_inline bool object_iterator::operator==(const object_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool object_iterator::operator!=(const object_iterator &) const noexcept { + return iter.is_open(); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline object_iterator &object_iterator::operator++() noexcept { + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (!iter.is_open()) { return *this; } // Iterator will be released if there is an error + + simdjson_unused error_code error; + if ((error = iter.skip_child() )) { return *this; } + + simdjson_unused bool has_value; + if ((error = iter.has_next_field().get(has_value) )) { return *this; }; + return *this; +} +SIMDJSON_POP_DISABLE_WARNINGS + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter.depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the object is first found and the iterator is just past the {. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the , or } before the next value. In this state, +// depth == iter.depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter.depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter.depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the object iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet field may be missing or not be an +// object--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter.depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between fields, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter.depth == depth, and at_start == false. +// +// Errors that occur while reading a field to give to the user (such as when the key is not a +// string or the field is missing a colon) are yielded immediately. Depth is then decremented, +// moving to the Finished state without transitioning through an Error state at all. +// +// ## Terminal State +// +// The terminal state has iter.depth < depth. at_start is always false. +// +// - Finished: When we have reached a }, we are finished. We signal this by decrementing depth. +// In this state, iter.depth < depth, at_start == false, and error == SUCCESS. +// + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + ppc64::ondemand::object_iterator &&value +) noexcept + : implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +// Checks for ']' and ',' +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++first; + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/object_iterator-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/parser-inl.h for ppc64: #include "simdjson/generic/ondemand/parser-inl.h" */ +/* begin file simdjson/generic/ondemand/parser-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string_view.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/dom/base.h" // for MINIMAL_DOCUMENT_CAPACITY */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline parser::parser(size_t max_capacity) noexcept + : _max_capacity{max_capacity} { +} + +simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept { + if (new_capacity > max_capacity()) { return CAPACITY; } + if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; } + + // string_capacity copied from document::allocate + _capacity = 0; + size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * new_capacity / 3 + SIMDJSON_PADDING, 64); + string_buf.reset(new (std::nothrow) uint8_t[string_capacity]); +#if SIMDJSON_DEVELOPMENT_CHECKS + start_positions.reset(new (std::nothrow) token_position[new_max_depth]); +#endif + if (implementation) { + SIMDJSON_TRY( implementation->set_capacity(new_capacity) ); + SIMDJSON_TRY( implementation->set_max_depth(new_max_depth) ); + } else { + SIMDJSON_TRY( simdjson::get_active_implementation()->create_dom_parser_implementation(new_capacity, new_max_depth, implementation) ); + } + _capacity = new_capacity; + _max_depth = new_max_depth; + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length() || !string_buf) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return document::start({ reinterpret_cast(json.data()), this }); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const char *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const uint8_t *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string_view json, size_t allocated) & noexcept { + return iterate(padded_string_view(json, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string &json) & noexcept { + if(json.capacity() - json.size() < SIMDJSON_PADDING) { + json.reserve(json.size() + SIMDJSON_PADDING); + } + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const std::string &json) & noexcept { + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + padded_string_view json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + const padded_string &json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate_raw(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length()) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return json_iterator(reinterpret_cast(json.data()), this); +} + +inline simdjson_result parser::iterate_many(const uint8_t *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + if(allow_comma_separated && batch_size < len) { batch_size = len; } + return document_stream(*this, buf, len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const char *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(reinterpret_cast(buf), len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const std::string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const padded_string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} + +simdjson_inline size_t parser::capacity() const noexcept { + return _capacity; +} +simdjson_inline size_t parser::max_capacity() const noexcept { + return _max_capacity; +} +simdjson_inline size_t parser::max_depth() const noexcept { + return _max_depth; +} + +simdjson_inline void parser::set_max_capacity(size_t max_capacity) noexcept { + if(max_capacity < dom::MINIMAL_DOCUMENT_CAPACITY) { + _max_capacity = max_capacity; + } else { + _max_capacity = dom::MINIMAL_DOCUMENT_CAPACITY; + } +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement) const noexcept { + uint8_t *end = implementation->parse_string(in.buf, dst, allow_replacement); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept { + uint8_t *end = implementation->parse_wobbly_string(in.buf, dst); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::parser &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H +/* end file simdjson/generic/ondemand/parser-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/raw_json_string-inl.h for ppc64: #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +namespace ppc64 { +namespace ondemand { + +simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {} + +simdjson_inline const char * raw_json_string::raw() const noexcept { return reinterpret_cast(buf); } + + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;pos < target.size() && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;pos < target.size();pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;target[pos] && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;target[pos];pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string_view target) const noexcept { + // If we are going to call memcmp, then we must know something about the length of the raw_json_string. + return (length >= target.size()) && (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); +} + +simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + if(target.size() <= SIMDJSON_PADDING) { + return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); + } + const char * r{raw()}; + size_t pos{0}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(std::string_view target) const noexcept { + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(const char * target) const noexcept { + // Assumptions: 'target' does not contain unescaped quote characters, is null terminated and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(const char* target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept { + return a.unsafe_is_equal(c); +} + +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept { + return a == c; +} + +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept { + return !(a == c); +} + +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept { + return !(a == c); +} + + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept { + return iter.unescape(*this, allow_replacement); +} + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape_wobbly(json_iterator &iter) const noexcept { + return iter.unescape_wobbly(*this); +} + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &out, const raw_json_string &str) noexcept { + bool in_escape = false; + const char *s = str.raw(); + while (true) { + switch (*s) { + case '\\': in_escape = !in_escape; break; + case '"': if (in_escape) { in_escape = false; } else { return out; } break; + default: if (in_escape) { in_escape = false; } + } + out << *s; + s++; + } +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::raw_json_string &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::raw() const noexcept { + if (error()) { return error(); } + return first.raw(); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape(ppc64::ondemand::json_iterator &iter, bool allow_replacement) const noexcept { + if (error()) { return error(); } + return first.unescape(iter, allow_replacement); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape_wobbly(ppc64::ondemand::json_iterator &iter) const noexcept { + if (error()) { return error(); } + return first.unescape_wobbly(iter); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H +/* end file simdjson/generic/ondemand/raw_json_string-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/serialization-inl.h for ppc64: #include "simdjson/generic/ondemand/serialization-inl.h" */ +/* begin file simdjson/generic/ondemand/serialization-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/serialization.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +inline std::string_view trim(const std::string_view str) noexcept { + // We can almost surely do better by rolling our own find_first_not_of function. + size_t first = str.find_first_not_of(" \t\n\r"); + // If we have the empty string (just white space), then no trimming is possible, and + // we return the empty string_view. + if (std::string_view::npos == first) { return std::string_view(); } + size_t last = str.find_last_not_of(" \t\n\r"); + return str.substr(first, (last - first + 1)); +} + + +inline simdjson_result to_json_string(ppc64::ondemand::document& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(ppc64::ondemand::document_reference& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(ppc64::ondemand::value& x) noexcept { + /** + * If we somehow receive a value that has already been consumed, + * then the following code could be in trouble. E.g., we create + * an array as needed, but if an array was already created, then + * it could be bad. + */ + using namespace ppc64::ondemand; + ppc64::ondemand::json_type t; + auto error = x.type().get(t); + if(error != SUCCESS) { return error; } + switch (t) + { + case json_type::array: + { + ppc64::ondemand::array array; + error = x.get_array().get(array); + if(error) { return error; } + return to_json_string(array); + } + case json_type::object: + { + ppc64::ondemand::object object; + error = x.get_object().get(object); + if(error) { return error; } + return to_json_string(object); + } + default: + return trim(x.raw_json_token()); + } +} + +inline simdjson_result to_json_string(ppc64::ondemand::object& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(ppc64::ondemand::array& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} +} // namespace simdjson + +namespace simdjson { namespace ppc64 { namespace ondemand { + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::document_reference& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::ppc64::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif +}}} // namespace simdjson::ppc64::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H +/* end file simdjson/generic/ondemand/serialization-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/token_iterator-inl.h for ppc64: #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/token_iterator-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline token_iterator::token_iterator( + const uint8_t *_buf, + token_position position +) noexcept : buf{_buf}, _position{position} +{ +} + +simdjson_inline uint32_t token_iterator::current_offset() const noexcept { + return *(_position); +} + + +simdjson_inline const uint8_t *token_iterator::return_current_and_advance() noexcept { + return &buf[*(_position++)]; +} + +simdjson_inline const uint8_t *token_iterator::peek(token_position position) const noexcept { + return &buf[*position]; +} +simdjson_inline uint32_t token_iterator::peek_index(token_position position) const noexcept { + return *position; +} +simdjson_inline uint32_t token_iterator::peek_length(token_position position) const noexcept { + return *(position+1) - *position; +} + +simdjson_inline const uint8_t *token_iterator::peek(int32_t delta) const noexcept { + return &buf[*(_position+delta)]; +} +simdjson_inline uint32_t token_iterator::peek_index(int32_t delta) const noexcept { + return *(_position+delta); +} +simdjson_inline uint32_t token_iterator::peek_length(int32_t delta) const noexcept { + return *(_position+delta+1) - *(_position+delta); +} + +simdjson_inline token_position token_iterator::position() const noexcept { + return _position; +} +simdjson_inline void token_iterator::set_position(token_position target_position) noexcept { + _position = target_position; +} + +simdjson_inline bool token_iterator::operator==(const token_iterator &other) const noexcept { + return _position == other._position; +} +simdjson_inline bool token_iterator::operator!=(const token_iterator &other) const noexcept { + return _position != other._position; +} +simdjson_inline bool token_iterator::operator>(const token_iterator &other) const noexcept { + return _position > other._position; +} +simdjson_inline bool token_iterator::operator>=(const token_iterator &other) const noexcept { + return _position >= other._position; +} +simdjson_inline bool token_iterator::operator<(const token_iterator &other) const noexcept { + return _position < other._position; +} +simdjson_inline bool token_iterator::operator<=(const token_iterator &other) const noexcept { + return _position <= other._position; +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::token_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/token_iterator-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/value-inl.h for ppc64: #include "simdjson/generic/ondemand/value-inl.h" */ +/* begin file simdjson/generic/ondemand/value-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline value::value(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} +simdjson_inline value value::start(const value_iterator &iter) noexcept { + return iter; +} +simdjson_inline value value::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline simdjson_result value::get_array() noexcept { + return array::start(iter); +} +simdjson_inline simdjson_result value::get_object() noexcept { + return object::start(iter); +} +simdjson_inline simdjson_result value::start_or_resume_object() noexcept { + if (iter.at_start()) { + return get_object(); + } else { + return object::resume(iter); + } +} + +simdjson_inline simdjson_result value::get_raw_json_string() noexcept { + return iter.get_raw_json_string(); +} +simdjson_inline simdjson_result value::get_string(bool allow_replacement) noexcept { + return iter.get_string(allow_replacement); +} +template +simdjson_inline error_code value::get_string(string_type& receiver, bool allow_replacement) noexcept { + return iter.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result value::get_wobbly_string() noexcept { + return iter.get_wobbly_string(); +} +simdjson_inline simdjson_result value::get_double() noexcept { + return iter.get_double(); +} +simdjson_inline simdjson_result value::get_double_in_string() noexcept { + return iter.get_double_in_string(); +} +simdjson_inline simdjson_result value::get_uint64() noexcept { + return iter.get_uint64(); +} +simdjson_inline simdjson_result value::get_uint64_in_string() noexcept { + return iter.get_uint64_in_string(); +} +simdjson_inline simdjson_result value::get_int64() noexcept { + return iter.get_int64(); +} +simdjson_inline simdjson_result value::get_int64_in_string() noexcept { + return iter.get_int64_in_string(); +} +simdjson_inline simdjson_result value::get_bool() noexcept { + return iter.get_bool(); +} +simdjson_inline simdjson_result value::is_null() noexcept { + return iter.is_null(); +} +template<> simdjson_inline simdjson_result value::get() noexcept { return get_array(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_object(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_number(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_double(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_bool(); } + +template simdjson_inline error_code value::get(T &out) noexcept { + return get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline value::operator array() noexcept(false) { + return get_array(); +} +simdjson_inline value::operator object() noexcept(false) { + return get_object(); +} +simdjson_inline value::operator uint64_t() noexcept(false) { + return get_uint64(); +} +simdjson_inline value::operator int64_t() noexcept(false) { + return get_int64(); +} +simdjson_inline value::operator double() noexcept(false) { + return get_double(); +} +simdjson_inline value::operator std::string_view() noexcept(false) { + return get_string(false); +} +simdjson_inline value::operator raw_json_string() noexcept(false) { + return get_raw_json_string(); +} +simdjson_inline value::operator bool() noexcept(false) { + return get_bool(); +} +#endif + +simdjson_inline simdjson_result value::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result value::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result value::count_elements() & noexcept { + simdjson_result answer; + auto a = get_array(); + answer = a.count_elements(); + // count_elements leaves you pointing inside the array, at the first element. + // We need to move back so that the user can create a new array (which requires that + // we point at '['). + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::count_fields() & noexcept { + simdjson_result answer; + auto a = get_object(); + answer = a.count_fields(); + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::at(size_t index) noexcept { + auto a = get_array(); + return a.at(index); +} + +simdjson_inline simdjson_result value::find_field(std::string_view key) noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result value::find_field(const char *key) noexcept { + return start_or_resume_object().find_field(key); +} + +simdjson_inline simdjson_result value::find_field_unordered(std::string_view key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result value::find_field_unordered(const char *key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} + +simdjson_inline simdjson_result value::operator[](std::string_view key) noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result value::operator[](const char *key) noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline simdjson_result value::type() noexcept { + return iter.type(); +} + +simdjson_inline simdjson_result value::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool value::is_negative() noexcept { + return iter.is_negative(); +} + +simdjson_inline simdjson_result value::is_integer() noexcept { + return iter.is_integer(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number_type() noexcept { + return iter.get_number_type(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number() noexcept { + return iter.get_number(); +} + +simdjson_inline std::string_view value::raw_json_token() noexcept { + return std::string_view(reinterpret_cast(iter.peek_start()), iter.peek_start_length()); +} + +simdjson_inline simdjson_result value::raw_json() noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: { + ondemand::array array; + SIMDJSON_TRY(get_array().get(array)); + return array.raw_json(); + } + case json_type::object: { + ondemand::object object; + SIMDJSON_TRY(get_object().get(object)); + return object.raw_json(); + } + default: + return raw_json_token(); + } +} + +simdjson_inline simdjson_result value::current_location() noexcept { + return iter.json_iter().current_location(); +} + +simdjson_inline int32_t value::current_depth() const noexcept{ + return iter.json_iter().depth(); +} + +simdjson_inline simdjson_result value::at_pointer(std::string_view json_pointer) noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + ppc64::ondemand::value &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + if (error()) { return error(); } + return {}; +} + +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} + +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) noexcept { + if (error()) { return error(); } + return first[key]; +} + +simdjson_inline simdjson_result simdjson_result::get_array() noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return first.get(); +} +template simdjson_inline error_code simdjson_result::get(T &out) noexcept { + if (error()) { return error(); } + return first.get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return std::move(first); +} +template<> simdjson_inline error_code simdjson_result::get(ppc64::ondemand::value &out) noexcept { + if (error()) { return error(); } + out = first; + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator ppc64::ondemand::array() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::object() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator ppc64::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H +/* end file simdjson/generic/ondemand/value-inl.h for ppc64 */ +/* including simdjson/generic/ondemand/value_iterator-inl.h for ppc64: #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/value_iterator-inl.h for ppc64 */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/atomparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace ppc64 { +namespace ondemand { + +simdjson_inline value_iterator::value_iterator( + json_iterator *json_iter, + depth_t depth, + token_position start_position +) noexcept : _json_iter{json_iter}, _depth{depth}, _start_position{start_position} +{ +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_root_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_object() noexcept { + assert_at_container_start(); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + if (*_json_iter->peek() == '}') { + logger::log_value(*_json_iter, "empty object"); + _json_iter->return_current_and_advance(); + end_container(); + return false; + } + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_object() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // object: e.g., `{"a":2} foo }`. Users concerned with garbage content should + // call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != '}') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing } at end"); + } + // If the last character is } *and* the first gibberish character is also '}' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == '}') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed object. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_object() noexcept { + auto error = check_root_object(); + if(error) { return error; } + return started_object(); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept { +#if SIMDJSON_CHECK_EOF + if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); } + // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + _json_iter->ascend_to(depth()-1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_field() noexcept { + assert_at_next(); + + // It's illegal to call this unless there are more tokens: anything that ends in } or ] is + // obligated to verify there are more tokens if they are not the top level. + switch (*_json_iter->return_current_and_advance()) { + case '}': + logger::log_end_value(*_json_iter, "object"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between object fields"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_raw(const std::string_view key) noexcept { + error_code error; + bool has_value; + // + // Initially, the object can be in one of a few different places: + // + // 1. The start of the object, at the first field: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + if (at_first_field()) { + has_value = true; + + // + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + return false; + + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + if ((error = skip_child() )) { abandon(); return error; } + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + while (has_value) { + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + //if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); // Skip the value entirely + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + + // If the loop ended, we're out of fields to look at. + return false; +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_unordered_raw(const std::string_view key) noexcept { + /** + * When find_field_unordered_raw is called, we can either be pointing at the + * first key, pointing outside (at the closing brace) or if a key was matched + * we can be either pointing right afterthe ':' right before the value (that we need skip), + * or we may have consumed the value and we might be at a comma or at the + * final brace (ready for a call to has_next_field()). + */ + error_code error; + bool has_value; + + // First, we scan from that point to the end. + // If we don't find a match, we may loop back around, and scan from the beginning to that point. + token_position search_start = _json_iter->position(); + + // We want to know whether we need to go back to the beginning. + bool at_first = at_first_field(); + /////////////// + // Initially, the object can be in one of a few different places: + // + // 1. At the first key: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + // + if (at_first) { + has_value = true; + + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { + +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + SIMDJSON_TRY(reset_object().get(has_value)); + at_first = true; + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + // If someone queried a key but they not did access the value, then we are left pointing + // at the ':' and we need to move forward through the value... If the value was + // processed then skip_child() does not move the iterator (but may adjust the depth). + if ((error = skip_child() )) { abandon(); return error; } + search_start = _json_iter->position(); + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + + // After initial processing, we will be in one of two states: + // + // ``` + // // At the beginning of a field + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // At the end of the object + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // ``` + // + // Next, we find a match starting from the current position. + while (has_value) { + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + // Performance note: it maybe wasteful to rewind to the beginning when there might be + // no other query following. Indeed, it would require reskipping the whole object. + // Instead, you can just stay where you are. If there is a new query, there is always time + // to rewind. + if(at_first) { return false; } + + // If we reach the end without finding a match, search the rest of the fields starting at the + // beginning of the object. + // (We have already run through the object before, so we've already validated its structure. We + // don't check errors in this bit.) + SIMDJSON_TRY(reset_object().get(has_value)); + while (true) { + SIMDJSON_ASSUME(has_value); // we should reach search_start before ever reaching the end of the object + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + error = field_key().get(actual_key); SIMDJSON_ASSUME(!error); + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + error = field_value(); SIMDJSON_ASSUME(!error); + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // If we reached the end of the key-value pair we started from, then we know + // that the key is not there so we return false. We are either right before + // the next comma or the final brace. + if(_json_iter->position() == search_start) { return false; } + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + error = has_next_field().get(has_value); SIMDJSON_ASSUME(!error); + // If we make the mistake of exiting here, then we could be left pointing at a key + // in the middle of an object. That's not an allowable state. + } + // If the loop ended, we're out of fields to look at. The program should + // never reach this point. + return false; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::field_key() noexcept { + assert_at_next(); + + const uint8_t *key = _json_iter->return_current_and_advance(); + if (*(key++) != '"') { return report_error(TAPE_ERROR, "Object key is not a string"); } + return raw_json_string(key); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::field_value() noexcept { + assert_at_next(); + + if (*_json_iter->return_current_and_advance() != ':') { return report_error(TAPE_ERROR, "Missing colon in object field"); } + _json_iter->descend_to(depth()+1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_root_array(); +} + +inline std::string value_iterator::to_string() const noexcept { + auto answer = std::string("value_iterator [ depth : ") + std::to_string(_depth) + std::string(", "); + if(_json_iter != nullptr) { answer += _json_iter->to_string(); } + answer += std::string(" ]"); + return answer; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_array() noexcept { + assert_at_container_start(); + if (*_json_iter->peek() == ']') { + logger::log_value(*_json_iter, "empty array"); + _json_iter->return_current_and_advance(); + SIMDJSON_TRY( end_container() ); + return false; + } + _json_iter->descend_to(depth()+1); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // array: e.g., `[1, 2] foo]`. Users concerned with garbage content should + // also call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != ']') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end"); + } + // If the last character is ] *and* the first gibberish character is also ']' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed array. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_array() noexcept { + auto error = check_root_array(); + if (error) { return error; } + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_element() noexcept { + assert_at_next(); + + logger::log_event(*this, "has_next_element"); + switch (*_json_iter->return_current_and_advance()) { + case ']': + logger::log_end_value(*_json_iter, "array"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + _json_iter->descend_to(depth()+1); + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between array elements"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_bool(const uint8_t *json) const noexcept { + auto not_true = atomparsing::str4ncmp(json, "true"); + auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e'); + bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]); + if (error) { return incorrect_type_error("Not a boolean"); } + return simdjson_result(!not_true); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_null(const uint8_t *json) const noexcept { + bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]); + // if we start with 'n', we must be a null + if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); } + return is_null_string; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_string(bool allow_replacement) noexcept { + return get_raw_json_string().unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_string(string_type& receiver, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_string(allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_wobbly_string() noexcept { + return get_raw_json_string().unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_raw_json_string() noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64() noexcept { + auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64_in_string() noexcept { + auto result = numberparsing::parse_unsigned_in_string(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64() noexcept { + auto result = numberparsing::parse_integer(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64_in_string() noexcept { + auto result = numberparsing::parse_integer_in_string(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double() noexcept { + auto result = numberparsing::parse_double(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double_in_string() noexcept { + auto result = numberparsing::parse_double_in_string(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_bool() noexcept { + auto result = parse_bool(peek_non_root_scalar("bool")); + if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); } + return result; +} +simdjson_inline simdjson_result value_iterator::is_null() noexcept { + bool is_null_value; + SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value)); + if(is_null_value) { advance_non_root_scalar("null"); } + return is_null_value; +} +simdjson_inline bool value_iterator::is_negative() noexcept { + return numberparsing::is_negative(peek_non_root_scalar("numbersign")); +} +simdjson_inline bool value_iterator::is_root_negative() noexcept { + return numberparsing::is_negative(peek_root_scalar("numbersign")); +} +simdjson_inline simdjson_result value_iterator::is_integer() noexcept { + return numberparsing::is_integer(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number_type() noexcept { + return numberparsing::get_number_type(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number() noexcept { + number num; + error_code error = numberparsing::parse_number(peek_non_root_scalar("number"), num); + if(error) { return error; } + return num; +} + +simdjson_inline simdjson_result value_iterator::is_root_integer(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("is_root_integer"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + return false; // if there are more than 20 characters, it cannot be represented as an integer. + } + auto answer = numberparsing::is_integer(tmpbuf); + // If the parsing was a success, we must still check that it is + // a single scalar. Note that we parse first because of cases like '[]' where + // getting TRAILING_CONTENT is wrong. + if(check_trailing && (answer.error() == SUCCESS) && (!_json_iter->is_single_token())) { return TRAILING_CONTENT; } + return answer; +} + +simdjson_inline simdjson_result value_iterator::get_root_number_type(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto answer = numberparsing::get_number_type(tmpbuf); + if (check_trailing && (answer.error() == SUCCESS) && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + return answer; +} +simdjson_inline simdjson_result value_iterator::get_root_number(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + number num; + error_code error = numberparsing::parse_number(tmpbuf, num); + if(error) { return error; } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("number"); + return num; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_string(bool check_trailing, bool allow_replacement) noexcept { + return get_root_raw_json_string(check_trailing).unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_root_string(check_trailing, allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_wobbly_string(bool check_trailing) noexcept { + return get_root_raw_json_string(check_trailing).unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_raw_json_string(bool check_trailing) noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_bool(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("bool"); + uint8_t tmpbuf[5+1+1]; // +1 for null termination + tmpbuf[5+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 5+1)) { return incorrect_type_error("Not a boolean"); } + auto result = parse_bool(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("bool"); + } + return result; +} +simdjson_inline simdjson_result value_iterator::is_root_null(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("null"); + bool result = (max_len >= 4 && !atomparsing::str4ncmp(json, "null") && + (max_len == 4 || jsoncharutils::is_structural_or_whitespace(json[4]))); + if(result) { // we have something that looks like a null. + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("null"); + } + return result; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth >= _depth ); + + return _json_iter->skip_child(depth()); +} + +simdjson_inline value_iterator value_iterator::child() const noexcept { + assert_at_child(); + return { _json_iter, depth()+1, _json_iter->token.position() }; +} + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and iterator depth, which is a desired effect. It does not happen if is_open is +// marked non-inline. +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline bool value_iterator::is_open() const noexcept { + return _json_iter->depth() >= depth(); +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool value_iterator::at_end() const noexcept { + return _json_iter->at_end(); +} + +simdjson_inline bool value_iterator::at_start() const noexcept { + return _json_iter->token.position() == start_position(); +} + +simdjson_inline bool value_iterator::at_first_field() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + return _json_iter->token.position() == start_position() + 1; +} + +simdjson_inline void value_iterator::abandon() noexcept { + _json_iter->abandon(); +} + +simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept { + return _depth; +} +simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept { + return _json_iter->error; +} +simdjson_warn_unused simdjson_inline uint8_t *&value_iterator::string_buf_loc() noexcept { + return _json_iter->string_buf_loc(); +} +simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept { + return *_json_iter; +} +simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept { + return *_json_iter; +} + +simdjson_inline const uint8_t *value_iterator::peek_start() const noexcept { + return _json_iter->peek(start_position()); +} +simdjson_inline uint32_t value_iterator::peek_start_length() const noexcept { + return _json_iter->peek_length(start_position()); +} + +simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return peek_start(); } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return; } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept { + logger::log_start_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + const uint8_t *json; + if (!is_at_start()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + json = peek_start(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + } else { + assert_at_start(); + /** + * We should be prudent. Let us peek. If it is not the right type, we + * return an error. Only once we have determined that we have the right + * type are we allowed to advance! + */ + json = _json_iter->peek(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + _json_iter->return_current_and_advance(); + } + + + return SUCCESS; +} + + +simdjson_inline const uint8_t *value_iterator::peek_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_root(); + return _json_iter->peek(); +} +simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_non_root_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_root(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} +simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_non_root_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept { + logger::log_error(*_json_iter, start_position(), depth(), message); + return INCORRECT_TYPE; +} + +simdjson_inline bool value_iterator::is_at_start() const noexcept { + return position() == start_position(); +} + +simdjson_inline bool value_iterator::is_at_key() const noexcept { + // Keys are at the same depth as the object. + // Note here that we could be safer and check that we are within an object, + // but we do not. + return _depth == _json_iter->_depth && *_json_iter->peek() == '"'; +} + +simdjson_inline bool value_iterator::is_at_iterator_start() const noexcept { + // We can legitimately be either at the first value ([1]), or after the array if it's empty ([]). + auto delta = position() - start_position(); + return delta == 1 || delta == 2; +} + +inline void value_iterator::assert_at_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_container_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_next() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +simdjson_inline void value_iterator::move_at_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position); +} + +simdjson_inline void value_iterator::move_at_container_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position + 1); +} + +simdjson_inline simdjson_result value_iterator::reset_array() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_array(); +} + +simdjson_inline simdjson_result value_iterator::reset_object() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_object(); +} + +inline void value_iterator::assert_at_child() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_root() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth == 1 ); +} + +inline void value_iterator::assert_at_non_root_start() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth > 1 ); +} + +inline void value_iterator::assert_is_valid() const noexcept { + SIMDJSON_ASSUME( _json_iter != nullptr ); +} + +simdjson_inline bool value_iterator::is_valid() const noexcept { + return _json_iter != nullptr; +} + +simdjson_inline simdjson_result value_iterator::type() const noexcept { + switch (*peek_start()) { + case '{': + return json_type::object; + case '[': + return json_type::array; + case '"': + return json_type::string; + case 'n': + return json_type::null; + case 't': case 'f': + return json_type::boolean; + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return json_type::number; + default: + return TAPE_ERROR; + } +} + +simdjson_inline token_position value_iterator::start_position() const noexcept { + return _start_position; +} + +simdjson_inline token_position value_iterator::position() const noexcept { + return _json_iter->position(); +} + +simdjson_inline token_position value_iterator::end_position() const noexcept { + return _json_iter->end_position(); +} + +simdjson_inline token_position value_iterator::last_position() const noexcept { + return _json_iter->last_position(); +} + +simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept { + return _json_iter->report_error(error, message); +} + +} // namespace ondemand +} // namespace ppc64 +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(ppc64::ondemand::value_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/value_iterator-inl.h for ppc64 */ +/* end file simdjson/generic/ondemand/amalgamated.h for ppc64 */ +/* including simdjson/ppc64/end.h: #include "simdjson/ppc64/end.h" */ +/* begin file simdjson/ppc64/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/ppc64/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +/* undefining SIMDJSON_IMPLEMENTATION from "ppc64" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/ppc64/end.h */ + +#endif // SIMDJSON_PPC64_ONDEMAND_H +/* end file simdjson/ppc64/ondemand.h */ +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(westmere) +/* including simdjson/westmere/ondemand.h: #include "simdjson/westmere/ondemand.h" */ +/* begin file simdjson/westmere/ondemand.h */ +#ifndef SIMDJSON_WESTMERE_ONDEMAND_H +#define SIMDJSON_WESTMERE_ONDEMAND_H + +/* including simdjson/westmere/begin.h: #include "simdjson/westmere/begin.h" */ +/* begin file simdjson/westmere/begin.h */ +/* defining SIMDJSON_IMPLEMENTATION to "westmere" */ +#define SIMDJSON_IMPLEMENTATION westmere +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_TARGET_REGION("sse4.2,pclmul,popcnt") +#endif + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/bitmask.h: #include "simdjson/westmere/bitmask.h" */ +/* begin file simdjson/westmere/bitmask.h */ +#ifndef SIMDJSON_WESTMERE_BITMASK_H +#define SIMDJSON_WESTMERE_BITMASK_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// +// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered. +// +// For example, prefix_xor(00100100) == 00011100 +// +simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) { + // There should be no such thing with a processing supporting avx2 + // but not clmul. + __m128i all_ones = _mm_set1_epi8('\xFF'); + __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0); + return _mm_cvtsi128_si64(result); +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMASK_H +/* end file simdjson/westmere/bitmask.h */ +/* including simdjson/westmere/numberparsing_defs.h: #include "simdjson/westmere/numberparsing_defs.h" */ +/* begin file simdjson/westmere/numberparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +#define SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H + +/* including simdjson/westmere/base.h: #include "simdjson/westmere/base.h" */ +/* begin file simdjson/westmere/base.h */ +#ifndef SIMDJSON_WESTMERE_BASE_H +#define SIMDJSON_WESTMERE_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +// The constructor may be executed on any host, so we take care not to use SIMDJSON_TARGET_WESTMERE +namespace simdjson { +/** + * Implementation for Westmere (Intel SSE4.2). + */ +namespace westmere { + +class implementation; + +namespace { +namespace simd { + +template struct simd8; +template struct simd8x64; + +} // namespace simd +} // unnamed namespace + +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BASE_H +/* end file simdjson/westmere/base.h */ +/* including simdjson/westmere/intrinsics.h: #include "simdjson/westmere/intrinsics.h" */ +/* begin file simdjson/westmere/intrinsics.h */ +#ifndef SIMDJSON_WESTMERE_INTRINSICS_H +#define SIMDJSON_WESTMERE_INTRINSICS_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if SIMDJSON_VISUAL_STUDIO +// under clang within visual studio, this will include +#include // visual studio or clang +#else +#include // elsewhere +#endif // SIMDJSON_VISUAL_STUDIO + + +#if SIMDJSON_CLANG_VISUAL_STUDIO +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + */ +#include // for _mm_alignr_epi8 +#include // for _mm_clmulepi64_si128 +#endif + +static_assert(sizeof(__m128i) <= simdjson::SIMDJSON_PADDING, "insufficient padding for westmere"); + +#endif // SIMDJSON_WESTMERE_INTRINSICS_H +/* end file simdjson/westmere/intrinsics.h */ + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/numberparsing_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace numberparsing { + +/** @private */ +static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) { + // this actually computes *16* values so we are being wasteful. + const __m128i ascii0 = _mm_set1_epi8('0'); + const __m128i mul_1_10 = + _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1); + const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1); + const __m128i mul_1_10000 = + _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1); + const __m128i input = _mm_sub_epi8( + _mm_loadu_si128(reinterpret_cast(chars)), ascii0); + const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10); + const __m128i t2 = _mm_madd_epi16(t1, mul_1_100); + const __m128i t3 = _mm_packus_epi32(t2, t2); + const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000); + return _mm_cvtsi128_si32( + t4); // only captures the sum of the first 8 digits, drop the rest +} + +/** @private */ +simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) { + internal::value128 answer; +#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS +#ifdef _M_ARM64 + // ARM64 has native support for 64-bit multiplications, no need to emultate + answer.high = __umulh(value1, value2); + answer.low = value1 * value2; +#else + answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64 +#endif // _M_ARM64 +#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS + __uint128_t r = (static_cast<__uint128_t>(value1)) * value2; + answer.low = uint64_t(r); + answer.high = uint64_t(r >> 64); +#endif + return answer; +} + +} // namespace numberparsing +} // namespace westmere +} // namespace simdjson + +#define SIMDJSON_SWAR_NUMBER_PARSING 1 + +#endif // SIMDJSON_WESTMERE_NUMBERPARSING_DEFS_H +/* end file simdjson/westmere/numberparsing_defs.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ +/* including simdjson/westmere/stringparsing_defs.h: #include "simdjson/westmere/stringparsing_defs.h" */ +/* begin file simdjson/westmere/stringparsing_defs.h */ +#ifndef SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +#define SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H + +/* including simdjson/westmere/bitmanipulation.h: #include "simdjson/westmere/bitmanipulation.h" */ +/* begin file simdjson/westmere/bitmanipulation.h */ +#ifndef SIMDJSON_WESTMERE_BITMANIPULATION_H +#define SIMDJSON_WESTMERE_BITMANIPULATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/intrinsics.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { + +// We sometimes call trailing_zero on inputs that are zero, +// but the algorithms do not end up using the returned value. +// Sadly, sanitizers are not smart enough to figure it out. +SIMDJSON_NO_SANITIZE_UNDEFINED +// This function can be used safely even if not all bytes have been +// initialized. +// See issue https://github.com/simdjson/simdjson/issues/1965 +SIMDJSON_NO_SANITIZE_MEMORY +simdjson_inline int trailing_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long ret; + // Search the mask data from least significant bit (LSB) + // to the most significant bit (MSB) for a set bit (1). + _BitScanForward64(&ret, input_num); + return (int)ret; +#else // SIMDJSON_REGULAR_VISUAL_STUDIO + return __builtin_ctzll(input_num); +#endif // SIMDJSON_REGULAR_VISUAL_STUDIO +} + +/* result might be undefined when input_num is zero */ +simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) { + return input_num & (input_num-1); +} + +/* result might be undefined when input_num is zero */ +simdjson_inline int leading_zeroes(uint64_t input_num) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + unsigned long leading_zero = 0; + // Search the mask data from most significant bit (MSB) + // to least significant bit (LSB) for a set bit (1). + if (_BitScanReverse64(&leading_zero, input_num)) + return (int)(63 - leading_zero); + else + return 64; +#else + return __builtin_clzll(input_num); +#endif// SIMDJSON_REGULAR_VISUAL_STUDIO +} + +#if SIMDJSON_REGULAR_VISUAL_STUDIO +simdjson_inline unsigned __int64 count_ones(uint64_t input_num) { + // note: we do not support legacy 32-bit Windows in this kernel + return __popcnt64(input_num);// Visual Studio wants two underscores +} +#else +simdjson_inline long long int count_ones(uint64_t input_num) { + return _popcnt64(input_num); +} +#endif + +simdjson_inline bool add_overflow(uint64_t value1, uint64_t value2, + uint64_t *result) { +#if SIMDJSON_REGULAR_VISUAL_STUDIO + return _addcarry_u64(0, value1, value2, + reinterpret_cast(result)); +#else + return __builtin_uaddll_overflow(value1, value2, + reinterpret_cast(result)); +#endif +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_BITMANIPULATION_H +/* end file simdjson/westmere/bitmanipulation.h */ +/* including simdjson/westmere/simd.h: #include "simdjson/westmere/simd.h" */ +/* begin file simdjson/westmere/simd.h */ +#ifndef SIMDJSON_WESTMERE_SIMD_H +#define SIMDJSON_WESTMERE_SIMD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/bitmanipulation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/simdprune_tables.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace { +namespace simd { + + template + struct base { + __m128i value; + + // Zero constructor + simdjson_inline base() : value{__m128i()} {} + + // Conversion from SIMD register + simdjson_inline base(const __m128i _value) : value(_value) {} + + // Conversion to SIMD register + simdjson_inline operator const __m128i&() const { return this->value; } + simdjson_inline operator __m128i&() { return this->value; } + + // Bit operations + simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); } + simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); } + simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); } + simdjson_inline Child bit_andnot(const Child other) const { return _mm_andnot_si128(other, *this); } + simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast | other; return *this_cast; } + simdjson_inline Child& operator&=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast & other; return *this_cast; } + simdjson_inline Child& operator^=(const Child other) { auto this_cast = static_cast(this); *this_cast = *this_cast ^ other; return *this_cast; } + }; + + template> + struct base8: base> { + typedef uint16_t bitmask_t; + typedef uint32_t bitmask2_t; + + simdjson_inline base8() : base>() {} + simdjson_inline base8(const __m128i _value) : base>(_value) {} + + friend simdjson_inline Mask operator==(const simd8 lhs, const simd8 rhs) { return _mm_cmpeq_epi8(lhs, rhs); } + + static const int SIZE = sizeof(base>::value); + + template + simdjson_inline simd8 prev(const simd8 prev_chunk) const { + return _mm_alignr_epi8(*this, prev_chunk, 16 - N); + } + }; + + // SIMD byte mask type (returned by things like eq and gt) + template<> + struct simd8: base8 { + static simdjson_inline simd8 splat(bool _value) { return _mm_set1_epi8(uint8_t(-(!!_value))); } + + simdjson_inline simd8() : base8() {} + simdjson_inline simd8(const __m128i _value) : base8(_value) {} + // Splat constructor + simdjson_inline simd8(bool _value) : base8(splat(_value)) {} + + simdjson_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } + simdjson_inline bool any() const { return !_mm_testz_si128(*this, *this); } + simdjson_inline simd8 operator~() const { return *this ^ true; } + }; + + template + struct base8_numeric: base8 { + static simdjson_inline simd8 splat(T _value) { return _mm_set1_epi8(_value); } + static simdjson_inline simd8 zero() { return _mm_setzero_si128(); } + static simdjson_inline simd8 load(const T values[16]) { + return _mm_loadu_si128(reinterpret_cast(values)); + } + // Repeat 16 values as many times as necessary (usually for lookup tables) + static simdjson_inline simd8 repeat_16( + T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, + T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + simdjson_inline base8_numeric() : base8() {} + simdjson_inline base8_numeric(const __m128i _value) : base8(_value) {} + + // Store to array + simdjson_inline void store(T dst[16]) const { return _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), *this); } + + // Override to distinguish from bool version + simdjson_inline simd8 operator~() const { return *this ^ 0xFFu; } + + // Addition/subtraction are the same for signed and unsigned + simdjson_inline simd8 operator+(const simd8 other) const { return _mm_add_epi8(*this, other); } + simdjson_inline simd8 operator-(const simd8 other) const { return _mm_sub_epi8(*this, other); } + simdjson_inline simd8& operator+=(const simd8 other) { *this = *this + other; return *static_cast*>(this); } + simdjson_inline simd8& operator-=(const simd8 other) { *this = *this - other; return *static_cast*>(this); } + + // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values) + template + simdjson_inline simd8 lookup_16(simd8 lookup_table) const { + return _mm_shuffle_epi8(lookup_table, *this); + } + + // Copies to 'output" all bytes corresponding to a 0 in the mask (interpreted as a bitset). + // Passing a 0 value for mask would be equivalent to writing out every byte to output. + // Only the first 16 - count_ones(mask) bytes of the result are significant but 16 bytes + // get written. + // Design consideration: it seems like a function with the + // signature simd8 compress(uint32_t mask) would be + // sensible, but the AVX ISA makes this kind of approach difficult. + template + simdjson_inline void compress(uint16_t mask, L * output) const { + using internal::thintable_epi8; + using internal::BitsSetTable256mul2; + using internal::pshufb_combine_table; + // this particular implementation was inspired by work done by @animetosho + // we do it in two steps, first 8 bytes and then second 8 bytes + uint8_t mask1 = uint8_t(mask); // least significant 8 bits + uint8_t mask2 = uint8_t(mask >> 8); // most significant 8 bits + // next line just loads the 64-bit values thintable_epi8[mask1] and + // thintable_epi8[mask2] into a 128-bit register, using only + // two instructions on most compilers. + __m128i shufmask = _mm_set_epi64x(thintable_epi8[mask2], thintable_epi8[mask1]); + // we increment by 0x08 the second half of the mask + shufmask = + _mm_add_epi8(shufmask, _mm_set_epi32(0x08080808, 0x08080808, 0, 0)); + // this is the version "nearly pruned" + __m128i pruned = _mm_shuffle_epi8(*this, shufmask); + // we still need to put the two halves together. + // we compute the popcount of the first half: + int pop1 = BitsSetTable256mul2[mask1]; + // then load the corresponding mask, what it does is to write + // only the first pop1 bytes from the first 8 bytes, and then + // it fills in with the bytes from the second 8 bytes + some filling + // at the end. + __m128i compactmask = + _mm_loadu_si128(reinterpret_cast(pshufb_combine_table + pop1 * 8)); + __m128i answer = _mm_shuffle_epi8(pruned, compactmask); + _mm_storeu_si128(reinterpret_cast<__m128i *>(output), answer); + } + + template + simdjson_inline simd8 lookup_16( + L replace0, L replace1, L replace2, L replace3, + L replace4, L replace5, L replace6, L replace7, + L replace8, L replace9, L replace10, L replace11, + L replace12, L replace13, L replace14, L replace15) const { + return lookup_16(simd8::repeat_16( + replace0, replace1, replace2, replace3, + replace4, replace5, replace6, replace7, + replace8, replace9, replace10, replace11, + replace12, replace13, replace14, replace15 + )); + } + }; + + // Signed bytes + template<> + struct simd8 : base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const int8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, + int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Order-sensitive comparisons + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epi8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epi8(*this, other); } + simdjson_inline simd8 operator>(const simd8 other) const { return _mm_cmpgt_epi8(*this, other); } + simdjson_inline simd8 operator<(const simd8 other) const { return _mm_cmpgt_epi8(other, *this); } + }; + + // Unsigned bytes + template<> + struct simd8: base8_numeric { + simdjson_inline simd8() : base8_numeric() {} + simdjson_inline simd8(const __m128i _value) : base8_numeric(_value) {} + // Splat constructor + simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {} + // Array constructor + simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {} + // Member-by-member initialization + simdjson_inline simd8( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) : simd8(_mm_setr_epi8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + )) {} + // Repeat 16 values as many times as necessary (usually for lookup tables) + simdjson_inline static simd8 repeat_16( + uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, + uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 + ) { + return simd8( + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10,v11,v12,v13,v14,v15 + ); + } + + // Saturated math + simdjson_inline simd8 saturating_add(const simd8 other) const { return _mm_adds_epu8(*this, other); } + simdjson_inline simd8 saturating_sub(const simd8 other) const { return _mm_subs_epu8(*this, other); } + + // Order-specific operations + simdjson_inline simd8 max_val(const simd8 other) const { return _mm_max_epu8(*this, other); } + simdjson_inline simd8 min_val(const simd8 other) const { return _mm_min_epu8(*this, other); } + // Same as >, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 gt_bits(const simd8 other) const { return this->saturating_sub(other); } + // Same as <, but only guarantees true is nonzero (< guarantees true = -1) + simdjson_inline simd8 lt_bits(const simd8 other) const { return other.saturating_sub(*this); } + simdjson_inline simd8 operator<=(const simd8 other) const { return other.max_val(*this) == other; } + simdjson_inline simd8 operator>=(const simd8 other) const { return other.min_val(*this) == other; } + simdjson_inline simd8 operator>(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + simdjson_inline simd8 operator<(const simd8 other) const { return this->gt_bits(other).any_bits_set(); } + + // Bit-specific operations + simdjson_inline simd8 bits_not_set() const { return *this == uint8_t(0); } + simdjson_inline simd8 bits_not_set(simd8 bits) const { return (*this & bits).bits_not_set(); } + simdjson_inline simd8 any_bits_set() const { return ~this->bits_not_set(); } + simdjson_inline simd8 any_bits_set(simd8 bits) const { return ~this->bits_not_set(bits); } + simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; } + simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); } + simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); } + simdjson_inline bool bits_not_set_anywhere(simd8 bits) const { return _mm_testz_si128(*this, bits); } + simdjson_inline bool any_bits_set_anywhere(simd8 bits) const { return !bits_not_set_anywhere(bits); } + template + simdjson_inline simd8 shr() const { return simd8(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); } + template + simdjson_inline simd8 shl() const { return simd8(_mm_slli_epi16(*this, N)) & uint8_t(0xFFu << N); } + // Get one of the bits and make a bitmask out of it. + // e.g. value.get_bit<7>() gets the high bit + template + simdjson_inline int get_bit() const { return _mm_movemask_epi8(_mm_slli_epi16(*this, 7-N)); } + }; + + template + struct simd8x64 { + static constexpr int NUM_CHUNKS = 64 / sizeof(simd8); + static_assert(NUM_CHUNKS == 4, "Westmere kernel should use four registers per 64-byte block."); + const simd8 chunks[NUM_CHUNKS]; + + simd8x64(const simd8x64& o) = delete; // no copy allowed + simd8x64& operator=(const simd8& other) = delete; // no assignment allowed + simd8x64() = delete; // no default constructor allowed + + simdjson_inline simd8x64(const simd8 chunk0, const simd8 chunk1, const simd8 chunk2, const simd8 chunk3) : chunks{chunk0, chunk1, chunk2, chunk3} {} + simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8::load(ptr), simd8::load(ptr+16), simd8::load(ptr+32), simd8::load(ptr+48)} {} + + simdjson_inline void store(T ptr[64]) const { + this->chunks[0].store(ptr+sizeof(simd8)*0); + this->chunks[1].store(ptr+sizeof(simd8)*1); + this->chunks[2].store(ptr+sizeof(simd8)*2); + this->chunks[3].store(ptr+sizeof(simd8)*3); + } + + simdjson_inline simd8 reduce_or() const { + return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]); + } + + simdjson_inline uint64_t compress(uint64_t mask, T * output) const { + this->chunks[0].compress(uint16_t(mask), output); + this->chunks[1].compress(uint16_t(mask >> 16), output + 16 - count_ones(mask & 0xFFFF)); + this->chunks[2].compress(uint16_t(mask >> 32), output + 32 - count_ones(mask & 0xFFFFFFFF)); + this->chunks[3].compress(uint16_t(mask >> 48), output + 48 - count_ones(mask & 0xFFFFFFFFFFFF)); + return 64 - count_ones(mask); + } + + simdjson_inline uint64_t to_bitmask() const { + uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() ); + uint64_t r1 = this->chunks[1].to_bitmask() ; + uint64_t r2 = this->chunks[2].to_bitmask() ; + uint64_t r3 = this->chunks[3].to_bitmask() ; + return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48); + } + + simdjson_inline uint64_t eq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] == mask, + this->chunks[1] == mask, + this->chunks[2] == mask, + this->chunks[3] == mask + ).to_bitmask(); + } + + simdjson_inline uint64_t eq(const simd8x64 &other) const { + return simd8x64( + this->chunks[0] == other.chunks[0], + this->chunks[1] == other.chunks[1], + this->chunks[2] == other.chunks[2], + this->chunks[3] == other.chunks[3] + ).to_bitmask(); + } + + simdjson_inline uint64_t lteq(const T m) const { + const simd8 mask = simd8::splat(m); + return simd8x64( + this->chunks[0] <= mask, + this->chunks[1] <= mask, + this->chunks[2] <= mask, + this->chunks[3] <= mask + ).to_bitmask(); + } + }; // struct simd8x64 + +} // namespace simd +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_SIMD_INPUT_H +/* end file simdjson/westmere/simd.h */ + +namespace simdjson { +namespace westmere { +namespace { + +using namespace simd; + +// Holds backslashes and quotes locations. +struct backslash_and_quote { +public: + static constexpr uint32_t BYTES_PROCESSED = 32; + simdjson_inline static backslash_and_quote copy_and_find(const uint8_t *src, uint8_t *dst); + + simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; } + simdjson_inline bool has_backslash() { return bs_bits != 0; } + simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); } + simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); } + + uint32_t bs_bits; + uint32_t quote_bits; +}; // struct backslash_and_quote + +simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) { + // this can read up to 31 bytes beyond the buffer size, but we require + // SIMDJSON_PADDING of padding + static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes"); + simd8 v0(src); + simd8 v1(src + 16); + v0.store(dst); + v1.store(dst + 16); + uint64_t bs_and_quote = simd8x64(v0 == '\\', v1 == '\\', v0 == '"', v1 == '"').to_bitmask(); + return { + uint32_t(bs_and_quote), // bs_bits + uint32_t(bs_and_quote >> 32) // quote_bits + }; +} + +} // unnamed namespace +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_WESTMERE_STRINGPARSING_DEFS_H +/* end file simdjson/westmere/stringparsing_defs.h */ +/* end file simdjson/westmere/begin.h */ +/* including simdjson/generic/ondemand/amalgamated.h for westmere: #include "simdjson/generic/ondemand/amalgamated.h" */ +/* begin file simdjson/generic/ondemand/amalgamated.h for westmere */ +#if defined(SIMDJSON_CONDITIONAL_INCLUDE) && !defined(SIMDJSON_GENERIC_ONDEMAND_DEPENDENCIES_H) +#error simdjson/generic/ondemand/dependencies.h must be included before simdjson/generic/ondemand/amalgamated.h! +#endif + +// Stuff other things depend on +/* including simdjson/generic/ondemand/base.h for westmere: #include "simdjson/generic/ondemand/base.h" */ +/* begin file simdjson/generic/ondemand/base.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_BASE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_BASE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +/** + * A fast, simple, DOM-like interface that parses JSON as you use it. + * + * Designed for maximum speed and a lower memory profile. + */ +namespace ondemand { + +/** Represents the depth of a JSON value (number of nested arrays/objects). */ +using depth_t = int32_t; + +/** @copydoc simdjson::westmere::number_type */ +using number_type = simdjson::westmere::number_type; + +/** @private Position in the JSON buffer indexes */ +using token_position = const uint32_t *; + +class array; +class array_iterator; +class document; +class document_reference; +class document_stream; +class field; +class json_iterator; +enum class json_type; +struct number; +class object; +class object_iterator; +class parser; +class raw_json_string; +class token_iterator; +class value; +class value_iterator; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_BASE_H +/* end file simdjson/generic/ondemand/base.h for westmere */ +/* including simdjson/generic/ondemand/value_iterator.h for westmere: #include "simdjson/generic/ondemand/value_iterator.h" */ +/* begin file simdjson/generic/ondemand/value_iterator.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * Iterates through a single JSON value at a particular depth. + * + * Does not keep track of the type of value: provides methods for objects, arrays and scalars and expects + * the caller to call the right ones. + * + * @private This is not intended for external use. + */ +class value_iterator { +protected: + /** The underlying JSON iterator */ + json_iterator *_json_iter{}; + /** The depth of this value */ + depth_t _depth{}; + /** + * The starting token index for this value + */ + token_position _start_position{}; + +public: + simdjson_inline value_iterator() noexcept = default; + + /** + * Denote that we're starting a document. + */ + simdjson_inline void start_document() noexcept; + + /** + * Skips a non-iterated or partially-iterated JSON value, whether it is a scalar, array or object. + * + * Optimized for scalars. + */ + simdjson_warn_unused simdjson_inline error_code skip_child() noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is at the start of the value + */ + simdjson_inline bool at_start() const noexcept; + + /** + * Tell whether the value is open--if the value has not been used, or the array/object is still open. + */ + simdjson_inline bool is_open() const noexcept; + + /** + * Tell whether the value is at an object's first field (just after the {). + */ + simdjson_inline bool at_first_field() const noexcept; + + /** + * Abandon all iteration. + */ + simdjson_inline void abandon() noexcept; + + /** + * Get the child value as a value_iterator. + */ + simdjson_inline value_iterator child_value() const noexcept; + + /** + * Get the depth of this value. + */ + simdjson_inline int32_t depth() const noexcept; + + /** + * Get the JSON type of this value. + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() const noexcept; + + /** + * @addtogroup object Object iteration + * + * Methods to iterate and find object fields. These methods generally *assume* the value is + * actually an object; the caller is responsible for keeping track of that fact. + * + * @{ + */ + + /** + * Start an object iteration. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + */ + simdjson_warn_unused simdjson_inline simdjson_result start_object() noexcept; + /** + * Start an object iteration from the root. + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_object() noexcept; + /** + * Checks whether an object could be started from the root. May be called by start_root_object. + * + * @returns SUCCESS if it is possible to safely start an object from the root (document level). + * @error INCORRECT_TYPE if there is no opening { + * @error TAPE_ERROR if there is no matching } at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_object() noexcept; + /** + * Start an object iteration after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_object() noexcept; + /** + * Start an object iteration from the root, after the user has already checked and moved past the {. + * + * Does not move the iterator unless the object is empty ({}). + * + * @returns Whether the object had any fields (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_object() noexcept; + + /** + * Moves to the next field in an object. + * + * Looks for , and }. If } is found, the object is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return whether there is another field in the object. + * @error TAPE_ERROR If there is a comma missing between fields. + * @error TAPE_ERROR If there is a comma, but not enough tokens remaining to have a key, :, and value. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_field() noexcept; + + /** + * Get the current field's key. + */ + simdjson_warn_unused simdjson_inline simdjson_result field_key() noexcept; + + /** + * Pass the : in the field and move to its value. + */ + simdjson_warn_unused simdjson_inline error_code field_value() noexcept; + + /** + * Find the next field with the given key. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline error_code find_field(const std::string_view key) noexcept; + + /** + * Find the next field with the given key, *without* unescaping. This assumes object order: it + * will not find the field if it was already passed when looking for some *other* field. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_raw(const std::string_view key) noexcept; + + /** + * Find the field with the given key without regard to order, and *without* unescaping. + * + * This is an unordered object lookup: if the field is not found initially, it will cycle around and scan from the beginning. + * + * Assumes you have called next_field() or otherwise matched the previous value. + * + * This means the iterator must be sitting at the next key: + * + * ``` + * { "a": 1, "b": 2 } + * ^ + * ``` + * + * Key is *raw JSON,* meaning it will be matched against the verbatim JSON without attempting to + * unescape it. This works well for typical ASCII and UTF-8 keys (almost all of them), but may + * fail to match some keys with escapes (\u, \n, etc.). + */ + simdjson_warn_unused simdjson_inline simdjson_result find_field_unordered_raw(const std::string_view key) noexcept; + + /** @} */ + + /** + * @addtogroup array Array iteration + * Methods to iterate over array elements. These methods generally *assume* the value is actually + * an object; the caller is responsible for keeping track of that fact. + * @{ + */ + + /** + * Check for an opening [ and start an array iteration. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + */ + simdjson_warn_unused simdjson_inline simdjson_result start_array() noexcept; + /** + * Check for an opening [ and start an array iteration while at the root. + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline simdjson_result start_root_array() noexcept; + /** + * Checks whether an array could be started from the root. May be called by start_root_array. + * + * @returns SUCCESS if it is possible to safely start an array from the root (document level). + * @error INCORRECT_TYPE If there is no [. + * @error TAPE_ERROR if there is no matching ] at end of document + */ + simdjson_warn_unused simdjson_inline error_code check_root_array() noexcept; + /** + * Start an array iteration, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_array() noexcept; + /** + * Start an array iteration from the root, after the user has already checked and moved past the [. + * + * Does not move the iterator unless the array is empty ([]). + * + * @returns Whether the array had any elements (returns false for empty). + * @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the *parent* + * array or object is incomplete). + */ + simdjson_warn_unused simdjson_inline simdjson_result started_root_array() noexcept; + + /** + * Moves to the next element in an array. + * + * Looks for , and ]. If ] is found, the array is finished and the iterator advances past it. + * Otherwise, it advances to the next value. + * + * @return Whether there is another element in the array. + * @error TAPE_ERROR If there is a comma missing between elements. + */ + simdjson_warn_unused simdjson_inline simdjson_result has_next_element() noexcept; + + /** + * Get a child value iterator. + */ + simdjson_warn_unused simdjson_inline value_iterator child() const noexcept; + + /** @} */ + + /** + * @defgroup scalar Scalar values + * @addtogroup scalar + * @{ + */ + + simdjson_warn_unused simdjson_inline simdjson_result get_string(bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_bool() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_null() noexcept; + simdjson_warn_unused simdjson_inline bool is_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_integer() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + simdjson_warn_unused simdjson_inline simdjson_result get_root_string(bool check_trailing, bool allow_replacement) noexcept; + template + simdjson_warn_unused simdjson_inline error_code get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_wobbly_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_raw_json_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_uint64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_int64_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_double_in_string(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_bool(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline bool is_root_negative() noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_integer(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number_type(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result get_root_number(bool check_trailing) noexcept; + simdjson_warn_unused simdjson_inline simdjson_result is_root_null(bool check_trailing) noexcept; + + simdjson_inline error_code error() const noexcept; + simdjson_inline uint8_t *&string_buf_loc() noexcept; + simdjson_inline const json_iterator &json_iter() const noexcept; + simdjson_inline json_iterator &json_iter() noexcept; + + simdjson_inline void assert_is_valid() const noexcept; + simdjson_inline bool is_valid() const noexcept; + + /** @} */ +protected: + /** + * Restarts an array iteration. + * @returns Whether the array has any elements (returns false for empty). + */ + simdjson_inline simdjson_result reset_array() noexcept; + /** + * Restarts an object iteration. + * @returns Whether the object has any fields (returns false for empty). + */ + simdjson_inline simdjson_result reset_object() noexcept; + /** + * move_at_start(): moves us so that we are pointing at the beginning of + * the container. It updates the index so that at_start() is true and it + * syncs the depth. The user can then create a new container instance. + * + * Usage: used with value::count_elements(). + **/ + simdjson_inline void move_at_start() noexcept; + + /** + * move_at_container_start(): moves us so that we are pointing at the beginning of + * the container so that assert_at_container_start() passes. + * + * Usage: used with reset_array() and reset_object(). + **/ + simdjson_inline void move_at_container_start() noexcept; + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + simdjson_inline value_iterator(json_iterator *json_iter, depth_t depth, token_position start_index) noexcept; + + simdjson_inline simdjson_result parse_null(const uint8_t *json) const noexcept; + simdjson_inline simdjson_result parse_bool(const uint8_t *json) const noexcept; + simdjson_inline const uint8_t *peek_start() const noexcept; + simdjson_inline uint32_t peek_start_length() const noexcept; + + /** + * The general idea of the advance_... methods and the peek_* methods + * is that you first peek and check that you have desired type. If you do, + * and only if you do, then you advance. + * + * We used to unconditionally advance. But this made reasoning about our + * current state difficult. + * Suppose you always advance. Look at the 'value' matching the key + * "shadowable" in the following example... + * + * ({"globals":{"a":{"shadowable":[}}}}) + * + * If the user thinks it is a Boolean and asks for it, then we check the '[', + * decide it is not a Boolean, but still move into the next character ('}'). Now + * we are left pointing at '}' right after a '['. And we have not yet reported + * an error, only that we do not have a Boolean. + * + * If, instead, you just stand your ground until it is content that you know, then + * you will only even move beyond the '[' if the user tells you that you have an + * array. So you will be at the '}' character inside the array and, hopefully, you + * will then catch the error because an array cannot start with '}', but the code + * processing Boolean values does not know this. + * + * So the contract is: first call 'peek_...' and then call 'advance_...' only + * if you have determined that it is a type you can handle. + * + * Unfortunately, it makes the code more verbose, longer and maybe more error prone. + */ + + simdjson_inline void advance_scalar(const char *type) noexcept; + simdjson_inline void advance_root_scalar(const char *type) noexcept; + simdjson_inline void advance_non_root_scalar(const char *type) noexcept; + + simdjson_inline const uint8_t *peek_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_root_scalar(const char *type) noexcept; + simdjson_inline const uint8_t *peek_non_root_scalar(const char *type) noexcept; + + + simdjson_inline error_code start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept; + simdjson_inline error_code end_container() noexcept; + + /** + * Advance to a place expecting a value (increasing depth). + * + * @return The current token (the one left behind). + * @error TAPE_ERROR If the document ended early. + */ + simdjson_inline simdjson_result advance_to_value() noexcept; + + simdjson_inline error_code incorrect_type_error(const char *message) const noexcept; + simdjson_inline error_code error_unless_more_tokens(uint32_t tokens=1) const noexcept; + + simdjson_inline bool is_at_start() const noexcept; + /** + * is_at_iterator_start() returns true on an array or object after it has just been + * created, whether the instance is empty or not. + * + * Usage: used by array::begin() in debug mode (SIMDJSON_DEVELOPMENT_CHECKS) + */ + simdjson_inline bool is_at_iterator_start() const noexcept; + + /** + * Assuming that we are within an object, this returns true if we + * are pointing at a key. + * + * Usage: the skip_child() method should never be used while we are pointing + * at a key inside an object. + */ + simdjson_inline bool is_at_key() const noexcept; + + inline void assert_at_start() const noexcept; + inline void assert_at_container_start() const noexcept; + inline void assert_at_root() const noexcept; + inline void assert_at_child() const noexcept; + inline void assert_at_next() const noexcept; + inline void assert_at_non_root_start() const noexcept; + + /** Get the starting position of this value */ + simdjson_inline token_position start_position() const noexcept; + + /** @copydoc error_code json_iterator::position() const noexcept; */ + simdjson_inline token_position position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position last_position() const noexcept; + /** @copydoc error_code json_iterator::end_position() const noexcept; */ + simdjson_inline token_position end_position() const noexcept; + /** @copydoc error_code json_iterator::report_error(error_code error, const char *message) noexcept; */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + friend class document; + friend class object; + friend class array; + friend class value; +}; // value_iterator + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::value_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_H +/* end file simdjson/generic/ondemand/value_iterator.h for westmere */ +/* including simdjson/generic/ondemand/value.h for westmere: #include "simdjson/generic/ondemand/value.h" */ +/* begin file simdjson/generic/ondemand/value.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * An ephemeral JSON value returned during iteration. It is only valid for as long as you do + * not access more data in the JSON document. + */ +class value { +public: + /** + * Create a new invalid value. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline value() noexcept = default; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) noexcept; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() noexcept; + + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() noexcept; + + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + + /** + * Cast this JSON value (inside string) to a unsigned integer. + * + * @returns A unsigned 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + + /** + * Cast this JSON value to a "wobbly" string. + * + * The string is may not be a valid UTF-8 string. + * See https://simonsapin.github.io/wtf-8/ + * + * Important: a value should be consumed once. Calling get_wobbly_string() twice on the same value + * is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Equivalent to get(). + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); +#endif + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + * + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * Performance hint: You should only call count_elements() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method on the object instance. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @return The type of JSON value (json_type::array, json_type::object, json_type::string, + * json_type::number, json_type::boolean, or json_type::null). + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the value is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the value is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the value is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * Performance note: if you call this function systematically + * before parsing a number, you may have fallen for a performance + * anti-pattern. + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + * + * Performance note: this is designed with performance in mind. When + * calling 'get_number()', you scan the number string only once, determining + * efficiently the type and storing it in an efficient manner. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. However, if this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view is guaranteed to be + * a non-space token. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + * + * See also value::raw_json(). + */ + simdjson_inline std::string_view raw_json_token() noexcept; + + /** + * Get a string_view pointing at this value in the JSON document. + * If this element is an array or an object, it consumes the array or the object + * and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + * If this element is a scalar (string, number, Boolean, null), it returns what + * raw_json_token() would return. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + simdjson_inline simdjson_result current_location() noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. + * + * Calling at_pointer() on non-document instances (e.g., arrays and objects) is not + * standardized (by RFC 6901). We provide some experimental support for JSON pointers + * on non-document instances. Yet it is not the case when calling at_pointer on an array + * or an object instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + +protected: + /** + * Create a value. + */ + simdjson_inline value(const value_iterator &iter) noexcept; + + /** + * Skip this value, allowing iteration to continue. + */ + simdjson_inline void skip() noexcept; + + /** + * Start a value at the current position. + * + * (It should already be started; this is just a self-documentation method.) + */ + static simdjson_inline value start(const value_iterator &iter) noexcept; + + /** + * Resume a value. + */ + static simdjson_inline value resume(const value_iterator &iter) noexcept; + + /** + * Get the object, starting or resuming it as necessary + */ + simdjson_inline simdjson_result start_or_resume_object() noexcept; + + // simdjson_inline void log_value(const char *type) const noexcept; + // simdjson_inline void log_error(const char *message) const noexcept; + + value_iterator iter{}; + + friend class document; + friend class array_iterator; + friend class field; + friend class object; + friend struct simdjson_result; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::value &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result get_array() noexcept; + simdjson_inline simdjson_result get_object() noexcept; + + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() noexcept; + + template simdjson_inline error_code get(T &out) noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator westmere::ondemand::array() noexcept(false); + simdjson_inline operator westmere::ondemand::object() noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator westmere::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) noexcept; + + /** + * Get the type of this JSON value. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + */ + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + + /** @copydoc simdjson_inline std::string_view value::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + + /** @copydoc simdjson_inline simdjson_result current_location() noexcept */ + simdjson_inline simdjson_result current_location() noexcept; + /** @copydoc simdjson_inline int32_t current_depth() const noexcept */ + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H +/* end file simdjson/generic/ondemand/value.h for westmere */ +/* including simdjson/generic/ondemand/logger.h for westmere: #include "simdjson/generic/ondemand/logger.h" */ +/* begin file simdjson/generic/ondemand/logger.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +// Logging should be free unless SIMDJSON_VERBOSE_LOGGING is set. Importantly, it is critical +// that the call to the log functions be side-effect free. Thus, for example, you should not +// create temporary std::string instances. +namespace logger { + +enum class log_level : int32_t { + info = 0, + error = 1 +}; + +#if SIMDJSON_VERBOSE_LOGGING + static constexpr const bool LOG_ENABLED = true; +#else + static constexpr const bool LOG_ENABLED = false; +#endif + +// We do not want these functions to be 'really inlined' since real inlining is +// for performance purposes and if you are using the loggers, you do not care about +// performance (or should not). +static inline void log_headers() noexcept; +// If args are provided, title will be treated as format string +template +static inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +template +static inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; +static inline void log_event(const json_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_value(const json_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail="") noexcept; +static inline void log_start_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const json_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; + +static inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail="") noexcept; +static inline void log_error(const json_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +static inline void log_event(const value_iterator &iter, const char *type, std::string_view detail="", int delta=0, int depth_delta=0) noexcept; +static inline void log_value(const value_iterator &iter, const char *type, std::string_view detail="", int delta=-1, int depth_delta=0) noexcept; +static inline void log_start_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_end_value(const value_iterator &iter, const char *type, int delta=-1, int depth_delta=0) noexcept; +static inline void log_error(const value_iterator &iter, const char *error, const char *detail="", int delta=-1, int depth_delta=0) noexcept; + +} // namespace logger +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_H +/* end file simdjson/generic/ondemand/logger.h for westmere */ +/* including simdjson/generic/ondemand/token_iterator.h for westmere: #include "simdjson/generic/ondemand/token_iterator.h" */ +/* begin file simdjson/generic/ondemand/token_iterator.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * Iterates through JSON tokens (`{` `}` `[` `]` `,` `:` `""` `123` `true` `false` `null`) + * detected by stage 1. + * + * @private This is not intended for external use. + */ +class token_iterator { +public: + /** + * Create a new invalid token_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline token_iterator() noexcept = default; + simdjson_inline token_iterator(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator &operator=(token_iterator &&other) noexcept = default; + simdjson_inline token_iterator(const token_iterator &other) noexcept = default; + simdjson_inline token_iterator &operator=(const token_iterator &other) noexcept = default; + + /** + * Advance to the next token (returning the current one). + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + /** + * Reports the current offset in bytes from the start of the underlying buffer. + */ + simdjson_inline uint32_t current_offset() const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for a given token. + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + + /** + * Return the current index. + */ + simdjson_inline token_position position() const noexcept; + /** + * Reset to a previously saved index. + */ + simdjson_inline void set_position(token_position target_position) noexcept; + + // NOTE: we don't support a full C++ iterator interface, because we expect people to make + // different calls to advance the iterator based on *their own* state. + + simdjson_inline bool operator==(const token_iterator &other) const noexcept; + simdjson_inline bool operator!=(const token_iterator &other) const noexcept; + simdjson_inline bool operator>(const token_iterator &other) const noexcept; + simdjson_inline bool operator>=(const token_iterator &other) const noexcept; + simdjson_inline bool operator<(const token_iterator &other) const noexcept; + simdjson_inline bool operator<=(const token_iterator &other) const noexcept; + +protected: + simdjson_inline token_iterator(const uint8_t *buf, token_position position) noexcept; + + /** + * Get the index of the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = current token, + * 1 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_index(int32_t delta=0) const noexcept; + /** + * Get the index of the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token. + * + */ + simdjson_inline uint32_t peek_index(token_position position) const noexcept; + + const uint8_t *buf{}; + token_position _position{}; + + friend class json_iterator; + friend class value_iterator; + friend class object; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::token_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_H +/* end file simdjson/generic/ondemand/token_iterator.h for westmere */ +/* including simdjson/generic/ondemand/json_iterator.h for westmere: #include "simdjson/generic/ondemand/json_iterator.h" */ +/* begin file simdjson/generic/ondemand/json_iterator.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * Iterates through JSON tokens, keeping track of depth and string buffer. + * + * @private This is not intended for external use. + */ +class json_iterator { +protected: + token_iterator token{}; + ondemand::parser *parser{}; + /** + * Next free location in the string buffer. + * + * Used by raw_json_string::unescape() to have a place to unescape strings to. + */ + uint8_t *_string_buf_loc{}; + /** + * JSON error, if there is one. + * + * INCORRECT_TYPE and NO_SUCH_FIELD are *not* stored here, ever. + * + * PERF NOTE: we *hope* this will be elided into control flow, as it is only used (a) in the first + * iteration of the loop, or (b) for the final iteration after a missing comma is found in ++. If + * this is not elided, we should make sure it's at least not using up a register. Failing that, + * we should store it in document so there's only one of them. + */ + error_code error{SUCCESS}; + /** + * Depth of the current token in the JSON. + * + * - 0 = finished with document + * - 1 = document root value (could be [ or {, not yet known) + * - 2 = , or } inside root array/object + * - 3 = key or value inside root array/object. + */ + depth_t _depth{}; + /** + * Beginning of the document indexes. + * Normally we have root == parser->implementation->structural_indexes.get() + * but this may differ, especially in streaming mode (where we have several + * documents); + */ + token_position _root{}; + /** + * Normally, a json_iterator operates over a single document, but in + * some cases, we may have a stream of documents. This attribute is meant + * as meta-data: the json_iterator works the same irrespective of the + * value of this attribute. + */ + bool _streaming{false}; + +public: + simdjson_inline json_iterator() noexcept = default; + simdjson_inline json_iterator(json_iterator &&other) noexcept; + simdjson_inline json_iterator &operator=(json_iterator &&other) noexcept; + simdjson_inline explicit json_iterator(const json_iterator &other) noexcept = default; + simdjson_inline json_iterator &operator=(const json_iterator &other) noexcept = default; + /** + * Skips a JSON value, whether it is a scalar, array or object. + */ + simdjson_warn_unused simdjson_inline error_code skip_child(depth_t parent_depth) noexcept; + + /** + * Tell whether the iterator is still at the start + */ + simdjson_inline bool at_root() const noexcept; + + /** + * Tell whether we should be expected to run in streaming + * mode (iterating over many documents). It is pure metadata + * that does not affect how the iterator works. It is used by + * start_root_array() and start_root_object(). + */ + simdjson_inline bool streaming() const noexcept; + + /** + * Get the root value iterator + */ + simdjson_inline token_position root_position() const noexcept; + /** + * Assert that we are at the document depth (== 1) + */ + simdjson_inline void assert_at_document_depth() const noexcept; + /** + * Assert that we are at the root of the document + */ + simdjson_inline void assert_at_root() const noexcept; + + /** + * Tell whether the iterator is at the EOF mark + */ + simdjson_inline bool at_end() const noexcept; + + /** + * Tell whether the iterator is live (has not been moved). + */ + simdjson_inline bool is_alive() const noexcept; + + /** + * Abandon this iterator, setting depth to 0 (as if the document is finished). + */ + simdjson_inline void abandon() noexcept; + + /** + * Advance the current token without modifying depth. + */ + simdjson_inline const uint8_t *return_current_and_advance() noexcept; + + /** + * Returns true if there is a single token in the index (i.e., it is + * a JSON with a scalar value such as a single number). + * + * @return whether there is a single token + */ + simdjson_inline bool is_single_token() const noexcept; + + /** + * Assert that there are at least the given number of tokens left. + * + * Has no effect in release builds. + */ + simdjson_inline void assert_more_tokens(uint32_t required_tokens=1) const noexcept; + /** + * Assert that the given position addresses an actual token (is within bounds). + * + * Has no effect in release builds. + */ + simdjson_inline void assert_valid_position(token_position position) const noexcept; + /** + * Get the JSON text for a given token (relative). + * + * This is not null-terminated; it is a view into the JSON. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(int32_t delta=0) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param delta The relative position of the token to retrieve. e.g. 0 = next token, -1 = prev token. + */ + simdjson_inline uint32_t peek_length(int32_t delta=0) const noexcept; + /** + * Get a pointer to the current location in the input buffer. + * + * This is not null-terminated; it is a view into the JSON. + * + * You may be pointing outside of the input buffer: it is not generally + * safe to dereference this pointer. + */ + simdjson_inline const uint8_t *unsafe_pointer() const noexcept; + /** + * Get the JSON text for a given token. + * + * This is not null-terminated; it is a view into the JSON. + * + * @param position The position of the token to retrieve. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek(token_position position) const noexcept; + /** + * Get the maximum length of the JSON text for the current token (or relative). + * + * The length will include any whitespace at the end of the token. + * + * @param position The position of the token to retrieve. + */ + simdjson_inline uint32_t peek_length(token_position position) const noexcept; + /** + * Get the JSON text for the last token in the document. + * + * This is not null-terminated; it is a view into the JSON. + * + * TODO consider a string_view, assuming the length will get stripped out by the optimizer when + * it isn't used ... + */ + simdjson_inline const uint8_t *peek_last() const noexcept; + + /** + * Ascend one level. + * + * Validates that the depth - 1 == parent_depth. + * + * @param parent_depth the expected parent depth. + */ + simdjson_inline void ascend_to(depth_t parent_depth) noexcept; + + /** + * Descend one level. + * + * Validates that the new depth == child_depth. + * + * @param child_depth the expected child depth. + */ + simdjson_inline void descend_to(depth_t child_depth) noexcept; + simdjson_inline void descend_to(depth_t child_depth, int32_t delta) noexcept; + + /** + * Get current depth. + */ + simdjson_inline depth_t depth() const noexcept; + + /** + * Get current (writeable) location in the string buffer. + */ + simdjson_inline uint8_t *&string_buf_loc() noexcept; + + /** + * Report an unrecoverable error, preventing further iteration. + * + * @param error The error to report. Must not be SUCCESS, UNINITIALIZED, INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code report_error(error_code error, const char *message) noexcept; + + /** + * Log error, but don't stop iteration. + * @param error The error to report. Must be INCORRECT_TYPE, or NO_SUCH_FIELD. + * @param message An error message to report with the error. + */ + simdjson_inline error_code optional_error(error_code error, const char *message) noexcept; + + /** + * Take an input in json containing max_len characters and attempt to copy it over to tmpbuf, a buffer with + * N bytes of capacity. It will return false if N is too small (smaller than max_len) of if it is zero. + * The buffer (tmpbuf) is padded with space characters. + */ + simdjson_warn_unused simdjson_inline bool copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept; + + simdjson_inline token_position position() const noexcept; + /** + * Write the raw_json_string to the string buffer and return a string_view. + * Each raw_json_string should be unescaped once, or else the string buffer might + * overflow. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, bool allow_replacement) noexcept; + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in) noexcept; + + simdjson_inline void reenter_child(token_position position, depth_t child_depth) noexcept; + + simdjson_inline error_code consume_character(char c) noexcept; +#if SIMDJSON_DEVELOPMENT_CHECKS + simdjson_inline token_position start_position(depth_t depth) const noexcept; + simdjson_inline void set_start_position(depth_t depth, token_position position) noexcept; +#endif + + /* Useful for debugging and logging purposes. */ + inline std::string to_string() const noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Updates this json iterator so that it is back at the beginning of the document, + * as if it had just been created. + */ + inline void rewind() noexcept; + /** + * This checks whether the {,},[,] are balanced so that the document + * ends with proper zero depth. This requires scanning the whole document + * and it may be expensive. It is expected that it will be rarely called. + * It does not attempt to match { with } and [ with ]. + */ + inline bool balanced() const noexcept; +protected: + simdjson_inline json_iterator(const uint8_t *buf, ondemand::parser *parser) noexcept; + /// The last token before the end + simdjson_inline token_position last_position() const noexcept; + /// The token *at* the end. This points at gibberish and should only be used for comparison. + simdjson_inline token_position end_position() const noexcept; + /// The end of the buffer. + simdjson_inline token_position end() const noexcept; + + friend class document; + friend class document_stream; + friend class object; + friend class array; + friend class value; + friend class raw_json_string; + friend class parser; + friend class value_iterator; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, logger::log_level level, Args&&... args) noexcept; + template + friend simdjson_inline void logger::log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, logger::log_level level, Args&&... args) noexcept; +}; // json_iterator + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::json_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H +/* end file simdjson/generic/ondemand/json_iterator.h for westmere */ +/* including simdjson/generic/ondemand/json_type.h for westmere: #include "simdjson/generic/ondemand/json_type.h" */ +/* begin file simdjson/generic/ondemand/json_type.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * The type of a JSON value. + */ +enum class json_type { + // Start at 1 to catch uninitialized / default values more easily + array=1, ///< A JSON array ( [ 1, 2, 3 ... ] ) + object, ///< A JSON object ( { "a": 1, "b" 2, ... } ) + number, ///< A JSON number ( 1 or -2.3 or 4.5e6 ...) + string, ///< A JSON string ( "a" or "hello world\n" ...) + boolean, ///< A JSON boolean (true or false) + null ///< A JSON null (null) +}; + +/** + * A type representing a JSON number. + * The design of the struct is deliberately straight-forward. All + * functions return standard values with no error check. + */ +struct number { + + /** + * return the automatically determined type of + * the number: number_type::floating_point_number, + * number_type::signed_integer or number_type::unsigned_integer. + * + * enum class number_type { + * floating_point_number=1, /// a binary64 number + * signed_integer, /// a signed integer that fits in a 64-bit word using two's complement + * unsigned_integer /// a positive integer larger or equal to 1<<63 + * }; + */ + simdjson_inline ondemand::number_type get_number_type() const noexcept; + /** + * return true if the automatically determined type of + * the number is number_type::unsigned_integer. + */ + simdjson_inline bool is_uint64() const noexcept; + /** + * return the value as a uint64_t, only valid if is_uint64() is true. + */ + simdjson_inline uint64_t get_uint64() const noexcept; + simdjson_inline operator uint64_t() const noexcept; + + /** + * return true if the automatically determined type of + * the number is number_type::signed_integer. + */ + simdjson_inline bool is_int64() const noexcept; + /** + * return the value as a int64_t, only valid if is_int64() is true. + */ + simdjson_inline int64_t get_int64() const noexcept; + simdjson_inline operator int64_t() const noexcept; + + + /** + * return true if the automatically determined type of + * the number is number_type::floating_point_number. + */ + simdjson_inline bool is_double() const noexcept; + /** + * return the value as a double, only valid if is_double() is true. + */ + simdjson_inline double get_double() const noexcept; + simdjson_inline operator double() const noexcept; + + /** + * Convert the number to a double. Though it always succeed, the conversion + * may be lossy if the number cannot be represented exactly. + */ + simdjson_inline double as_double() const noexcept; + + +protected: + /** + * The next block of declaration is designed so that we can call the number parsing + * functions on a number type. They are protected and should never be used outside + * of the core simdjson library. + */ + friend class value_iterator; + template + friend error_code numberparsing::slow_float_parsing(simdjson_unused const uint8_t * src, W writer); + template + friend error_code numberparsing::write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer); + template + friend error_code numberparsing::parse_number(const uint8_t *const src, W &writer); + /** Store a signed 64-bit value to the number. */ + simdjson_inline void append_s64(int64_t value) noexcept; + /** Store an unsigned 64-bit value to the number. */ + simdjson_inline void append_u64(uint64_t value) noexcept; + /** Store a double value to the number. */ + simdjson_inline void append_double(double value) noexcept; + /** Specifies that the value is a double, but leave it undefined. */ + simdjson_inline void skip_double() noexcept; + /** + * End of friend declarations. + */ + + /** + * Our attributes are a union type (size = 64 bits) + * followed by a type indicator. + */ + union { + double floating_point_number; + int64_t signed_integer; + uint64_t unsigned_integer; + } payload{0}; + number_type type{number_type::signed_integer}; +}; + +/** + * Write the JSON type to the output stream + * + * @param out The output stream. + * @param type The json_type. + */ +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept; + +#if SIMDJSON_EXCEPTIONS +/** + * Send JSON type to an output stream. + * + * @param out The output stream. + * @param type The json_type. + * @throw simdjson_error if the result being printed has an error. If there is an error with the + * underlying output stream, that error will be propagated (simdjson_error will not be + * thrown). + */ +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false); +#endif + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::json_type &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_H +/* end file simdjson/generic/ondemand/json_type.h for westmere */ +/* including simdjson/generic/ondemand/raw_json_string.h for westmere: #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * A string escaped per JSON rules, terminated with quote ("). They are used to represent + * unescaped keys inside JSON documents. + * + * (In other words, a pointer to the beginning of a string, just after the start quote, inside a + * JSON file.) + * + * This class is deliberately simplistic and has little functionality. You can + * compare a raw_json_string instance with an unescaped C string, but + * that is nearly all you can do. + * + * The raw_json_string is unescaped. If you wish to write an unescaped version of it to your own + * buffer, you may do so using the parser.unescape(string, buff) method, using an ondemand::parser + * instance. Doing so requires you to have a sufficiently large buffer. + * + * The raw_json_string instances originate typically from field instance which in turn represent + * key-value pairs from object instances. From a field instance, you get the raw_json_string + * instance by calling key(). You can, if you want a more usable string_view instance, call + * the unescaped_key() method on the field instance. You may also create a raw_json_string from + * any other string value, with the value.get_raw_json_string() method. Again, you can get + * a more usable string_view instance by calling get_string(). + * + */ +class raw_json_string { +public: + /** + * Create a new invalid raw_json_string. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline raw_json_string() noexcept = default; + + /** + * Create a new invalid raw_json_string pointed at the given location in the JSON. + * + * The given location must be just *after* the beginning quote (") in the JSON file. + * + * It *must* be terminated by a ", and be a valid JSON string. + */ + simdjson_inline raw_json_string(const uint8_t * _buf) noexcept; + /** + * Get the raw pointer to the beginning of the string in the JSON (just after the "). + * + * It is possible for this function to return a null pointer if the instance + * has outlived its existence. + */ + simdjson_inline const char * raw() const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done) on target.size() characters, + * and if the raw_json_string instance has a quote character at byte index target.size(). + * We never read more than length + 1 bytes in the raw_json_string instance. + * If length is smaller than target.size(), this will return false. + * + * The std::string_view instance may contain any characters. However, the caller + * is responsible for setting length so that length bytes may be read in the + * raw_json_string. + * + * Performance: the comparison may be done using memcmp which may be efficient + * for long strings. + */ + simdjson_inline bool unsafe_is_equal(size_t length, std::string_view target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The std::string_view instance should not contain unescaped quote characters: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * Performance: the comparison is done byte-by-byte which might be inefficient for + * long strings. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + * The provided C string should not contain an unescaped quote character: + * the caller is responsible for this check. See is_free_from_unescaped_quote. + * + * If target is a compile-time constant, and your compiler likes you, + * you should be able to do the following without performance penalty... + * + * static_assert(raw_json_string::is_free_from_unescaped_quote(target), ""); + * s.unsafe_is_equal(target); + */ + simdjson_inline bool unsafe_is_equal(const char* target) const noexcept; + + /** + * This compares the current instance to the std::string_view target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(std::string_view target) const noexcept; + + /** + * This compares the current instance to the C string target: returns true if + * they are byte-by-byte equal (no escaping is done). + */ + simdjson_inline bool is_equal(const char* target) const noexcept; + + /** + * Returns true if target is free from unescaped quote. If target is known at + * compile-time, we might expect the computation to happen at compile time with + * many compilers (not all!). + */ + static simdjson_inline bool is_free_from_unescaped_quote(std::string_view target) noexcept; + static simdjson_inline bool is_free_from_unescaped_quote(const char* target) noexcept; + +private: + + + /** + * This will set the inner pointer to zero, effectively making + * this instance unusable. + */ + simdjson_inline void consume() noexcept { buf = nullptr; } + + /** + * Checks whether the inner pointer is non-null and thus usable. + */ + simdjson_inline simdjson_warn_unused bool alive() const noexcept { return buf != nullptr; } + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result will be a valid UTF-8. + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + * @param allow_replacement Whether we allow replacement of invalid surrogate pairs. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape(json_iterator &iter, bool allow_replacement) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. + * The result may not be a valid UTF-8. https://simonsapin.github.io/wtf-8/ + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid until the next parse() call on the parser. + * + * @param iter A json_iterator, which contains a buffer where the string will be written. + */ + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(json_iterator &iter) const noexcept; + const uint8_t * buf{}; + friend class object; + friend class field; + friend class parser; + friend struct simdjson_result; +}; + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &, const raw_json_string &) noexcept; + +/** + * Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible + * for providing a string with no unescaped quote. Note that unescaped quotes cannot be present in valid JSON strings. + */ +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept; +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept; +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept; + + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::raw_json_string &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline ~simdjson_result() noexcept = default; ///< @private + + simdjson_inline simdjson_result raw() const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape(westmere::ondemand::json_iterator &iter, bool allow_replacement) const noexcept; + simdjson_inline simdjson_warn_unused simdjson_result unescape_wobbly(westmere::ondemand::json_iterator &iter) const noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H +/* end file simdjson/generic/ondemand/raw_json_string.h for westmere */ +/* including simdjson/generic/ondemand/parser.h for westmere: #include "simdjson/generic/ondemand/parser.h" */ +/* begin file simdjson/generic/ondemand/parser.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * The default batch size for document_stream instances for this On Demand kernel. + * Note that different On Demand kernel may use a different DEFAULT_BATCH_SIZE value + * in the future. + */ +static constexpr size_t DEFAULT_BATCH_SIZE = 1000000; +/** + * Some adversary might try to set the batch size to 0 or 1, which might cause problems. + * We set a minimum of 32B since anything else is highly likely to be an error. In practice, + * most users will want a much larger batch size. + * + * All non-negative MINIMAL_BATCH_SIZE values should be 'safe' except that, obviously, no JSON + * document can ever span 0 or 1 byte and that very large values would create memory allocation issues. + */ +static constexpr size_t MINIMAL_BATCH_SIZE = 32; + +/** + * A JSON fragment iterator. + * + * This holds the actual iterator as well as the buffer for writing strings. + */ +class parser { +public: + /** + * Create a JSON parser. + * + * The new parser will have zero capacity. + */ + inline explicit parser(size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept; + + inline parser(parser &&other) noexcept = default; + simdjson_inline parser(const parser &other) = delete; + simdjson_inline parser &operator=(const parser &other) = delete; + simdjson_inline parser &operator=(parser &&other) noexcept = default; + + /** Deallocate the JSON parser. */ + inline ~parser() noexcept = default; + + /** + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * document doc = parser.iterate(json); + * + * It is expected that the content is a valid UTF-8 file, containing a valid JSON document. + * Otherwise the iterate method may return an error. In particular, the whole input should be + * valid: we do not attempt to tolerate incorrect content either before or after a JSON + * document. If there is a UTF-8 BOM, the parser skips it. + * + * ### IMPORTANT: Validate what you use + * + * Calling iterate on an invalid JSON document may not immediately trigger an error. The call to + * iterate does not parse and validate the whole document. + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * @param len The length of the JSON. + * @param capacity The number of bytes allocated in the JSON (must be at least len+SIMDJSON_PADDING). + * + * @return The document, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate(padded_string_view json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const char *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const uint8_t *json, size_t len, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string_view json, size_t capacity) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(std::string &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(const simdjson_result &json) & noexcept; + /** @overload simdjson_result iterate(padded_string_view json) & noexcept */ + simdjson_warn_unused simdjson_result iterate(padded_string &&json) & noexcept = delete; + + /** + * @private + * + * Start iterating an on-demand JSON document. + * + * ondemand::parser parser; + * json_iterator doc = parser.iterate(json); + * + * ### IMPORTANT: Buffer Lifetime + * + * Because parsing is done while you iterate, you *must* keep the JSON buffer around at least as + * long as the document iteration. + * + * ### IMPORTANT: Document Lifetime + * + * Only one iteration at a time can happen per parser, and the parser *must* be kept alive during + * iteration to ensure intermediate buffers can be accessed. Any document must be destroyed before + * you call parse() again or destroy the parser. + * + * The ondemand::document instance holds the iterator. The document must remain in scope + * while you are accessing instances of ondemand::value, ondemand::object, ondemand::array. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * @param json The JSON to parse. + * + * @return The iterator, or an error: + * - INSUFFICIENT_PADDING if the input has less than SIMDJSON_PADDING extra bytes. + * - MEMALLOC if realloc_if_needed the parser does not have enough capacity, and memory + * allocation fails. + * - EMPTY if the document is all whitespace. + * - UTF8_ERROR if the document is not valid UTF-8. + * - UNESCAPED_CHARS if a string contains control characters that must be escaped + * - UNCLOSED_STRING if there is an unclosed string in the document. + */ + simdjson_warn_unused simdjson_result iterate_raw(padded_string_view json) & noexcept; + + + /** + * Parse a buffer containing many JSON documents. + * + * auto json = R"({ "foo": 1 } { "foo": 2 } { "foo": 3 } )"_padded; + * ondemand::parser parser; + * ondemand::document_stream docs = parser.iterate_many(json); + * for (auto & doc : docs) { + * std::cout << doc["foo"] << std::endl; + * } + * // Prints 1 2 3 + * + * No copy of the input buffer is made. + * + * The function is lazy: it may be that no more than one JSON document at a time is parsed. + * + * The caller is responsabile to ensure that the input string data remains unchanged and is + * not deleted during the loop. + * + * ### Format + * + * The buffer must contain a series of one or more JSON documents, concatenated into a single + * buffer, separated by ASCII whitespace. It effectively parses until it has a fully valid document, + * then starts parsing the next document at that point. (It does this with more parallelism and + * lookahead than you might think, though.) + * + * documents that consist of an object or array may omit the whitespace between them, concatenating + * with no separator. Documents that consist of a single primitive (i.e. documents that are not + * arrays or objects) MUST be separated with ASCII whitespace. + * + * The characters inside a JSON document, and between JSON documents, must be valid Unicode (UTF-8). + * If there is a UTF-8 BOM, the parser skips it. + * + * The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse. + * Setting batch_size to excessively large or excessively small values may impact negatively the + * performance. + * + * ### REQUIRED: Buffer Padding + * + * The buffer must have at least SIMDJSON_PADDING extra allocated bytes. It does not matter what + * those bytes are initialized to, as long as they are allocated. These bytes will be read: if you + * using a sanitizer that verifies that no uninitialized byte is read, then you should initialize the + * SIMDJSON_PADDING bytes to avoid runtime warnings. + * + * ### Threads + * + * When compiled with SIMDJSON_THREADS_ENABLED, this method will use a single thread under the + * hood to do some lookahead. + * + * ### Parser Capacity + * + * If the parser's current capacity is less than batch_size, it will allocate enough capacity + * to handle it (up to max_capacity). + * + * @param buf The concatenated JSON to parse. + * @param len The length of the concatenated JSON. + * @param batch_size The batch size to use. MUST be larger than the largest document. The sweet + * spot is cache-related: small enough to fit in cache, yet big enough to + * parse as many documents as possible in one tight loop. + * Defaults to 10MB, which has been a reasonable sweet spot in our tests. + * @param allow_comma_separated (defaults on false) This allows a mode where the documents are + * separated by commas instead of whitespace. It comes with a performance + * penalty because the entire document is indexed at once (and the document must be + * less than 4 GB), and there is no multithreading. In this mode, the batch_size parameter + * is effectively ignored, as it is set to at least the document size. + * @return The stream, or an error. An empty input will yield 0 documents rather than an EMPTY error. Errors: + * - MEMALLOC if the parser does not have enough capacity and memory allocation fails + * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity. + * - other json errors if parsing fails. You should not rely on these errors to always the same for the + * same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware). + */ + inline simdjson_result iterate_many(const uint8_t *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const char *buf, size_t len, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const std::string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const std::string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + /** @overload parse_many(const uint8_t *buf, size_t len, size_t batch_size) */ + inline simdjson_result iterate_many(const padded_string &s, size_t batch_size = DEFAULT_BATCH_SIZE, bool allow_comma_separated = false) noexcept; + inline simdjson_result iterate_many(const padded_string &&s, size_t batch_size, bool allow_comma_separated = false) = delete;// unsafe + + /** @private We do not want to allow implicit conversion from C string to std::string. */ + simdjson_result iterate_many(const char *buf, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept = delete; + + /** The capacity of this parser (the largest document it can process). */ + simdjson_inline size_t capacity() const noexcept; + /** The maximum capacity of this parser (the largest document it is allowed to process). */ + simdjson_inline size_t max_capacity() const noexcept; + simdjson_inline void set_max_capacity(size_t max_capacity) noexcept; + /** + * The maximum depth of this parser (the most deeply nested objects and arrays it can process). + * This parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + */ + simdjson_inline size_t max_depth() const noexcept; + + /** + * Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length + * and `max_depth` depth. + * + * The max_depth parameter is only relevant when the macro SIMDJSON_DEVELOPMENT_CHECKS is set to true. + * The document's instance current_depth() method should be used to monitor the parsing + * depth and limit it if desired. + * + * @param capacity The new capacity. + * @param max_depth The new max_depth. Defaults to DEFAULT_MAX_DEPTH. + * @return The error, if there is one. + */ + simdjson_warn_unused error_code allocate(size_t capacity, size_t max_depth=DEFAULT_MAX_DEPTH) noexcept; + + #ifdef SIMDJSON_THREADS_ENABLED + /** + * The parser instance can use threads when they are available to speed up some + * operations. It is enabled by default. Changing this attribute will change the + * behavior of the parser for future operations. + */ + bool threaded{true}; + #endif + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result must be valid UTF-8. + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @param allow_replacement Whether we allow a replacement if the input string contains unmatched surrogate pairs. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement = false) const noexcept; + + /** + * Unescape this JSON string, replacing \\ with \, \n with newline, etc. to a user-provided buffer. + * The result may not be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * The provided pointer is advanced to the end of the string by reference, and a string_view instance + * is returned. You can ensure that your buffer is large enough by allocating a block of memory at least + * as large as the input JSON plus SIMDJSON_PADDING and then unescape all strings to this one buffer. + * + * This unescape function is a low-level function. If you want a more user-friendly approach, you should + * avoid raw_json_string instances (e.g., by calling unescaped_key() instead of key() or get_string() + * instead of get_raw_json_string()). + * + * ## IMPORTANT: string_view lifetime + * + * The string_view is only valid as long as the bytes in dst. + * + * @param raw_json_string input + * @param dst A pointer to a buffer at least large enough to write this string as well as + * an additional SIMDJSON_PADDING bytes. + * @return A string_view pointing at the unescaped string in dst + * @error STRING_ERROR if escapes are incorrect. + */ + simdjson_inline simdjson_result unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept; + +private: + /** @private [for benchmarking access] The implementation to use */ + std::unique_ptr implementation{}; + size_t _capacity{0}; + size_t _max_capacity; + size_t _max_depth{DEFAULT_MAX_DEPTH}; + std::unique_ptr string_buf{}; +#if SIMDJSON_DEVELOPMENT_CHECKS + std::unique_ptr start_positions{}; +#endif + + friend class json_iterator; + friend class document_stream; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::parser &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_H +/* end file simdjson/generic/ondemand/parser.h for westmere */ + +// All other declarations +/* including simdjson/generic/ondemand/array.h for westmere: #include "simdjson/generic/ondemand/array.h" */ +/* begin file simdjson/generic/ondemand/array.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * A forward-only JSON array. + */ +class array { +public: + /** + * Create a new invalid array. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline array() noexcept = default; + + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() noexcept; + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an array is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the beginning of the array and checks whether the + * array is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result is_empty() & noexcept; + /** + * Reset the iterator so that we are pointing back at the + * beginning of the array. You should still consume values only once even if you + * can iterate through the array more than once. If you unescape a string + * within the array more than once, you have unsafe code. Note that rewinding + * an array means that you may need to reparse it anew: it is not a free + * operation. + * + * @returns true if the array contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/0/foo/a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an array + * instance: there is no rewind and no invalidation. + * + * You may only call at_pointer on an array after it has been created, but before it has + * been first accessed. When calling at_pointer on an array, the pointer is advanced to + * the location indicated by the JSON pointer (in case of success). It is no longer possible + * to call at_pointer on the same array. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the array and returns a string_view instance corresponding to the + * array as represented in JSON. It points inside the original document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + + /** + * Get the value at the given index. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) noexcept; +protected: + /** + * Go to the end of the array, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + + /** + * Begin array iteration. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + */ + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + /** + * Begin array iteration from the root. + * + * @param iter The iterator. Must be where the initial [ is expected. Will be *moved* into the + * resulting array. + * @error INCORRECT_TYPE if the iterator is not at [. + * @error TAPE_ERROR if there is no closing ] at the end of the document. + */ + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + /** + * Begin array iteration. + * + * This version of the method should be called after the initial [ has been verified, and is + * intended for use by switch statements that check the type of a value. + * + * @param iter The iterator. Must be after the initial [. Will be *moved* into the resulting array. + */ + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + + /** + * Create an array at the given Internal array creation. Call array::start() or array::started() instead of this. + * + * @param iter The iterator. Must either be at the start of the first element with iter.is_alive() + * == true, or past the [] with is_alive() == false if the array is empty. Will be *moved* + * into the resulting array. + */ + simdjson_inline array(const value_iterator &iter) noexcept; + + /** + * Iterator marking current position. + * + * iter.is_alive() == false indicates iteration is complete. + */ + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; + friend struct simdjson_result; + friend class array_iterator; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::array &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + inline simdjson_result count_elements() & noexcept; + inline simdjson_result is_empty() & noexcept; + inline simdjson_result reset() & noexcept; + simdjson_inline simdjson_result at(size_t index) noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_H +/* end file simdjson/generic/ondemand/array.h for westmere */ +/* including simdjson/generic/ondemand/array_iterator.h for westmere: #include "simdjson/generic/ondemand/array_iterator.h" */ +/* begin file simdjson/generic/ondemand/array_iterator.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * A forward-only JSON array. + * + * This is an input_iterator, meaning: + * - It is forward-only + * - * must be called exactly once per element. + * - ++ must be called exactly once in between each * (*, ++, *, ++, * ...) + */ +class array_iterator { +public: + /** Create a new, invalid array iterator. */ + simdjson_inline array_iterator() noexcept = default; + + // + // Iterator interface + // + + /** + * Get the current element. + * + * Part of the std::iterator interface. + */ + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + /** + * Check if we are at the end of the JSON. + * + * Part of the std::iterator interface. + * + * @return true if there are no more elements in the JSON array. + */ + simdjson_inline bool operator==(const array_iterator &) const noexcept; + /** + * Check if there are more elements in the JSON array. + * + * Part of the std::iterator interface. + * + * @return true if there are more elements in the JSON array. + */ + simdjson_inline bool operator!=(const array_iterator &) const noexcept; + /** + * Move to the next element. + * + * Part of the std::iterator interface. + */ + simdjson_inline array_iterator &operator++() noexcept; + +private: + value_iterator iter{}; + + simdjson_inline array_iterator(const value_iterator &iter) noexcept; + + friend class array; + friend class value; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::array_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H +/* end file simdjson/generic/ondemand/array_iterator.h for westmere */ +/* including simdjson/generic/ondemand/document.h for westmere: #include "simdjson/generic/ondemand/document.h" */ +/* begin file simdjson/generic/ondemand/document.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * A JSON document. It holds a json_iterator instance. + * + * Used by tokens to get text, and string buffer location. + * + * You must keep the document around during iteration. + */ +class document { +public: + /** + * Create a new invalid document. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline document() noexcept = default; + simdjson_inline document(const document &other) noexcept = delete; // pass your documents by reference, not by copy + simdjson_inline document(document &&other) noexcept = default; + simdjson_inline document &operator=(const document &other) noexcept = delete; + simdjson_inline document &operator=(document &&other) noexcept = default; + + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @returns INCORRECT_TYPE If the JSON value is not an array. + */ + simdjson_inline simdjson_result get_array() & noexcept; + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @returns INCORRECT_TYPE If the JSON value is not an object. + */ + simdjson_inline simdjson_result get_object() & noexcept; + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64() noexcept; + /** + * Cast this JSON value (inside string) to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64() noexcept; + /** + * Cast this JSON value (inside string) to a signed integer. + * + * @returns A signed 64-bit integer. + * @returns INCORRECT_TYPE If the JSON value is not a 64-bit integer. + */ + simdjson_inline simdjson_result get_int64_in_string() noexcept; + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double() noexcept; + + /** + * Cast this JSON value (inside string) to a double. + * + * @returns A double. + * @returns INCORRECT_TYPE If the JSON value is not a valid floating-point number. + */ + simdjson_inline simdjson_result get_double_in_string() noexcept; + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: Calling get_string() twice on the same document is an error. + * + * @param Whether to allow a replacement character for unmatched surrogate pairs. + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + /** + * Attempts to fill the provided std::string reference with the parsed value of the current string. + * + * The string is guaranteed to be valid UTF-8. + * + * Important: a value should be consumed once. Calling get_string() twice on the same value + * is an error. + * + * Performance: This method may be slower than get_string() or get_string(bool) because it may need to allocate memory. + * We recommend you avoid allocating an std::string unless you need to. + * + * @returns INCORRECT_TYPE if the JSON value is not a string. Otherwise, we return SUCCESS. + */ + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + /** + * Cast this JSON value to a string. + * + * The string is not guaranteed to be valid UTF-8. See https://simonsapin.github.io/wtf-8/ + * + * Important: Calling get_wobbly_string() twice on the same document is an error. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_wobbly_string() noexcept; + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @returns INCORRECT_TYPE if the JSON value is not a string. + */ + simdjson_inline simdjson_result get_raw_json_string() noexcept; + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @returns INCORRECT_TYPE if the JSON value is not true or false. + */ + simdjson_inline simdjson_result get_bool() noexcept; + /** + * Cast this JSON value to a value when the document is an object or an array. + * + * @returns A value if a JSON array or object cannot be found. + * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result get_value() noexcept; + + /** + * Checks if this JSON value is null. If and only if the value is + * null, then it is consumed (we advance). If we find a token that + * begins with 'n' but is not 'null', then an error is returned. + * + * @returns Whether the value is null. + * @returns INCORRECT_TYPE If the JSON value begins with 'n' and is not 'null'. + */ + simdjson_inline simdjson_result is_null() noexcept; + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool + * + * You may use get_double(), get_bool(), get_uint64(), get_int64(), + * get_object(), get_array(), get_raw_json_string(), or get_string() instead. + * + * @returns A value of the given type, parsed from the JSON. + * @returns INCORRECT_TYPE If the JSON value is not the given type. + */ + template simdjson_inline simdjson_result get() & noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + /** @overload template simdjson_result get() & noexcept */ + template simdjson_inline simdjson_result get() && noexcept { + // Unless the simdjson library provides an inline implementation, calling this method should + // immediately fail. + static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. " + "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, " + "int64_t, double, and bool. We recommend you use get_double(), get_bool(), get_uint64(), get_int64(), " + " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."); + } + + /** + * Get this value as the given type. + * + * Supported types: object, array, raw_json_string, string_view, uint64_t, int64_t, double, bool, value + * + * Be mindful that the document instance must remain in scope while you are accessing object, array and value instances. + * + * @param out This is set to a value of the given type, parsed from the JSON. If there is an error, this may not be initialized. + * @returns INCORRECT_TYPE If the JSON value is not an object. + * @returns SUCCESS If the parse succeeded and the out parameter was set to the value. + */ + template simdjson_inline error_code get(T &out) & noexcept; + /** @overload template error_code get(T &out) & noexcept */ + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + /** + * Cast this JSON value to an array. + * + * @returns An object that can be used to iterate the array. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an array. + */ + simdjson_inline operator array() & noexcept(false); + /** + * Cast this JSON value to an object. + * + * @returns An object that can be used to look up or iterate fields. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not an object. + */ + simdjson_inline operator object() & noexcept(false); + /** + * Cast this JSON value to an unsigned integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit unsigned integer. + */ + simdjson_inline operator uint64_t() noexcept(false); + /** + * Cast this JSON value to a signed integer. + * + * @returns A signed 64-bit integer. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a 64-bit integer. + */ + simdjson_inline operator int64_t() noexcept(false); + /** + * Cast this JSON value to a double. + * + * @returns A double. + * @exception simdjson_error(INCORRECT_TYPE) If the JSON value is not a valid floating-point number. + */ + simdjson_inline operator double() noexcept(false); + /** + * Cast this JSON value to a string. + * + * The string is guaranteed to be valid UTF-8. + * + * @returns An UTF-8 string. The string is stored in the parser and will be invalidated the next + * time it parses a document or when it is destroyed. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator std::string_view() noexcept(false); + /** + * Cast this JSON value to a raw_json_string. + * + * The string is guaranteed to be valid UTF-8, and may have escapes in it (e.g. \\ or \n). + * + * @returns A pointer to the raw JSON for the given string. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not a string. + */ + simdjson_inline operator raw_json_string() noexcept(false); + /** + * Cast this JSON value to a bool. + * + * @returns A bool value. + * @exception simdjson_error(INCORRECT_TYPE) if the JSON value is not true or false. + */ + simdjson_inline operator bool() noexcept(false); + /** + * Cast this JSON value to a value. + * + * @returns A value value. + * @exception if a JSON value cannot be found + */ + simdjson_inline operator value() noexcept(false); +#endif + /** + * This method scans the array and counts the number of elements. + * The count_elements method should always be called before you have begun + * iterating through the array: it is expected that you are pointing at + * the beginning of the array. + * The runtime complexity is linear in the size of the array. After + * calling this function, if successful, the array is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + simdjson_inline simdjson_result count_elements() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Get the value at the given index in the array. This function has linear-time complexity. + * This function should only be called once on an array instance since the array iterator is not reset between each call. + * + * @return The value at the given index, or: + * - INDEX_OUT_OF_BOUNDS if the array index is larger than an array length + */ + simdjson_inline simdjson_result at(size_t index) & noexcept; + /** + * Begin array iteration. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result begin() & noexcept; + /** + * Sentinel representing the end of the array. + * + * Part of the std::iterable interface. + */ + simdjson_inline simdjson_result end() & noexcept; + + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to + * a key a single time. Doing object["mykey"].to_string()and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. E.g., the array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + + /** + * Get the type of this JSON value. It does not validate or consume the value. + * E.g., you must still call "is_null()" to check that a value is null even if + * "type()" returns json_type::null. + * + * NOTE: If you're only expecting a value to be one type (a typical case), it's generally + * better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just + * let it throw an exception). + * + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result type() noexcept; + + /** + * Checks whether the document is a scalar (string, number, null, Boolean). + * Returns false when there it is an array or object. + * + * @returns true if the type is string, number, null, Boolean + * @error TAPE_ERROR when the JSON value is a bad token like "}" "," or "alse". + */ + simdjson_inline simdjson_result is_scalar() noexcept; + + /** + * Checks whether the document is a negative number. + * + * @returns true if the number if negative. + */ + simdjson_inline bool is_negative() noexcept; + /** + * Checks whether the document is an integer number. Note that + * this requires to partially parse the number string. If + * the value is determined to be an integer, it may still + * not parse properly as an integer in subsequent steps + * (e.g., it might overflow). + * + * @returns true if the number if negative. + */ + simdjson_inline simdjson_result is_integer() noexcept; + /** + * Determine the number type (integer or floating-point number) as quickly + * as possible. This function does not fully validate the input. It is + * useful when you only need to classify the numbers, without parsing them. + * + * If you are planning to retrieve the value or you need full validation, + * consider using the get_number() method instead: it will fully parse + * and validate the input, and give you access to the type: + * get_number().get_number_type(). + * + * get_number_type() is number_type::unsigned_integer if we have + * an integer greater or equal to 9223372036854775808 + * get_number_type() is number_type::signed_integer if we have an + * integer that is less than 9223372036854775808 + * Otherwise, get_number_type() has value number_type::floating_point_number + * + * This function requires processing the number string, but it is expected + * to be faster than get_number().get_number_type() because it is does not + * parse the number value. + * + * @returns the type of the number + */ + simdjson_inline simdjson_result get_number_type() noexcept; + + /** + * Attempt to parse an ondemand::number. An ondemand::number may + * contain an integer value or a floating-point value, the simdjson + * library will autodetect the type. Thus it is a dynamically typed + * number. Before accessing the value, you must determine the detected + * type. + * + * number.get_number_type() is number_type::signed_integer if we have + * an integer in [-9223372036854775808,9223372036854775808) + * You can recover the value by calling number.get_int64() and you + * have that number.is_int64() is true. + * + * number.get_number_type() is number_type::unsigned_integer if we have + * an integer in [9223372036854775808,18446744073709551616) + * You can recover the value by calling number.get_uint64() and you + * have that number.is_uint64() is true. + * + * Otherwise, number.get_number_type() has value number_type::floating_point_number + * and we have a binary64 number. + * You can recover the value by calling number.get_double() and you + * have that number.is_double() is true. + * + * You must check the type before accessing the value: it is an error + * to call "get_int64()" when number.get_number_type() is not + * number_type::signed_integer and when number.is_int64() is false. + */ + simdjson_warn_unused simdjson_inline simdjson_result get_number() noexcept; + + /** + * Get the raw JSON for this token. + * + * The string_view will always point into the input buffer. + * + * The string_view will start at the beginning of the token, and include the entire token + * *as well as all spaces until the next token (or EOF).* This means, for example, that a + * string token always begins with a " and is always terminated by the final ", possibly + * followed by a number of spaces. + * + * The string_view is *not* null-terminated. If this is a scalar (string, number, + * boolean, or null), the character after the end of the string_view may be the padded buffer. + * + * Tokens include: + * - { + * - [ + * - "a string (possibly with UTF-8 or backslashed characters like \\\")". + * - -1.2e-100 + * - true + * - false + * - null + */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + /** + * Reset the iterator inside the document instance so we are pointing back at the + * beginning of the document, as if it had just been created. It invalidates all + * values, objects and arrays that you have created so far (including unescaped strings). + */ + inline void rewind() noexcept; + /** + * Returns debugging information. + */ + inline std::string to_debug_string() noexcept; + /** + * Some unrecoverable error conditions may render the document instance unusable. + * The is_alive() method returns true when the document is still suitable. + */ + inline bool is_alive() noexcept; + + /** + * Returns the current location in the document if in bounds. + */ + inline simdjson_result current_location() const noexcept; + + /** + * Returns true if this document has been fully parsed. + * If you have consumed the whole document and at_end() returns + * false, then there may be trailing content. + */ + inline bool at_end() const noexcept; + + /** + * Returns the current depth in the document if in bounds. + * + * E.g., + * 0 = finished with document + * 1 = document root value (could be [ or {, not yet known) + * 2 = , or } inside root array/object + * 3 = key or value inside root array/object. + */ + simdjson_inline int32_t current_depth() const noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() automatically calls rewind between each call. Thus + * all values, objects and arrays that you have created so far (including unescaped strings) + * are invalidated. After calling at_pointer, you need to consume the result: string values + * should be stored in your own variables, arrays should be decoded and stored in your own array-like + * structures and so forth. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + * - SCALAR_DOCUMENT_AS_VALUE if the json_pointer is empty and the document is not a scalar (see is_scalar() function). + */ + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + /** + * Consumes the document and returns a string_view instance corresponding to the + * document as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; +protected: + /** + * Consumes the document. + */ + simdjson_inline error_code consume() noexcept; + + simdjson_inline document(ondemand::json_iterator &&iter) noexcept; + simdjson_inline const uint8_t *text(uint32_t idx) const noexcept; + + simdjson_inline value_iterator resume_value_iterator() noexcept; + simdjson_inline value_iterator get_root_value_iterator() noexcept; + simdjson_inline simdjson_result start_or_resume_object() noexcept; + static simdjson_inline document start(ondemand::json_iterator &&iter) noexcept; + + // + // Fields + // + json_iterator iter{}; ///< Current position in the document + static constexpr depth_t DOCUMENT_DEPTH = 0; ///< document depth is always 0 + + friend class array_iterator; + friend class value; + friend class ondemand::parser; + friend class object; + friend class array; + friend class field; + friend class token; + friend class document_stream; + friend class document_reference; +}; + + +/** + * A document_reference is a thin wrapper around a document reference instance. + */ +class document_reference { +public: + simdjson_inline document_reference() noexcept; + simdjson_inline document_reference(document &d) noexcept; + simdjson_inline document_reference(const document_reference &other) noexcept = default; + simdjson_inline document_reference& operator=(const document_reference &other) noexcept = default; + simdjson_inline void rewind() noexcept; + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + + simdjson_inline simdjson_result is_null() noexcept; + simdjson_inline simdjson_result raw_json() noexcept; + simdjson_inline operator document&() const noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator array() & noexcept(false); + simdjson_inline operator object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + simdjson_inline simdjson_result raw_json_token() noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +private: + document *doc{nullptr}; +}; +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::document &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + + template simdjson_inline simdjson_result get() & noexcept; + template simdjson_inline simdjson_result get() && noexcept; + + template simdjson_inline error_code get(T &out) & noexcept; + template simdjson_inline error_code get(T &out) && noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator westmere::ondemand::array() & noexcept(false); + simdjson_inline operator westmere::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator westmere::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator westmere::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline int32_t current_depth() const noexcept; + simdjson_inline bool at_end() const noexcept; + simdjson_inline bool is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + + + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::document_reference value, error_code error) noexcept; + simdjson_inline simdjson_result() noexcept = default; + simdjson_inline error_code rewind() noexcept; + + simdjson_inline simdjson_result get_array() & noexcept; + simdjson_inline simdjson_result get_object() & noexcept; + simdjson_inline simdjson_result get_uint64() noexcept; + simdjson_inline simdjson_result get_uint64_in_string() noexcept; + simdjson_inline simdjson_result get_int64() noexcept; + simdjson_inline simdjson_result get_int64_in_string() noexcept; + simdjson_inline simdjson_result get_double() noexcept; + simdjson_inline simdjson_result get_double_in_string() noexcept; + simdjson_inline simdjson_result get_string(bool allow_replacement = false) noexcept; + template + simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result get_wobbly_string() noexcept; + simdjson_inline simdjson_result get_raw_json_string() noexcept; + simdjson_inline simdjson_result get_bool() noexcept; + simdjson_inline simdjson_result get_value() noexcept; + simdjson_inline simdjson_result is_null() noexcept; + +#if SIMDJSON_EXCEPTIONS + simdjson_inline operator westmere::ondemand::array() & noexcept(false); + simdjson_inline operator westmere::ondemand::object() & noexcept(false); + simdjson_inline operator uint64_t() noexcept(false); + simdjson_inline operator int64_t() noexcept(false); + simdjson_inline operator double() noexcept(false); + simdjson_inline operator std::string_view() noexcept(false); + simdjson_inline operator westmere::ondemand::raw_json_string() noexcept(false); + simdjson_inline operator bool() noexcept(false); + simdjson_inline operator westmere::ondemand::value() noexcept(false); +#endif + simdjson_inline simdjson_result count_elements() & noexcept; + simdjson_inline simdjson_result count_fields() & noexcept; + simdjson_inline simdjson_result at(size_t index) & noexcept; + simdjson_inline simdjson_result begin() & noexcept; + simdjson_inline simdjson_result end() & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(const char *key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](const char *key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(const char *key) & noexcept; + simdjson_inline simdjson_result type() noexcept; + simdjson_inline simdjson_result is_scalar() noexcept; + simdjson_inline simdjson_result current_location() noexcept; + simdjson_inline simdjson_result current_depth() const noexcept; + simdjson_inline simdjson_result is_negative() noexcept; + simdjson_inline simdjson_result is_integer() noexcept; + simdjson_inline simdjson_result get_number_type() noexcept; + simdjson_inline simdjson_result get_number() noexcept; + /** @copydoc simdjson_inline std::string_view document_reference::raw_json_token() const noexcept */ + simdjson_inline simdjson_result raw_json_token() noexcept; + + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; +}; + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_H +/* end file simdjson/generic/ondemand/document.h for westmere */ +/* including simdjson/generic/ondemand/document_stream.h for westmere: #include "simdjson/generic/ondemand/document_stream.h" */ +/* begin file simdjson/generic/ondemand/document_stream.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#ifdef SIMDJSON_THREADS_ENABLED +#include +#include +#include +#endif + +namespace simdjson { +namespace westmere { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED +/** @private Custom worker class **/ +struct stage1_worker { + stage1_worker() noexcept = default; + stage1_worker(const stage1_worker&) = delete; + stage1_worker(stage1_worker&&) = delete; + stage1_worker operator=(const stage1_worker&) = delete; + ~stage1_worker(); + /** + * We only start the thread when it is needed, not at object construction, this may throw. + * You should only call this once. + **/ + void start_thread(); + /** + * Start a stage 1 job. You should first call 'run', then 'finish'. + * You must call start_thread once before. + */ + void run(document_stream * ds, parser * stage1, size_t next_batch_start); + /** Wait for the run to finish (blocking). You should first call 'run', then 'finish'. **/ + void finish(); + +private: + + /** + * Normally, we would never stop the thread. But we do in the destructor. + * This function is only safe assuming that you are not waiting for results. You + * should have called run, then finish, and be done. + **/ + void stop_thread(); + + std::thread thread{}; + /** These three variables define the work done by the thread. **/ + ondemand::parser * stage1_thread_parser{}; + size_t _next_batch_start{}; + document_stream * owner{}; + /** + * We have two state variables. This could be streamlined to one variable in the future but + * we use two for clarity. + */ + bool has_work{false}; + bool can_work{true}; + + /** + * We lock using a mutex. + */ + std::mutex locking_mutex{}; + std::condition_variable cond_var{}; + + friend class document_stream; +}; +#endif // SIMDJSON_THREADS_ENABLED + +/** + * A forward-only stream of documents. + * + * Produced by parser::iterate_many. + * + */ +class document_stream { +public: + /** + * Construct an uninitialized document_stream. + * + * ```c++ + * document_stream docs; + * auto error = parser.iterate_many(json).get(docs); + * ``` + */ + simdjson_inline document_stream() noexcept; + /** Move one document_stream to another. */ + simdjson_inline document_stream(document_stream &&other) noexcept = default; + /** Move one document_stream to another. */ + simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default; + + simdjson_inline ~document_stream() noexcept; + + /** + * Returns the input size in bytes. + */ + inline size_t size_in_bytes() const noexcept; + + /** + * After iterating through the stream, this method + * returns the number of bytes that were not parsed at the end + * of the stream. If truncated_bytes() differs from zero, + * then the input was truncated maybe because incomplete JSON + * documents were found at the end of the stream. You + * may need to process the bytes in the interval [size_in_bytes()-truncated_bytes(), size_in_bytes()). + * + * You should only call truncated_bytes() after streaming through all + * documents, like so: + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto & doc : stream) { + * // do something with doc + * } + * size_t truncated = stream.truncated_bytes(); + * + */ + inline size_t truncated_bytes() const noexcept; + + class iterator { + public: + using value_type = simdjson_result; + using reference = value_type; + + using difference_type = std::ptrdiff_t; + + using iterator_category = std::input_iterator_tag; + + /** + * Default constructor. + */ + simdjson_inline iterator() noexcept; + /** + * Get the current document (or error). + */ + simdjson_inline simdjson_result operator*() noexcept; + /** + * Advance to the next document (prefix). + */ + inline iterator& operator++() noexcept; + /** + * Check if we're at the end yet. + * @param other the end iterator to compare to. + */ + simdjson_inline bool operator!=(const iterator &other) const noexcept; + /** + * @private + * + * Gives the current index in the input document in bytes. + * + * document_stream stream = parser.parse_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * auto doc = *i; + * size_t index = i.current_index(); + * } + * + * This function (current_index()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + */ + simdjson_inline size_t current_index() const noexcept; + + /** + * @private + * + * Gives a view of the current document at the current position. + * + * document_stream stream = parser.iterate_many(json,window); + * for(auto i = stream.begin(); i != stream.end(); ++i) { + * std::string_view v = i.source(); + * } + * + * The returned string_view instance is simply a map to the (unparsed) + * source string: it may thus include white-space characters and all manner + * of padding. + * + * This function (source()) is experimental and the usage + * may change in future versions of simdjson: we find the API somewhat + * awkward and we would like to offer something friendlier. + * + */ + simdjson_inline std::string_view source() const noexcept; + + /** + * Returns error of the stream (if any). + */ + inline error_code error() const noexcept; + + private: + simdjson_inline iterator(document_stream *s, bool finished) noexcept; + /** The document_stream we're iterating through. */ + document_stream* stream; + /** Whether we're finished or not. */ + bool finished; + + friend class document; + friend class document_stream; + friend class json_iterator; + }; + + /** + * Start iterating the documents in the stream. + */ + simdjson_inline iterator begin() noexcept; + /** + * The end of the stream, for iterator comparison purposes. + */ + simdjson_inline iterator end() noexcept; + +private: + + document_stream &operator=(const document_stream &) = delete; // Disallow copying + document_stream(const document_stream &other) = delete; // Disallow copying + + /** + * Construct a document_stream. Does not allocate or parse anything until the iterator is + * used. + * + * @param parser is a reference to the parser instance used to generate this document_stream + * @param buf is the raw byte buffer we need to process + * @param len is the length of the raw byte buffer in bytes + * @param batch_size is the size of the windows (must be strictly greater or equal to the largest JSON document) + */ + simdjson_inline document_stream( + ondemand::parser &parser, + const uint8_t *buf, + size_t len, + size_t batch_size, + bool allow_comma_separated + ) noexcept; + + /** + * Parse the first document in the buffer. Used by begin(), to handle allocation and + * initialization. + */ + inline void start() noexcept; + + /** + * Parse the next document found in the buffer previously given to document_stream. + * + * The content should be a valid JSON document encoded as UTF-8. If there is a + * UTF-8 BOM, the parser skips it. + * + * You do NOT need to pre-allocate a parser. This function takes care of + * pre-allocating a capacity defined by the batch_size defined when creating the + * document_stream object. + * + * The function returns simdjson::EMPTY if there is no more data to be parsed. + * + * The function returns simdjson::SUCCESS (as integer = 0) in case of success + * and indicates that the buffer has successfully been parsed to the end. + * Every document it contained has been parsed without error. + * + * The function returns an error code from simdjson/simdjson.h in case of failure + * such as simdjson::CAPACITY, simdjson::MEMALLOC, simdjson::DEPTH_ERROR and so forth; + * the simdjson::error_message function converts these error codes into a string). + * + * You can also check validity by calling parser.is_valid(). The same parser can + * and should be reused for the other documents in the buffer. + */ + inline void next() noexcept; + + /** Move the json_iterator of the document to the location of the next document in the stream. */ + inline void next_document() noexcept; + + /** Get the next document index. */ + inline size_t next_batch_start() const noexcept; + + /** Pass the next batch through stage 1 with the given parser. */ + inline error_code run_stage1(ondemand::parser &p, size_t batch_start) noexcept; + + // Fields + ondemand::parser *parser; + const uint8_t *buf; + size_t len; + size_t batch_size; + bool allow_comma_separated; + /** + * We are going to use just one document instance. The document owns + * the json_iterator. It implies that we only ever pass a reference + * to the document to the users. + */ + document doc{}; + /** The error (or lack thereof) from the current document. */ + error_code error; + size_t batch_start{0}; + size_t doc_index{}; + + #ifdef SIMDJSON_THREADS_ENABLED + /** Indicates whether we use threads. Note that this needs to be a constant during the execution of the parsing. */ + bool use_thread; + + inline void load_from_stage1_thread() noexcept; + + /** Start a thread to run stage 1 on the next batch. */ + inline void start_stage1_thread() noexcept; + + /** Wait for the stage 1 thread to finish and capture the results. */ + inline void finish_stage1_thread() noexcept; + + /** The error returned from the stage 1 thread. */ + error_code stage1_thread_error{UNINITIALIZED}; + /** The thread used to run stage 1 against the next batch in the background. */ + std::unique_ptr worker{new(std::nothrow) stage1_worker()}; + /** + * The parser used to run stage 1 in the background. Will be swapped + * with the regular parser when finished. + */ + ondemand::parser stage1_thread_parser{}; + + friend struct stage1_worker; + #endif // SIMDJSON_THREADS_ENABLED + + friend class parser; + friend class document; + friend class json_iterator; + friend struct simdjson_result; + friend struct internal::simdjson_result_base; +}; // document_stream + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::document_stream &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_H +/* end file simdjson/generic/ondemand/document_stream.h for westmere */ +/* including simdjson/generic/ondemand/field.h for westmere: #include "simdjson/generic/ondemand/field.h" */ +/* begin file simdjson/generic/ondemand/field.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * A JSON field (key/value pair) in an object. + * + * Returned from object iteration. + * + * Extends from std::pair so you can use C++ algorithms that rely on pairs. + */ +class field : public std::pair { +public: + /** + * Create a new invalid field. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline field() noexcept; + + /** + * Get the key as a string_view (for higher speed, consider raw_key). + * We deliberately use a more cumbersome name (unescaped_key) to force users + * to think twice about using it. + * + * This consumes the key: once you have called unescaped_key(), you cannot + * call it again nor can you call key(). + */ + simdjson_inline simdjson_warn_unused simdjson_result unescaped_key(bool allow_replacement) noexcept; + /** + * Get the key as a raw_json_string. Can be used for direct comparison with + * an unescaped C string: e.g., key() == "test". + */ + simdjson_inline raw_json_string key() const noexcept; + /** + * Get the field value. + */ + simdjson_inline ondemand::value &value() & noexcept; + /** + * @overload ondemand::value &ondemand::value() & noexcept + */ + simdjson_inline ondemand::value value() && noexcept; + +protected: + simdjson_inline field(raw_json_string key, ondemand::value &&value) noexcept; + static simdjson_inline simdjson_result start(value_iterator &parent_iter) noexcept; + static simdjson_inline simdjson_result start(const value_iterator &parent_iter, raw_json_string key) noexcept; + friend struct simdjson_result; + friend class object_iterator; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::field &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result unescaped_key(bool allow_replacement = false) noexcept; + simdjson_inline simdjson_result key() noexcept; + simdjson_inline simdjson_result value() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_H +/* end file simdjson/generic/ondemand/field.h for westmere */ +/* including simdjson/generic/ondemand/object.h for westmere: #include "simdjson/generic/ondemand/object.h" */ +/* begin file simdjson/generic/ondemand/object.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +/** + * A forward-only JSON object field iterator. + */ +class object { +public: + /** + * Create a new invalid object. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + /** + * Look up a field by name on an object (order-sensitive). + * + * The following code reads z, then y, then x, and thus will not retrieve x or y if fed the + * JSON `{ "x": 1, "y": 2, "z": 3 }`: + * + * ```c++ + * simdjson::ondemand::parser parser; + * auto obj = parser.parse(R"( { "x": 1, "y": 2, "z": 3 } )"_padded); + * double z = obj.find_field("z"); + * double y = obj.find_field("y"); + * double x = obj.find_field("x"); + * ``` + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * **Raw Keys:** The lookup will be done against the *raw* key, and will not unescape keys. + * e.g. `object["a"]` will match `{ "a": 1 }`, but will *not* match `{ "\u0061": 1 }`. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a + * key a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() + * is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + + /** + * Look up a field by name on an object, without regard to key order. + * + * **Performance Notes:** This is a bit less performant than find_field(), though its effect varies + * and often appears negligible. It starts out normally, starting out at the last field; but if + * the field is not found, it scans from the beginning of the object to see if it missed it. That + * missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object + * in question is large. The fact that the extra code is there also bumps the executable size. + * + * It is the default, however, because it would be highly surprising (and hard to debug) if the + * default behavior failed to look up a field just because it was in the wrong order--and many + * APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order. + * + * Use find_field() if you are sure fields will be in order (or are willing to treat it as if the + * field wasn't there when they aren't). + * + * If you have multiple fields with a matching key ({"x": 1, "x": 1}) be mindful + * that only one field is returned. + * + * You must consume the fields on an object one at a time. A request for a new key + * invalidates previous field values: it makes them unsafe. The value instance you get + * from `content["bids"]` becomes invalid when you call `content["asks"]`. The array + * given by content["bids"].get_array() should not be accessed after you have called + * content["asks"].get_array(). You can detect such mistakes by first compiling and running + * the code in Debug mode (or with the macro `SIMDJSON_DEVELOPMENT_CHECKS` set to 1): an + * OUT_OF_ORDER_ITERATION error is generated. + * + * You are expected to access keys only once. You should access the value corresponding to a key + * a single time. Doing object["mykey"].to_string() and then again object["mykey"].to_string() is an error. + * + * @param key The key to look up. + * @returns The value of the field, or NO_SUCH_FIELD if the field is not in the object. + */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + /** @overload simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; */ + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + + /** + * Get the value associated with the given JSON pointer. We use the RFC 6901 + * https://tools.ietf.org/html/rfc6901 standard, interpreting the current node + * as the root of its own JSON document. + * + * ondemand::parser parser; + * auto json = R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("/foo/a/1") == 20 + * + * It is allowed for a key to be the empty string: + * + * ondemand::parser parser; + * auto json = R"({ "": { "a": [ 10, 20, 30 ] }})"_padded; + * auto doc = parser.iterate(json); + * doc.at_pointer("//a/1") == 20 + * + * Note that at_pointer() called on the document automatically calls the document's rewind + * method between each call. It invalidates all previously accessed arrays, objects and values + * that have not been consumed. Yet it is not the case when calling at_pointer on an object + * instance: there is no rewind and no invalidation. + * + * You may call at_pointer more than once on an object, but each time the pointer is advanced + * to be within the value matched by the key indicated by the JSON pointer query. Thus any preceding + * key (as well as the current key) can no longer be used with following JSON pointer calls. + * + * Also note that at_pointer() relies on find_field() which implies that we do not unescape keys when matching. + * + * @return The value associated with the given JSON pointer, or: + * - NO_SUCH_FIELD if a field does not exist in an object + * - INDEX_OUT_OF_BOUNDS if an array index is larger than an array length + * - INCORRECT_TYPE if a non-integer is used to access an array + * - INVALID_JSON_POINTER if the JSON pointer is invalid and cannot be parsed + */ + inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + + /** + * Reset the iterator so that we are pointing back at the + * beginning of the object. You should still consume values only once even if you + * can iterate through the object more than once. If you unescape a string within + * the object more than once, you have unsafe code. Note that rewinding an object + * means that you may need to reparse it anew: it is not a free operation. + * + * @returns true if the object contains some elements (not empty) + */ + inline simdjson_result reset() & noexcept; + /** + * This method scans the beginning of the object and checks whether the + * object is empty. + * The runtime complexity is constant time. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + */ + inline simdjson_result is_empty() & noexcept; + /** + * This method scans the object and counts the number of key-value pairs. + * The count_fields method should always be called before you have begun + * iterating through the object: it is expected that you are pointing at + * the beginning of the object. + * The runtime complexity is linear in the size of the object. After + * calling this function, if successful, the object is 'rewinded' at its + * beginning as if it had never been accessed. If the JSON is malformed (e.g., + * there is a missing comma), then an error is returned and it is no longer + * safe to continue. + * + * To check that an object is empty, it is more performant to use + * the is_empty() method. + * + * Performance hint: You should only call count_fields() as a last + * resort as it may require scanning the document twice or more. + */ + simdjson_inline simdjson_result count_fields() & noexcept; + /** + * Consumes the object and returns a string_view instance corresponding to the + * object as represented in JSON. It points inside the original byte array containing + * the JSON document. + */ + simdjson_inline simdjson_result raw_json() noexcept; + +protected: + /** + * Go to the end of the object, no matter where you are right now. + */ + simdjson_inline error_code consume() noexcept; + static simdjson_inline simdjson_result start(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result start_root(value_iterator &iter) noexcept; + static simdjson_inline simdjson_result started(value_iterator &iter) noexcept; + static simdjson_inline object resume(const value_iterator &iter) noexcept; + simdjson_inline object(const value_iterator &iter) noexcept; + + simdjson_warn_unused simdjson_inline error_code find_field_raw(const std::string_view key) noexcept; + + value_iterator iter{}; + + friend class value; + friend class document; + friend struct simdjson_result; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::object &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + simdjson_inline simdjson_result begin() noexcept; + simdjson_inline simdjson_result end() noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field(std::string_view key) && noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) & noexcept; + simdjson_inline simdjson_result find_field_unordered(std::string_view key) && noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) & noexcept; + simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; + simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; + inline simdjson_result reset() noexcept; + inline simdjson_result is_empty() noexcept; + inline simdjson_result count_fields() & noexcept; + inline simdjson_result raw_json() noexcept; + +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_H +/* end file simdjson/generic/ondemand/object.h for westmere */ +/* including simdjson/generic/ondemand/object_iterator.h for westmere: #include "simdjson/generic/ondemand/object_iterator.h" */ +/* begin file simdjson/generic/ondemand/object_iterator.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +class object_iterator { +public: + /** + * Create a new invalid object_iterator. + * + * Exists so you can declare a variable and later assign to it before use. + */ + simdjson_inline object_iterator() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + // MUST ONLY BE CALLED ONCE PER ITERATION. + simdjson_inline simdjson_result operator*() noexcept; + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const object_iterator &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const object_iterator &) const noexcept; + // Checks for ']' and ',' + simdjson_inline object_iterator &operator++() noexcept; + +private: + /** + * The underlying JSON iterator. + * + * PERF NOTE: expected to be elided in favor of the parent document: this is set when the object + * is first used, and never changes afterwards. + */ + value_iterator iter{}; + + simdjson_inline object_iterator(const value_iterator &iter) noexcept; + friend struct simdjson_result; + friend class object; +}; + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +template<> +struct simdjson_result : public westmere::implementation_simdjson_result_base { +public: + simdjson_inline simdjson_result(westmere::ondemand::object_iterator &&value) noexcept; ///< @private + simdjson_inline simdjson_result(error_code error) noexcept; ///< @private + simdjson_inline simdjson_result() noexcept = default; + + // + // Iterator interface + // + + // Reads key and value, yielding them to the user. + simdjson_inline simdjson_result operator*() noexcept; // MUST ONLY BE CALLED ONCE PER ITERATION. + // Assumes it's being compared with the end. true if depth < iter->depth. + simdjson_inline bool operator==(const simdjson_result &) const noexcept; + // Assumes it's being compared with the end. true if depth >= iter->depth. + simdjson_inline bool operator!=(const simdjson_result &) const noexcept; + // Checks for ']' and ',' + simdjson_inline simdjson_result &operator++() noexcept; +}; + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_H +/* end file simdjson/generic/ondemand/object_iterator.h for westmere */ +/* including simdjson/generic/ondemand/serialization.h for westmere: #include "simdjson/generic/ondemand/serialization.h" */ +/* begin file simdjson/generic/ondemand/serialization.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +/** + * Create a string-view instance out of a document instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(westmere::ondemand::document& x) noexcept; +/** + * Create a string-view instance out of a value instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. The value must + * not have been accessed previously. It does not + * validate the content. + */ +inline simdjson_result to_json_string(westmere::ondemand::value& x) noexcept; +/** + * Create a string-view instance out of an object instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(westmere::ondemand::object& x) noexcept; +/** + * Create a string-view instance out of an array instance. The string-view instance + * contains JSON text that is suitable to be parsed as JSON again. It does not + * validate the content. + */ +inline simdjson_result to_json_string(westmere::ondemand::array& x) noexcept; +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +inline simdjson_result to_json_string(simdjson_result x); +} // namespace simdjson + +/** + * We want to support argument-dependent lookup (ADL). + * Hence we should define operator<< in the namespace + * where the argument (here value, object, etc.) resides. + * Credit: @madhur4127 + * See https://github.com/simdjson/simdjson/issues/1768 + */ +namespace simdjson { namespace westmere { namespace ondemand { + +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The element. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::value x); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::array value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The array. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::document& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::document_reference& value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x); +#endif +/** + * Print JSON to an output stream. It does not + * validate the content. + * + * @param out The output stream. + * @param value The object. + * @throw if there is an error with the underlying output stream. simdjson itself will not throw. + */ +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::object value); +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x); +#endif +}}} // namespace simdjson::westmere::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H +/* end file simdjson/generic/ondemand/serialization.h for westmere */ + +// Inline definitions +/* including simdjson/generic/ondemand/array-inl.h for westmere: #include "simdjson/generic/ondemand/array-inl.h" */ +/* begin file simdjson/generic/ondemand/array-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter->depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the array is first found and the iterator is just past the `{`. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the `,` before the next value (or `]`). In this state, +// depth == iter->depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter->depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter->depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the array iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet element may be missing or not be an +// array--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter->depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between elements, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter->depth == depth, and at_start == false. +// +// ## Terminal State +// +// The terminal state has iter->depth < depth. at_start is always false. +// +// - Finished: When we have reached a `]` or have reported an error, we are finished. We signal this +// by decrementing depth. In this state, iter->depth < depth, at_start == false, and +// error == SUCCESS. +// + +simdjson_inline array::array(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result array::start(value_iterator &iter) noexcept { + // We don't need to know if the array is empty to start iteration, but we do want to know if there + // is an error--thus `simdjson_unused`. + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::start_root(value_iterator &iter) noexcept { + simdjson_unused bool has_value; + SIMDJSON_TRY( iter.start_root_array().get(has_value) ); + return array(iter); +} +simdjson_inline simdjson_result array::started(value_iterator &iter) noexcept { + bool has_value; + SIMDJSON_TRY(iter.started_array().get(has_value)); + return array(iter); +} + +simdjson_inline simdjson_result array::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return array_iterator(iter); +} +simdjson_inline simdjson_result array::end() noexcept { + return array_iterator(iter); +} +simdjson_inline error_code array::consume() noexcept { + auto error = iter.json_iter().skip_child(iter.depth()-1); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result array::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter._json_iter->unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline simdjson_result array::count_elements() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the array after counting the number of elements. + iter.reset_array(); + return count; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline simdjson_result array::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_array().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +inline simdjson_result array::reset() & noexcept { + return iter.reset_array(); +} + +inline simdjson_result array::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + // - means "the append position" or "the element after the end of the array" + // We don't support this, because we're returning a real element, not a position. + if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; } + + // Read the array index + size_t array_index = 0; + size_t i; + for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) { + uint8_t digit = uint8_t(json_pointer[i] - '0'); + // Check for non-digit in array index. If it's there, we're trying to get a field in an object + if (digit > 9) { return INCORRECT_TYPE; } + array_index = array_index*10 + digit; + } + + // 0 followed by other digits is invalid + if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0" + + // Empty string is invalid; so is a "/" with no digits before it + if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index" + // Get the child + auto child = at(array_index); + // If there is an error, it ends here + if(child.error()) { + return child; + } + + // If there is a /, we're not done yet, call recursively. + if (i < json_pointer.length()) { + child = child.at_pointer(json_pointer.substr(i)); + } + return child; +} + +simdjson_inline simdjson_result array::at(size_t index) noexcept { + size_t i = 0; + for (auto value : *this) { + if (i == index) { return value; } + i++; + } + return INDEX_OUT_OF_BOUNDS; +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + westmere::ondemand::array &&value +) noexcept + : implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept + : implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::is_empty() & noexcept { + if (error()) { return error(); } + return first.is_empty(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_INL_H +/* end file simdjson/generic/ondemand/array-inl.h for westmere */ +/* including simdjson/generic/ondemand/array_iterator-inl.h for westmere: #include "simdjson/generic/ondemand/array_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/array_iterator-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline array_iterator::array_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result array_iterator::operator*() noexcept { + if (iter.error()) { iter.abandon(); return iter.error(); } + return value(iter.child()); +} +simdjson_inline bool array_iterator::operator==(const array_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept { + return iter.is_open(); +} +simdjson_inline array_iterator &array_iterator::operator++() noexcept { + error_code error; + // PERF NOTE this is a safety rail ... users should exit loops as soon as they receive an error, so we'll never get here. + // However, it does not seem to make a perf difference, so we add it out of an abundance of caution. + if (( error = iter.error() )) { return *this; } + if (( error = iter.skip_child() )) { return *this; } + if (( error = iter.has_next_element().error() )) { return *this; } + return *this; +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + westmere::ondemand::array_iterator &&value +) noexcept + : westmere::implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : westmere::implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++(first); + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/array_iterator-inl.h for westmere */ +/* including simdjson/generic/ondemand/document-inl.h for westmere: #include "simdjson/generic/ondemand/document-inl.h" */ +/* begin file simdjson/generic/ondemand/document-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline document::document(ondemand::json_iterator &&_iter) noexcept + : iter{std::forward(_iter)} +{ + logger::log_start_value(iter, "document"); +} + +simdjson_inline document document::start(json_iterator &&iter) noexcept { + return document(std::forward(iter)); +} + +inline void document::rewind() noexcept { + iter.rewind(); +} + +inline std::string document::to_debug_string() noexcept { + return iter.to_string(); +} + +inline simdjson_result document::current_location() const noexcept { + return iter.current_location(); +} + +inline int32_t document::current_depth() const noexcept { + return iter.depth(); +} + +inline bool document::at_end() const noexcept { + return iter.at_end(); +} + + +inline bool document::is_alive() noexcept { + return iter.is_alive(); +} +simdjson_inline value_iterator document::resume_value_iterator() noexcept { + return value_iterator(&iter, 1, iter.root_position()); +} +simdjson_inline value_iterator document::get_root_value_iterator() noexcept { + return resume_value_iterator(); +} +simdjson_inline simdjson_result document::start_or_resume_object() noexcept { + if (iter.at_root()) { + return get_object(); + } else { + return object::resume(resume_value_iterator()); + } +} +simdjson_inline simdjson_result document::get_value() noexcept { + // Make sure we start any arrays or objects before returning, so that start_root_() + // gets called. + iter.assert_at_document_depth(); + switch (*iter.peek()) { + case '[': { + // The following lines check that the document ends with ]. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_array(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + case '{': { + // The following lines would check that the document ends with }. + auto value_iterator = get_root_value_iterator(); + auto error = value_iterator.check_root_object(); + if(error) { return error; } + return value(get_root_value_iterator()); + } + default: + // Unfortunately, scalar documents are a special case in simdjson and they cannot + // be safely converted to value instances. + return SCALAR_DOCUMENT_AS_VALUE; + } +} +simdjson_inline simdjson_result document::get_array() & noexcept { + auto value = get_root_value_iterator(); + return array::start_root(value); +} +simdjson_inline simdjson_result document::get_object() & noexcept { + auto value = get_root_value_iterator(); + return object::start_root(value); +} + +/** + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. We want to disallow trailing + * content. + * Thus, in several implementations below, we pass a 'true' parameter value to + * a get_root_value_iterator() method: this indicates that we disallow trailing content. + */ + +simdjson_inline simdjson_result document::get_uint64() noexcept { + return get_root_value_iterator().get_root_uint64(true); +} +simdjson_inline simdjson_result document::get_uint64_in_string() noexcept { + return get_root_value_iterator().get_root_uint64_in_string(true); +} +simdjson_inline simdjson_result document::get_int64() noexcept { + return get_root_value_iterator().get_root_int64(true); +} +simdjson_inline simdjson_result document::get_int64_in_string() noexcept { + return get_root_value_iterator().get_root_int64_in_string(true); +} +simdjson_inline simdjson_result document::get_double() noexcept { + return get_root_value_iterator().get_root_double(true); +} +simdjson_inline simdjson_result document::get_double_in_string() noexcept { + return get_root_value_iterator().get_root_double_in_string(true); +} +simdjson_inline simdjson_result document::get_string(bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(true, allow_replacement); +} +template +simdjson_inline error_code document::get_string(string_type& receiver, bool allow_replacement) noexcept { + return get_root_value_iterator().get_root_string(receiver, true, allow_replacement); +} +simdjson_inline simdjson_result document::get_wobbly_string() noexcept { + return get_root_value_iterator().get_root_wobbly_string(true); +} +simdjson_inline simdjson_result document::get_raw_json_string() noexcept { + return get_root_value_iterator().get_root_raw_json_string(true); +} +simdjson_inline simdjson_result document::get_bool() noexcept { + return get_root_value_iterator().get_root_bool(true); +} +simdjson_inline simdjson_result document::is_null() noexcept { + return get_root_value_iterator().is_root_null(true); +} + +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_array(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_object(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_double(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_bool(); } +template<> simdjson_inline simdjson_result document::get() & noexcept { return get_value(); } + +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_double(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_uint64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_int64(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return std::forward(*this).get_bool(); } +template<> simdjson_inline simdjson_result document::get() && noexcept { return get_value(); } + +template simdjson_inline error_code document::get(T &out) & noexcept { + return get().get(out); +} +template simdjson_inline error_code document::get(T &out) && noexcept { + return std::forward(*this).get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document::operator array() & noexcept(false) { return get_array(); } +simdjson_inline document::operator object() & noexcept(false) { return get_object(); } +simdjson_inline document::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document::operator double() noexcept(false) { return get_double(); } +simdjson_inline document::operator std::string_view() noexcept(false) { return get_string(false); } +simdjson_inline document::operator raw_json_string() noexcept(false) { return get_raw_json_string(); } +simdjson_inline document::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document::operator value() noexcept(false) { return get_value(); } + +#endif +simdjson_inline simdjson_result document::count_elements() & noexcept { + auto a = get_array(); + simdjson_result answer = a.count_elements(); + /* If there was an array, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::count_fields() & noexcept { + auto a = get_object(); + simdjson_result answer = a.count_fields(); + /* If there was an object, we are now left pointing at its first element. */ + if(answer.error() == SUCCESS) { rewind(); } + return answer; +} +simdjson_inline simdjson_result document::at(size_t index) & noexcept { + auto a = get_array(); + return a.at(index); +} +simdjson_inline simdjson_result document::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result document::end() & noexcept { + return {}; +} + +simdjson_inline simdjson_result document::find_field(std::string_view key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field(const char *key) & noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result document::find_field_unordered(std::string_view key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::find_field_unordered(const char *key) & noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result document::operator[](std::string_view key) & noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result document::operator[](const char *key) & noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline error_code document::consume() noexcept { + auto error = iter.skip_child(0); + if(error) { iter.abandon(); } + return error; +} + +simdjson_inline simdjson_result document::raw_json() noexcept { + auto _iter = get_root_value_iterator(); + const uint8_t * starting_point{_iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + // After 'consume()', we could be left pointing just beyond the document, but that + // is ok because we are not going to dereference the final pointer position, we just + // use it to compute the length in bytes. + const uint8_t * final_point{iter.unsafe_pointer()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result document::type() noexcept { + return get_root_value_iterator().type(); +} + +simdjson_inline simdjson_result document::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool document::is_negative() noexcept { + return get_root_value_iterator().is_root_negative(); +} + +simdjson_inline simdjson_result document::is_integer() noexcept { + return get_root_value_iterator().is_root_integer(true); +} + +simdjson_inline simdjson_result document::get_number_type() noexcept { + return get_root_value_iterator().get_root_number_type(true); +} + +simdjson_inline simdjson_result document::get_number() noexcept { + return get_root_value_iterator().get_root_number(true); +} + + +simdjson_inline simdjson_result document::raw_json_token() noexcept { + auto _iter = get_root_value_iterator(); + return std::string_view(reinterpret_cast(_iter.peek_start()), _iter.peek_start_length()); +} + +simdjson_inline simdjson_result document::at_pointer(std::string_view json_pointer) noexcept { + rewind(); // Rewind the document each time at_pointer is called + if (json_pointer.empty()) { + return this->get_value(); + } + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + westmere::ondemand::document &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base( + error + ) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template +simdjson_inline simdjson_result simdjson_result::get() & noexcept { + if (error()) { return error(); } + return first.get(); +} +template +simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first).get(); +} +template +simdjson_inline error_code simdjson_result::get(T &out) & noexcept { + if (error()) { return error(); } + return first.get(out); +} +template +simdjson_inline error_code simdjson_result::get(T &out) && noexcept { + if (error()) { return error(); } + return std::forward(first).get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() & noexcept = delete; +template<> simdjson_inline simdjson_result simdjson_result::get() && noexcept { + if (error()) { return error(); } + return std::forward(first); +} +template<> simdjson_inline error_code simdjson_result::get(westmere::ondemand::document &out) & noexcept = delete; +template<> simdjson_inline error_code simdjson_result::get(westmere::ondemand::document &out) && noexcept { + if (error()) { return error(); } + out = std::forward(first); + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} + +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} + + +simdjson_inline bool simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} + +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} + +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} + +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} + + +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator westmere::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline bool simdjson_result::at_end() const noexcept { + if (error()) { return error(); } + return first.at_end(); +} + + +simdjson_inline int32_t simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline document_reference::document_reference() noexcept : doc{nullptr} {} +simdjson_inline document_reference::document_reference(document &d) noexcept : doc(&d) {} +simdjson_inline void document_reference::rewind() noexcept { doc->rewind(); } +simdjson_inline simdjson_result document_reference::get_array() & noexcept { return doc->get_array(); } +simdjson_inline simdjson_result document_reference::get_object() & noexcept { return doc->get_object(); } +/** + * The document_reference instances are used primarily/solely for streams of JSON + * documents. + * We decided that calling 'get_double()' on the JSON document '1.233 blabla' should + * give an error, so we check for trailing content. + * + * However, for streams of JSON documents, we want to be able to start from + * "321" "321" "321" + * and parse it successfully as a stream of JSON documents, calling get_uint64_in_string() + * successfully each time. + * + * To achieve this result, we pass a 'false' to a get_root_value_iterator() method: + * this indicates that we allow trailing content. + */ +simdjson_inline simdjson_result document_reference::get_uint64() noexcept { return doc->get_root_value_iterator().get_root_uint64(false); } +simdjson_inline simdjson_result document_reference::get_uint64_in_string() noexcept { return doc->get_root_value_iterator().get_root_uint64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_int64() noexcept { return doc->get_root_value_iterator().get_root_int64(false); } +simdjson_inline simdjson_result document_reference::get_int64_in_string() noexcept { return doc->get_root_value_iterator().get_root_int64_in_string(false); } +simdjson_inline simdjson_result document_reference::get_double() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_double_in_string() noexcept { return doc->get_root_value_iterator().get_root_double(false); } +simdjson_inline simdjson_result document_reference::get_string(bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(false, allow_replacement); } +template +simdjson_inline error_code document_reference::get_string(string_type& receiver, bool allow_replacement) noexcept { return doc->get_root_value_iterator().get_root_string(receiver, false, allow_replacement); } +simdjson_inline simdjson_result document_reference::get_wobbly_string() noexcept { return doc->get_root_value_iterator().get_root_wobbly_string(false); } +simdjson_inline simdjson_result document_reference::get_raw_json_string() noexcept { return doc->get_root_value_iterator().get_root_raw_json_string(false); } +simdjson_inline simdjson_result document_reference::get_bool() noexcept { return doc->get_root_value_iterator().get_root_bool(false); } +simdjson_inline simdjson_result document_reference::get_value() noexcept { return doc->get_value(); } +simdjson_inline simdjson_result document_reference::is_null() noexcept { return doc->get_root_value_iterator().is_root_null(false); } + +#if SIMDJSON_EXCEPTIONS +simdjson_inline document_reference::operator array() & noexcept(false) { return array(*doc); } +simdjson_inline document_reference::operator object() & noexcept(false) { return object(*doc); } +simdjson_inline document_reference::operator uint64_t() noexcept(false) { return get_uint64(); } +simdjson_inline document_reference::operator int64_t() noexcept(false) { return get_int64(); } +simdjson_inline document_reference::operator double() noexcept(false) { return get_double(); } +simdjson_inline document_reference::operator std::string_view() noexcept(false) { return std::string_view(*doc); } +simdjson_inline document_reference::operator raw_json_string() noexcept(false) { return raw_json_string(*doc); } +simdjson_inline document_reference::operator bool() noexcept(false) { return get_bool(); } +simdjson_inline document_reference::operator value() noexcept(false) { return value(*doc); } +#endif +simdjson_inline simdjson_result document_reference::count_elements() & noexcept { return doc->count_elements(); } +simdjson_inline simdjson_result document_reference::count_fields() & noexcept { return doc->count_fields(); } +simdjson_inline simdjson_result document_reference::at(size_t index) & noexcept { return doc->at(index); } +simdjson_inline simdjson_result document_reference::begin() & noexcept { return doc->begin(); } +simdjson_inline simdjson_result document_reference::end() & noexcept { return doc->end(); } +simdjson_inline simdjson_result document_reference::find_field(std::string_view key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::find_field(const char *key) & noexcept { return doc->find_field(key); } +simdjson_inline simdjson_result document_reference::operator[](std::string_view key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::operator[](const char *key) & noexcept { return (*doc)[key]; } +simdjson_inline simdjson_result document_reference::find_field_unordered(std::string_view key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::find_field_unordered(const char *key) & noexcept { return doc->find_field_unordered(key); } +simdjson_inline simdjson_result document_reference::type() noexcept { return doc->type(); } +simdjson_inline simdjson_result document_reference::is_scalar() noexcept { return doc->is_scalar(); } +simdjson_inline simdjson_result document_reference::current_location() noexcept { return doc->current_location(); } +simdjson_inline int32_t document_reference::current_depth() const noexcept { return doc->current_depth(); } +simdjson_inline bool document_reference::is_negative() noexcept { return doc->is_negative(); } +simdjson_inline simdjson_result document_reference::is_integer() noexcept { return doc->get_root_value_iterator().is_root_integer(false); } +simdjson_inline simdjson_result document_reference::get_number_type() noexcept { return doc->get_root_value_iterator().get_root_number_type(false); } +simdjson_inline simdjson_result document_reference::get_number() noexcept { return doc->get_root_value_iterator().get_root_number(false); } +simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } +simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } +simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} +simdjson_inline document_reference::operator document&() const noexcept { return *doc; } + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + + + +namespace simdjson { +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::document_reference value, error_code error) + noexcept : implementation_simdjson_result_base(std::forward(value), error) {} + + +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) & noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline error_code simdjson_result::rewind() noexcept { + if (error()) { return error(); } + first.rewind(); + return SUCCESS; +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::get_array() & noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() & noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::get_value() noexcept { + if (error()) { return error(); } + return first.get_value(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator westmere::ondemand::array() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::object() & noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::value() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_INL_H +/* end file simdjson/generic/ondemand/document-inl.h for westmere */ +/* including simdjson/generic/ondemand/document_stream-inl.h for westmere: #include "simdjson/generic/ondemand/document_stream-inl.h" */ +/* begin file simdjson/generic/ondemand/document_stream-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace westmere { +namespace ondemand { + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void stage1_worker::finish() { + // After calling "run" someone would call finish() to wait + // for the end of the processing. + // This function will wait until either the thread has done + // the processing or, else, the destructor has been called. + std::unique_lock lock(locking_mutex); + cond_var.wait(lock, [this]{return has_work == false;}); +} + +inline stage1_worker::~stage1_worker() { + // The thread may never outlive the stage1_worker instance + // and will always be stopped/joined before the stage1_worker + // instance is gone. + stop_thread(); +} + +inline void stage1_worker::start_thread() { + std::unique_lock lock(locking_mutex); + if(thread.joinable()) { + return; // This should never happen but we never want to create more than one thread. + } + thread = std::thread([this]{ + while(true) { + std::unique_lock thread_lock(locking_mutex); + // We wait for either "run" or "stop_thread" to be called. + cond_var.wait(thread_lock, [this]{return has_work || !can_work;}); + // If, for some reason, the stop_thread() method was called (i.e., the + // destructor of stage1_worker is called, then we want to immediately destroy + // the thread (and not do any more processing). + if(!can_work) { + break; + } + this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser, + this->_next_batch_start); + this->has_work = false; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify "finish" + thread_lock.unlock(); + } + } + ); +} + + +inline void stage1_worker::stop_thread() { + std::unique_lock lock(locking_mutex); + // We have to make sure that all locks can be released. + can_work = false; + has_work = false; + cond_var.notify_all(); + lock.unlock(); + if(thread.joinable()) { + thread.join(); + } +} + +inline void stage1_worker::run(document_stream * ds, parser * stage1, size_t next_batch_start) { + std::unique_lock lock(locking_mutex); + owner = ds; + _next_batch_start = next_batch_start; + stage1_thread_parser = stage1; + has_work = true; + // The condition variable call should be moved after thread_lock.unlock() for performance + // reasons but thread sanitizers may report it as a data race if we do. + // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock + cond_var.notify_one(); // will notify the thread lock that we have work + lock.unlock(); +} + +#endif // SIMDJSON_THREADS_ENABLED + +simdjson_inline document_stream::document_stream( + ondemand::parser &_parser, + const uint8_t *_buf, + size_t _len, + size_t _batch_size, + bool _allow_comma_separated +) noexcept + : parser{&_parser}, + buf{_buf}, + len{_len}, + batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size}, + allow_comma_separated{_allow_comma_separated}, + error{SUCCESS} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change + #endif +{ +#ifdef SIMDJSON_THREADS_ENABLED + if(worker.get() == nullptr) { + error = MEMALLOC; + } +#endif +} + +simdjson_inline document_stream::document_stream() noexcept + : parser{nullptr}, + buf{nullptr}, + len{0}, + batch_size{0}, + allow_comma_separated{false}, + error{UNINITIALIZED} + #ifdef SIMDJSON_THREADS_ENABLED + , use_thread(false) + #endif +{ +} + +simdjson_inline document_stream::~document_stream() noexcept +{ + #ifdef SIMDJSON_THREADS_ENABLED + worker.reset(); + #endif +} + +inline size_t document_stream::size_in_bytes() const noexcept { + return len; +} + +inline size_t document_stream::truncated_bytes() const noexcept { + if(error == CAPACITY) { return len - batch_start; } + return parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] - parser->implementation->structural_indexes[parser->implementation->n_structural_indexes + 1]; +} + +simdjson_inline document_stream::iterator::iterator() noexcept + : stream{nullptr}, finished{true} { +} + +simdjson_inline document_stream::iterator::iterator(document_stream* _stream, bool is_end) noexcept + : stream{_stream}, finished{is_end} { +} + +simdjson_inline simdjson_result document_stream::iterator::operator*() noexcept { + //if(stream->error) { return stream->error; } + return simdjson_result(stream->doc, stream->error); +} + +simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept { + // If there is an error, then we want the iterator + // to be finished, no matter what. (E.g., we do not + // keep generating documents with errors, or go beyond + // a document with errors.) + // + // Users do not have to call "operator*()" when they use operator++, + // so we need to end the stream in the operator++ function. + // + // Note that setting finished = true is essential otherwise + // we would enter an infinite loop. + if (stream->error) { finished = true; } + // Note that stream->error() is guarded against error conditions + // (it will immediately return if stream->error casts to false). + // In effect, this next function does nothing when (stream->error) + // is true (hence the risk of an infinite loop). + stream->next(); + // If that was the last document, we're finished. + // It is the only type of error we do not want to appear + // in operator*. + if (stream->error == EMPTY) { finished = true; } + // If we had any other kind of error (not EMPTY) then we want + // to pass it along to the operator* and we cannot mark the result + // as "finished" just yet. + return *this; +} + +simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept { + return finished != other.finished; +} + +simdjson_inline document_stream::iterator document_stream::begin() noexcept { + start(); + // If there are no documents, we're finished. + return iterator(this, error == EMPTY); +} + +simdjson_inline document_stream::iterator document_stream::end() noexcept { + return iterator(this, true); +} + +inline void document_stream::start() noexcept { + if (error) { return; } + error = parser->allocate(batch_size); + if (error) { return; } + // Always run the first stage 1 parse immediately + batch_start = 0; + error = run_stage1(*parser, batch_start); + while(error == EMPTY) { + // In exceptional cases, we may start with an empty block + batch_start = next_batch_start(); + if (batch_start >= len) { return; } + error = run_stage1(*parser, batch_start); + } + if (error) { return; } + doc_index = batch_start; + doc = document(json_iterator(&buf[batch_start], parser)); + doc.iter._streaming = true; + + #ifdef SIMDJSON_THREADS_ENABLED + if (use_thread && next_batch_start() < len) { + // Kick off the first thread on next batch if needed + error = stage1_thread_parser.allocate(batch_size); + if (error) { return; } + worker->start_thread(); + start_stage1_thread(); + if (error) { return; } + } + #endif // SIMDJSON_THREADS_ENABLED +} + +inline void document_stream::next() noexcept { + // We always enter at once once in an error condition. + if (error) { return; } + next_document(); + if (error) { return; } + auto cur_struct_index = doc.iter._root - parser->implementation->structural_indexes.get(); + doc_index = batch_start + parser->implementation->structural_indexes[cur_struct_index]; + + // Check if at end of structural indexes (i.e. at end of batch) + if(cur_struct_index >= static_cast(parser->implementation->n_structural_indexes)) { + error = EMPTY; + // Load another batch (if available) + while (error == EMPTY) { + batch_start = next_batch_start(); + if (batch_start >= len) { break; } + #ifdef SIMDJSON_THREADS_ENABLED + if(use_thread) { + load_from_stage1_thread(); + } else { + error = run_stage1(*parser, batch_start); + } + #else + error = run_stage1(*parser, batch_start); + #endif + /** + * Whenever we move to another window, we need to update all pointers to make + * it appear as if the input buffer started at the beginning of the window. + * + * Take this input: + * + * {"z":5} {"1":1,"2":2,"4":4} [7, 10, 9] [15, 11, 12, 13] [154, 110, 112, 1311] + * + * Say you process the following window... + * + * '{"z":5} {"1":1,"2":2,"4":4} [7, 10, 9]' + * + * When you do so, the json_iterator has a pointer at the beginning of the memory region + * (pointing at the beginning of '{"z"...'. + * + * When you move to the window that starts at... + * + * '[7, 10, 9] [15, 11, 12, 13] ... + * + * then it is not sufficient to just run stage 1. You also need to re-anchor the + * json_iterator so that it believes we are starting at '[7, 10, 9]...'. + * + * Under the DOM front-end, this gets done automatically because the parser owns + * the pointer the data, and when you call stage1 and then stage2 on the same + * parser, then stage2 will run on the pointer acquired by stage1. + * + * That is, stage1 calls "this->buf = _buf" so the parser remembers the buffer that + * we used. But json_iterator has no callback when stage1 is called on the parser. + * In fact, I think that the parser is unaware of json_iterator. + * + * + * So we need to re-anchor the json_iterator after each call to stage 1 so that + * all of the pointers are in sync. + */ + doc.iter = json_iterator(&buf[batch_start], parser); + doc.iter._streaming = true; + /** + * End of resync. + */ + + if (error) { continue; } // If the error was EMPTY, we may want to load another batch. + doc_index = batch_start; + } + } +} + +inline void document_stream::next_document() noexcept { + // Go to next place where depth=0 (document depth) + error = doc.iter.skip_child(0); + if (error) { return; } + // Always set depth=1 at the start of document + doc.iter._depth = 1; + // consume comma if comma separated is allowed + if (allow_comma_separated) { doc.iter.consume_character(','); } + // Resets the string buffer at the beginning, thus invalidating the strings. + doc.iter._string_buf_loc = parser->string_buf.get(); + doc.iter._root = doc.iter.position(); +} + +inline size_t document_stream::next_batch_start() const noexcept { + return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes]; +} + +inline error_code document_stream::run_stage1(ondemand::parser &p, size_t _batch_start) noexcept { + // This code only updates the structural index in the parser, it does not update any json_iterator + // instance. + size_t remaining = len - _batch_start; + if (remaining <= batch_size) { + return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final); + } else { + return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial); + } +} + +simdjson_inline size_t document_stream::iterator::current_index() const noexcept { + return stream->doc_index; +} + +simdjson_inline std::string_view document_stream::iterator::source() const noexcept { + auto depth = stream->doc.iter.depth(); + auto cur_struct_index = stream->doc.iter._root - stream->parser->implementation->structural_indexes.get(); + + // If at root, process the first token to determine if scalar value + if (stream->doc.iter.at_root()) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': // Depth=1 already at start of document + break; + case '}': case ']': + depth--; + break; + default: // Scalar value document + // TODO: Remove any trailing whitespaces + // This returns a string spanning from start of value to the beginning of the next document (excluded) + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[++cur_struct_index] - current_index() - 1); + } + cur_struct_index++; + } + + while (cur_struct_index <= static_cast(stream->parser->implementation->n_structural_indexes)) { + switch (stream->buf[stream->batch_start + stream->parser->implementation->structural_indexes[cur_struct_index]]) { + case '{': case '[': + depth++; + break; + case '}': case ']': + depth--; + break; + } + if (depth == 0) { break; } + cur_struct_index++; + } + + return std::string_view(reinterpret_cast(stream->buf) + current_index(), stream->parser->implementation->structural_indexes[cur_struct_index] - current_index() + stream->batch_start + 1);; +} + +inline error_code document_stream::iterator::error() const noexcept { + return stream->error; +} + +#ifdef SIMDJSON_THREADS_ENABLED + +inline void document_stream::load_from_stage1_thread() noexcept { + worker->finish(); + // Swap to the parser that was loaded up in the thread. Make sure the parser has + // enough memory to swap to, as well. + std::swap(stage1_thread_parser,*parser); + error = stage1_thread_error; + if (error) { return; } + + // If there's anything left, start the stage 1 thread! + if (next_batch_start() < len) { + start_stage1_thread(); + } +} + +inline void document_stream::start_stage1_thread() noexcept { + // we call the thread on a lambda that will update + // this->stage1_thread_error + // there is only one thread that may write to this value + // TODO this is NOT exception-safe. + this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error + size_t _next_batch_start = this->next_batch_start(); + + worker->run(this, & this->stage1_thread_parser, _next_batch_start); +} + +#endif // SIMDJSON_THREADS_ENABLED + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result::simdjson_result( + westmere::ondemand::document_stream &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} + +} + +#endif // SIMDJSON_GENERIC_ONDEMAND_DOCUMENT_STREAM_INL_H +/* end file simdjson/generic/ondemand/document_stream-inl.h for westmere */ +/* including simdjson/generic/ondemand/field-inl.h for westmere: #include "simdjson/generic/ondemand/field-inl.h" */ +/* begin file simdjson/generic/ondemand/field-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +// clang 6 doesn't think the default constructor can be noexcept, so we make it explicit +simdjson_inline field::field() noexcept : std::pair() {} + +simdjson_inline field::field(raw_json_string key, ondemand::value &&value) noexcept + : std::pair(key, std::forward(value)) +{ +} + +simdjson_inline simdjson_result field::start(value_iterator &parent_iter) noexcept { + raw_json_string key; + SIMDJSON_TRY( parent_iter.field_key().get(key) ); + SIMDJSON_TRY( parent_iter.field_value() ); + return field::start(parent_iter, key); +} + +simdjson_inline simdjson_result field::start(const value_iterator &parent_iter, raw_json_string key) noexcept { + return field(key, parent_iter.child()); +} + +simdjson_inline simdjson_warn_unused simdjson_result field::unescaped_key(bool allow_replacement) noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() but Visual Studio won't let us. + simdjson_result answer = first.unescape(second.iter.json_iter(), allow_replacement); + first.consume(); + return answer; +} + +simdjson_inline raw_json_string field::key() const noexcept { + SIMDJSON_ASSUME(first.buf != nullptr); // We would like to call .alive() by Visual Studio won't let us. + return first; +} + +simdjson_inline value &field::value() & noexcept { + return second; +} + +simdjson_inline value field::value() && noexcept { + return std::forward(*this).second; +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + westmere::ondemand::field &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} + +simdjson_inline simdjson_result simdjson_result::key() noexcept { + if (error()) { return error(); } + return first.key(); +} +simdjson_inline simdjson_result simdjson_result::unescaped_key(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.unescaped_key(allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::value() noexcept { + if (error()) { return error(); } + return std::move(first.value()); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_FIELD_INL_H +/* end file simdjson/generic/ondemand/field-inl.h for westmere */ +/* including simdjson/generic/ondemand/json_iterator-inl.h for westmere: #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/json_iterator-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline json_iterator::json_iterator(json_iterator &&other) noexcept + : token(std::forward(other.token)), + parser{other.parser}, + _string_buf_loc{other._string_buf_loc}, + error{other.error}, + _depth{other._depth}, + _root{other._root}, + _streaming{other._streaming} +{ + other.parser = nullptr; +} +simdjson_inline json_iterator &json_iterator::operator=(json_iterator &&other) noexcept { + token = other.token; + parser = other.parser; + _string_buf_loc = other._string_buf_loc; + error = other.error; + _depth = other._depth; + _root = other._root; + _streaming = other._streaming; + other.parser = nullptr; + return *this; +} + +simdjson_inline json_iterator::json_iterator(const uint8_t *buf, ondemand::parser *_parser) noexcept + : token(buf, &_parser->implementation->structural_indexes[0]), + parser{_parser}, + _string_buf_loc{parser->string_buf.get()}, + _depth{1}, + _root{parser->implementation->structural_indexes.get()}, + _streaming{false} + +{ + logger::log_headers(); +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif +} + +inline void json_iterator::rewind() noexcept { + token.set_position( root_position() ); + logger::log_headers(); // We start again + _string_buf_loc = parser->string_buf.get(); + _depth = 1; +} + +inline bool json_iterator::balanced() const noexcept { + token_iterator ti(token); + int32_t count{0}; + ti.set_position( root_position() ); + while(ti.peek() <= peek_last()) { + switch (*ti.return_current_and_advance()) + { + case '[': case '{': + count++; + break; + case ']': case '}': + count--; + break; + default: + break; + } + } + return count == 0; +} + + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and parent_depth, which is a desired effect. The warning does not show up if the +// skip_child() function is not marked inline). +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept { + if (depth() <= parent_depth) { return SUCCESS; } + switch (*return_current_and_advance()) { + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + + // For the first open array/object in a value, we've already incremented depth, so keep it the same + // We never stop at colon, but if we did, it wouldn't affect depth + case '[': case '{': case ':': + logger::log_start_value(*this, "skip"); + break; + // If there is a comma, we have just finished a value in an array/object, and need to get back in + case ',': + logger::log_value(*this, "skip"); + break; + // ] or } means we just finished a value and need to jump out of the array/object + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } +#if SIMDJSON_CHECK_EOF + // If there are no more tokens, the parent is incomplete. + if (at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "Missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + break; + case '"': + if(*peek() == ':') { + // We are at a key!!! + // This might happen if you just started an object and you skip it immediately. + // Performance note: it would be nice to get rid of this check as it is somewhat + // expensive. + // https://github.com/simdjson/simdjson/issues/1742 + logger::log_value(*this, "key"); + return_current_and_advance(); // eat up the ':' + break; // important!!! + } + simdjson_fallthrough; + // Anything else must be a scalar value + default: + // For the first scalar, we will have incremented depth already, so we decrement it here. + logger::log_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + } + + // Now that we've considered the first value, we only increment/decrement for arrays/objects + while (position() < end_position()) { + switch (*return_current_and_advance()) { + case '[': case '{': + logger::log_start_value(*this, "skip"); + _depth++; + break; + // TODO consider whether matching braces is a requirement: if non-matching braces indicates + // *missing* braces, then future lookups are not in the object/arrays they think they are, + // violating the rule "validate enough structure that the user can be confident they are + // looking at the right values." + // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth + case ']': case '}': + logger::log_end_value(*this, "skip"); + _depth--; + if (depth() <= parent_depth) { return SUCCESS; } + break; + default: + logger::log_value(*this, "skip", ""); + break; + } + } + + return report_error(TAPE_ERROR, "not enough close braces"); +} + +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool json_iterator::at_root() const noexcept { + return position() == root_position(); +} + +simdjson_inline bool json_iterator::is_single_token() const noexcept { + return parser->implementation->n_structural_indexes == 1; +} + +simdjson_inline bool json_iterator::streaming() const noexcept { + return _streaming; +} + +simdjson_inline token_position json_iterator::root_position() const noexcept { + return _root; +} + +simdjson_inline void json_iterator::assert_at_document_depth() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +} + +simdjson_inline void json_iterator::assert_at_root() const noexcept { + SIMDJSON_ASSUME( _depth == 1 ); +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + // Under Visual Studio, the next SIMDJSON_ASSUME fails with: the argument + // has side effects that will be discarded. + SIMDJSON_ASSUME( token.position() == _root ); +#endif +} + +simdjson_inline void json_iterator::assert_more_tokens(uint32_t required_tokens) const noexcept { + assert_valid_position(token._position + required_tokens - 1); +} + +simdjson_inline void json_iterator::assert_valid_position(token_position position) const noexcept { +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME( position >= &parser->implementation->structural_indexes[0] ); + SIMDJSON_ASSUME( position < &parser->implementation->structural_indexes[parser->implementation->n_structural_indexes] ); +#endif +} + +simdjson_inline bool json_iterator::at_end() const noexcept { + return position() == end_position(); +} +simdjson_inline token_position json_iterator::end_position() const noexcept { + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + return &parser->implementation->structural_indexes[n_structural_indexes]; +} + +inline std::string json_iterator::to_string() const noexcept { + if( !is_alive() ) { return "dead json_iterator instance"; } + const char * current_structural = reinterpret_cast(token.peek()); + return std::string("json_iterator [ depth : ") + std::to_string(_depth) + + std::string(", structural : '") + std::string(current_structural,1) + + std::string("', offset : ") + std::to_string(token.current_offset()) + + std::string("', error : ") + error_message(error) + + std::string(" ]"); +} + +inline simdjson_result json_iterator::current_location() const noexcept { + if (!is_alive()) { // Unrecoverable error + if (!at_root()) { + return reinterpret_cast(token.peek(-1)); + } else { + return reinterpret_cast(token.peek()); + } + } + if (at_end()) { + return OUT_OF_BOUNDS; + } + return reinterpret_cast(token.peek()); +} + +simdjson_inline bool json_iterator::is_alive() const noexcept { + return parser; +} + +simdjson_inline void json_iterator::abandon() noexcept { + parser = nullptr; + _depth = 0; +} + +simdjson_inline const uint8_t *json_iterator::return_current_and_advance() noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(); +#endif // SIMDJSON_CHECK_EOF + return token.return_current_and_advance(); +} + +simdjson_inline const uint8_t *json_iterator::unsafe_pointer() const noexcept { + // deliberately done without safety guard: + return token.peek(); +} + +simdjson_inline const uint8_t *json_iterator::peek(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // SIMDJSON_CHECK_EOF + return token.peek(delta); +} + +simdjson_inline uint32_t json_iterator::peek_length(int32_t delta) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_more_tokens(delta+1); +#endif // #if SIMDJSON_CHECK_EOF + return token.peek_length(delta); +} + +simdjson_inline const uint8_t *json_iterator::peek(token_position position) const noexcept { + // todo: currently we require end-of-string buffering, but the following + // assert_valid_position should be turned on if/when we lift that condition. + // assert_valid_position(position); + // This is almost surely related to SIMDJSON_CHECK_EOF but given that SIMDJSON_CHECK_EOF + // is ON by default, we have no choice but to disable it for real with a comment. + return token.peek(position); +} + +simdjson_inline uint32_t json_iterator::peek_length(token_position position) const noexcept { +#if SIMDJSON_CHECK_EOF + assert_valid_position(position); +#endif // SIMDJSON_CHECK_EOF + return token.peek_length(position); +} + +simdjson_inline token_position json_iterator::last_position() const noexcept { + // The following line fails under some compilers... + // SIMDJSON_ASSUME(parser->implementation->n_structural_indexes > 0); + // since it has side-effects. + uint32_t n_structural_indexes{parser->implementation->n_structural_indexes}; + SIMDJSON_ASSUME(n_structural_indexes > 0); + return &parser->implementation->structural_indexes[n_structural_indexes - 1]; +} +simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept { + return token.peek(last_position()); +} + +simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept { + SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1); + SIMDJSON_ASSUME(_depth == parent_depth + 1); + _depth = parent_depth; +} + +simdjson_inline void json_iterator::descend_to(depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); + _depth = child_depth; +} + +simdjson_inline depth_t json_iterator::depth() const noexcept { + return _depth; +} + +simdjson_inline uint8_t *&json_iterator::string_buf_loc() noexcept { + return _string_buf_loc; +} + +simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD); + logger::log_error(*this, message); + error = _error; + return error; +} + +simdjson_inline token_position json_iterator::position() const noexcept { + return token.position(); +} + +simdjson_inline simdjson_result json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept { + return parser->unescape(in, _string_buf_loc, allow_replacement); +} + +simdjson_inline simdjson_result json_iterator::unescape_wobbly(raw_json_string in) noexcept { + return parser->unescape_wobbly(in, _string_buf_loc); +} + +simdjson_inline void json_iterator::reenter_child(token_position position, depth_t child_depth) noexcept { + SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX); + SIMDJSON_ASSUME(_depth == child_depth - 1); +#if SIMDJSON_DEVELOPMENT_CHECKS +#ifndef SIMDJSON_CLANG_VISUAL_STUDIO + SIMDJSON_ASSUME(size_t(child_depth) < parser->max_depth()); + SIMDJSON_ASSUME(position >= parser->start_positions[child_depth]); +#endif +#endif + token.set_position(position); + _depth = child_depth; +} + +simdjson_inline error_code json_iterator::consume_character(char c) noexcept { + if (*peek() == c) { + return_current_and_advance(); + return SUCCESS; + } + return TAPE_ERROR; +} + +#if SIMDJSON_DEVELOPMENT_CHECKS + +simdjson_inline token_position json_iterator::start_position(depth_t depth) const noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + return size_t(depth) < parser->max_depth() ? parser->start_positions[depth] : 0; +} + +simdjson_inline void json_iterator::set_start_position(depth_t depth, token_position position) noexcept { + SIMDJSON_ASSUME(size_t(depth) < parser->max_depth()); + if(size_t(depth) < parser->max_depth()) { parser->start_positions[depth] = position; } +} + +#endif + + +simdjson_inline error_code json_iterator::optional_error(error_code _error, const char *message) noexcept { + SIMDJSON_ASSUME(_error == INCORRECT_TYPE || _error == NO_SUCH_FIELD); + logger::log_error(*this, message); + return _error; +} + + +simdjson_warn_unused simdjson_inline bool json_iterator::copy_to_buffer(const uint8_t *json, uint32_t max_len, uint8_t *tmpbuf, size_t N) noexcept { + // This function is not expected to be called in performance-sensitive settings. + // Let us guard against silly cases: + if((N < max_len) || (N == 0)) { return false; } + // Copy to the buffer. + std::memcpy(tmpbuf, json, max_len); + if(N > max_len) { // We pad whatever remains with ' '. + std::memset(tmpbuf + max_len, ' ', N - max_len); + } + return true; +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::json_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/json_iterator-inl.h for westmere */ +/* including simdjson/generic/ondemand/json_type-inl.h for westmere: #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* begin file simdjson/generic/ondemand/json_type-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +inline std::ostream& operator<<(std::ostream& out, json_type type) noexcept { + switch (type) { + case json_type::array: out << "array"; break; + case json_type::object: out << "object"; break; + case json_type::number: out << "number"; break; + case json_type::string: out << "string"; break; + case json_type::boolean: out << "boolean"; break; + case json_type::null: out << "null"; break; + default: SIMDJSON_UNREACHABLE(); + } + return out; +} + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson_result &type) noexcept(false) { + return out << type.value(); +} +#endif + + + +simdjson_inline number_type number::get_number_type() const noexcept { + return type; +} + +simdjson_inline bool number::is_uint64() const noexcept { + return get_number_type() == number_type::unsigned_integer; +} + +simdjson_inline uint64_t number::get_uint64() const noexcept { + return payload.unsigned_integer; +} + +simdjson_inline number::operator uint64_t() const noexcept { + return get_uint64(); +} + + +simdjson_inline bool number::is_int64() const noexcept { + return get_number_type() == number_type::signed_integer; +} + +simdjson_inline int64_t number::get_int64() const noexcept { + return payload.signed_integer; +} + +simdjson_inline number::operator int64_t() const noexcept { + return get_int64(); +} + +simdjson_inline bool number::is_double() const noexcept { + return get_number_type() == number_type::floating_point_number; +} + +simdjson_inline double number::get_double() const noexcept { + return payload.floating_point_number; +} + +simdjson_inline number::operator double() const noexcept { + return get_double(); +} + +simdjson_inline double number::as_double() const noexcept { + if(is_double()) { + return payload.floating_point_number; + } + if(is_int64()) { + return double(payload.signed_integer); + } + return double(payload.unsigned_integer); +} + +simdjson_inline void number::append_s64(int64_t value) noexcept { + payload.signed_integer = value; + type = number_type::signed_integer; +} + +simdjson_inline void number::append_u64(uint64_t value) noexcept { + payload.unsigned_integer = value; + type = number_type::unsigned_integer; +} + +simdjson_inline void number::append_double(double value) noexcept { + payload.floating_point_number = value; + type = number_type::floating_point_number; +} + +simdjson_inline void number::skip_double() noexcept { + type = number_type::floating_point_number; +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::json_type &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_JSON_TYPE_INL_H +/* end file simdjson/generic/ondemand/json_type-inl.h for westmere */ +/* including simdjson/generic/ondemand/logger-inl.h for westmere: #include "simdjson/generic/ondemand/logger-inl.h" */ +/* begin file simdjson/generic/ondemand/logger-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/logger.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#include +#include + +namespace simdjson { +namespace westmere { +namespace ondemand { +namespace logger { + +static constexpr const char * DASHES = "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; +static constexpr const int LOG_EVENT_LEN = 20; +static constexpr const int LOG_BUFFER_LEN = 30; +static constexpr const int LOG_SMALL_BUFFER_LEN = 10; +static int log_depth = 0; // Not threadsafe. Log only. + +// Helper to turn unprintable or newline characters into spaces +static inline char printable_char(char c) { + if (c >= 0x20) { + return c; + } else { + return ' '; + } +} + +template +static inline std::string string_format(const std::string& format, const Args&... args) +{ + SIMDJSON_PUSH_DISABLE_ALL_WARNINGS + int size_s = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; + auto size = static_cast(size_s); + if (size <= 0) return std::string(); + std::unique_ptr buf(new char[size]); + std::snprintf(buf.get(), size, format.c_str(), args...); + SIMDJSON_POP_DISABLE_WARNINGS + return std::string(buf.get(), buf.get() + size - 1); +} + +static inline log_level get_log_level_from_env() +{ + SIMDJSON_PUSH_DISABLE_WARNINGS + SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe + char *lvl = getenv("SIMDJSON_LOG_LEVEL"); + SIMDJSON_POP_DISABLE_WARNINGS + if (lvl && simdjson_strcasecmp(lvl, "ERROR") == 0) { return log_level::error; } + return log_level::info; +} + +static inline log_level log_threshold() +{ + static log_level threshold = get_log_level_from_env(); + return threshold; +} + +static inline bool should_log(log_level level) +{ + return level >= log_threshold(); +} + +inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "", type, detail, log_level::info); +} +inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_line(iter, "", type, detail, delta, depth_delta, log_level::info); +} + +inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept { + log_line(iter, index, depth, "+", type, detail, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} +inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_line(iter, "+", type, "", delta, depth_delta, log_level::info); + if (LOG_ENABLED) { log_depth++; } +} + +inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + if (LOG_ENABLED) { log_depth--; } + log_line(iter, "-", type, "", delta, depth_delta, log_level::info); +} + +inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_line(iter, "ERROR: ", error, detail, delta, depth_delta, log_level::error); +} +inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept { + log_line(iter, index, depth, "ERROR: ", error, detail, log_level::error); +} + +inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_event(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_value(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept { + log_value(iter.json_iter(), type, detail, delta, depth_delta); +} + +inline void log_start_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_start_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_end_value(const value_iterator &iter, const char *type, int delta, int depth_delta) noexcept { + log_end_value(iter.json_iter(), type, delta, depth_delta); +} + +inline void log_error(const value_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept { + log_error(iter.json_iter(), error, detail, delta, depth_delta); +} + +inline void log_headers() noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(log_level::info))) { + // Technically a static variable is not thread-safe, but if you are using threads and logging... well... + static bool displayed_hint{false}; + log_depth = 0; + printf("\n"); + if (!displayed_hint) { + // We only print this helpful header once. + printf("# Logging provides the depth and position of the iterator user-visible steps:\n"); + printf("# +array says 'this is where we were when we discovered the start array'\n"); + printf( + "# -array says 'this is where we were when we ended the array'\n"); + printf("# skip says 'this is a structural or value I am skipping'\n"); + printf("# +/-skip says 'this is a start/end array or object I am skipping'\n"); + printf("#\n"); + printf("# The indentation of the terms (array, string,...) indicates the depth,\n"); + printf("# in addition to the depth being displayed.\n"); + printf("#\n"); + printf("# Every token in the document has a single depth determined by the tokens before it,\n"); + printf("# and is not affected by what the token actually is.\n"); + printf("#\n"); + printf("# Not all structural elements are presented as tokens in the logs.\n"); + printf("#\n"); + printf("# We never give control to the user within an empty array or an empty object.\n"); + printf("#\n"); + printf("# Inside an array, having a depth greater than the array's depth means that\n"); + printf("# we are pointing inside a value.\n"); + printf("# Having a depth equal to the array means that we are pointing right before a value.\n"); + printf("# Having a depth smaller than the array means that we have moved beyond the array.\n"); + displayed_hint = true; + } + printf("\n"); + printf("| %-*s ", LOG_EVENT_LEN, "Event"); + printf("| %-*s ", LOG_BUFFER_LEN, "Buffer"); + printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next"); + // printf("| %-*s ", 5, "Next#"); + printf("| %-*s ", 5, "Depth"); + printf("| Detail "); + printf("|\n"); + + printf("|%.*s", LOG_EVENT_LEN + 2, DASHES); + printf("|%.*s", LOG_BUFFER_LEN + 2, DASHES); + printf("|%.*s", LOG_SMALL_BUFFER_LEN + 2, DASHES); + // printf("|%.*s", 5+2, DASHES); + printf("|%.*s", 5 + 2, DASHES); + printf("|--------"); + printf("|\n"); + fflush(stdout); + } + } +} + +template +inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, log_level level, Args&&... args) noexcept { + log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail, level, std::forward(args)...); +} + +template +inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, log_level level, Args&&... args) noexcept { + if (LOG_ENABLED) { + if (simdjson_unlikely(should_log(level))) { + const int indent = depth * 2; + const auto buf = iter.token.buf; + auto msg = string_format(title, std::forward(args)...); + printf("| %*s%s%-*s ", indent, "", title_prefix, + LOG_EVENT_LEN - indent - int(strlen(title_prefix)), msg.c_str()); + { + // Print the current structural. + printf("| "); + // Before we begin, the index might point right before the document. + // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938 + if (index < iter._root) { + printf("%*s", LOG_BUFFER_LEN, ""); + } else { + auto current_structural = &buf[*index]; + for (int i = 0; i < LOG_BUFFER_LEN; i++) { + printf("%c", printable_char(current_structural[i])); + } + } + printf(" "); + } + { + // Print the next structural. + printf("| "); + auto next_structural = &buf[*(index + 1)]; + for (int i = 0; i < LOG_SMALL_BUFFER_LEN; i++) { + printf("%c", printable_char(next_structural[i])); + } + printf(" "); + } + // printf("| %5u ", *(index+1)); + printf("| %5i ", depth); + printf("| %6.*s ", int(detail.size()), detail.data()); + printf("|\n"); + fflush(stdout); + } + } +} + +} // namespace logger +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_LOGGER_INL_H +/* end file simdjson/generic/ondemand/logger-inl.h for westmere */ +/* including simdjson/generic/ondemand/object-inl.h for westmere: #include "simdjson/generic/ondemand/object-inl.h" */ +/* begin file simdjson/generic/ondemand/object-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field_unordered(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_unordered_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) & noexcept { + return find_field_unordered(key); +} +simdjson_inline simdjson_result object::operator[](const std::string_view key) && noexcept { + return std::forward(*this).find_field_unordered(key); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) & noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} +simdjson_inline simdjson_result object::find_field(const std::string_view key) && noexcept { + bool has_value; + SIMDJSON_TRY( iter.find_field_raw(key).get(has_value) ); + if (!has_value) { + logger::log_line(iter.json_iter(), "ERROR: ", "Cannot find key %.*s", "", -1, 0, logger::log_level::error, static_cast(key.size()), key.data()); + return NO_SUCH_FIELD; + } + return value(iter.child()); +} + +simdjson_inline simdjson_result object::start(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_object().error() ); + return object(iter); +} +simdjson_inline simdjson_result object::start_root(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.start_root_object().error() ); + return object(iter); +} +simdjson_inline error_code object::consume() noexcept { + if(iter.is_at_key()) { + /** + * whenever you are pointing at a key, calling skip_child() is + * unsafe because you will hit a string and you will assume that + * it is string value, and this mistake will lead you to make bad + * depth computation. + */ + /** + * We want to 'consume' the key. We could really + * just do _json_iter->return_current_and_advance(); at this + * point, but, for clarity, we will use the high-level API to + * eat the key. We assume that the compiler optimizes away + * most of the work. + */ + simdjson_unused raw_json_string actual_key; + auto error = iter.field_key().get(actual_key); + if (error) { iter.abandon(); return error; }; + // Let us move to the value while we are at it. + if ((error = iter.field_value())) { iter.abandon(); return error; } + } + auto error_skip = iter.json_iter().skip_child(iter.depth()-1); + if(error_skip) { iter.abandon(); } + return error_skip; +} + +simdjson_inline simdjson_result object::raw_json() noexcept { + const uint8_t * starting_point{iter.peek_start()}; + auto error = consume(); + if(error) { return error; } + const uint8_t * final_point{iter._json_iter->peek()}; + return std::string_view(reinterpret_cast(starting_point), size_t(final_point - starting_point)); +} + +simdjson_inline simdjson_result object::started(value_iterator &iter) noexcept { + SIMDJSON_TRY( iter.started_object().error() ); + return object(iter); +} + +simdjson_inline object object::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline object::object(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} + +simdjson_inline simdjson_result object::begin() noexcept { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + return object_iterator(iter); +} +simdjson_inline simdjson_result object::end() noexcept { + return object_iterator(iter); +} + +inline simdjson_result object::at_pointer(std::string_view json_pointer) noexcept { + if (json_pointer[0] != '/') { return INVALID_JSON_POINTER; } + json_pointer = json_pointer.substr(1); + size_t slash = json_pointer.find('/'); + std::string_view key = json_pointer.substr(0, slash); + // Grab the child with the given key + simdjson_result child; + + // If there is an escape character in the key, unescape it and then get the child. + size_t escape = key.find('~'); + if (escape != std::string_view::npos) { + // Unescape the key + std::string unescaped(key); + do { + switch (unescaped[escape+1]) { + case '0': + unescaped.replace(escape, 2, "~"); + break; + case '1': + unescaped.replace(escape, 2, "/"); + break; + default: + return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer"); + } + escape = unescaped.find('~', escape+1); + } while (escape != std::string::npos); + child = find_field(unescaped); // Take note find_field does not unescape keys when matching + } else { + child = find_field(key); + } + if(child.error()) { + return child; // we do not continue if there was an error + } + // If there is a /, we have to recurse and look up more of the path + if (slash != std::string_view::npos) { + child = child.at_pointer(json_pointer.substr(slash)); + } + return child; +} + +simdjson_inline simdjson_result object::count_fields() & noexcept { + size_t count{0}; + // Important: we do not consume any of the values. + for(simdjson_unused auto v : *this) { count++; } + // The above loop will always succeed, but we want to report errors. + if(iter.error()) { return iter.error(); } + // We need to move back at the start because we expect users to iterate through + // the object after counting the number of elements. + iter.reset_object(); + return count; +} + +simdjson_inline simdjson_result object::is_empty() & noexcept { + bool is_not_empty; + auto error = iter.reset_object().get(is_not_empty); + if(error) { return error; } + return !is_not_empty; +} + +simdjson_inline simdjson_result object::reset() & noexcept { + return iter.reset_object(); +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::object &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::begin() noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() noexcept { + if (error()) { return error(); } + return first.end(); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) & noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first)[key]; +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) & noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) && noexcept { + if (error()) { return error(); } + return std::forward(first).find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +inline simdjson_result simdjson_result::reset() noexcept { + if (error()) { return error(); } + return first.reset(); +} + +inline simdjson_result simdjson_result::is_empty() noexcept { + if (error()) { return error(); } + return first.is_empty(); +} + +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_INL_H +/* end file simdjson/generic/ondemand/object-inl.h for westmere */ +/* including simdjson/generic/ondemand/object_iterator-inl.h for westmere: #include "simdjson/generic/ondemand/object_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/object_iterator-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/field-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +// +// object_iterator +// + +simdjson_inline object_iterator::object_iterator(const value_iterator &_iter) noexcept + : iter{_iter} +{} + +simdjson_inline simdjson_result object_iterator::operator*() noexcept { + error_code error = iter.error(); + if (error) { iter.abandon(); return error; } + auto result = field::start(iter); + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (result.error()) { iter.abandon(); } + return result; +} +simdjson_inline bool object_iterator::operator==(const object_iterator &other) const noexcept { + return !(*this != other); +} +simdjson_inline bool object_iterator::operator!=(const object_iterator &) const noexcept { + return iter.is_open(); +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline object_iterator &object_iterator::operator++() noexcept { + // TODO this is a safety rail ... users should exit loops as soon as they receive an error. + // Nonetheless, let's see if performance is OK with this if statement--the compiler may give it to us for free. + if (!iter.is_open()) { return *this; } // Iterator will be released if there is an error + + simdjson_unused error_code error; + if ((error = iter.skip_child() )) { return *this; } + + simdjson_unused bool has_value; + if ((error = iter.has_next_field().get(has_value) )) { return *this; }; + return *this; +} +SIMDJSON_POP_DISABLE_WARNINGS + +// +// ### Live States +// +// While iterating or looking up values, depth >= iter.depth. at_start may vary. Error is +// always SUCCESS: +// +// - Start: This is the state when the object is first found and the iterator is just past the {. +// In this state, at_start == true. +// - Next: After we hand a scalar value to the user, or an array/object which they then fully +// iterate over, the iterator is at the , or } before the next value. In this state, +// depth == iter.depth, at_start == false, and error == SUCCESS. +// - Unfinished Business: When we hand an array/object to the user which they do not fully +// iterate over, we need to finish that iteration by skipping child values until we reach the +// Next state. In this state, depth > iter.depth, at_start == false, and error == SUCCESS. +// +// ## Error States +// +// In error states, we will yield exactly one more value before stopping. iter.depth == depth +// and at_start is always false. We decrement after yielding the error, moving to the Finished +// state. +// +// - Chained Error: When the object iterator is part of an error chain--for example, in +// `for (auto tweet : doc["tweets"])`, where the tweet field may be missing or not be an +// object--we yield that error in the loop, exactly once. In this state, error != SUCCESS and +// iter.depth == depth, and at_start == false. We decrement depth when we yield the error. +// - Missing Comma Error: When the iterator ++ method discovers there is no comma between fields, +// we flag that as an error and treat it exactly the same as a Chained Error. In this state, +// error == TAPE_ERROR, iter.depth == depth, and at_start == false. +// +// Errors that occur while reading a field to give to the user (such as when the key is not a +// string or the field is missing a colon) are yielded immediately. Depth is then decremented, +// moving to the Finished state without transitioning through an Error state at all. +// +// ## Terminal State +// +// The terminal state has iter.depth < depth. at_start is always false. +// +// - Finished: When we have reached a }, we are finished. We signal this by decrementing depth. +// In this state, iter.depth < depth, at_start == false, and error == SUCCESS. +// + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + westmere::ondemand::object_iterator &&value +) noexcept + : implementation_simdjson_result_base(std::forward(value)) +{ + first.iter.assert_is_valid(); +} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base({}, error) +{ +} + +simdjson_inline simdjson_result simdjson_result::operator*() noexcept { + if (error()) { return error(); } + return *first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator==(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return !error(); } + return first == other.first; +} +// If we're iterating and there is an error, return the error once. +simdjson_inline bool simdjson_result::operator!=(const simdjson_result &other) const noexcept { + if (!first.iter.is_valid()) { return error(); } + return first != other.first; +} +// Checks for ']' and ',' +simdjson_inline simdjson_result &simdjson_result::operator++() noexcept { + // Clear the error if there is one, so we don't yield it twice + if (error()) { second = SUCCESS; return *this; } + ++first; + return *this; +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_OBJECT_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/object_iterator-inl.h for westmere */ +/* including simdjson/generic/ondemand/parser-inl.h for westmere: #include "simdjson/generic/ondemand/parser-inl.h" */ +/* begin file simdjson/generic/ondemand/parser-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/padded_string_view.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/internal/dom_parser_implementation.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/dom/base.h" // for MINIMAL_DOCUMENT_CAPACITY */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document_stream.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/parser.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline parser::parser(size_t max_capacity) noexcept + : _max_capacity{max_capacity} { +} + +simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept { + if (new_capacity > max_capacity()) { return CAPACITY; } + if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; } + + // string_capacity copied from document::allocate + _capacity = 0; + size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * new_capacity / 3 + SIMDJSON_PADDING, 64); + string_buf.reset(new (std::nothrow) uint8_t[string_capacity]); +#if SIMDJSON_DEVELOPMENT_CHECKS + start_positions.reset(new (std::nothrow) token_position[new_max_depth]); +#endif + if (implementation) { + SIMDJSON_TRY( implementation->set_capacity(new_capacity) ); + SIMDJSON_TRY( implementation->set_max_depth(new_max_depth) ); + } else { + SIMDJSON_TRY( simdjson::get_active_implementation()->create_dom_parser_implementation(new_capacity, new_max_depth, implementation) ); + } + _capacity = new_capacity; + _max_depth = new_max_depth; + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length() || !string_buf) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return document::start({ reinterpret_cast(json.data()), this }); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const char *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const uint8_t *json, size_t len, size_t allocated) & noexcept { + return iterate(padded_string_view(json, len, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string_view json, size_t allocated) & noexcept { + return iterate(padded_string_view(json, allocated)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(std::string &json) & noexcept { + if(json.capacity() - json.size() < SIMDJSON_PADDING) { + json.reserve(json.size() + SIMDJSON_PADDING); + } + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const std::string &json) & noexcept { + return iterate(padded_string_view(json)); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + padded_string_view json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate(const simdjson_result &result) & noexcept { + // We don't presently have a way to temporarily get a const T& from a simdjson_result without throwing an exception + SIMDJSON_TRY( result.error() ); + const padded_string &json = result.value_unsafe(); + return iterate(json); +} + +simdjson_warn_unused simdjson_inline simdjson_result parser::iterate_raw(padded_string_view json) & noexcept { + if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; } + + json.remove_utf8_bom(); + + // Allocate if needed + if (capacity() < json.length()) { + SIMDJSON_TRY( allocate(json.length(), max_depth()) ); + } + + // Run stage 1. + SIMDJSON_TRY( implementation->stage1(reinterpret_cast(json.data()), json.length(), stage1_mode::regular) ); + return json_iterator(reinterpret_cast(json.data()), this); +} + +inline simdjson_result parser::iterate_many(const uint8_t *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; } + if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) { + buf += 3; + len -= 3; + } + if(allow_comma_separated && batch_size < len) { batch_size = len; } + return document_stream(*this, buf, len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const char *buf, size_t len, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(reinterpret_cast(buf), len, batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const std::string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} +inline simdjson_result parser::iterate_many(const padded_string &s, size_t batch_size, bool allow_comma_separated) noexcept { + return iterate_many(s.data(), s.length(), batch_size, allow_comma_separated); +} + +simdjson_inline size_t parser::capacity() const noexcept { + return _capacity; +} +simdjson_inline size_t parser::max_capacity() const noexcept { + return _max_capacity; +} +simdjson_inline size_t parser::max_depth() const noexcept { + return _max_depth; +} + +simdjson_inline void parser::set_max_capacity(size_t max_capacity) noexcept { + if(max_capacity < dom::MINIMAL_DOCUMENT_CAPACITY) { + _max_capacity = max_capacity; + } else { + _max_capacity = dom::MINIMAL_DOCUMENT_CAPACITY; + } +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement) const noexcept { + uint8_t *end = implementation->parse_string(in.buf, dst, allow_replacement); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +simdjson_inline simdjson_warn_unused simdjson_result parser::unescape_wobbly(raw_json_string in, uint8_t *&dst) const noexcept { + uint8_t *end = implementation->parse_wobbly_string(in.buf, dst); + if (!end) { return STRING_ERROR; } + std::string_view result(reinterpret_cast(dst), end-dst); + dst = end; + return result; +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::parser &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_PARSER_INL_H +/* end file simdjson/generic/ondemand/parser-inl.h for westmere */ +/* including simdjson/generic/ondemand/raw_json_string-inl.h for westmere: #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* begin file simdjson/generic/ondemand/raw_json_string-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +namespace westmere { +namespace ondemand { + +simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {} + +simdjson_inline const char * raw_json_string::raw() const noexcept { return reinterpret_cast(buf); } + + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;pos < target.size() && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;pos < target.size();pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + +simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept { + size_t pos{0}; + // if the content has no escape character, just scan through it quickly! + for(;target[pos] && target[pos] != '\\';pos++) {} + // slow path may begin. + bool escaping{false}; + for(;target[pos];pos++) { + if((target[pos] == '"') && !escaping) { + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string_view target) const noexcept { + // If we are going to call memcmp, then we must know something about the length of the raw_json_string. + return (length >= target.size()) && (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); +} + +simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + if(target.size() <= SIMDJSON_PADDING) { + return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size()); + } + const char * r{raw()}; + size_t pos{0}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(std::string_view target) const noexcept { + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;pos < target.size();pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + + +simdjson_inline bool raw_json_string::unsafe_is_equal(const char * target) const noexcept { + // Assumptions: 'target' does not contain unescaped quote characters, is null terminated and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_inline bool raw_json_string::is_equal(const char* target) const noexcept { + // Assumptions: does not contain unescaped quote characters, and + // the raw content is quote terminated within a valid JSON string. + const char * r{raw()}; + size_t pos{0}; + bool escaping{false}; + for(;target[pos];pos++) { + if(r[pos] != target[pos]) { return false; } + // if target is a compile-time constant and it is free from + // quotes, then the next part could get optimized away through + // inlining. + if((target[pos] == '"') && !escaping) { + // We have reached the end of the raw_json_string but + // the target is not done. + return false; + } else if(target[pos] == '\\') { + escaping = !escaping; + } else { + escaping = false; + } + } + if(r[pos] != '"') { return false; } + return true; +} + +simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept { + return a.unsafe_is_equal(c); +} + +simdjson_unused simdjson_inline bool operator==(std::string_view c, const raw_json_string &a) noexcept { + return a == c; +} + +simdjson_unused simdjson_inline bool operator!=(const raw_json_string &a, std::string_view c) noexcept { + return !(a == c); +} + +simdjson_unused simdjson_inline bool operator!=(std::string_view c, const raw_json_string &a) noexcept { + return !(a == c); +} + + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept { + return iter.unescape(*this, allow_replacement); +} + +simdjson_inline simdjson_warn_unused simdjson_result raw_json_string::unescape_wobbly(json_iterator &iter) const noexcept { + return iter.unescape_wobbly(*this); +} + +simdjson_unused simdjson_inline std::ostream &operator<<(std::ostream &out, const raw_json_string &str) noexcept { + bool in_escape = false; + const char *s = str.raw(); + while (true) { + switch (*s) { + case '\\': in_escape = !in_escape; break; + case '"': if (in_escape) { in_escape = false; } else { return out; } break; + default: if (in_escape) { in_escape = false; } + } + out << *s; + s++; + } +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::raw_json_string &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +simdjson_inline simdjson_result simdjson_result::raw() const noexcept { + if (error()) { return error(); } + return first.raw(); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape(westmere::ondemand::json_iterator &iter, bool allow_replacement) const noexcept { + if (error()) { return error(); } + return first.unescape(iter, allow_replacement); +} +simdjson_inline simdjson_warn_unused simdjson_result simdjson_result::unescape_wobbly(westmere::ondemand::json_iterator &iter) const noexcept { + if (error()) { return error(); } + return first.unescape_wobbly(iter); +} +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_INL_H +/* end file simdjson/generic/ondemand/raw_json_string-inl.h for westmere */ +/* including simdjson/generic/ondemand/serialization-inl.h for westmere: #include "simdjson/generic/ondemand/serialization-inl.h" */ +/* begin file simdjson/generic/ondemand/serialization-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/document-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/serialization.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { + +inline std::string_view trim(const std::string_view str) noexcept { + // We can almost surely do better by rolling our own find_first_not_of function. + size_t first = str.find_first_not_of(" \t\n\r"); + // If we have the empty string (just white space), then no trimming is possible, and + // we return the empty string_view. + if (std::string_view::npos == first) { return std::string_view(); } + size_t last = str.find_last_not_of(" \t\n\r"); + return str.substr(first, (last - first + 1)); +} + + +inline simdjson_result to_json_string(westmere::ondemand::document& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(westmere::ondemand::document_reference& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(westmere::ondemand::value& x) noexcept { + /** + * If we somehow receive a value that has already been consumed, + * then the following code could be in trouble. E.g., we create + * an array as needed, but if an array was already created, then + * it could be bad. + */ + using namespace westmere::ondemand; + westmere::ondemand::json_type t; + auto error = x.type().get(t); + if(error != SUCCESS) { return error; } + switch (t) + { + case json_type::array: + { + westmere::ondemand::array array; + error = x.get_array().get(array); + if(error) { return error; } + return to_json_string(array); + } + case json_type::object: + { + westmere::ondemand::object object; + error = x.get_object().get(object); + if(error) { return error; } + return to_json_string(object); + } + default: + return trim(x.raw_json_token()); + } +} + +inline simdjson_result to_json_string(westmere::ondemand::object& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(westmere::ondemand::array& x) noexcept { + std::string_view v; + auto error = x.raw_json().get(v); + if(error) {return error; } + return trim(v); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} + +inline simdjson_result to_json_string(simdjson_result x) { + if (x.error()) { return x.error(); } + return to_json_string(x.value_unsafe()); +} +} // namespace simdjson + +namespace simdjson { namespace westmere { namespace ondemand { + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::value x) { + std::string_view v; + auto error = simdjson::to_json_string(x).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::array value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::document_reference& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result&& x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::document& value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif + +#if SIMDJSON_EXCEPTIONS +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + throw simdjson::simdjson_error(error); + } +} +inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result x) { + if (x.error()) { throw simdjson::simdjson_error(x.error()); } + return (out << x.value()); +} +#else +inline std::ostream& operator<<(std::ostream& out, simdjson::westmere::ondemand::object value) { + std::string_view v; + auto error = simdjson::to_json_string(value).get(v); + if(error == simdjson::SUCCESS) { + return (out << v); + } else { + return (out << error); + } +} +#endif +}}} // namespace simdjson::westmere::ondemand + +#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_INL_H +/* end file simdjson/generic/ondemand/serialization-inl.h for westmere */ +/* including simdjson/generic/ondemand/token_iterator-inl.h for westmere: #include "simdjson/generic/ondemand/token_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/token_iterator-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/token_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/implementation_simdjson_result_base-inl.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline token_iterator::token_iterator( + const uint8_t *_buf, + token_position position +) noexcept : buf{_buf}, _position{position} +{ +} + +simdjson_inline uint32_t token_iterator::current_offset() const noexcept { + return *(_position); +} + + +simdjson_inline const uint8_t *token_iterator::return_current_and_advance() noexcept { + return &buf[*(_position++)]; +} + +simdjson_inline const uint8_t *token_iterator::peek(token_position position) const noexcept { + return &buf[*position]; +} +simdjson_inline uint32_t token_iterator::peek_index(token_position position) const noexcept { + return *position; +} +simdjson_inline uint32_t token_iterator::peek_length(token_position position) const noexcept { + return *(position+1) - *position; +} + +simdjson_inline const uint8_t *token_iterator::peek(int32_t delta) const noexcept { + return &buf[*(_position+delta)]; +} +simdjson_inline uint32_t token_iterator::peek_index(int32_t delta) const noexcept { + return *(_position+delta); +} +simdjson_inline uint32_t token_iterator::peek_length(int32_t delta) const noexcept { + return *(_position+delta+1) - *(_position+delta); +} + +simdjson_inline token_position token_iterator::position() const noexcept { + return _position; +} +simdjson_inline void token_iterator::set_position(token_position target_position) noexcept { + _position = target_position; +} + +simdjson_inline bool token_iterator::operator==(const token_iterator &other) const noexcept { + return _position == other._position; +} +simdjson_inline bool token_iterator::operator!=(const token_iterator &other) const noexcept { + return _position != other._position; +} +simdjson_inline bool token_iterator::operator>(const token_iterator &other) const noexcept { + return _position > other._position; +} +simdjson_inline bool token_iterator::operator>=(const token_iterator &other) const noexcept { + return _position >= other._position; +} +simdjson_inline bool token_iterator::operator<(const token_iterator &other) const noexcept { + return _position < other._position; +} +simdjson_inline bool token_iterator::operator<=(const token_iterator &other) const noexcept { + return _position <= other._position; +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::token_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_TOKEN_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/token_iterator-inl.h for westmere */ +/* including simdjson/generic/ondemand/value-inl.h for westmere: #include "simdjson/generic/ondemand/value-inl.h" */ +/* begin file simdjson/generic/ondemand/value-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/array_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/object.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline value::value(const value_iterator &_iter) noexcept + : iter{_iter} +{ +} +simdjson_inline value value::start(const value_iterator &iter) noexcept { + return iter; +} +simdjson_inline value value::resume(const value_iterator &iter) noexcept { + return iter; +} + +simdjson_inline simdjson_result value::get_array() noexcept { + return array::start(iter); +} +simdjson_inline simdjson_result value::get_object() noexcept { + return object::start(iter); +} +simdjson_inline simdjson_result value::start_or_resume_object() noexcept { + if (iter.at_start()) { + return get_object(); + } else { + return object::resume(iter); + } +} + +simdjson_inline simdjson_result value::get_raw_json_string() noexcept { + return iter.get_raw_json_string(); +} +simdjson_inline simdjson_result value::get_string(bool allow_replacement) noexcept { + return iter.get_string(allow_replacement); +} +template +simdjson_inline error_code value::get_string(string_type& receiver, bool allow_replacement) noexcept { + return iter.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result value::get_wobbly_string() noexcept { + return iter.get_wobbly_string(); +} +simdjson_inline simdjson_result value::get_double() noexcept { + return iter.get_double(); +} +simdjson_inline simdjson_result value::get_double_in_string() noexcept { + return iter.get_double_in_string(); +} +simdjson_inline simdjson_result value::get_uint64() noexcept { + return iter.get_uint64(); +} +simdjson_inline simdjson_result value::get_uint64_in_string() noexcept { + return iter.get_uint64_in_string(); +} +simdjson_inline simdjson_result value::get_int64() noexcept { + return iter.get_int64(); +} +simdjson_inline simdjson_result value::get_int64_in_string() noexcept { + return iter.get_int64_in_string(); +} +simdjson_inline simdjson_result value::get_bool() noexcept { + return iter.get_bool(); +} +simdjson_inline simdjson_result value::is_null() noexcept { + return iter.is_null(); +} +template<> simdjson_inline simdjson_result value::get() noexcept { return get_array(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_object(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_raw_json_string(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_string(false); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_number(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_double(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_uint64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_int64(); } +template<> simdjson_inline simdjson_result value::get() noexcept { return get_bool(); } + +template simdjson_inline error_code value::get(T &out) noexcept { + return get().get(out); +} + +#if SIMDJSON_EXCEPTIONS +simdjson_inline value::operator array() noexcept(false) { + return get_array(); +} +simdjson_inline value::operator object() noexcept(false) { + return get_object(); +} +simdjson_inline value::operator uint64_t() noexcept(false) { + return get_uint64(); +} +simdjson_inline value::operator int64_t() noexcept(false) { + return get_int64(); +} +simdjson_inline value::operator double() noexcept(false) { + return get_double(); +} +simdjson_inline value::operator std::string_view() noexcept(false) { + return get_string(false); +} +simdjson_inline value::operator raw_json_string() noexcept(false) { + return get_raw_json_string(); +} +simdjson_inline value::operator bool() noexcept(false) { + return get_bool(); +} +#endif + +simdjson_inline simdjson_result value::begin() & noexcept { + return get_array().begin(); +} +simdjson_inline simdjson_result value::end() & noexcept { + return {}; +} +simdjson_inline simdjson_result value::count_elements() & noexcept { + simdjson_result answer; + auto a = get_array(); + answer = a.count_elements(); + // count_elements leaves you pointing inside the array, at the first element. + // We need to move back so that the user can create a new array (which requires that + // we point at '['). + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::count_fields() & noexcept { + simdjson_result answer; + auto a = get_object(); + answer = a.count_fields(); + iter.move_at_start(); + return answer; +} +simdjson_inline simdjson_result value::at(size_t index) noexcept { + auto a = get_array(); + return a.at(index); +} + +simdjson_inline simdjson_result value::find_field(std::string_view key) noexcept { + return start_or_resume_object().find_field(key); +} +simdjson_inline simdjson_result value::find_field(const char *key) noexcept { + return start_or_resume_object().find_field(key); +} + +simdjson_inline simdjson_result value::find_field_unordered(std::string_view key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} +simdjson_inline simdjson_result value::find_field_unordered(const char *key) noexcept { + return start_or_resume_object().find_field_unordered(key); +} + +simdjson_inline simdjson_result value::operator[](std::string_view key) noexcept { + return start_or_resume_object()[key]; +} +simdjson_inline simdjson_result value::operator[](const char *key) noexcept { + return start_or_resume_object()[key]; +} + +simdjson_inline simdjson_result value::type() noexcept { + return iter.type(); +} + +simdjson_inline simdjson_result value::is_scalar() noexcept { + json_type this_type; + auto error = type().get(this_type); + if(error) { return error; } + return ! ((this_type == json_type::array) || (this_type == json_type::object)); +} + +simdjson_inline bool value::is_negative() noexcept { + return iter.is_negative(); +} + +simdjson_inline simdjson_result value::is_integer() noexcept { + return iter.is_integer(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number_type() noexcept { + return iter.get_number_type(); +} +simdjson_warn_unused simdjson_inline simdjson_result value::get_number() noexcept { + return iter.get_number(); +} + +simdjson_inline std::string_view value::raw_json_token() noexcept { + return std::string_view(reinterpret_cast(iter.peek_start()), iter.peek_start_length()); +} + +simdjson_inline simdjson_result value::raw_json() noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: { + ondemand::array array; + SIMDJSON_TRY(get_array().get(array)); + return array.raw_json(); + } + case json_type::object: { + ondemand::object object; + SIMDJSON_TRY(get_object().get(object)); + return object.raw_json(); + } + default: + return raw_json_token(); + } +} + +simdjson_inline simdjson_result value::current_location() noexcept { + return iter.json_iter().current_location(); +} + +simdjson_inline int32_t value::current_depth() const noexcept{ + return iter.json_iter().depth(); +} + +simdjson_inline simdjson_result value::at_pointer(std::string_view json_pointer) noexcept { + json_type t; + SIMDJSON_TRY(type().get(t)); + switch (t) + { + case json_type::array: + return (*this).get_array().at_pointer(json_pointer); + case json_type::object: + return (*this).get_object().at_pointer(json_pointer); + default: + return INVALID_JSON_POINTER; + } +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result( + westmere::ondemand::value &&value +) noexcept : + implementation_simdjson_result_base( + std::forward(value) + ) +{ +} +simdjson_inline simdjson_result::simdjson_result( + error_code error +) noexcept : + implementation_simdjson_result_base(error) +{ +} +simdjson_inline simdjson_result simdjson_result::count_elements() & noexcept { + if (error()) { return error(); } + return first.count_elements(); +} +simdjson_inline simdjson_result simdjson_result::count_fields() & noexcept { + if (error()) { return error(); } + return first.count_fields(); +} +simdjson_inline simdjson_result simdjson_result::at(size_t index) noexcept { + if (error()) { return error(); } + return first.at(index); +} +simdjson_inline simdjson_result simdjson_result::begin() & noexcept { + if (error()) { return error(); } + return first.begin(); +} +simdjson_inline simdjson_result simdjson_result::end() & noexcept { + if (error()) { return error(); } + return {}; +} + +simdjson_inline simdjson_result simdjson_result::find_field(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} +simdjson_inline simdjson_result simdjson_result::find_field(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field(key); +} + +simdjson_inline simdjson_result simdjson_result::find_field_unordered(std::string_view key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} +simdjson_inline simdjson_result simdjson_result::find_field_unordered(const char *key) noexcept { + if (error()) { return error(); } + return first.find_field_unordered(key); +} + +simdjson_inline simdjson_result simdjson_result::operator[](std::string_view key) noexcept { + if (error()) { return error(); } + return first[key]; +} +simdjson_inline simdjson_result simdjson_result::operator[](const char *key) noexcept { + if (error()) { return error(); } + return first[key]; +} + +simdjson_inline simdjson_result simdjson_result::get_array() noexcept { + if (error()) { return error(); } + return first.get_array(); +} +simdjson_inline simdjson_result simdjson_result::get_object() noexcept { + if (error()) { return error(); } + return first.get_object(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64() noexcept { + if (error()) { return error(); } + return first.get_uint64(); +} +simdjson_inline simdjson_result simdjson_result::get_uint64_in_string() noexcept { + if (error()) { return error(); } + return first.get_uint64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_int64() noexcept { + if (error()) { return error(); } + return first.get_int64(); +} +simdjson_inline simdjson_result simdjson_result::get_int64_in_string() noexcept { + if (error()) { return error(); } + return first.get_int64_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_double() noexcept { + if (error()) { return error(); } + return first.get_double(); +} +simdjson_inline simdjson_result simdjson_result::get_double_in_string() noexcept { + if (error()) { return error(); } + return first.get_double_in_string(); +} +simdjson_inline simdjson_result simdjson_result::get_string(bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(allow_replacement); +} +template +simdjson_inline error_code simdjson_result::get_string(string_type& receiver, bool allow_replacement) noexcept { + if (error()) { return error(); } + return first.get_string(receiver, allow_replacement); +} +simdjson_inline simdjson_result simdjson_result::get_wobbly_string() noexcept { + if (error()) { return error(); } + return first.get_wobbly_string(); +} +simdjson_inline simdjson_result simdjson_result::get_raw_json_string() noexcept { + if (error()) { return error(); } + return first.get_raw_json_string(); +} +simdjson_inline simdjson_result simdjson_result::get_bool() noexcept { + if (error()) { return error(); } + return first.get_bool(); +} +simdjson_inline simdjson_result simdjson_result::is_null() noexcept { + if (error()) { return error(); } + return first.is_null(); +} + +template simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return first.get(); +} +template simdjson_inline error_code simdjson_result::get(T &out) noexcept { + if (error()) { return error(); } + return first.get(out); +} + +template<> simdjson_inline simdjson_result simdjson_result::get() noexcept { + if (error()) { return error(); } + return std::move(first); +} +template<> simdjson_inline error_code simdjson_result::get(westmere::ondemand::value &out) noexcept { + if (error()) { return error(); } + out = first; + return SUCCESS; +} + +simdjson_inline simdjson_result simdjson_result::type() noexcept { + if (error()) { return error(); } + return first.type(); +} +simdjson_inline simdjson_result simdjson_result::is_scalar() noexcept { + if (error()) { return error(); } + return first.is_scalar(); +} +simdjson_inline simdjson_result simdjson_result::is_negative() noexcept { + if (error()) { return error(); } + return first.is_negative(); +} +simdjson_inline simdjson_result simdjson_result::is_integer() noexcept { + if (error()) { return error(); } + return first.is_integer(); +} +simdjson_inline simdjson_result simdjson_result::get_number_type() noexcept { + if (error()) { return error(); } + return first.get_number_type(); +} +simdjson_inline simdjson_result simdjson_result::get_number() noexcept { + if (error()) { return error(); } + return first.get_number(); +} +#if SIMDJSON_EXCEPTIONS +simdjson_inline simdjson_result::operator westmere::ondemand::array() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::object() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator uint64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator int64_t() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator double() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator std::string_view() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator westmere::ondemand::raw_json_string() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +simdjson_inline simdjson_result::operator bool() noexcept(false) { + if (error()) { throw simdjson_error(error()); } + return first; +} +#endif + +simdjson_inline simdjson_result simdjson_result::raw_json_token() noexcept { + if (error()) { return error(); } + return first.raw_json_token(); +} + +simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { + if (error()) { return error(); } + return first.raw_json(); +} + +simdjson_inline simdjson_result simdjson_result::current_location() noexcept { + if (error()) { return error(); } + return first.current_location(); +} + +simdjson_inline simdjson_result simdjson_result::current_depth() const noexcept { + if (error()) { return error(); } + return first.current_depth(); +} + +simdjson_inline simdjson_result simdjson_result::at_pointer(std::string_view json_pointer) noexcept { + if (error()) { return error(); } + return first.at_pointer(json_pointer); +} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_INL_H +/* end file simdjson/generic/ondemand/value-inl.h for westmere */ +/* including simdjson/generic/ondemand/value_iterator-inl.h for westmere: #include "simdjson/generic/ondemand/value_iterator-inl.h" */ +/* begin file simdjson/generic/ondemand/value_iterator-inl.h for westmere */ +#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H + +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #define SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/base.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/atomparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/numberparsing.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_iterator.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/json_type-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/raw_json_string-inl.h" */ +/* amalgamation skipped (editor-only): #include "simdjson/generic/ondemand/value_iterator.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +namespace simdjson { +namespace westmere { +namespace ondemand { + +simdjson_inline value_iterator::value_iterator( + json_iterator *json_iter, + depth_t depth, + token_position start_position +) noexcept : _json_iter{json_iter}, _depth{depth}, _start_position{start_position} +{ +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_object() noexcept { + SIMDJSON_TRY( start_container('{', "Not an object", "object") ); + return started_root_object(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_object() noexcept { + assert_at_container_start(); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + if (*_json_iter->peek() == '}') { + logger::log_value(*_json_iter, "empty object"); + _json_iter->return_current_and_advance(); + end_container(); + return false; + } + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_object() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // object: e.g., `{"a":2} foo }`. Users concerned with garbage content should + // call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != '}') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing } at end"); + } + // If the last character is } *and* the first gibberish character is also '}' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == '}') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed object. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_object() noexcept { + auto error = check_root_object(); + if(error) { return error; } + return started_object(); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept { +#if SIMDJSON_CHECK_EOF + if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); } + // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); } +#endif // SIMDJSON_CHECK_EOF + _json_iter->ascend_to(depth()-1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_field() noexcept { + assert_at_next(); + + // It's illegal to call this unless there are more tokens: anything that ends in } or ] is + // obligated to verify there are more tokens if they are not the top level. + switch (*_json_iter->return_current_and_advance()) { + case '}': + logger::log_end_value(*_json_iter, "object"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between object fields"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_raw(const std::string_view key) noexcept { + error_code error; + bool has_value; + // + // Initially, the object can be in one of a few different places: + // + // 1. The start of the object, at the first field: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + if (at_first_field()) { + has_value = true; + + // + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + return false; + + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + if ((error = skip_child() )) { abandon(); return error; } + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + while (has_value) { + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + //if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); // Skip the value entirely + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + + // If the loop ended, we're out of fields to look at. + return false; +} + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::find_field_unordered_raw(const std::string_view key) noexcept { + /** + * When find_field_unordered_raw is called, we can either be pointing at the + * first key, pointing outside (at the closing brace) or if a key was matched + * we can be either pointing right afterthe ':' right before the value (that we need skip), + * or we may have consumed the value and we might be at a comma or at the + * final brace (ready for a call to has_next_field()). + */ + error_code error; + bool has_value; + + // First, we scan from that point to the end. + // If we don't find a match, we may loop back around, and scan from the beginning to that point. + token_position search_start = _json_iter->position(); + + // We want to know whether we need to go back to the beginning. + bool at_first = at_first_field(); + /////////////// + // Initially, the object can be in one of a few different places: + // + // 1. At the first key: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2, index 1) + // ``` + // + if (at_first) { + has_value = true; + + // 2. When a previous search did not yield a value or the object is empty: + // + // ``` + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // { } + // ^ (depth 0, index 2) + // ``` + // + } else if (!is_open()) { + +#if SIMDJSON_DEVELOPMENT_CHECKS + // If we're past the end of the object, we're being iterated out of order. + // Note: this isn't perfect detection. It's possible the user is inside some other object; if so, + // this object iterator will blithely scan that object for fields. + if (_json_iter->depth() < depth() - 1) { return OUT_OF_ORDER_ITERATION; } +#endif + SIMDJSON_TRY(reset_object().get(has_value)); + at_first = true; + // 3. When a previous search found a field or an iterator yielded a value: + // + // ``` + // // When a field was not fully consumed (or not even touched at all) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 2) + // // When a field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // When the last field was fully consumed + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // ``` + // + } else { + // If someone queried a key but they not did access the value, then we are left pointing + // at the ':' and we need to move forward through the value... If the value was + // processed then skip_child() does not move the iterator (but may adjust the depth). + if ((error = skip_child() )) { abandon(); return error; } + search_start = _json_iter->position(); + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } +#if SIMDJSON_DEVELOPMENT_CHECKS + if (_json_iter->start_position(_depth) != start_position()) { return OUT_OF_ORDER_ITERATION; } +#endif + } + + // After initial processing, we will be in one of two states: + // + // ``` + // // At the beginning of a field + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 1) + // // At the end of the object + // { "a": [ 1, 2 ], "b": [ 3, 4 ] } + // ^ (depth 0) + // ``` + // + // Next, we find a match starting from the current position. + while (has_value) { + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + if ((error = field_key().get(actual_key) )) { abandon(); return error; }; + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + if ((error = field_value() )) { abandon(); return error; } + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + if ((error = has_next_field().get(has_value) )) { abandon(); return error; } + } + // Performance note: it maybe wasteful to rewind to the beginning when there might be + // no other query following. Indeed, it would require reskipping the whole object. + // Instead, you can just stay where you are. If there is a new query, there is always time + // to rewind. + if(at_first) { return false; } + + // If we reach the end without finding a match, search the rest of the fields starting at the + // beginning of the object. + // (We have already run through the object before, so we've already validated its structure. We + // don't check errors in this bit.) + SIMDJSON_TRY(reset_object().get(has_value)); + while (true) { + SIMDJSON_ASSUME(has_value); // we should reach search_start before ever reaching the end of the object + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); // We must be at the start of a field + + // Get the key and colon, stopping at the value. + raw_json_string actual_key; + // size_t max_key_length = _json_iter->peek_length() - 2; // -2 for the two quotes + // Note: _json_iter->peek_length() - 2 might overflow if _json_iter->peek_length() < 2. + // field_key() advances the pointer and checks that '"' is found (corresponding to a key). + // The depth is left unchanged by field_key(). + error = field_key().get(actual_key); SIMDJSON_ASSUME(!error); + // field_value() will advance and check that we find a ':' separating the + // key and the value. It will also increment the depth by one. + error = field_value(); SIMDJSON_ASSUME(!error); + + // If it matches, stop and return + // We could do it this way if we wanted to allow arbitrary + // key content (including escaped quotes). + // if (actual_key.unsafe_is_equal(max_key_length, key)) { + // Instead we do the following which may trigger buffer overruns if the + // user provides an adversarial key (containing a well placed unescaped quote + // character and being longer than the number of bytes remaining in the JSON + // input). + if (actual_key.unsafe_is_equal(key)) { + logger::log_event(*this, "match", key, -2); + // If we return here, then we return while pointing at the ':' that we just checked. + return true; + } + + // No match: skip the value and see if , or } is next + logger::log_event(*this, "no match", key, -2); + // The call to skip_child is meant to skip over the value corresponding to the key. + // After skip_child(), we are right before the next comma (',') or the final brace ('}'). + SIMDJSON_TRY( skip_child() ); + // If we reached the end of the key-value pair we started from, then we know + // that the key is not there so we return false. We are either right before + // the next comma or the final brace. + if(_json_iter->position() == search_start) { return false; } + // The has_next_field() advances the pointer and check that either ',' or '}' is found. + // It returns true if ',' is found, false otherwise. If anything other than ',' or '}' is found, + // then we are in error and we abort. + error = has_next_field().get(has_value); SIMDJSON_ASSUME(!error); + // If we make the mistake of exiting here, then we could be left pointing at a key + // in the middle of an object. That's not an allowable state. + } + // If the loop ended, we're out of fields to look at. The program should + // never reach this point. + return false; +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::field_key() noexcept { + assert_at_next(); + + const uint8_t *key = _json_iter->return_current_and_advance(); + if (*(key++) != '"') { return report_error(TAPE_ERROR, "Object key is not a string"); } + return raw_json_string(key); +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::field_value() noexcept { + assert_at_next(); + + if (*_json_iter->return_current_and_advance() != ':') { return report_error(TAPE_ERROR, "Missing colon in object field"); } + _json_iter->descend_to(depth()+1); + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::start_root_array() noexcept { + SIMDJSON_TRY( start_container('[', "Not an array", "array") ); + return started_root_array(); +} + +inline std::string value_iterator::to_string() const noexcept { + auto answer = std::string("value_iterator [ depth : ") + std::to_string(_depth) + std::string(", "); + if(_json_iter != nullptr) { answer += _json_iter->to_string(); } + answer += std::string(" ]"); + return answer; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_array() noexcept { + assert_at_container_start(); + if (*_json_iter->peek() == ']') { + logger::log_value(*_json_iter, "empty array"); + _json_iter->return_current_and_advance(); + SIMDJSON_TRY( end_container() ); + return false; + } + _json_iter->descend_to(depth()+1); +#if SIMDJSON_DEVELOPMENT_CHECKS + _json_iter->set_start_position(_depth, start_position()); +#endif + return true; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept { + // When in streaming mode, we cannot expect peek_last() to be the last structural element of the + // current document. It only works in the normal mode where we have indexed a single document. + // Note that adding a check for 'streaming' is not expensive since we only have at most + // one root element. + if ( ! _json_iter->streaming() ) { + // The following lines do not fully protect against garbage content within the + // array: e.g., `[1, 2] foo]`. Users concerned with garbage content should + // also call `at_end()` on the document instance at the end of the processing to + // ensure that the processing has finished at the end. + // + if (*_json_iter->peek_last() != ']') { + _json_iter->abandon(); + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end"); + } + // If the last character is ] *and* the first gibberish character is also ']' + // then on-demand could accidentally go over. So we need additional checks. + // https://github.com/simdjson/simdjson/issues/1834 + // Checking that the document is balanced requires a full scan which is potentially + // expensive, but it only happens in edge cases where the first padding character is + // a closing bracket. + if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) { + _json_iter->abandon(); + // The exact error would require more work. It will typically be an unclosed array. + return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced"); + } + } + return SUCCESS; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::started_root_array() noexcept { + auto error = check_root_array(); + if (error) { return error; } + return started_array(); +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::has_next_element() noexcept { + assert_at_next(); + + logger::log_event(*this, "has_next_element"); + switch (*_json_iter->return_current_and_advance()) { + case ']': + logger::log_end_value(*_json_iter, "array"); + SIMDJSON_TRY( end_container() ); + return false; + case ',': + _json_iter->descend_to(depth()+1); + return true; + default: + return report_error(TAPE_ERROR, "Missing comma between array elements"); + } +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_bool(const uint8_t *json) const noexcept { + auto not_true = atomparsing::str4ncmp(json, "true"); + auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e'); + bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]); + if (error) { return incorrect_type_error("Not a boolean"); } + return simdjson_result(!not_true); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::parse_null(const uint8_t *json) const noexcept { + bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]); + // if we start with 'n', we must be a null + if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); } + return is_null_string; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_string(bool allow_replacement) noexcept { + return get_raw_json_string().unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_string(string_type& receiver, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_string(allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_wobbly_string() noexcept { + return get_raw_json_string().unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_raw_json_string() noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64() noexcept { + auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_uint64_in_string() noexcept { + auto result = numberparsing::parse_unsigned_in_string(peek_non_root_scalar("uint64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64() noexcept { + auto result = numberparsing::parse_integer(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_int64_in_string() noexcept { + auto result = numberparsing::parse_integer_in_string(peek_non_root_scalar("int64")); + if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double() noexcept { + auto result = numberparsing::parse_double(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_double_in_string() noexcept { + auto result = numberparsing::parse_double_in_string(peek_non_root_scalar("double")); + if(result.error() == SUCCESS) { advance_non_root_scalar("double"); } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_bool() noexcept { + auto result = parse_bool(peek_non_root_scalar("bool")); + if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); } + return result; +} +simdjson_inline simdjson_result value_iterator::is_null() noexcept { + bool is_null_value; + SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value)); + if(is_null_value) { advance_non_root_scalar("null"); } + return is_null_value; +} +simdjson_inline bool value_iterator::is_negative() noexcept { + return numberparsing::is_negative(peek_non_root_scalar("numbersign")); +} +simdjson_inline bool value_iterator::is_root_negative() noexcept { + return numberparsing::is_negative(peek_root_scalar("numbersign")); +} +simdjson_inline simdjson_result value_iterator::is_integer() noexcept { + return numberparsing::is_integer(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number_type() noexcept { + return numberparsing::get_number_type(peek_non_root_scalar("integer")); +} +simdjson_inline simdjson_result value_iterator::get_number() noexcept { + number num; + error_code error = numberparsing::parse_number(peek_non_root_scalar("number"), num); + if(error) { return error; } + return num; +} + +simdjson_inline simdjson_result value_iterator::is_root_integer(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("is_root_integer"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + return false; // if there are more than 20 characters, it cannot be represented as an integer. + } + auto answer = numberparsing::is_integer(tmpbuf); + // If the parsing was a success, we must still check that it is + // a single scalar. Note that we parse first because of cases like '[]' where + // getting TRAILING_CONTENT is wrong. + if(check_trailing && (answer.error() == SUCCESS) && (!_json_iter->is_single_token())) { return TRAILING_CONTENT; } + return answer; +} + +simdjson_inline simdjson_result value_iterator::get_root_number_type(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto answer = numberparsing::get_number_type(tmpbuf); + if (check_trailing && (answer.error() == SUCCESS) && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + return answer; +} +simdjson_inline simdjson_result value_iterator::get_root_number(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("number"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + number num; + error_code error = numberparsing::parse_number(tmpbuf, num); + if(error) { return error; } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("number"); + return num; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_string(bool check_trailing, bool allow_replacement) noexcept { + return get_root_raw_json_string(check_trailing).unescape(json_iter(), allow_replacement); +} +template +simdjson_warn_unused simdjson_inline error_code value_iterator::get_root_string(string_type& receiver, bool check_trailing, bool allow_replacement) noexcept { + std::string_view content; + auto err = get_root_string(check_trailing, allow_replacement).get(content); + if (err) { return err; } + receiver = content; + return SUCCESS; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_wobbly_string(bool check_trailing) noexcept { + return get_root_raw_json_string(check_trailing).unescape_wobbly(json_iter()); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_raw_json_string(bool check_trailing) noexcept { + auto json = peek_scalar("string"); + if (*json != '"') { return incorrect_type_error("Not a string"); } + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_scalar("string"); + return raw_json_string(json+1); +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_uint64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("uint64"); + uint8_t tmpbuf[20+1+1]{}; // <20 digits> is the longest possible unsigned integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_unsigned_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("uint64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_int64_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("int64"); + uint8_t tmpbuf[20+1+1]; // -<19 digits> is the longest possible integer + tmpbuf[20+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 20+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 20 characters"); + return NUMBER_ERROR; + } + + auto result = numberparsing::parse_integer_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("int64"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} + +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_double_in_string(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("double"); + // Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, + // 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest + // number: -0.e-308. + uint8_t tmpbuf[1074+8+1+1]; // +1 for null termination. + tmpbuf[1074+8+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 1074+8+1)) { + logger::log_error(*_json_iter, start_position(), depth(), "Root number more than 1082 characters"); + return NUMBER_ERROR; + } + auto result = numberparsing::parse_double_in_string(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("double"); + } + return result; +} +simdjson_warn_unused simdjson_inline simdjson_result value_iterator::get_root_bool(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("bool"); + uint8_t tmpbuf[5+1+1]; // +1 for null termination + tmpbuf[5+1] = '\0'; // make sure that buffer is always null terminated. + if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf, 5+1)) { return incorrect_type_error("Not a boolean"); } + auto result = parse_bool(tmpbuf); + if(result.error() == SUCCESS) { + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("bool"); + } + return result; +} +simdjson_inline simdjson_result value_iterator::is_root_null(bool check_trailing) noexcept { + auto max_len = peek_start_length(); + auto json = peek_root_scalar("null"); + bool result = (max_len >= 4 && !atomparsing::str4ncmp(json, "null") && + (max_len == 4 || jsoncharutils::is_structural_or_whitespace(json[4]))); + if(result) { // we have something that looks like a null. + if (check_trailing && !_json_iter->is_single_token()) { return TRAILING_CONTENT; } + advance_root_scalar("null"); + } + return result; +} + +simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth >= _depth ); + + return _json_iter->skip_child(depth()); +} + +simdjson_inline value_iterator value_iterator::child() const noexcept { + assert_at_child(); + return { _json_iter, depth()+1, _json_iter->token.position() }; +} + +// GCC 7 warns when the first line of this function is inlined away into oblivion due to the caller +// relating depth and iterator depth, which is a desired effect. It does not happen if is_open is +// marked non-inline. +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING +simdjson_inline bool value_iterator::is_open() const noexcept { + return _json_iter->depth() >= depth(); +} +SIMDJSON_POP_DISABLE_WARNINGS + +simdjson_inline bool value_iterator::at_end() const noexcept { + return _json_iter->at_end(); +} + +simdjson_inline bool value_iterator::at_start() const noexcept { + return _json_iter->token.position() == start_position(); +} + +simdjson_inline bool value_iterator::at_first_field() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + return _json_iter->token.position() == start_position() + 1; +} + +simdjson_inline void value_iterator::abandon() noexcept { + _json_iter->abandon(); +} + +simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept { + return _depth; +} +simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept { + return _json_iter->error; +} +simdjson_warn_unused simdjson_inline uint8_t *&value_iterator::string_buf_loc() noexcept { + return _json_iter->string_buf_loc(); +} +simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept { + return *_json_iter; +} +simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept { + return *_json_iter; +} + +simdjson_inline const uint8_t *value_iterator::peek_start() const noexcept { + return _json_iter->peek(start_position()); +} +simdjson_inline uint32_t value_iterator::peek_start_length() const noexcept { + return _json_iter->peek_length(start_position()); +} + +simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return peek_start(); } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + if (!is_at_start()) { return; } + + // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value. + assert_at_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept { + logger::log_start_value(*_json_iter, start_position(), depth(), type); + // If we're not at the position anymore, we don't want to advance the cursor. + const uint8_t *json; + if (!is_at_start()) { +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; } +#endif + json = peek_start(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + } else { + assert_at_start(); + /** + * We should be prudent. Let us peek. If it is not the right type, we + * return an error. Only once we have determined that we have the right + * type are we allowed to advance! + */ + json = _json_iter->peek(); + if (*json != start_char) { return incorrect_type_error(incorrect_type_message); } + _json_iter->return_current_and_advance(); + } + + + return SUCCESS; +} + + +simdjson_inline const uint8_t *value_iterator::peek_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_root(); + return _json_iter->peek(); +} +simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return peek_start(); } + + assert_at_non_root_start(); + return _json_iter->peek(); +} + +simdjson_inline void value_iterator::advance_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_root(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} +simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept { + logger::log_value(*_json_iter, start_position(), depth(), type); + if (!is_at_start()) { return; } + + assert_at_non_root_start(); + _json_iter->return_current_and_advance(); + _json_iter->ascend_to(depth()-1); +} + +simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept { + logger::log_error(*_json_iter, start_position(), depth(), message); + return INCORRECT_TYPE; +} + +simdjson_inline bool value_iterator::is_at_start() const noexcept { + return position() == start_position(); +} + +simdjson_inline bool value_iterator::is_at_key() const noexcept { + // Keys are at the same depth as the object. + // Note here that we could be safer and check that we are within an object, + // but we do not. + return _depth == _json_iter->_depth && *_json_iter->peek() == '"'; +} + +simdjson_inline bool value_iterator::is_at_iterator_start() const noexcept { + // We can legitimately be either at the first value ([1]), or after the array if it's empty ([]). + auto delta = position() - start_position(); + return delta == 1 || delta == 2; +} + +inline void value_iterator::assert_at_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_container_start() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_next() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +simdjson_inline void value_iterator::move_at_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position); +} + +simdjson_inline void value_iterator::move_at_container_start() noexcept { + _json_iter->_depth = _depth; + _json_iter->token.set_position(_start_position + 1); +} + +simdjson_inline simdjson_result value_iterator::reset_array() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_array(); +} + +simdjson_inline simdjson_result value_iterator::reset_object() noexcept { + if(error()) { return error(); } + move_at_container_start(); + return started_object(); +} + +inline void value_iterator::assert_at_child() const noexcept { + SIMDJSON_ASSUME( _json_iter->token._position > _start_position ); + SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 ); + SIMDJSON_ASSUME( _depth > 0 ); +} + +inline void value_iterator::assert_at_root() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth == 1 ); +} + +inline void value_iterator::assert_at_non_root_start() const noexcept { + assert_at_start(); + SIMDJSON_ASSUME( _depth > 1 ); +} + +inline void value_iterator::assert_is_valid() const noexcept { + SIMDJSON_ASSUME( _json_iter != nullptr ); +} + +simdjson_inline bool value_iterator::is_valid() const noexcept { + return _json_iter != nullptr; +} + +simdjson_inline simdjson_result value_iterator::type() const noexcept { + switch (*peek_start()) { + case '{': + return json_type::object; + case '[': + return json_type::array; + case '"': + return json_type::string; + case 'n': + return json_type::null; + case 't': case 'f': + return json_type::boolean; + case '-': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return json_type::number; + default: + return TAPE_ERROR; + } +} + +simdjson_inline token_position value_iterator::start_position() const noexcept { + return _start_position; +} + +simdjson_inline token_position value_iterator::position() const noexcept { + return _json_iter->position(); +} + +simdjson_inline token_position value_iterator::end_position() const noexcept { + return _json_iter->end_position(); +} + +simdjson_inline token_position value_iterator::last_position() const noexcept { + return _json_iter->last_position(); +} + +simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept { + return _json_iter->report_error(error, message); +} + +} // namespace ondemand +} // namespace westmere +} // namespace simdjson + +namespace simdjson { + +simdjson_inline simdjson_result::simdjson_result(westmere::ondemand::value_iterator &&value) noexcept + : implementation_simdjson_result_base(std::forward(value)) {} +simdjson_inline simdjson_result::simdjson_result(error_code error) noexcept + : implementation_simdjson_result_base(error) {} + +} // namespace simdjson + +#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_ITERATOR_INL_H +/* end file simdjson/generic/ondemand/value_iterator-inl.h for westmere */ +/* end file simdjson/generic/ondemand/amalgamated.h for westmere */ +/* including simdjson/westmere/end.h: #include "simdjson/westmere/end.h" */ +/* begin file simdjson/westmere/end.h */ +/* amalgamation skipped (editor-only): #ifndef SIMDJSON_CONDITIONAL_INCLUDE */ +/* amalgamation skipped (editor-only): #include "simdjson/westmere/base.h" */ +/* amalgamation skipped (editor-only): #endif // SIMDJSON_CONDITIONAL_INCLUDE */ + +#if !SIMDJSON_CAN_ALWAYS_RUN_WESTMERE +SIMDJSON_UNTARGET_REGION +#endif + +/* undefining SIMDJSON_IMPLEMENTATION from "westmere" */ +#undef SIMDJSON_IMPLEMENTATION +/* end file simdjson/westmere/end.h */ + +#endif // SIMDJSON_WESTMERE_IMPLEMENTATION_H +/* end file simdjson/westmere/ondemand.h */ +#else +#error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION +#endif + +/* undefining SIMDJSON_CONDITIONAL_INCLUDE */ +#undef SIMDJSON_CONDITIONAL_INCLUDE + +namespace simdjson { + /** + * @copydoc simdjson::SIMDJSON_BUILTIN_IMPLEMENTATION::ondemand + */ + namespace ondemand = SIMDJSON_BUILTIN_IMPLEMENTATION::ondemand; +} // namespace simdjson + +#endif // SIMDJSON_BUILTIN_ONDEMAND_H +/* end file simdjson/builtin/ondemand.h */ + +namespace simdjson { + /** + * @copydoc simdjson::builtin::ondemand + */ + namespace ondemand = builtin::ondemand; +} // namespace simdjson + +#endif // SIMDJSON_ONDEMAND_H +/* end file simdjson/ondemand.h */ + +#endif // SIMDJSON_H +/* end file simdjson.h */ diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index 0c6ab414a3538a..81754343f2c921 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -27,6 +27,7 @@ This a list of all the dependencies: * [npm 9.6.7][] * [openssl 3.0.8][] * [postject 1.0.0-alpha.6][] +* [simdjson 3.6.0][] * [simdutf 4.0.4][] * [undici 5.28.1][] * [uvwasi 0.0.19][] @@ -286,6 +287,11 @@ See [maintaining-openssl][] for more informations. The [postject](https://github.com/nodejs/postject) dependency is used for the [Single Executable strategic initiative](https://github.com/nodejs/single-executable). +### simdjson 3.6.0 + +The [simdjson](https://github.com/simdjson/simdjson) dependency is +a C++ library for fast JSON parsing. + ### simdutf 4.0.4 The [simdutf](https://github.com/simdutf/simdutf) dependency is @@ -344,6 +350,7 @@ performance improvements not currently available in standard zlib. [npm 9.6.7]: #npm-967 [openssl 3.0.8]: #openssl-308 [postject 1.0.0-alpha.6]: #postject-100-alpha6 +[simdjson 3.6.0]: #simdutf-360 [simdutf 4.0.4]: #simdutf-404 [undici 5.28.1]: #undici-5281 [update-openssl-action]: ../../../.github/workflows/update-openssl.yml diff --git a/node.gyp b/node.gyp index 3f6915b266fc38..4ff22822f0094c 100644 --- a/node.gyp +++ b/node.gyp @@ -816,6 +816,7 @@ 'deps/googletest/googletest.gyp:gtest_prod', 'deps/histogram/histogram.gyp:histogram', 'deps/uvwasi/uvwasi.gyp:uvwasi', + 'deps/simdjson/simdjson.gyp:simdjson', 'deps/simdutf/simdutf.gyp:simdutf', 'deps/ada/ada.gyp:ada', 'node_js2c#host', @@ -1047,6 +1048,7 @@ 'deps/googletest/googletest.gyp:gtest_main', 'deps/histogram/histogram.gyp:histogram', 'deps/uvwasi/uvwasi.gyp:uvwasi', + 'deps/simdjson/simdjson.gyp:simdjson', 'deps/simdutf/simdutf.gyp:simdutf', 'deps/ada/ada.gyp:ada', ], diff --git a/src/node_metadata.cc b/src/node_metadata.cc index f6837ba6d07933..ffd8d065073fee 100644 --- a/src/node_metadata.cc +++ b/src/node_metadata.cc @@ -8,6 +8,7 @@ #include "llhttp.h" #include "nghttp2/nghttp2ver.h" #include "node.h" +#include "simdjson.h" #include "simdutf.h" #include "undici_version.h" #include "util.h" @@ -119,6 +120,7 @@ Metadata::Versions::Versions() { nghttp3 = NGHTTP3_VERSION; #endif + simdjson = SIMDJSON_VERSION; simdutf = SIMDUTF_VERSION; ada = ADA_VERSION; } diff --git a/src/node_metadata.h b/src/node_metadata.h index cf051585e779e2..2eccd1d9dcdfd0 100644 --- a/src/node_metadata.h +++ b/src/node_metadata.h @@ -46,6 +46,7 @@ namespace node { V(llhttp) \ V(uvwasi) \ V(acorn) \ + V(simdjson) \ V(simdutf) \ V(ada) \ NODE_VERSIONS_KEY_UNDICI(V) \ diff --git a/test/parallel/test-process-versions.js b/test/parallel/test-process-versions.js index 98dbda9ee8f20b..cf35aa67a42cdb 100644 --- a/test/parallel/test-process-versions.js +++ b/test/parallel/test-process-versions.js @@ -18,6 +18,7 @@ const expected_keys = [ 'llhttp', 'uvwasi', 'acorn', + 'simdjson', 'simdutf', 'ada', 'cjs_module_lexer', diff --git a/tools/dep_updaters/update-simdjson.sh b/tools/dep_updaters/update-simdjson.sh new file mode 100755 index 00000000000000..48a0bd0f64c743 --- /dev/null +++ b/tools/dep_updaters/update-simdjson.sh @@ -0,0 +1,52 @@ +#!/bin/sh +set -e +# Shell script to update simdjson in the source tree to a specific version + +BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) +DEPS_DIR="$BASE_DIR/deps" +[ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node" +[ -x "$NODE" ] || NODE=$(command -v node) + +NEW_VERSION="$("$NODE" --input-type=module <<'EOF' +const res = await fetch('https://api.github.com/repos/simdjson/simdjson/releases/latest'); +if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); +const { tag_name } = await res.json(); +console.log(tag_name.replace('v', '')); +EOF +)" +CURRENT_VERSION=$(grep "#define SIMDJSON_VERSION" "$DEPS_DIR/simdjson/simdjson.h" | sed -n "s/^.*VERSION \"\(.*\)\"/\1/p") + +if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then + echo "Skipped because simdjson is on the latest version." + exit 0 +fi + +echo "Making temporary workspace..." + +WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') + +cleanup () { + EXIT_CODE=$? + [ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE" + exit $EXIT_CODE +} + +trap cleanup INT TERM EXIT + +SIMDJSON_REF="v$NEW_VERSION" +SIMDJSON_ZIP="simdjson-$NEW_VERSION.zip" + +cd "$WORKSPACE" + +echo "Fetching simdjson source archive..." +curl -sL -o "$SIMDJSON_ZIP" "https://github.com/simdjson/simdjson/archive/refs/tags/$SIMDJSON_REF.zip" +unzip "$SIMDJSON_ZIP" +cd "simdjson-$NEW_VERSION" +mv "singleheader/simdjson.h" "$DEPS_DIR/simdjson" +mv "singleheader/simdjson.cpp" "$DEPS_DIR/simdjson" +mv "LICENSE" "$DEPS_DIR/simdjson" + +# Update the version number on maintaining-dependencies.md +# and print the new version as the last line of the script as we need +# to add it to $GITHUB_ENV variable +finalize_version_update "simdjson" "$NEW_VERSION" diff --git a/tools/license-builder.sh b/tools/license-builder.sh index 10b894262946ea..00babe6006ce00 100755 --- a/tools/license-builder.sh +++ b/tools/license-builder.sh @@ -79,6 +79,8 @@ licenseText="$(sed -e '/You should have received a copy of the CC0/,$d' -e 's/^\ addlicense "SipHash" "deps/v8/src/third_party/siphash" "$licenseText" licenseText="$(sed -e '/The data format used by the zlib library/,$d' -e 's/^\/\* *//' -e 's/^ *//' "${rootdir}/deps/zlib/zlib.h")" addlicense "zlib" "deps/zlib" "$licenseText" +licenseText="$(cat "${rootdir}/deps/simdjson/LICENSE")" +addlicense "simdjson" "deps/simdjson" "$licenseText" licenseText="$(cat "${rootdir}/deps/simdutf/LICENSE-MIT")" addlicense "simdutf" "deps/simdutf" "$licenseText" licenseText="$(curl -sL https://raw.githubusercontent.com/ada-url/ada/HEAD/LICENSE-MIT)" From 45e4f82912883b0a8632323a0792fdb11fab9acc Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Wed, 25 Oct 2023 17:51:27 -0400 Subject: [PATCH 02/67] src: move package resolver to c++ Co-authored-by: Daniel Lemire PR-URL: https://github.com/nodejs/node/pull/50322 Reviewed-By: Jacob Smith Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell Reviewed-By: Geoffrey Booth --- lib/internal/modules/cjs/loader.js | 29 +- lib/internal/modules/esm/get_format.js | 2 +- lib/internal/modules/esm/module_job.js | 2 +- lib/internal/modules/esm/package_config.js | 69 +-- lib/internal/modules/esm/resolve.js | 18 +- lib/internal/modules/package_json_reader.js | 241 +++++----- lib/internal/modules/run_main.js | 35 +- node.gyp | 2 + src/base_object_types.h | 3 +- src/node_binding.cc | 1 + src/node_binding.h | 1 + src/node_errors.h | 1 + src/node_external_reference.h | 1 + src/node_file.cc | 64 --- src/node_modules.cc | 450 ++++++++++++++++++ src/node_modules.h | 89 ++++ src/node_snapshotable.cc | 1 + src/node_url.cc | 58 +-- src/node_url.h | 6 +- test/es-module/test-esm-invalid-pjson.js | 8 +- .../pkgexports-number/package.json | 2 +- test/parallel/test-bootstrap-modules.js | 1 + test/parallel/test-module-binding.js | 29 -- typings/globals.d.ts | 2 + typings/internalBinding/fs.d.ts | 1 - typings/internalBinding/modules.d.ts | 29 ++ 26 files changed, 798 insertions(+), 347 deletions(-) create mode 100644 src/node_modules.cc create mode 100644 src/node_modules.h delete mode 100644 test/parallel/test-module-binding.js create mode 100644 typings/internalBinding/modules.d.ts diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index b077ee386bb40e..9c59b2b5a77218 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -427,7 +427,7 @@ ObjectDefineProperty(Module, '_readPackage', { * @param {string} originalPath The specifier passed to `require` */ function tryPackage(requestPath, exts, isMain, originalPath) { - const pkg = _readPackage(requestPath).main; + const { main: pkg, pjsonPath } = _readPackage(requestPath); if (!pkg) { return tryExtensions(path.resolve(requestPath, 'index'), exts, isMain); @@ -446,14 +446,13 @@ function tryPackage(requestPath, exts, isMain, originalPath) { 'Please verify that the package.json has a valid "main" entry', ); err.code = 'MODULE_NOT_FOUND'; - err.path = path.resolve(requestPath, 'package.json'); + err.path = pjsonPath; err.requestPath = originalPath; // TODO(BridgeAR): Add the requireStack as well. throw err; } else { - const jsonPath = path.resolve(requestPath, 'package.json'); process.emitWarning( - `Invalid 'main' field in '${jsonPath}' of '${pkg}'. ` + + `Invalid 'main' field in '${pjsonPath}' of '${pkg}'. ` + 'Please either fix that or report it to the module author', 'DeprecationWarning', 'DEP0128', @@ -539,16 +538,16 @@ function trySelfParentPath(parent) { function trySelf(parentPath, request) { if (!parentPath) { return false; } - const { data: pkg, path: pkgPath } = packageJsonReader.readPackageScope(parentPath); - if (!pkg || pkg.exports == null || pkg.name === undefined) { + const pkg = packageJsonReader.getNearestParentPackageJSON(parentPath); + if (pkg?.data.exports === undefined || pkg.data.name === undefined) { return false; } let expansion; - if (request === pkg.name) { + if (request === pkg.data.name) { expansion = '.'; - } else if (StringPrototypeStartsWith(request, `${pkg.name}/`)) { - expansion = '.' + StringPrototypeSlice(request, pkg.name.length); + } else if (StringPrototypeStartsWith(request, `${pkg.data.name}/`)) { + expansion = '.' + StringPrototypeSlice(request, pkg.data.name.length); } else { return false; } @@ -556,11 +555,11 @@ function trySelf(parentPath, request) { try { const { packageExportsResolve } = require('internal/modules/esm/resolve'); return finalizeEsmResolution(packageExportsResolve( - pathToFileURL(pkgPath + '/package.json'), expansion, pkg, - pathToFileURL(parentPath), getCjsConditions()), parentPath, pkgPath); + pathToFileURL(pkg.path + '/package.json'), expansion, pkg.data, + pathToFileURL(parentPath), getCjsConditions()), parentPath, pkg.path); } catch (e) { if (e.code === 'ERR_MODULE_NOT_FOUND') { - throw createEsmNotFoundErr(request, pkgPath + '/package.json'); + throw createEsmNotFoundErr(request, pkg.path + '/package.json'); } throw e; } @@ -1099,7 +1098,7 @@ Module._resolveFilename = function(request, parent, isMain, options) { if (request[0] === '#' && (parent?.filename || parent?.id === '')) { const parentPath = parent?.filename ?? process.cwd() + path.sep; - const pkg = packageJsonReader.readPackageScope(parentPath) || { __proto__: null }; + const pkg = packageJsonReader.getNearestParentPackageJSON(parentPath) || { __proto__: null }; if (pkg.data?.imports != null) { try { const { packageImportsResolve } = require('internal/modules/esm/resolve'); @@ -1397,9 +1396,9 @@ Module._extensions['.js'] = function(module, filename) { content = fs.readFileSync(filename, 'utf8'); } if (StringPrototypeEndsWith(filename, '.js')) { - const pkg = packageJsonReader.readPackageScope(filename) || { __proto__: null }; + const pkg = packageJsonReader.getNearestParentPackageJSON(filename); // Function require shouldn't be used in ES modules. - if (pkg.data?.type === 'module') { + if (pkg?.data.type === 'module') { // This is an error path because `require` of a `.js` file in a `"type": "module"` scope is not allowed. const parent = moduleParentCache.get(module); const parentPath = parent?.filename; diff --git a/lib/internal/modules/esm/get_format.js b/lib/internal/modules/esm/get_format.js index 1931688e85d05e..c029b6c614384f 100644 --- a/lib/internal/modules/esm/get_format.js +++ b/lib/internal/modules/esm/get_format.js @@ -19,7 +19,7 @@ const { const experimentalNetworkImports = getOptionValue('--experimental-network-imports'); const { containsModuleSyntax } = internalBinding('contextify'); -const { getPackageType } = require('internal/modules/esm/resolve'); +const { getPackageType } = require('internal/modules/esm/package_config'); const { fileURLToPath } = require('internal/url'); const { ERR_UNKNOWN_FILE_EXTENSION } = require('internal/errors').codes; diff --git a/lib/internal/modules/esm/module_job.js b/lib/internal/modules/esm/module_job.js index 83c23456e05f10..7116f3724bb6e1 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -228,7 +228,7 @@ class ModuleJob { const packageConfig = StringPrototypeStartsWith(this.module.url, 'file://') && RegExpPrototypeExec(/\.js(\?[^#]*)?(#.*)?$/, this.module.url) !== null && - require('internal/modules/esm/resolve') + require('internal/modules/esm/package_config') .getPackageScopeConfig(this.module.url); if (packageConfig.type === 'module') { e.message += diff --git a/lib/internal/modules/esm/package_config.js b/lib/internal/modules/esm/package_config.js index 5da47764c9de2c..6b3847966cb1d3 100644 --- a/lib/internal/modules/esm/package_config.js +++ b/lib/internal/modules/esm/package_config.js @@ -1,69 +1,44 @@ 'use strict'; -const { - StringPrototypeEndsWith, -} = primordials; -const { URL, fileURLToPath } = require('internal/url'); -const packageJsonReader = require('internal/modules/package_json_reader'); +const { ArrayIsArray } = primordials; +const modulesBinding = internalBinding('modules'); +const { deserializePackageJSON } = require('internal/modules/package_json_reader'); -/** - * @typedef {object} PackageConfig - * @property {string} pjsonPath - The path to the package.json file. - * @property {boolean} exists - Whether the package.json file exists. - * @property {'none' | 'commonjs' | 'module'} type - The type of the package. - * @property {string} [name] - The name of the package. - * @property {string} [main] - The main entry point of the package. - * @property {PackageTarget} [exports] - The exports configuration of the package. - * @property {Record>} [imports] - The imports configuration of the package. - */ -/** - * @typedef {string | string[] | Record>} PackageTarget - */ +// TODO(@anonrig): Merge this file with internal/esm/package_json_reader.js /** * Returns the package configuration for the given resolved URL. * @param {URL | string} resolved - The resolved URL. - * @returns {PackageConfig} - The package configuration. + * @returns {import('typings/internalBinding/modules').PackageConfig} - The package configuration. */ function getPackageScopeConfig(resolved) { - let packageJSONUrl = new URL('./package.json', resolved); - while (true) { - const packageJSONPath = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath, 'node_modules/package.json')) { - break; - } - const packageConfig = packageJsonReader.read(fileURLToPath(packageJSONUrl), { - __proto__: null, - specifier: resolved, - isESM: true, - }); - if (packageConfig.exists) { - return packageConfig; - } - - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL('../package.json', packageJSONUrl); + const result = modulesBinding.getPackageScopeConfig(`${resolved}`); - // Terminates at root where ../package.json equals ../../package.json - // (can't just check "/package.json" for Windows support). - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } + if (ArrayIsArray(result)) { + return deserializePackageJSON(`${resolved}`, result, false /* checkIntegrity */); } - const packageJSONPath = fileURLToPath(packageJSONUrl); + + // This means that the response is a string + // and it is the path to the package.json file return { __proto__: null, - pjsonPath: packageJSONPath, + pjsonPath: result, exists: false, - main: undefined, - name: undefined, type: 'none', - exports: undefined, - imports: undefined, }; } +/** + * Returns the package type for a given URL. + * @param {URL} url - The URL to get the package type for. + */ +function getPackageType(url) { + // TODO(@anonrig): Write a C++ function that returns only "type". + return getPackageScopeConfig(url).type; +} + module.exports = { getPackageScopeConfig, + getPackageType, }; diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index 06a34c11254a2f..a6469cfad77e47 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -198,7 +198,7 @@ const legacyMainResolveExtensionsIndexes = { * 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node) * 5. NOT_FOUND * @param {URL} packageJSONUrl - * @param {PackageConfig} packageConfig + * @param {import('typings/internalBinding/modules').PackageConfig} packageConfig * @param {string | URL | undefined} base * @returns {URL} */ @@ -502,7 +502,7 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, } return resolveResult; } - if (lastException === undefined || lastException === null) { + if (lastException == null) { return lastException; } throw lastException; @@ -575,7 +575,7 @@ function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { */ function packageExportsResolve( packageJSONUrl, packageSubpath, packageConfig, base, conditions) { - let exports = packageConfig.exports; + let { exports } = packageConfig; if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) { exports = { '.': exports }; } @@ -740,15 +740,6 @@ function packageImportsResolve(name, base, conditions) { throw importNotDefined(name, packageJSONUrl, base); } -/** - * Returns the package type for a given URL. - * @param {URL} url - The URL to get the package type for. - */ -function getPackageType(url) { - const packageConfig = getPackageScopeConfig(url); - return packageConfig.type; -} - /** * Parse a package name from a specifier. * @param {string} specifier - The import specifier. @@ -796,6 +787,7 @@ function parsePackageName(specifier, base) { * @returns {URL} - The resolved URL. */ function packageResolve(specifier, base, conditions) { + // TODO(@anonrig): Move this to a C++ function. if (BuiltinModule.canBeRequiredWithoutScheme(specifier)) { return new URL('node:' + specifier); } @@ -1179,8 +1171,6 @@ module.exports = { decorateErrorWithCommonJSHints, defaultResolve, encodedSepRegEx, - getPackageScopeConfig, - getPackageType, packageExportsResolve, packageImportsResolve, throwIfInvalidParentURL, diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js index 65f5ce3551bbd0..232ed35528c5c5 100644 --- a/lib/internal/modules/package_json_reader.js +++ b/lib/internal/modules/package_json_reader.js @@ -2,161 +2,158 @@ const { JSONParse, - ObjectPrototypeHasOwnProperty, - SafeMap, - StringPrototypeEndsWith, - StringPrototypeIndexOf, - StringPrototypeLastIndexOf, StringPrototypeSlice, + StringPrototypeLastIndexOf, + ObjectDefineProperty, } = primordials; -const { - ERR_INVALID_PACKAGE_CONFIG, -} = require('internal/errors').codes; -const { internalModuleReadJSON } = internalBinding('fs'); -const { resolve, sep, toNamespacedPath } = require('path'); -const permission = require('internal/process/permission'); -const { kEmptyObject, setOwnProperty } = require('internal/util'); - -const { fileURLToPath, pathToFileURL } = require('internal/url'); - -const cache = new SafeMap(); +const modulesBinding = internalBinding('modules'); +const { resolve, sep } = require('path'); +const { kEmptyObject } = require('internal/util'); +const { pathToFileURL } = require('internal/url'); let manifest; /** - * @typedef {{ - * exists: boolean, - * pjsonPath: string, - * exports?: string | string[] | Record, - * imports?: string | string[] | Record, - * name?: string, - * main?: string, - * type: 'commonjs' | 'module' | 'none', - * }} PackageConfig + * @param {string} jsonPath + * @param {string} value The integrity value to check against. */ +function checkPackageJSONIntegrity(jsonPath, value) { + if (manifest === undefined) { + const { getOptionValue } = require('internal/options'); + manifest = getOptionValue('--experimental-policy') ? + require('internal/process/policy').manifest : + null; + } + if (manifest !== null) { + const jsonURL = pathToFileURL(jsonPath); + manifest.assertIntegrity(jsonURL, value); + } +} /** + * @param {string} path + * @param {import('typings/internalBinding/modules').SerializedPackageConfig} contents + * @param {boolean} [checkIntegrity=false] Whether to check the integrity of the package.json file. + * @returns {import('typings/internalBinding/modules').PackageConfig} + */ +function deserializePackageJSON(path, contents, checkIntegrity = false) { + if (contents === undefined) { + return { + __proto__: null, + exists: false, + pjsonPath: path, + type: 'none', // Ignore unknown types for forwards compatibility + }; + } + + let pjsonPath = path; + const { + 0: name, + 1: main, + 2: type, + 3: plainImports, + 4: plainExports, + 5: manifest, + 6: optionalFilePath, + } = contents; + + // This is required to be used in getPackageScopeConfig. + if (optionalFilePath) { + pjsonPath = optionalFilePath; + } + + if (checkIntegrity) { + // parsed[5] is only available when experimental policy is enabled. + checkPackageJSONIntegrity(pjsonPath, manifest); + } + + // The imports and exports fields can be either undefined or a string. + // - If it's a string, it's either plain string or a stringified JSON string. + // - If it's a stringified JSON string, it starts with either '[' or '{'. + const requiresJSONParse = (value) => (value !== undefined && (value[0] === '[' || value[0] === '{')); + + return { + __proto__: null, + exists: true, + pjsonPath, + name, + main, + type, + // This getters are used to lazily parse the imports and exports fields. + get imports() { + const value = requiresJSONParse(plainImports) ? JSONParse(plainImports) : plainImports; + ObjectDefineProperty(this, 'imports', { __proto__: null, value }); + return this.imports; + }, + get exports() { + const value = requiresJSONParse(plainExports) ? JSONParse(plainExports) : plainExports; + ObjectDefineProperty(this, 'exports', { __proto__: null, value }); + return this.exports; + }, + }; +} + +/** + * Reads a package.json file and returns the parsed contents. * @param {string} jsonPath * @param {{ - * base?: string, - * specifier: string, - * isESM: boolean, + * base?: URL | string, + * specifier?: URL | string, + * isESM?: boolean, * }} options - * @returns {PackageConfig} + * @returns {import('typings/internalBinding/modules').PackageConfig} */ function read(jsonPath, { base, specifier, isESM } = kEmptyObject) { - if (cache.has(jsonPath)) { - return cache.get(jsonPath); - } - - const string = internalModuleReadJSON( - toNamespacedPath(jsonPath), + // This function will be called by both CJS and ESM, so we need to make sure + // non-null attributes are converted to strings. + const parsed = modulesBinding.readPackageJSON( + jsonPath, + isESM, + base == null ? undefined : `${base}`, + specifier == null ? undefined : `${specifier}`, ); - const result = { - __proto__: null, - exists: false, - pjsonPath: jsonPath, - main: undefined, - name: undefined, - type: 'none', // Ignore unknown types for forwards compatibility - exports: undefined, - imports: undefined, - }; - if (string !== undefined) { - let parsed; - try { - parsed = JSONParse(string); - } catch (cause) { - const error = new ERR_INVALID_PACKAGE_CONFIG( - jsonPath, - isESM && (base ? `"${specifier}" from ` : '') + fileURLToPath(base || specifier), - cause.message, - ); - setOwnProperty(error, 'cause', cause); - throw error; - } - - result.exists = true; - - // ObjectPrototypeHasOwnProperty is used to avoid prototype pollution. - if (ObjectPrototypeHasOwnProperty(parsed, 'name') && typeof parsed.name === 'string') { - result.name = parsed.name; - } - - if (ObjectPrototypeHasOwnProperty(parsed, 'main') && typeof parsed.main === 'string') { - result.main = parsed.main; - } - - if (ObjectPrototypeHasOwnProperty(parsed, 'exports')) { - result.exports = parsed.exports; - } - - if (ObjectPrototypeHasOwnProperty(parsed, 'imports')) { - result.imports = parsed.imports; - } - - // Ignore unknown types for forwards compatibility - if (ObjectPrototypeHasOwnProperty(parsed, 'type') && (parsed.type === 'commonjs' || parsed.type === 'module')) { - result.type = parsed.type; - } - - if (manifest === undefined) { - const { getOptionValue } = require('internal/options'); - manifest = getOptionValue('--experimental-policy') ? - require('internal/process/policy').manifest : - null; - } - if (manifest !== null) { - const jsonURL = pathToFileURL(jsonPath); - manifest.assertIntegrity(jsonURL, string); - } - } - cache.set(jsonPath, result); - return result; + return deserializePackageJSON(jsonPath, parsed, true /* checkIntegrity */); } /** + * @deprecated Expected to be removed in favor of `read` in the future. + * Behaves the same was as `read`, but appends package.json to the path. * @param {string} requestPath * @return {PackageConfig} */ function readPackage(requestPath) { + // TODO(@anonrig): Remove this function. return read(resolve(requestPath, 'package.json')); } /** * Get the nearest parent package.json file from a given path. - * Return the package.json data and the path to the package.json file, or false. + * Return the package.json data and the path to the package.json file, or undefined. * @param {string} checkPath The path to start searching from. + * @returns {undefined | {data: import('typings/internalBinding/modules').PackageConfig, path: string}} */ -function readPackageScope(checkPath) { - const rootSeparatorIndex = StringPrototypeIndexOf(checkPath, sep); - let separatorIndex; - const enabledPermission = permission.isEnabled(); - do { - separatorIndex = StringPrototypeLastIndexOf(checkPath, sep); - checkPath = StringPrototypeSlice(checkPath, 0, separatorIndex); - // Stop the search when the process doesn't have permissions - // to walk upwards - if (enabledPermission && !permission.has('fs.read', checkPath + sep)) { - return false; - } - if (StringPrototypeEndsWith(checkPath, sep + 'node_modules')) { - return false; - } - const pjson = readPackage(checkPath + sep); - if (pjson.exists) { - return { - data: pjson, - path: checkPath, - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; +function getNearestParentPackageJSON(checkPath) { + const result = modulesBinding.getNearestParentPackageJSON(checkPath); + + if (result === undefined) { + return undefined; + } + + const data = deserializePackageJSON(checkPath, result, true /* checkIntegrity */); + + // Path should be the root folder of the matched package.json + // For example for ~/path/package.json, it should be ~/path + const path = StringPrototypeSlice(data.pjsonPath, 0, StringPrototypeLastIndexOf(data.pjsonPath, sep)); + + return { data, path }; } module.exports = { + checkPackageJSONIntegrity, read, readPackage, - readPackageScope, + getNearestParentPackageJSON, + + deserializePackageJSON, }; diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js index 1f03c313121db0..23268637e4fd58 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -5,7 +5,9 @@ const { } = primordials; const { containsModuleSyntax } = internalBinding('contextify'); +const { getNearestParentPackageJSONType } = internalBinding('modules'); const { getOptionValue } = require('internal/options'); +const { checkPackageJSONIntegrity } = require('internal/modules/package_json_reader'); const path = require('path'); /** @@ -68,22 +70,27 @@ function shouldUseESMLoader(mainPath) { if (mainPath && StringPrototypeEndsWith(mainPath, '.mjs')) { return true; } if (!mainPath || StringPrototypeEndsWith(mainPath, '.cjs')) { return false; } - const { readPackageScope } = require('internal/modules/package_json_reader'); - const pkg = readPackageScope(mainPath); - // No need to guard `pkg` as it can only be an object or `false`. - switch (pkg.data?.type) { - case 'module': - return true; - case 'commonjs': - return false; - default: { // No package.json or no `type` field. - if (getOptionValue('--experimental-detect-module')) { - // If the first argument of `containsModuleSyntax` is undefined, it will read `mainPath` from the file system. - return containsModuleSyntax(undefined, mainPath); - } - return false; + const response = getNearestParentPackageJSONType(mainPath); + + // No package.json or no `type` field. + if (response === undefined || response[0] === 'none') { + if (getOptionValue('--experimental-detect-module')) { + // If the first argument of `containsModuleSyntax` is undefined, it will read `mainPath` from the file system. + return containsModuleSyntax(undefined, mainPath); } + return false; } + + // TODO(@anonrig): Do not return filePath and rawContent if experimental-policy is not used. + const { + 0: type, + 1: filePath, + 2: rawContent, + } = response; + + checkPackageJSONIntegrity(filePath, rawContent); + + return type === 'module'; } /** diff --git a/node.gyp b/node.gyp index 4ff22822f0094c..811d15b0df9ad3 100644 --- a/node.gyp +++ b/node.gyp @@ -112,6 +112,7 @@ 'src/node_main_instance.cc', 'src/node_messaging.cc', 'src/node_metadata.cc', + 'src/node_modules.cc', 'src/node_options.cc', 'src/node_os.cc', 'src/node_perf.cc', @@ -234,6 +235,7 @@ 'src/node_messaging.h', 'src/node_metadata.h', 'src/node_mutex.h', + 'src/node_modules.h', 'src/node_object_wrap.h', 'src/node_options.h', 'src/node_options-inl.h', diff --git a/src/base_object_types.h b/src/base_object_types.h index cb034f1d62b681..9cfe6a77f71708 100644 --- a/src/base_object_types.h +++ b/src/base_object_types.h @@ -17,7 +17,8 @@ namespace node { V(blob_binding_data, BlobBindingData) \ V(process_binding_data, process::BindingData) \ V(timers_binding_data, timers::BindingData) \ - V(url_binding_data, url::BindingData) + V(url_binding_data, url::BindingData) \ + V(modules_binding_data, modules::BindingData) #define UNSERIALIZABLE_BINDING_TYPES(V) \ V(http2_binding_data, http2::BindingData) \ diff --git a/src/node_binding.cc b/src/node_binding.cc index 97257d47c61738..2b69a828a744b6 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -49,6 +49,7 @@ V(js_stream) \ V(js_udp_wrap) \ V(messaging) \ + V(modules) \ V(module_wrap) \ V(mksnapshot) \ V(options) \ diff --git a/src/node_binding.h b/src/node_binding.h index 7256bf2bbcf732..dfcfe5fe9e1bf4 100644 --- a/src/node_binding.h +++ b/src/node_binding.h @@ -40,6 +40,7 @@ static_assert(static_cast(NM_F_LINKED) == V(fs_dir) \ V(messaging) \ V(mksnapshot) \ + V(modules) \ V(module_wrap) \ V(performance) \ V(process_methods) \ diff --git a/src/node_errors.h b/src/node_errors.h index 21e51f658db4c6..9e7aaf2c36dd0e 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -76,6 +76,7 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details); V(ERR_INVALID_ARG_TYPE, TypeError) \ V(ERR_INVALID_FILE_URL_HOST, TypeError) \ V(ERR_INVALID_FILE_URL_PATH, TypeError) \ + V(ERR_INVALID_PACKAGE_CONFIG, Error) \ V(ERR_INVALID_OBJECT_DEFINE_PROPERTY, TypeError) \ V(ERR_INVALID_MODULE, Error) \ V(ERR_INVALID_STATE, Error) \ diff --git a/src/node_external_reference.h b/src/node_external_reference.h index 541b73499869e3..f15c97c03d2e9d 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -103,6 +103,7 @@ class ExternalReferenceRegistry { V(messaging) \ V(mksnapshot) \ V(module_wrap) \ + V(modules) \ V(options) \ V(os) \ V(performance) \ diff --git a/src/node_file.cc b/src/node_file.cc index 44935cbf57d5ff..0855bda583a62d 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1038,68 +1038,6 @@ static void ExistsSync(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err == 0); } -// Used to speed up module loading. Returns an array [string, boolean] -static void InternalModuleReadJSON(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args); - Isolate* isolate = env->isolate(); - uv_loop_t* loop = env->event_loop(); - - CHECK(args[0]->IsString()); - node::Utf8Value path(isolate, args[0]); - THROW_IF_INSUFFICIENT_PERMISSIONS( - env, permission::PermissionScope::kFileSystemRead, path.ToStringView()); - - if (strlen(*path) != path.length()) { - return; // Contains a nul byte. - } - uv_fs_t open_req; - const int fd = uv_fs_open(loop, &open_req, *path, O_RDONLY, 0, nullptr); - uv_fs_req_cleanup(&open_req); - - if (fd < 0) { - return; - } - - auto defer_close = OnScopeLeave([fd, loop]() { - uv_fs_t close_req; - CHECK_EQ(0, uv_fs_close(loop, &close_req, fd, nullptr)); - uv_fs_req_cleanup(&close_req); - }); - - const size_t kBlockSize = 32 << 10; - std::vector chars; - int64_t offset = 0; - ssize_t numchars; - do { - const size_t start = chars.size(); - chars.resize(start + kBlockSize); - - uv_buf_t buf; - buf.base = &chars[start]; - buf.len = kBlockSize; - - uv_fs_t read_req; - numchars = uv_fs_read(loop, &read_req, fd, &buf, 1, offset, nullptr); - uv_fs_req_cleanup(&read_req); - - if (numchars < 0) { - return; - } - offset += numchars; - } while (static_cast(numchars) == kBlockSize); - - size_t start = 0; - if (offset >= 3 && 0 == memcmp(chars.data(), "\xEF\xBB\xBF", 3)) { - start = 3; // Skip UTF-8 BOM. - } - const size_t size = offset - start; - - args.GetReturnValue().Set( - String::NewFromUtf8( - isolate, &chars[start], v8::NewStringType::kNormal, size) - .ToLocalChecked()); -} - // Used to speed up module loading. Returns 0 if the path refers to // a file, 1 when it's a directory or < 0 on error (usually -ENOENT.) // The speedup comes from not creating thousands of Stat and Error objects. @@ -3199,7 +3137,6 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data, SetMethod(isolate, target, "rmdir", RMDir); SetMethod(isolate, target, "mkdir", MKDir); SetMethod(isolate, target, "readdir", ReadDir); - SetMethod(isolate, target, "internalModuleReadJSON", InternalModuleReadJSON); SetMethod(isolate, target, "internalModuleStat", InternalModuleStat); SetMethod(isolate, target, "stat", Stat); SetMethod(isolate, target, "lstat", LStat); @@ -3320,7 +3257,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) { registry->Register(RMDir); registry->Register(MKDir); registry->Register(ReadDir); - registry->Register(InternalModuleReadJSON); registry->Register(InternalModuleStat); registry->Register(Stat); registry->Register(LStat); diff --git a/src/node_modules.cc b/src/node_modules.cc new file mode 100644 index 00000000000000..ffe9fdf3f2ccdf --- /dev/null +++ b/src/node_modules.cc @@ -0,0 +1,450 @@ +#include "node_modules.h" +#include +#include "base_object-inl.h" +#include "node_errors.h" +#include "node_external_reference.h" +#include "node_url.h" +#include "permission/permission.h" +#include "permission/permission_base.h" +#include "util-inl.h" +#include "v8-fast-api-calls.h" +#include "v8-function-callback.h" +#include "v8-primitive.h" +#include "v8-value.h" +#include "v8.h" + +#include "simdjson.h" + +namespace node { +namespace modules { + +using v8::Array; +using v8::Context; +using v8::FunctionCallbackInfo; +using v8::HandleScope; +using v8::Isolate; +using v8::Local; +using v8::NewStringType; +using v8::Object; +using v8::ObjectTemplate; +using v8::Primitive; +using v8::String; +using v8::Undefined; +using v8::Value; + +#ifdef __POSIX__ +constexpr char kPathSeparator = '/'; +constexpr std::string_view kNodeModules = "/node_modules"; +#else +constexpr char kPathSeparator = '\\'; +constexpr std::string_view kNodeModules = "\\node_modules"; +#endif + +void BindingData::MemoryInfo(MemoryTracker* tracker) const { + // Do nothing +} + +BindingData::BindingData(Realm* realm, + v8::Local object, + InternalFieldInfo* info) + : SnapshotableObject(realm, object, type_int) {} + +bool BindingData::PrepareForSerialization(v8::Local context, + v8::SnapshotCreator* creator) { + // Return true because we need to maintain the reference to the binding from + // JS land. + return true; +} + +InternalFieldInfoBase* BindingData::Serialize(int index) { + DCHECK_IS_SNAPSHOT_SLOT(index); + InternalFieldInfo* info = + InternalFieldInfoBase::New(type()); + return info; +} + +void BindingData::Deserialize(v8::Local context, + v8::Local holder, + int index, + InternalFieldInfoBase* info) { + DCHECK_IS_SNAPSHOT_SLOT(index); + HandleScope scope(context->GetIsolate()); + Realm* realm = Realm::GetCurrent(context); + BindingData* binding = realm->AddBindingData(holder); + CHECK_NOT_NULL(binding); +} + +Local BindingData::PackageConfig::Serialize(Realm* realm) const { + auto has_manifest = !realm->env()->options()->experimental_policy.empty(); + auto isolate = realm->isolate(); + const auto ToString = [isolate](std::string_view input) -> Local { + return String::NewFromUtf8( + isolate, input.data(), NewStringType::kNormal, input.size()) + .ToLocalChecked(); + }; + Local values[7] = { + name.has_value() ? ToString(*name) : Undefined(isolate), + main.has_value() ? ToString(*main) : Undefined(isolate), + ToString(type), + imports.has_value() ? ToString(*imports) : Undefined(isolate), + exports.has_value() ? ToString(*exports) : Undefined(isolate), + has_manifest ? ToString(raw_json) : Undefined(isolate), + ToString(file_path), + }; + return Array::New(isolate, values, 7); +} + +const BindingData::PackageConfig* BindingData::GetPackageJSON( + Realm* realm, std::string_view path, ErrorContext* error_context) { + auto binding_data = realm->GetBindingData(); + + auto cache_entry = binding_data->package_configs_.find(path.data()); + if (cache_entry != binding_data->package_configs_.end()) { + return &cache_entry->second; + } + + PackageConfig package_config{}; + package_config.file_path = path; + // No need to exclude BOM since simdjson will skip it. + if (ReadFileSync(&package_config.raw_json, path.data()) < 0) { + return nullptr; + } + + simdjson::ondemand::document document; + simdjson::ondemand::object main_object; + simdjson::error_code error = + binding_data->json_parser.iterate(package_config.raw_json).get(document); + + const auto throw_invalid_package_config = [error_context, path, realm]() { + if (error_context == nullptr) { + THROW_ERR_INVALID_PACKAGE_CONFIG( + realm->isolate(), "Invalid package config %s.", path.data()); + } else if (error_context->base.has_value()) { + auto file_url = ada::parse(error_context->base.value()); + CHECK(file_url); + auto file_path = url::FileURLToPath(realm->env(), *file_url); + CHECK(file_path.has_value()); + THROW_ERR_INVALID_PACKAGE_CONFIG( + realm->isolate(), + "Invalid package config %s while importing \"%s\" from %s.", + path.data(), + error_context->specifier.c_str(), + file_path->c_str()); + } else { + THROW_ERR_INVALID_PACKAGE_CONFIG( + realm->isolate(), "Invalid package config %s.", path.data()); + } + + return nullptr; + }; + + if (error || document.get_object().get(main_object)) { + return throw_invalid_package_config(); + } + + simdjson::ondemand::raw_json_string key; + simdjson::ondemand::value value; + std::string_view field_value; + simdjson::ondemand::json_type field_type; + + for (auto field : main_object) { + // Throw error if getting key or value fails. + if (field.key().get(key) || field.value().get(value)) { + return throw_invalid_package_config(); + } + + if (key == "name") { + // Though there is a key "name" with a corresponding value, + // the value may not be a string or could be an invalid JSON string + if (value.get_string(package_config.name)) { + return throw_invalid_package_config(); + } + } else if (key == "main") { + if (value.get_string(package_config.main)) { + return throw_invalid_package_config(); + } + } else if (key == "exports") { + if (value.type().get(field_type)) { + return throw_invalid_package_config(); + } + switch (field_type) { + case simdjson::ondemand::json_type::object: + case simdjson::ondemand::json_type::array: { + if (value.raw_json().get(field_value)) { + return throw_invalid_package_config(); + } + package_config.exports = field_value; + break; + } + case simdjson::ondemand::json_type::string: { + if (value.get_string(package_config.exports)) { + return throw_invalid_package_config(); + } + break; + } + default: + break; + } + } else if (key == "imports") { + if (value.type().get(field_type)) { + return throw_invalid_package_config(); + } + switch (field_type) { + case simdjson::ondemand::json_type::array: + case simdjson::ondemand::json_type::object: { + if (value.raw_json().get(field_value)) { + return throw_invalid_package_config(); + } + package_config.imports = field_value; + break; + } + case simdjson::ondemand::json_type::string: { + if (value.get_string(package_config.imports)) { + return throw_invalid_package_config(); + } + break; + } + default: + break; + } + } else if (key == "type") { + if (value.get_string().get(field_value)) { + return throw_invalid_package_config(); + } + // Only update type if it is "commonjs" or "module" + // The default value is "none" for backward compatibility. + if (field_value == "commonjs" || field_value == "module") { + package_config.type = field_value; + } + } + } + // package_config could be quite large, so we should move it instead of + // copying it. + auto cached = binding_data->package_configs_.insert( + {std::string(path), std::move(package_config)}); + + return &cached.first->second; +} + +void BindingData::ReadPackageJSON(const FunctionCallbackInfo& args) { + CHECK_GE(args.Length(), 1); // path, [is_esm, base, specifier] + CHECK(args[0]->IsString()); // path + + Realm* realm = Realm::GetCurrent(args); + auto isolate = realm->isolate(); + + Utf8Value path(isolate, args[0]); + bool is_esm = args[1]->IsTrue(); + auto error_context = ErrorContext(); + if (is_esm) { + CHECK(args[2]->IsUndefined() || args[2]->IsString()); // base + CHECK(args[3]->IsString()); // specifier + + if (args[2]->IsString()) { + Utf8Value base_value(isolate, args[2]); + error_context.base = base_value.ToString(); + } + Utf8Value specifier(isolate, args[3]); + error_context.specifier = specifier.ToString(); + } + + THROW_IF_INSUFFICIENT_PERMISSIONS( + realm->env(), + permission::PermissionScope::kFileSystemRead, + path.ToStringView()); + + auto package_json = + GetPackageJSON(realm, path.ToString(), is_esm ? &error_context : nullptr); + if (package_json == nullptr) { + return; + } + + args.GetReturnValue().Set(package_json->Serialize(realm)); +} + +const BindingData::PackageConfig* BindingData::TraverseParent( + Realm* realm, std::string_view check_path) { + auto env = realm->env(); + auto root_separator_index = check_path.find_first_of(kPathSeparator); + size_t separator_index = 0; + const bool is_permissions_enabled = env->permission()->enabled(); + + do { + separator_index = check_path.find_last_of(kPathSeparator); + check_path = check_path.substr(0, separator_index); + + // We don't need to try "/" + if (check_path.empty()) { + break; + } + + // Stop the search when the process doesn't have permissions + // to walk upwards + if (UNLIKELY(is_permissions_enabled && + !env->permission()->is_granted( + permission::PermissionScope::kFileSystemRead, + std::string(check_path) + kPathSeparator))) { + return nullptr; + } + + // Check if the path ends with `/node_modules` + if (check_path.size() >= kNodeModules.size() && + std::equal(check_path.end() - kNodeModules.size(), + check_path.end(), + kNodeModules.begin())) { + return nullptr; + } + + auto package_json = GetPackageJSON( + realm, + std::string(check_path) + kPathSeparator + "package.json", + nullptr); + if (package_json != nullptr) { + return package_json; + } + } while (separator_index > root_separator_index); + + return nullptr; +} + +void BindingData::GetNearestParentPackageJSON( + const v8::FunctionCallbackInfo& args) { + CHECK_GE(args.Length(), 1); + CHECK(args[0]->IsString()); + + Realm* realm = Realm::GetCurrent(args); + Utf8Value path_value(realm->isolate(), args[0]); + auto package_json = TraverseParent(realm, path_value.ToStringView()); + + if (package_json != nullptr) { + args.GetReturnValue().Set(package_json->Serialize(realm)); + } +} + +void BindingData::GetNearestParentPackageJSONType( + const FunctionCallbackInfo& args) { + CHECK_GE(args.Length(), 1); + CHECK(args[0]->IsString()); + + Realm* realm = Realm::GetCurrent(args); + Utf8Value path(realm->isolate(), args[0]); + auto package_json = TraverseParent(realm, path.ToStringView()); + + if (package_json == nullptr) { + return; + } + + Local values[3] = { + ToV8Value(realm->context(), package_json->type).ToLocalChecked(), + ToV8Value(realm->context(), package_json->file_path).ToLocalChecked(), + ToV8Value(realm->context(), package_json->raw_json).ToLocalChecked()}; + args.GetReturnValue().Set(Array::New(realm->isolate(), values, 3)); +} + +void BindingData::GetPackageScopeConfig( + const FunctionCallbackInfo& args) { + CHECK_GE(args.Length(), 1); + CHECK(args[0]->IsString()); + + Realm* realm = Realm::GetCurrent(args); + Utf8Value resolved(realm->isolate(), args[0]); + auto package_json_url_base = ada::parse(resolved.ToStringView()); + if (!package_json_url_base) { + url::ThrowInvalidURL(realm->env(), resolved.ToStringView(), std::nullopt); + return; + } + auto package_json_url = + ada::parse("./package.json", &package_json_url_base.value()); + if (!package_json_url) { + url::ThrowInvalidURL(realm->env(), "./package.json", resolved.ToString()); + return; + } + + std::string_view node_modules_package_path = "node_modules/package.json"; + auto error_context = ErrorContext(); + error_context.is_esm = true; + + // TODO(@anonrig): Rewrite this function and avoid calling URL parser. + while (true) { + auto pathname = package_json_url->get_pathname(); + if (pathname.size() >= node_modules_package_path.size() && + pathname.compare(pathname.size() - node_modules_package_path.size(), + node_modules_package_path.size(), + node_modules_package_path) == 0) { + break; + } + + auto file_url = url::FileURLToPath(realm->env(), *package_json_url); + CHECK(file_url); + error_context.specifier = resolved.ToString(); + auto package_json = GetPackageJSON(realm, *file_url, &error_context); + if (package_json != nullptr) { + return args.GetReturnValue().Set(package_json->Serialize(realm)); + } + + auto last_href = std::string(package_json_url->get_href()); + auto last_pathname = std::string(package_json_url->get_pathname()); + package_json_url = ada::parse("../package.json", &package_json_url.value()); + if (!package_json_url) { + url::ThrowInvalidURL(realm->env(), "../package.json", last_href); + return; + } + + // Terminates at root where ../package.json equals ../../package.json + // (can't just check "/package.json" for Windows support). + if (package_json_url->get_pathname() == last_pathname) { + break; + } + } + + auto package_json_url_as_path = + url::FileURLToPath(realm->env(), *package_json_url); + CHECK(package_json_url_as_path); + return args.GetReturnValue().Set( + String::NewFromUtf8(realm->isolate(), + package_json_url_as_path->c_str(), + NewStringType::kNormal, + package_json_url_as_path->size()) + .ToLocalChecked()); +} + +void BindingData::CreatePerIsolateProperties(IsolateData* isolate_data, + Local target) { + Isolate* isolate = isolate_data->isolate(); + SetMethod(isolate, target, "readPackageJSON", ReadPackageJSON); + SetMethod(isolate, + target, + "getNearestParentPackageJSONType", + GetNearestParentPackageJSONType); + SetMethod(isolate, + target, + "getNearestParentPackageJSON", + GetNearestParentPackageJSON); + SetMethod(isolate, target, "getPackageScopeConfig", GetPackageScopeConfig); +} + +void BindingData::CreatePerContextProperties(Local target, + Local unused, + Local context, + void* priv) { + Realm* realm = Realm::GetCurrent(context); + realm->AddBindingData(target); +} + +void BindingData::RegisterExternalReferences( + ExternalReferenceRegistry* registry) { + registry->Register(ReadPackageJSON); + registry->Register(GetNearestParentPackageJSONType); + registry->Register(GetNearestParentPackageJSON); + registry->Register(GetPackageScopeConfig); +} + +} // namespace modules +} // namespace node + +NODE_BINDING_CONTEXT_AWARE_INTERNAL( + modules, node::modules::BindingData::CreatePerContextProperties) +NODE_BINDING_PER_ISOLATE_INIT( + modules, node::modules::BindingData::CreatePerIsolateProperties) +NODE_BINDING_EXTERNAL_REFERENCE( + modules, node::modules::BindingData::RegisterExternalReferences) diff --git a/src/node_modules.h b/src/node_modules.h new file mode 100644 index 00000000000000..27b2bcb11f56b0 --- /dev/null +++ b/src/node_modules.h @@ -0,0 +1,89 @@ +#ifndef SRC_NODE_MODULES_H_ +#define SRC_NODE_MODULES_H_ + +#include "v8-function-callback.h" +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#include "node.h" +#include "node_snapshotable.h" +#include "simdjson.h" +#include "util.h" +#include "v8-fast-api-calls.h" +#include "v8.h" + +#include +#include +#include +#include + +namespace node { +class ExternalReferenceRegistry; + +namespace modules { + +class BindingData : public SnapshotableObject { + public: + using InternalFieldInfo = InternalFieldInfoBase; + + struct PackageConfig { + std::string file_path; + std::optional name; + std::optional main; + std::string type = "none"; + std::optional exports; + std::optional imports; + std::string raw_json; + + v8::Local Serialize(Realm* realm) const; + }; + + struct ErrorContext { + std::optional base; + std::string specifier; + bool is_esm; + }; + + BindingData(Realm* realm, + v8::Local obj, + InternalFieldInfo* info = nullptr); + SERIALIZABLE_OBJECT_METHODS() + SET_BINDING_ID(modules_binding_data) + + void MemoryInfo(MemoryTracker* tracker) const override; + SET_SELF_SIZE(BindingData) + SET_MEMORY_INFO_NAME(BindingData) + + static void ReadPackageJSON(const v8::FunctionCallbackInfo& args); + static void GetNearestParentPackageJSON( + const v8::FunctionCallbackInfo& args); + static void GetNearestParentPackageJSONType( + const v8::FunctionCallbackInfo& args); + static void GetPackageScopeConfig( + const v8::FunctionCallbackInfo& args); + + static void CreatePerIsolateProperties(IsolateData* isolate_data, + v8::Local ctor); + static void CreatePerContextProperties(v8::Local target, + v8::Local unused, + v8::Local context, + void* priv); + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); + + private: + std::unordered_map package_configs_; + simdjson::ondemand::parser json_parser; + // returns null on error + static const PackageConfig* GetPackageJSON( + Realm* realm, + std::string_view path, + ErrorContext* error_context = nullptr); + static const PackageConfig* TraverseParent(Realm* realm, + std::string_view check_path); +}; + +} // namespace modules +} // namespace node + +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#endif // SRC_NODE_MODULES_H_ diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index 0a9c5db2af5075..f40669d1695a4b 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -19,6 +19,7 @@ #include "node_internals.h" #include "node_main_instance.h" #include "node_metadata.h" +#include "node_modules.h" #include "node_process.h" #include "node_snapshot_builder.h" #include "node_url.h" diff --git a/src/node_url.cc b/src/node_url.cc index 94510aa1904a00..95d15c78407359 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -229,35 +229,6 @@ void BindingData::Format(const FunctionCallbackInfo& args) { .ToLocalChecked()); } -void BindingData::ThrowInvalidURL(node::Environment* env, - std::string_view input, - std::optional base) { - Local err = ERR_INVALID_URL(env->isolate(), "Invalid URL"); - DCHECK(err->IsObject()); - - auto err_object = err.As(); - - USE(err_object->Set(env->context(), - env->input_string(), - v8::String::NewFromUtf8(env->isolate(), - input.data(), - v8::NewStringType::kNormal, - input.size()) - .ToLocalChecked())); - - if (base.has_value()) { - USE(err_object->Set(env->context(), - env->base_string(), - v8::String::NewFromUtf8(env->isolate(), - base.value().c_str(), - v8::NewStringType::kNormal, - base.value().size()) - .ToLocalChecked())); - } - - env->isolate()->ThrowException(err); -} - void BindingData::Parse(const FunctionCallbackInfo& args) { CHECK_GE(args.Length(), 1); CHECK(args[0]->IsString()); // input @@ -419,6 +390,35 @@ void BindingData::RegisterExternalReferences( } } +void ThrowInvalidURL(node::Environment* env, + std::string_view input, + std::optional base) { + Local err = ERR_INVALID_URL(env->isolate(), "Invalid URL"); + DCHECK(err->IsObject()); + + auto err_object = err.As(); + + USE(err_object->Set(env->context(), + env->input_string(), + v8::String::NewFromUtf8(env->isolate(), + input.data(), + v8::NewStringType::kNormal, + input.size()) + .ToLocalChecked())); + + if (base.has_value()) { + USE(err_object->Set(env->context(), + env->base_string(), + v8::String::NewFromUtf8(env->isolate(), + base.value().c_str(), + v8::NewStringType::kNormal, + base.value().size()) + .ToLocalChecked())); + } + + env->isolate()->ThrowException(err); +} + std::string FromFilePath(std::string_view file_path) { // Avoid unnecessary allocations. size_t pos = file_path.empty() ? std::string_view::npos : file_path.find('%'); diff --git a/src/node_url.h b/src/node_url.h index c106e8245284da..3c77b538b16f8f 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -77,11 +77,11 @@ class BindingData : public SnapshotableObject { const ada::scheme::type type); static v8::CFunction fast_can_parse_methods_[]; - static void ThrowInvalidURL(Environment* env, - std::string_view input, - std::optional base); }; +void ThrowInvalidURL(Environment* env, + std::string_view input, + std::optional base); std::string FromFilePath(std::string_view file_path); std::optional FileURLToPath(Environment* env, const ada::url_aggregator& file_url); diff --git a/test/es-module/test-esm-invalid-pjson.js b/test/es-module/test-esm-invalid-pjson.js index 9b49f6f1357685..52cef9ea98b40a 100644 --- a/test/es-module/test-esm-invalid-pjson.js +++ b/test/es-module/test-esm-invalid-pjson.js @@ -1,6 +1,6 @@ 'use strict'; -const { checkoutEOL, spawnPromisified } = require('../common'); +const { spawnPromisified } = require('../common'); const fixtures = require('../common/fixtures.js'); const assert = require('node:assert'); const { execPath } = require('node:process'); @@ -14,12 +14,10 @@ describe('ESM: Package.json', { concurrency: true }, () => { const { code, signal, stderr } = await spawnPromisified(execPath, [entry]); + assert.ok(stderr.includes('code: \'ERR_INVALID_PACKAGE_CONFIG\''), stderr); assert.ok( stderr.includes( - `[ERR_INVALID_PACKAGE_CONFIG]: Invalid package config ${invalidJson} ` + - `while importing "invalid-pjson" from ${entry}. ` + - "Expected ':' after property name in JSON at position " + - `${12 + checkoutEOL.length * 2}` + `Invalid package config ${invalidJson} while importing "invalid-pjson" from ${entry}.` ), stderr ); diff --git a/test/fixtures/node_modules/pkgexports-number/package.json b/test/fixtures/node_modules/pkgexports-number/package.json index 315f39a66e32a6..c5807f588ce8f7 100644 --- a/test/fixtures/node_modules/pkgexports-number/package.json +++ b/test/fixtures/node_modules/pkgexports-number/package.json @@ -1,3 +1,3 @@ { - "exports": 42 + "exports": {} } diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js index 047e4fbeaa1e67..d158e489196c39 100644 --- a/test/parallel/test-bootstrap-modules.js +++ b/test/parallel/test-bootstrap-modules.js @@ -24,6 +24,7 @@ const expected = {}; expected.beforePreExec = new Set([ 'Internal Binding builtins', 'Internal Binding encoding_binding', + 'Internal Binding modules', 'Internal Binding errors', 'Internal Binding util', 'NativeModule internal/errors', diff --git a/test/parallel/test-module-binding.js b/test/parallel/test-module-binding.js deleted file mode 100644 index d7f76d6ef5b153..00000000000000 --- a/test/parallel/test-module-binding.js +++ /dev/null @@ -1,29 +0,0 @@ -// Flags: --expose-internals -'use strict'; -require('../common'); -const fixtures = require('../common/fixtures'); -const { internalBinding } = require('internal/test/binding'); -const { filterOwnProperties } = require('internal/util'); -const { internalModuleReadJSON } = internalBinding('fs'); -const { readFileSync } = require('fs'); -const { strictEqual, deepStrictEqual } = require('assert'); - -{ - strictEqual(internalModuleReadJSON('nosuchfile'), undefined); -} -{ - strictEqual(internalModuleReadJSON(fixtures.path('empty.txt')), ''); -} -{ - strictEqual(internalModuleReadJSON(fixtures.path('empty-with-bom.txt')), ''); -} -{ - const filename = fixtures.path('require-bin/package.json'); - const returnValue = JSON.parse(internalModuleReadJSON(filename)); - const file = JSON.parse(readFileSync(filename, 'utf-8')); - const expectedValue = filterOwnProperties(file, ['name', 'main', 'exports', 'imports', 'type']); - deepStrictEqual({ - __proto__: null, - ...returnValue, - }, expectedValue); -} diff --git a/typings/globals.d.ts b/typings/globals.d.ts index d72bf937bb75c9..39df64f7ec5bf4 100644 --- a/typings/globals.d.ts +++ b/typings/globals.d.ts @@ -14,6 +14,7 @@ import {TypesBinding} from "./internalBinding/types"; import {URLBinding} from "./internalBinding/url"; import {UtilBinding} from "./internalBinding/util"; import {WorkerBinding} from "./internalBinding/worker"; +import {ModulesBinding} from "./internalBinding/modules"; declare type TypedArray = | Uint8Array @@ -36,6 +37,7 @@ interface InternalBindingMap { fs: FsBinding; http_parser: HttpParserBinding; messaging: MessagingBinding; + modules: ModulesBinding; options: OptionsBinding; os: OSBinding; serdes: SerdesBinding; diff --git a/typings/internalBinding/fs.d.ts b/typings/internalBinding/fs.d.ts index 5e7b3482bf6260..71707c0329020a 100644 --- a/typings/internalBinding/fs.d.ts +++ b/typings/internalBinding/fs.d.ts @@ -111,7 +111,6 @@ declare namespace InternalFSBinding { function futimes(fd: number, atime: number, mtime: number): void; function futimes(fd: number, atime: number, mtime: number, usePromises: typeof kUsePromises): Promise; - function internalModuleReadJSON(path: string): [] | [string, boolean]; function internalModuleStat(path: string): number; function lchown(path: string, uid: number, gid: number, req: FSReqCallback): void; diff --git a/typings/internalBinding/modules.d.ts b/typings/internalBinding/modules.d.ts new file mode 100644 index 00000000000000..ddbb3d02704908 --- /dev/null +++ b/typings/internalBinding/modules.d.ts @@ -0,0 +1,29 @@ +export type PackageType = 'commonjs' | 'module' | 'none' +export type PackageConfig = { + pjsonPath: string + exists: boolean + name?: string + main?: any + type: PackageType + exports?: string | string[] | Record + imports?: string | string[] | Record +} +export type SerializedPackageConfig = [ + PackageConfig['name'], + PackageConfig['main'], + PackageConfig['type'], + string | undefined, // exports + string | undefined, // imports + string | undefined, // raw json available for experimental policy +] + +export interface ModulesBinding { + readPackageJSON(path: string): SerializedPackageConfig | undefined; + getNearestParentPackageJSON(path: string): PackageConfig | undefined + getNearestParentPackageJSONType(path: string): [ + PackageConfig['type'], + string, // package.json path + string, // raw content + ] + getPackageScopeConfig(path: string): SerializedPackageConfig | undefined +} From 9f54987fbc50503a4644c3f5b22eba93ff97f405 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Fri, 10 Nov 2023 15:49:40 -0500 Subject: [PATCH 03/67] module: merge config with `package_json_reader` PR-URL: https://github.com/nodejs/node/pull/50322 Reviewed-By: Jacob Smith Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell Reviewed-By: Geoffrey Booth --- lib/internal/modules/esm/get_format.js | 2 +- lib/internal/modules/esm/module_job.js | 2 +- lib/internal/modules/esm/package_config.js | 44 --------------------- lib/internal/modules/esm/resolve.js | 5 +-- lib/internal/modules/package_json_reader.js | 36 ++++++++++++++++- 5 files changed, 38 insertions(+), 51 deletions(-) delete mode 100644 lib/internal/modules/esm/package_config.js diff --git a/lib/internal/modules/esm/get_format.js b/lib/internal/modules/esm/get_format.js index c029b6c614384f..5959d476e13bd9 100644 --- a/lib/internal/modules/esm/get_format.js +++ b/lib/internal/modules/esm/get_format.js @@ -19,7 +19,7 @@ const { const experimentalNetworkImports = getOptionValue('--experimental-network-imports'); const { containsModuleSyntax } = internalBinding('contextify'); -const { getPackageType } = require('internal/modules/esm/package_config'); +const { getPackageType } = require('internal/modules/package_json_reader'); const { fileURLToPath } = require('internal/url'); const { ERR_UNKNOWN_FILE_EXTENSION } = require('internal/errors').codes; diff --git a/lib/internal/modules/esm/module_job.js b/lib/internal/modules/esm/module_job.js index 7116f3724bb6e1..33576c5893600b 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -228,7 +228,7 @@ class ModuleJob { const packageConfig = StringPrototypeStartsWith(this.module.url, 'file://') && RegExpPrototypeExec(/\.js(\?[^#]*)?(#.*)?$/, this.module.url) !== null && - require('internal/modules/esm/package_config') + require('internal/modules/package_json_reader') .getPackageScopeConfig(this.module.url); if (packageConfig.type === 'module') { e.message += diff --git a/lib/internal/modules/esm/package_config.js b/lib/internal/modules/esm/package_config.js deleted file mode 100644 index 6b3847966cb1d3..00000000000000 --- a/lib/internal/modules/esm/package_config.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -const { ArrayIsArray } = primordials; -const modulesBinding = internalBinding('modules'); -const { deserializePackageJSON } = require('internal/modules/package_json_reader'); - -// TODO(@anonrig): Merge this file with internal/esm/package_json_reader.js - -/** - * Returns the package configuration for the given resolved URL. - * @param {URL | string} resolved - The resolved URL. - * @returns {import('typings/internalBinding/modules').PackageConfig} - The package configuration. - */ -function getPackageScopeConfig(resolved) { - const result = modulesBinding.getPackageScopeConfig(`${resolved}`); - - if (ArrayIsArray(result)) { - return deserializePackageJSON(`${resolved}`, result, false /* checkIntegrity */); - } - - // This means that the response is a string - // and it is the path to the package.json file - return { - __proto__: null, - pjsonPath: result, - exists: false, - type: 'none', - }; -} - -/** - * Returns the package type for a given URL. - * @param {URL} url - The URL to get the package type for. - */ -function getPackageType(url) { - // TODO(@anonrig): Write a C++ function that returns only "type". - return getPackageScopeConfig(url).type; -} - - -module.exports = { - getPackageScopeConfig, - getPackageType, -}; diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index a6469cfad77e47..c40f81200de5fc 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -55,7 +55,6 @@ const { } = require('internal/errors').codes; const { Module: CJSModule } = require('internal/modules/cjs/loader'); -const { getPackageScopeConfig } = require('internal/modules/esm/package_config'); const { getConditionsSet } = require('internal/modules/esm/utils'); const packageJsonReader = require('internal/modules/package_json_reader'); const { internalModuleStat } = internalBinding('fs'); @@ -687,7 +686,7 @@ function packageImportsResolve(name, base, conditions) { throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base)); } let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base); + const packageConfig = packageJsonReader.getPackageScopeConfig(base); if (packageConfig.exists) { packageJSONUrl = pathToFileURL(packageConfig.pjsonPath); const imports = packageConfig.imports; @@ -796,7 +795,7 @@ function packageResolve(specifier, base, conditions) { parsePackageName(specifier, base); // ResolveSelf - const packageConfig = getPackageScopeConfig(base); + const packageConfig = packageJsonReader.getPackageScopeConfig(base); if (packageConfig.exists) { const packageJSONUrl = pathToFileURL(packageConfig.pjsonPath); if (packageConfig.exports != null && packageConfig.name === packageName) { diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js index 232ed35528c5c5..0842d543862c33 100644 --- a/lib/internal/modules/package_json_reader.js +++ b/lib/internal/modules/package_json_reader.js @@ -1,6 +1,7 @@ 'use strict'; const { + ArrayIsArray, JSONParse, StringPrototypeSlice, StringPrototypeLastIndexOf, @@ -149,11 +150,42 @@ function getNearestParentPackageJSON(checkPath) { return { data, path }; } +/** + * Returns the package configuration for the given resolved URL. + * @param {URL | string} resolved - The resolved URL. + * @returns {import('typings/internalBinding/modules').PackageConfig} - The package configuration. + */ +function getPackageScopeConfig(resolved) { + const result = modulesBinding.getPackageScopeConfig(`${resolved}`); + + if (ArrayIsArray(result)) { + return deserializePackageJSON(`${resolved}`, result, false /* checkIntegrity */); + } + + // This means that the response is a string + // and it is the path to the package.json file + return { + __proto__: null, + pjsonPath: result, + exists: false, + type: 'none', + }; +} + +/** + * Returns the package type for a given URL. + * @param {URL} url - The URL to get the package type for. + */ +function getPackageType(url) { + // TODO(@anonrig): Write a C++ function that returns only "type". + return getPackageScopeConfig(url).type; +} + module.exports = { checkPackageJSONIntegrity, read, readPackage, getNearestParentPackageJSON, - - deserializePackageJSON, + getPackageScopeConfig, + getPackageType, }; From 9bf144379fed135ed32661d5daff9b26c92f2bbb Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sun, 3 Dec 2023 18:45:47 -0500 Subject: [PATCH 04/67] src: omit bool values of package.json main field PR-URL: https://github.com/nodejs/node/pull/50965 Reviewed-By: Geoffrey Booth Reviewed-By: Benjamin Gruenbaum --- src/node_modules.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node_modules.cc b/src/node_modules.cc index ffe9fdf3f2ccdf..cfb6090d27ac6f 100644 --- a/src/node_modules.cc +++ b/src/node_modules.cc @@ -160,9 +160,8 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( return throw_invalid_package_config(); } } else if (key == "main") { - if (value.get_string(package_config.main)) { - return throw_invalid_package_config(); - } + // Omit all non-string values + USE(value.get_string(package_config.main)); } else if (key == "exports") { if (value.type().get(field_type)) { return throw_invalid_package_config(); From f2d83a3a84204730a704b2cf6f350ec6e79e84ea Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Mon, 4 Dec 2023 22:37:44 +0800 Subject: [PATCH 05/67] benchmark: update iterations in benchmark/util/format.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/50571 PR-URL: https://github.com/nodejs/node/pull/50932 Refs: https://github.com/nodejs/node/issues/50571 Reviewed-By: Vinícius Lourenço Claro Cardoso --- benchmark/util/format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/util/format.js b/benchmark/util/format.js index 4078fe5e3da7cd..dfbb6c3372a23b 100644 --- a/benchmark/util/format.js +++ b/benchmark/util/format.js @@ -18,7 +18,7 @@ const inputs = { }; const bench = common.createBenchmark(main, { - n: [1e5], + n: [1e6], type: Object.keys(inputs), }); From dbee03d6469f855cc205cbddfc691b66495bac74 Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Mon, 4 Dec 2023 22:37:54 +0800 Subject: [PATCH 06/67] benchmark: update iterations in benchmark/util/inspect-array.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/50571 PR-URL: https://github.com/nodejs/node/pull/50933 Refs: https://github.com/nodejs/node/issues/50571 Reviewed-By: Vinícius Lourenço Claro Cardoso --- benchmark/util/inspect-array.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/util/inspect-array.js b/benchmark/util/inspect-array.js index 7b2394d80e9cfe..ed40f5c4324ac3 100644 --- a/benchmark/util/inspect-array.js +++ b/benchmark/util/inspect-array.js @@ -4,7 +4,7 @@ const common = require('../common'); const util = require('util'); const bench = common.createBenchmark(main, { - n: [5e2], + n: [5e3], len: [1e2, 1e5], type: [ 'denseArray', From b80bb1329b24b7f6377ae5fb3bf440fe922de719 Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Mon, 4 Dec 2023 22:38:05 +0800 Subject: [PATCH 07/67] benchmark: update iterations in benchmark/util/normalize-encoding.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/50571 PR-URL: https://github.com/nodejs/node/pull/50934 Refs: https://github.com/nodejs/node/issues/50571 Reviewed-By: Vinícius Lourenço Claro Cardoso --- benchmark/util/normalize-encoding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/util/normalize-encoding.js b/benchmark/util/normalize-encoding.js index cd65caca4a4056..204ea67c54ce1a 100644 --- a/benchmark/util/normalize-encoding.js +++ b/benchmark/util/normalize-encoding.js @@ -21,7 +21,7 @@ const inputs = [ const bench = common.createBenchmark(main, { input: inputs.concat(Object.keys(groupedInputs)), - n: [1e5], + n: [1e6], }, { flags: '--expose-internals', }); From a9972057ac037bae76c896352dac6ddd792cfe99 Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Mon, 4 Dec 2023 22:38:26 +0800 Subject: [PATCH 08/67] benchmark: update iterations of benchmark/util/type-check.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/50571 PR-URL: https://github.com/nodejs/node/pull/50937 Refs: https://github.com/nodejs/node/issues/50571 Reviewed-By: Vinícius Lourenço Claro Cardoso --- benchmark/util/type-check.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index 2bb956f4ed87ee..269c2a4e9c1374 100644 --- a/benchmark/util/type-check.js +++ b/benchmark/util/type-check.js @@ -29,7 +29,7 @@ const bench = common.createBenchmark(main, { type: Object.keys(args), version: ['native', 'js'], argument: ['true', 'false-primitive', 'false-object'], - n: [1e5], + n: [1e6], }, { flags: ['--expose-internals', '--no-warnings'], }); From fdd8c18f96b14e74549ef3f8a4f05a823cf017a3 Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Mon, 4 Dec 2023 22:38:36 +0800 Subject: [PATCH 09/67] benchmark: update interations and len in benchmark/util/text-decoder.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/50571 PR-URL: https://github.com/nodejs/node/pull/50938 Refs: https://github.com/nodejs/node/issues/50571 Reviewed-By: Vinícius Lourenço Claro Cardoso --- benchmark/util/text-decoder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/util/text-decoder.js b/benchmark/util/text-decoder.js index f85dd4db008ed8..dd4f02016df077 100644 --- a/benchmark/util/text-decoder.js +++ b/benchmark/util/text-decoder.js @@ -6,8 +6,8 @@ const bench = common.createBenchmark(main, { encoding: ['utf-8', 'latin1', 'iso-8859-3'], ignoreBOM: [0, 1], fatal: [0, 1], - len: [256, 1024 * 16, 1024 * 512], - n: [1e2], + len: [256, 1024 * 16, 1024 * 128], + n: [1e3], type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer'], }); From 4eedf5e694da6e7b15302c1e6cceb6802460fada Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 21 Nov 2023 22:31:09 +0000 Subject: [PATCH 10/67] module: fix recently introduced coverity warning Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/50843 Reviewed-By: James M Snell --- src/node_modules.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node_modules.cc b/src/node_modules.cc index cfb6090d27ac6f..9217b94852e33b 100644 --- a/src/node_modules.cc +++ b/src/node_modules.cc @@ -153,6 +153,10 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( return throw_invalid_package_config(); } + // based on coverity using key with == derefs the raw value + // avoid derefing if its null + if (key.raw() == nullptr) continue; + if (key == "name") { // Though there is a key "name" with a corresponding value, // the value may not be a string or could be an invalid JSON string From f90fc83e9718debe248c6291acd7b518d167784b Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Mon, 4 Dec 2023 17:30:58 +0000 Subject: [PATCH 11/67] src: fix dynamically linked zlib version Report the version of the dynamically linked zlib if built with `configure --shared-zlib` instead of the hardcoded version that corresponds to the bundled version of zlib in `deps`. PR-URL: https://github.com/nodejs/node/pull/51007 Refs: https://github.com/nodejs/node/pull/50910 Refs: https://github.com/nodejs/node/pull/50158 Reviewed-By: Luigi Pinca Reviewed-By: Michael Dawson --- node.gypi | 1 + src/node_metadata.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/node.gypi b/node.gypi index 9138317c62c7cd..95133818dff7c7 100644 --- a/node.gypi +++ b/node.gypi @@ -141,6 +141,7 @@ } ], [ 'node_shared_zlib=="false"', { 'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ], + 'defines': [ 'NODE_BUNDLED_ZLIB' ], 'conditions': [ [ 'force_load=="true"', { 'xcode_settings': { diff --git a/src/node_metadata.cc b/src/node_metadata.cc index ffd8d065073fee..14fb8ec9714001 100644 --- a/src/node_metadata.cc +++ b/src/node_metadata.cc @@ -15,7 +15,12 @@ #include "uv.h" #include "uvwasi.h" #include "v8.h" + +#ifdef NODE_BUNDLED_ZLIB #include "zlib_version.h" +#else +#include +#endif // NODE_BUNDLED_ZLIB #if HAVE_OPENSSL #include @@ -79,7 +84,11 @@ Metadata::Versions::Versions() { node = NODE_VERSION_STRING; v8 = v8::V8::GetVersion(); uv = uv_version_string(); +#ifdef NODE_BUNDLED_ZLIB zlib = ZLIB_VERSION; +#else + zlib = zlibVersion(); +#endif // NODE_BUNDLED_ZLIB ares = ARES_VERSION_STR; modules = NODE_STRINGIFY(NODE_MODULE_VERSION); nghttp2 = NGHTTP2_VERSION; From 58ca66a1a7b5cb025e449c786002f0ea62c59dcf Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 5 Dec 2023 00:11:36 +0100 Subject: [PATCH 12/67] doc: deprecate `dirent.path` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51020 Reviewed-By: Yagiz Nizipli Reviewed-By: LiviaMedeiros Reviewed-By: Michaël Zasso Reviewed-By: Moshe Atlow --- doc/api/deprecations.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 4168b88ef8b678..0d99af2ad4ee39 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3453,6 +3453,20 @@ Type: Documentation-only The [`util.types.isWebAssemblyCompiledModule`][] API is deprecated. Please use `value instanceof WebAssembly.Module` instead. +### DEP0178: `dirent.path` + + + +Type: Documentation-only + +The [`dirent.path`][] is deprecated due to its lack of consistency across +release lines. Please use [`dirent.parentPath`][] instead. + [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 [RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4 @@ -3499,6 +3513,8 @@ The [`util.types.isWebAssemblyCompiledModule`][] API is deprecated. Please use [`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding [`diagnostics_channel.subscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelsubscribename-onmessage [`diagnostics_channel.unsubscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelunsubscribename-onmessage +[`dirent.parentPath`]: fs.md#direntparentpath +[`dirent.path`]: fs.md#direntpath [`dns.lookup()`]: dns.md#dnslookuphostname-options-callback [`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options [`domain`]: domain.md From 06038a489ec4bbd9938d0b4b3964eecd33bbc575 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Fri, 10 Nov 2023 08:44:03 +0000 Subject: [PATCH 13/67] deps: update libuv to 1.47.0 deps: update libuv to 1.47.0 PR-URL: https://github.com/nodejs/node/pull/50650 Reviewed-By: Ben Noordhuis Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca --- deps/uv/AUTHORS | 12 + deps/uv/CMakeLists.txt | 7 +- deps/uv/ChangeLog | 111 +- deps/uv/configure.ac | 4 +- deps/uv/docs/requirements.txt | 13 +- deps/uv/docs/src/conf.py | 2 +- deps/uv/docs/src/fs_event.rst | 8 +- deps/uv/docs/src/misc.rst | 47 + deps/uv/include/uv.h | 12 + deps/uv/include/uv/version.h | 2 +- deps/uv/src/idna.c | 244 ++- deps/uv/src/idna.h | 4 +- deps/uv/src/unix/darwin.c | 4 +- deps/uv/src/unix/fs.c | 242 +-- deps/uv/src/unix/kqueue.c | 18 +- deps/uv/src/unix/linux.c | 121 +- deps/uv/src/unix/os390.c | 14 +- deps/uv/src/unix/signal.c | 15 + deps/uv/src/unix/tcp.c | 101 +- deps/uv/src/unix/thread.c | 22 + deps/uv/src/uv-common.c | 3 + deps/uv/src/win/dl.c | 15 +- deps/uv/src/win/fs-event.c | 28 +- deps/uv/src/win/fs.c | 381 +--- deps/uv/src/win/getaddrinfo.c | 156 +- deps/uv/src/win/getnameinfo.c | 29 +- deps/uv/src/win/internal.h | 5 +- deps/uv/src/win/pipe.c | 146 +- deps/uv/src/win/process.c | 192 +- deps/uv/src/win/tty.c | 62 +- deps/uv/src/win/util.c | 412 +--- deps/uv/test/benchmark-async-pummel.c | 8 +- deps/uv/test/benchmark-async.c | 32 +- deps/uv/test/benchmark-getaddrinfo.c | 8 +- deps/uv/test/benchmark-loop-count.c | 2 +- deps/uv/test/benchmark-million-async.c | 12 +- deps/uv/test/benchmark-million-timers.c | 12 +- deps/uv/test/benchmark-multi-accept.c | 114 +- deps/uv/test/benchmark-ping-pongs.c | 26 +- deps/uv/test/benchmark-ping-udp.c | 12 +- deps/uv/test/benchmark-pound.c | 12 +- deps/uv/test/benchmark-pump.c | 50 +- deps/uv/test/benchmark-queue-work.c | 10 +- deps/uv/test/benchmark-spawn.c | 22 +- deps/uv/test/benchmark-tcp-write-batch.c | 30 +- deps/uv/test/benchmark-thread.c | 8 +- deps/uv/test/benchmark-udp-pummel.c | 60 +- deps/uv/test/blackhole-server.c | 22 +- deps/uv/test/echo-server.c | 36 +- deps/uv/test/run-tests.c | 33 +- deps/uv/test/runner-win.c | 4 +- deps/uv/test/task.h | 5 +- deps/uv/test/test-active.c | 32 +- deps/uv/test/test-async-null-cb.c | 16 +- deps/uv/test/test-async.c | 26 +- deps/uv/test/test-barrier.c | 26 +- deps/uv/test/test-callback-stack.c | 35 +- deps/uv/test/test-close-fd.c | 34 +- deps/uv/test/test-close-order.c | 18 +- deps/uv/test/test-condvar.c | 36 +- deps/uv/test/test-connect-unspecified.c | 30 +- deps/uv/test/test-connection-fail.c | 34 +- deps/uv/test/test-cwd-and-chdir.c | 18 +- deps/uv/test/test-default-loop-close.c | 18 +- deps/uv/test/test-delayed-accept.c | 40 +- deps/uv/test/test-dlerror.c | 2 +- deps/uv/test/test-eintr-handling.c | 24 +- deps/uv/test/test-embed.c | 10 +- deps/uv/test/test-emfile.c | 30 +- deps/uv/test/test-env-vars.c | 68 +- deps/uv/test/test-error.c | 26 +- deps/uv/test/test-fork.c | 257 ++- deps/uv/test/test-fs-copyfile.c | 66 +- deps/uv/test/test-fs-event.c | 355 ++-- deps/uv/test/test-fs-fd-hash.c | 6 +- deps/uv/test/test-fs-open-flags.c | 96 +- deps/uv/test/test-fs-poll.c | 108 +- deps/uv/test/test-fs-readdir.c | 152 +- deps/uv/test/test-fs.c | 1727 +++++++++-------- deps/uv/test/test-get-currentexe.c | 26 +- deps/uv/test/test-get-loadavg.c | 6 +- deps/uv/test/test-get-memory.c | 8 +- deps/uv/test/test-get-passwd.c | 21 +- deps/uv/test/test-getaddrinfo.c | 68 +- deps/uv/test/test-gethostname.c | 14 +- deps/uv/test/test-getnameinfo.c | 26 +- deps/uv/test/test-getsockname.c | 68 +- deps/uv/test/test-getters-setters.c | 48 +- deps/uv/test/test-gettimeofday.c | 6 +- deps/uv/test/test-handle-fileno.c | 42 +- deps/uv/test/test-homedir.c | 28 +- deps/uv/test/test-hrtime.c | 6 +- deps/uv/test/test-idle.c | 38 +- deps/uv/test/test-idna.c | 73 +- deps/uv/test/test-ip-name.c | 20 +- deps/uv/test/test-ip4-addr.c | 28 +- deps/uv/test/test-ip6-addr.c | 50 +- .../test-ipc-heavy-traffic-deadlock-bug.c | 24 +- deps/uv/test/test-ipc-send-recv.c | 100 +- deps/uv/test/test-ipc.c | 216 +-- deps/uv/test/test-list.h | 11 + deps/uv/test/test-loop-alive.c | 8 +- deps/uv/test/test-loop-close.c | 24 +- deps/uv/test/test-loop-configure.c | 14 +- deps/uv/test/test-loop-handles.c | 72 +- deps/uv/test/test-loop-stop.c | 20 +- deps/uv/test/test-loop-time.c | 20 +- deps/uv/test/test-metrics.c | 80 +- deps/uv/test/test-multiple-listen.c | 26 +- deps/uv/test/test-mutexes.c | 44 +- ...-not-readable-nor-writable-on-read-error.c | 36 +- .../test/test-not-writable-after-shutdown.c | 14 +- deps/uv/test/test-osx-select.c | 20 +- deps/uv/test/test-ping-pong.c | 72 +- deps/uv/test/test-pipe-bind-error.c | 38 +- .../test/test-pipe-close-stdout-read-stdin.c | 12 +- deps/uv/test/test-pipe-connect-error.c | 12 +- deps/uv/test/test-pipe-connect-multiple.c | 34 +- deps/uv/test/test-pipe-connect-prepare.c | 16 +- deps/uv/test/test-pipe-getsockname.c | 80 +- deps/uv/test/test-pipe-pending-instances.c | 8 +- deps/uv/test/test-pipe-sendmsg.c | 38 +- deps/uv/test/test-pipe-server-close.c | 24 +- deps/uv/test/test-pipe-set-fchmod.c | 18 +- deps/uv/test/test-pipe-set-non-blocking.c | 36 +- deps/uv/test/test-platform-output.c | 40 +- .../test-poll-close-doesnt-corrupt-stack.c | 24 +- deps/uv/test/test-poll-close.c | 4 +- deps/uv/test/test-poll-closesocket.c | 24 +- deps/uv/test/test-poll-multiple-handles.c | 33 +- deps/uv/test/test-poll-oob.c | 90 +- deps/uv/test/test-poll.c | 110 +- deps/uv/test/test-process-priority.c | 26 +- deps/uv/test/test-process-title-threadsafe.c | 23 +- deps/uv/test/test-process-title.c | 26 +- deps/uv/test/test-queue-foreach-delete.c | 36 +- deps/uv/test/test-random.c | 42 +- deps/uv/test/test-readable-on-eof.c | 37 +- deps/uv/test/test-ref.c | 58 +- deps/uv/test/test-run-nowait.c | 6 +- deps/uv/test/test-run-once.c | 4 +- deps/uv/test/test-semaphore.c | 30 +- deps/uv/test/test-shutdown-close.c | 36 +- deps/uv/test/test-shutdown-eof.c | 52 +- deps/uv/test/test-shutdown-simultaneous.c | 28 +- deps/uv/test/test-shutdown-twice.c | 20 +- deps/uv/test/test-signal-multiple-loops.c | 64 +- deps/uv/test/test-signal-pending-on-close.c | 38 +- deps/uv/test/test-signal.c | 142 +- deps/uv/test/test-socket-buffer-size.c | 22 +- deps/uv/test/test-spawn.c | 590 +++--- deps/uv/test/test-stdio-over-pipes.c | 68 +- deps/uv/test/test-strscpy.c | 24 +- deps/uv/test/test-strtok.c | 6 +- deps/uv/test/test-tcp-alloc-cb-fail.c | 50 +- deps/uv/test/test-tcp-bind-error.c | 118 +- deps/uv/test/test-tcp-bind6-error.c | 48 +- deps/uv/test/test-tcp-close-accept.c | 68 +- .../test/test-tcp-close-after-read-timeout.c | 48 +- deps/uv/test/test-tcp-close-reset.c | 132 +- .../uv/test/test-tcp-close-while-connecting.c | 24 +- deps/uv/test/test-tcp-close.c | 34 +- .../test/test-tcp-connect-error-after-write.c | 22 +- deps/uv/test/test-tcp-connect-error.c | 8 +- deps/uv/test/test-tcp-connect-timeout.c | 44 +- deps/uv/test/test-tcp-connect6-error.c | 49 +- deps/uv/test/test-tcp-create-socket-early.c | 68 +- deps/uv/test/test-tcp-flags.c | 8 +- deps/uv/test/test-tcp-oob.c | 56 +- deps/uv/test/test-tcp-open.c | 132 +- deps/uv/test/test-tcp-read-stop-start.c | 44 +- deps/uv/test/test-tcp-read-stop.c | 38 +- deps/uv/test/test-tcp-rst.c | 20 +- deps/uv/test/test-tcp-shutdown-after-write.c | 34 +- deps/uv/test/test-tcp-try-write-error.c | 40 +- deps/uv/test/test-tcp-try-write.c | 42 +- deps/uv/test/test-tcp-unexpected-read.c | 50 +- deps/uv/test/test-tcp-write-after-connect.c | 32 +- deps/uv/test/test-tcp-write-fail.c | 24 +- deps/uv/test/test-tcp-write-in-a-row.c | 38 +- deps/uv/test/test-tcp-write-queue-order.c | 60 +- .../test-tcp-write-to-half-open-connection.c | 36 +- deps/uv/test/test-tcp-writealot.c | 40 +- deps/uv/test/test-thread-affinity.c | 60 +- deps/uv/test/test-thread-equal.c | 14 +- deps/uv/test/test-thread.c | 98 +- deps/uv/test/test-threadpool-cancel.c | 165 +- deps/uv/test/test-threadpool.c | 22 +- deps/uv/test/test-timer-again.c | 38 +- deps/uv/test/test-timer-from-check.c | 50 +- deps/uv/test/test-timer.c | 172 +- deps/uv/test/test-tmpdir.c | 28 +- deps/uv/test/test-tty-duplicate-key.c | 60 +- .../test-tty-escape-sequence-processing.c | 182 +- deps/uv/test/test-tty.c | 128 +- deps/uv/test/test-udp-alloc-cb-fail.c | 56 +- deps/uv/test/test-udp-bind.c | 24 +- deps/uv/test/test-udp-connect.c | 72 +- deps/uv/test/test-udp-connect6.c | 54 +- deps/uv/test/test-udp-create-socket-early.c | 50 +- deps/uv/test/test-udp-dgram-too-big.c | 20 +- deps/uv/test/test-udp-ipv6.c | 70 +- deps/uv/test/test-udp-mmsg.c | 28 +- deps/uv/test/test-udp-multicast-interface.c | 26 +- deps/uv/test/test-udp-multicast-interface6.c | 24 +- deps/uv/test/test-udp-multicast-join.c | 46 +- deps/uv/test/test-udp-multicast-join6.c | 46 +- deps/uv/test/test-udp-multicast-ttl.c | 22 +- deps/uv/test/test-udp-open.c | 96 +- deps/uv/test/test-udp-options.c | 56 +- deps/uv/test/test-udp-recv-in-a-row.c | 22 +- deps/uv/test/test-udp-send-and-recv.c | 62 +- deps/uv/test/test-udp-send-hang-loop.c | 20 +- deps/uv/test/test-udp-send-immediate.c | 34 +- deps/uv/test/test-udp-send-unreachable.c | 38 +- deps/uv/test/test-udp-sendmmsg-error.c | 10 +- deps/uv/test/test-udp-try-send.c | 34 +- deps/uv/test/test-uname.c | 18 +- deps/uv/test/test-walk-handles.c | 16 +- deps/uv/test/test-watcher-cross-stop.c | 30 +- .../maintaining/maintaining-dependencies.md | 6 +- 221 files changed, 6587 insertions(+), 6453 deletions(-) diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS index 9b89421c42877e..6bf1a9fa2f96fa 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -548,3 +548,15 @@ liuxiang88 <94350585+liuxiang88@users.noreply.github.com> Jeffrey H. Johnson Abdirahim Musse <33973272+abmusse@users.noreply.github.com> 小明 <7737673+caobug@users.noreply.github.com> +Shuduo Sang +Keith Winstein +michalbiesek +Alois Klink +SmorkalovG +Pleuvens +jolai <58589285+laijonathan@users.noreply.github.com> +Julien Roncaglia +prubel +Per Allansson <65364157+per-allansson@users.noreply.github.com> +Matheus Izvekov +Christian Heimlich diff --git a/deps/uv/CMakeLists.txt b/deps/uv/CMakeLists.txt index 93733dd0478343..72377851b69f74 100644 --- a/deps/uv/CMakeLists.txt +++ b/deps/uv/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.9) if(POLICY CMP0091) cmake_policy(SET CMP0091 NEW) # Enable MSVC_RUNTIME_LIBRARY setting @@ -186,7 +186,8 @@ if(WIN32) ws2_32 dbghelp ole32 - uuid) + uuid + shell32) list(APPEND uv_sources src/win/async.c src/win/core.c @@ -477,7 +478,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") endif() target_link_libraries(uv_a ${uv_libraries}) set_target_properties(uv_a PROPERTIES OUTPUT_NAME "uv") -if(MSVC) +if(WIN32) set_target_properties(uv_a PROPERTIES PREFIX "lib") endif() diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index e2cd8825222e31..f40fcc600bbc34 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,4 +1,113 @@ -2023.06.30, Version 1.46.0 (Stable) +2023.11.06, Version 1.47.0 (Stable) + +Changes since version 1.46.0: + +* test: fix license blurb (Ben Noordhuis) + +* linux: fix harmless warn_unused_result warning (Shuduo Sang) + +* darwin: fix build warnings (小明) + +* linux: don't use io_uring on pre-5.10.186 kernels (Ben Noordhuis) + +* fs: fix WTF-8 decoding issue (Jameson Nash) + +* test: enable disabled tcp_connect6_error_fault (Ben Noordhuis) + +* test: enable disabled fs_link (Ben Noordhuis) + +* test: enable disabled spawn_same_stdout_stderr (Ben Noordhuis) + +* linux: handle UNAME26 personality (Ben Noordhuis) + +* build: move cmake_minimum_required version to 3.9 (Keith Winstein) + +* unix: set ipv6 scope id for link-local addresses (Ben Noordhuis) + +* unix: match kqueue and epoll code (Trevor Norris) + +* win,spawn: allow `%PATH%` to be unset (Kyle Edwards) + +* doc: switch to Furo, a more modern Sphinx theme (Saúl Ibarra Corretgé) + +* darwin: make TCP_KEEPINTVL and TCP_KEEPCNT available (小明) + +* win,fs: avoid winapi macro redefinition (Brad King) + +* linux: add missing riscv syscall numbers (michalbiesek) + +* doc: fix broken "Shared library" Wikipedia link (Alois Klink) + +* unix: get mainline kernel version in Ubuntu (Santiago Gimeno) + +* unix: get mainline kernel version in Debian (Ben Noordhuis) + +* build: fix qemu install in CI-unix workflow (Santiago Gimeno) + +* unix: disable io_uring close on selected kernels (Santiago Gimeno) + +* test: skip tests when ipv6 is not available (Santiago Gimeno) + +* ibmi: implement ifaddrs, getifaddrs, freeifaddrs (Abdirahim Musse) + +* unix: reset signal counters after fork (SmorkalovG) + +* win,process: avoid assert after spawning Store app (Jameson Nash) + +* unix: remove pread/preadv conditionals (Ben Noordhuis) + +* unix: remove pwrite/pwritev conditionals (Ben Noordhuis) + +* darwin: remove workaround for data corruption bug (Ben Noordhuis) + +* src: default to stream=stderr in handle printer (Ben Noordhuis) + +* test: switch to new-style ASSERT_EQ macros (Pleuvens) + +* zos: correctly get cpu model in uv_cpu_info() (jolai) + +* test: fix get_passwd2 on IBM i (Abdirahim Musse) + +* unix: don't malloc on sync uv_fs_read (Ben Noordhuis) + +* freebsd: get fs event path with fcntl(F_KINFO) (David Carlier) + +* test: switch from ASSERT_* to ASSERT_PTR_* (Pleuvens) + +* darwin: workaround apple pthread_cond_wait bug (Julien Roncaglia) + +* doc: uv_close should be called after exit callback (Pleuvens) + +* test: 192.0.2.0/24 is the actual -TEST-NET-1 (prubel) + +* unix: add back preadv/pwritev fallback (Ben Noordhuis) + +* unix: rename variable for consistency (Ben Noordhuis) + +* unix: merge read/write code into single functions (Ben Noordhuis) + +* doc: filename arg to uv_fs_event_cb can be NULL (Ben Noordhuis) + +* build,win: we need to link against shell32.lib (Per Allansson) + +* unix: no preadv/pwritev workaround if not needed (Jeffrey H. Johnson) + +* build: add CI for Windows ARM64 (build only) (Per Allansson) + +* linux: disable io_uring on 32 bits arm systems (Ben Noordhuis) + +* build: run sanitizers on macos ci (Ben Noordhuis) + +* misc: export WTF8 conversion utilities (Jameson Nash) + +* build: fix libuv.a file name for cmake (Jameson Nash) + +* build: add windows ubsan and clang ci (Matheus Izvekov) + +* win: improve accuracy of ProductName between arch (Christian Heimlich) + + +2023.06.30, Version 1.46.0 (Stable), f0bb7e40f0508bedf6fad33769b3f87bb8aedfa6 Changes since version 1.45.0: diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index deb083605de639..0a1042ce3d384f 100644 --- a/deps/uv/configure.ac +++ b/deps/uv/configure.ac @@ -13,7 +13,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ(2.57) -AC_INIT([libuv], [1.46.0], [https://github.com/libuv/libuv/issues]) +AC_INIT([libuv], [1.47.0], [https://github.com/libuv/libuv/issues]) AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/as_case.m4]) @@ -74,7 +74,7 @@ AM_CONDITIONAL([OS400], [AS_CASE([$host_os],[os400], [true], [false]) AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])]) AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])]) AS_CASE([$host_os],[mingw*], [ - LIBS="$LIBS -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -luser32 -ldbghelp -lole32 -luuid" + LIBS="$LIBS -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -luser32 -ldbghelp -lole32 -luuid -lshell32" ]) AS_CASE([$host_os], [solaris2.10], [ CFLAGS="$CFLAGS -DSUNOS_NO_IFADDRS" diff --git a/deps/uv/docs/requirements.txt b/deps/uv/docs/requirements.txt index b037de46595389..2e310ebe7283af 100644 --- a/deps/uv/docs/requirements.txt +++ b/deps/uv/docs/requirements.txt @@ -1,27 +1,36 @@ # primary -sphinx==6.1.3 +furo==2023.5.20 +Sphinx==6.1.3 # dependencies alabaster==0.7.13 Babel==2.11.0 +beautifulsoup4==4.12.2 certifi==2022.12.7 charset-normalizer==3.0.1 +colorama==0.4.6 docutils==0.19 idna==3.4 imagesize==1.4.1 importlib-metadata==6.0.0 Jinja2==3.1.2 +livereload==2.6.3 MarkupSafe==2.1.2 packaging==23.0 Pygments==2.14.0 pytz==2022.7.1 requests==2.28.2 +six==1.16.0 snowballstemmer==2.2.0 -sphinxcontrib-applehelp==1.0.3 +soupsieve==2.4.1 +sphinx-autobuild==2021.3.14 +sphinx-basic-ng==1.0.0b2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib.applehelp==1.0.3 +tornado==6.3.2 urllib3==1.26.14 zipp==3.11.0 diff --git a/deps/uv/docs/src/conf.py b/deps/uv/docs/src/conf.py index f6f43253d364c5..354759a23c507a 100644 --- a/deps/uv/docs/src/conf.py +++ b/deps/uv/docs/src/conf.py @@ -118,7 +118,7 @@ def get_libuv_version(): # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'nature' +html_theme = 'furo' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/deps/uv/docs/src/fs_event.rst b/deps/uv/docs/src/fs_event.rst index e28ec625ed6b56..54a776ae6f1453 100644 --- a/deps/uv/docs/src/fs_event.rst +++ b/deps/uv/docs/src/fs_event.rst @@ -39,8 +39,12 @@ Data types .. c:type:: void (*uv_fs_event_cb)(uv_fs_event_t* handle, const char* filename, int events, int status) Callback passed to :c:func:`uv_fs_event_start` which will be called repeatedly - after the handle is started. If the handle was started with a directory the - `filename` parameter will be a relative path to a file contained in the directory. + after the handle is started. + + If the handle was started with a directory the `filename` parameter will + be a relative path to a file contained in the directory, or `NULL` if the + file name cannot be determined. + The `events` parameter is an ORed mask of :c:type:`uv_fs_event` elements. .. c:type:: uv_fs_event diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index 8c3a00e934c97e..989618304d16e5 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -839,3 +839,50 @@ API Causes the calling thread to sleep for `msec` milliseconds. .. versionadded:: 1.34.0 + +String manipulation functions +----------------------------- + +These string utilities are needed internally for dealing with Windows, and are +exported to allow clients to work uniformly with this data when the libuv API +is not complete. + +.. c:function:: size_t uv_utf16_length_as_wtf8(const uint16_t* utf16, ssize_t utf16_len) + + Get the length of a UTF-16 (or UCS-2) `utf16` value after converting it to + WTF-8. If `utf16` is NUL terminated, `utf16_len` can be set to -1, + otherwise it must be specified. + + .. versionadded:: 1.47.0 + +.. c:function:: int uv_utf16_to_wtf8(const uint16_t* utf16, ssize_t utf16_len, char** wtf8_ptr, size_t* wtf8_len_ptr) + + Convert UTF-16 (or UCS-2) data in `utf16` to WTF-8 data in `*wtf8_ptr`. The + `utf16_len` count (in characters) gives the length of `utf16`. If `utf16` + is NUL terminated, `utf16_len` can be set to -1, otherwise it must be + specified. If `wtf8_ptr` is `NULL`, no result will be computed, but the + length (equal to `uv_utf16_length_as_wtf8`) will be stored in `wtf8_ptr`. + If `*wtf8_ptr` is `NULL`, space for the conversion will be allocated and + returned in `wtf8_ptr` and the length will be returned in `wtf8_len_ptr`. + Otherwise, the length of `*wtf8_ptr` must be passed in `wtf8_len_ptr`. The + `wtf8_ptr` must contain an extra space for an extra NUL after the result. + If the result is truncated, `UV_ENOBUFS` will be returned and + `wtf8_len_ptr` will be the length of the required `wtf8_ptr` to contain the + whole result. + + .. versionadded:: 1.47.0 + +.. c:function:: ssize_t uv_wtf8_length_as_utf16(const char* wtf8) + + Get the length in characters of a NUL-terminated WTF-8 `wtf8` value + after converting it to UTF-16 (or UCS-2), including NUL terminator. + + .. versionadded:: 1.47.0 + +.. c:function:: void uv_wtf8_to_utf16(const char* utf8, uint16_t* utf16, size_t utf16_len) + + Convert NUL-terminated WTF-8 data in `wtf8` to UTF-16 (or UCS-2) data + in `utf16`. The `utf16_len` count (in characters) must include space + for the NUL terminator. + + .. versionadded:: 1.47.0 diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index 02397dd0fdd43d..5642101c10c351 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -1885,6 +1885,18 @@ struct uv_loop_s { UV_EXTERN void* uv_loop_get_data(const uv_loop_t*); UV_EXTERN void uv_loop_set_data(uv_loop_t*, void* data); +/* String utilities needed internally for dealing with Windows. */ +size_t uv_utf16_length_as_wtf8(const uint16_t* utf16, + ssize_t utf16_len); +int uv_utf16_to_wtf8(const uint16_t* utf16, + ssize_t utf16_len, + char** wtf8_ptr, + size_t* wtf8_len_ptr); +ssize_t uv_wtf8_length_as_utf16(const char* wtf8); +void uv_wtf8_to_utf16(const char* wtf8, + uint16_t* utf16, + size_t utf16_len); + /* Don't export the private CPP symbols. */ #undef UV_HANDLE_TYPE_PRIVATE #undef UV_REQ_TYPE_PRIVATE diff --git a/deps/uv/include/uv/version.h b/deps/uv/include/uv/version.h index 24fac8d8aa76f7..b17220fcf9090e 100644 --- a/deps/uv/include/uv/version.h +++ b/deps/uv/include/uv/version.h @@ -31,7 +31,7 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 46 +#define UV_VERSION_MINOR 47 #define UV_VERSION_PATCH 0 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/deps/uv/src/idna.c b/deps/uv/src/idna.c index 93d982ca018f2d..1c0a60cf3e3bec 100644 --- a/deps/uv/src/idna.c +++ b/deps/uv/src/idna.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2018 Ben Noordhuis +/* Copyright libuv contributors. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,11 +18,56 @@ */ #include "uv.h" +#include "uv-common.h" #include "idna.h" #include #include #include /* UINT_MAX */ + +static int32_t uv__wtf8_decode1(const char** input) { + uint32_t code_point; + uint8_t b1; + uint8_t b2; + uint8_t b3; + uint8_t b4; + + b1 = **input; + if (b1 <= 0x7F) + return b1; /* ASCII code point */ + if (b1 < 0xC2) + return -1; /* invalid: continuation byte */ + code_point = b1; + + b2 = *++*input; + if ((b2 & 0xC0) != 0x80) + return -1; /* invalid: not a continuation byte */ + code_point = (code_point << 6) | (b2 & 0x3F); + if (b1 <= 0xDF) + return 0x7FF & code_point; /* two-byte character */ + + b3 = *++*input; + if ((b3 & 0xC0) != 0x80) + return -1; /* invalid: not a continuation byte */ + code_point = (code_point << 6) | (b3 & 0x3F); + if (b1 <= 0xEF) + return 0xFFFF & code_point; /* three-byte character */ + + b4 = *++*input; + if ((b4 & 0xC0) != 0x80) + return -1; /* invalid: not a continuation byte */ + code_point = (code_point << 6) | (b4 & 0x3F); + if (b1 <= 0xF4) { + code_point &= 0x1FFFFF; + if (code_point <= 0x10FFFF) + return code_point; /* four-byte character */ + } + + /* code point too large */ + return -1; +} + + static unsigned uv__utf8_decode1_slow(const char** p, const char* pe, unsigned a) { @@ -89,6 +134,7 @@ static unsigned uv__utf8_decode1_slow(const char** p, return a; } + unsigned uv__utf8_decode1(const char** p, const char* pe) { unsigned a; @@ -102,6 +148,7 @@ unsigned uv__utf8_decode1(const char** p, const char* pe) { return uv__utf8_decode1_slow(p, pe, a); } + static int uv__idna_toascii_label(const char* s, const char* se, char** d, char* de) { static const char alphabet[] = "abcdefghijklmnopqrstuvwxyz0123456789"; @@ -267,7 +314,8 @@ static int uv__idna_toascii_label(const char* s, const char* se, return 0; } -long uv__idna_toascii(const char* s, const char* se, char* d, char* de) { + +ssize_t uv__idna_toascii(const char* s, const char* se, char* d, char* de) { const char* si; const char* st; unsigned c; @@ -313,3 +361,195 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) { return d - ds; /* Number of bytes written. */ } + + +ssize_t uv_wtf8_length_as_utf16(const char* source_ptr) { + size_t w_target_len = 0; + int32_t code_point; + + do { + code_point = uv__wtf8_decode1(&source_ptr); + if (code_point < 0) + return -1; + if (code_point > 0xFFFF) + w_target_len++; + w_target_len++; + } while (*source_ptr++); + + return w_target_len; +} + + +void uv_wtf8_to_utf16(const char* source_ptr, + uint16_t* w_target, + size_t w_target_len) { + int32_t code_point; + + do { + code_point = uv__wtf8_decode1(&source_ptr); + /* uv_wtf8_length_as_utf16 should have been called and checked first. */ + assert(code_point >= 0); + if (code_point > 0x10000) { + assert(code_point < 0x10FFFF); + *w_target++ = (((code_point - 0x10000) >> 10) + 0xD800); + *w_target++ = ((code_point - 0x10000) & 0x3FF) + 0xDC00; + w_target_len -= 2; + } else { + *w_target++ = code_point; + w_target_len -= 1; + } + } while (*source_ptr++); + + assert(w_target_len == 0); +} + + +static int32_t uv__get_surrogate_value(const uint16_t* w_source_ptr, + ssize_t w_source_len) { + uint16_t u; + uint16_t next; + + u = w_source_ptr[0]; + if (u >= 0xD800 && u <= 0xDBFF && w_source_len != 1) { + next = w_source_ptr[1]; + if (next >= 0xDC00 && next <= 0xDFFF) + return 0x10000 + ((u - 0xD800) << 10) + (next - 0xDC00); + } + return u; +} + + +size_t uv_utf16_length_as_wtf8(const uint16_t* w_source_ptr, + ssize_t w_source_len) { + size_t target_len; + int32_t code_point; + + target_len = 0; + while (w_source_len) { + code_point = uv__get_surrogate_value(w_source_ptr, w_source_len); + /* Can be invalid UTF-8 but must be valid WTF-8. */ + assert(code_point >= 0); + if (w_source_len < 0 && code_point == 0) + break; + if (code_point < 0x80) + target_len += 1; + else if (code_point < 0x800) + target_len += 2; + else if (code_point < 0x10000) + target_len += 3; + else { + target_len += 4; + w_source_ptr++; + if (w_source_len > 0) + w_source_len--; + } + w_source_ptr++; + if (w_source_len > 0) + w_source_len--; + } + + return target_len; +} + + +int uv_utf16_to_wtf8(const uint16_t* w_source_ptr, + ssize_t w_source_len, + char** target_ptr, + size_t* target_len_ptr) { + size_t target_len; + char* target; + char* target_end; + int32_t code_point; + + /* If *target_ptr is provided, then *target_len_ptr must be its length + * (excluding space for NUL), otherwise we will compute the target_len_ptr + * length and may return a new allocation in *target_ptr if target_ptr is + * provided. */ + if (target_ptr == NULL || *target_ptr == NULL) { + target_len = uv_utf16_length_as_wtf8(w_source_ptr, w_source_len); + if (target_len_ptr != NULL) + *target_len_ptr = target_len; + } else { + target_len = *target_len_ptr; + } + + if (target_ptr == NULL) + return 0; + + if (*target_ptr == NULL) { + target = uv__malloc(target_len + 1); + if (target == NULL) { + return UV_ENOMEM; + } + *target_ptr = target; + } else { + target = *target_ptr; + } + + target_end = target + target_len; + + while (target != target_end && w_source_len) { + code_point = uv__get_surrogate_value(w_source_ptr, w_source_len); + /* Can be invalid UTF-8 but must be valid WTF-8. */ + assert(code_point >= 0); + if (w_source_len < 0 && code_point == 0) { + w_source_len = 0; + break; + } + if (code_point < 0x80) { + *target++ = code_point; + } else if (code_point < 0x800) { + *target++ = 0xC0 | (code_point >> 6); + if (target == target_end) + break; + *target++ = 0x80 | (code_point & 0x3F); + } else if (code_point < 0x10000) { + *target++ = 0xE0 | (code_point >> 12); + if (target == target_end) + break; + *target++ = 0x80 | ((code_point >> 6) & 0x3F); + if (target == target_end) + break; + *target++ = 0x80 | (code_point & 0x3F); + } else { + *target++ = 0xF0 | (code_point >> 18); + if (target == target_end) + break; + *target++ = 0x80 | ((code_point >> 12) & 0x3F); + if (target == target_end) + break; + *target++ = 0x80 | ((code_point >> 6) & 0x3F); + if (target == target_end) + break; + *target++ = 0x80 | (code_point & 0x3F); + /* uv__get_surrogate_value consumed 2 input characters */ + w_source_ptr++; + if (w_source_len > 0) + w_source_len--; + } + target_len = target - *target_ptr; + w_source_ptr++; + if (w_source_len > 0) + w_source_len--; + } + + if (target != target_end && target_len_ptr != NULL) + /* Did not fill all of the provided buffer, so update the target_len_ptr + * output with the space used. */ + *target_len_ptr = target - *target_ptr; + + /* Check if input fit into target exactly. */ + if (w_source_len < 0 && target == target_end && w_source_ptr[0] == 0) + w_source_len = 0; + + *target++ = '\0'; + + /* Characters remained after filling the buffer, compute the remaining length now. */ + if (w_source_len) { + if (target_len_ptr != NULL) + *target_len_ptr = target_len + uv_utf16_length_as_wtf8(w_source_ptr, w_source_len); + return UV_ENOBUFS; + } + + return 0; +} diff --git a/deps/uv/src/idna.h b/deps/uv/src/idna.h index 8e0c592fe139e5..ea6b4df9671fcc 100644 --- a/deps/uv/src/idna.h +++ b/deps/uv/src/idna.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2018 Ben Noordhuis +/* Copyright libuv contributors. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -26,6 +26,6 @@ unsigned uv__utf8_decode1(const char** p, const char* pe); * is the number of bytes written to |d|, including the trailing nul byte. * A return value < 0 is a libuv error code. |s| and |d| can not overlap. */ -long uv__idna_toascii(const char* s, const char* se, char* d, char* de); +ssize_t uv__idna_toascii(const char* s, const char* se, char* d, char* de); #endif /* UV_SRC_IDNA_H_ */ diff --git a/deps/uv/src/unix/darwin.c b/deps/uv/src/unix/darwin.c index 90790d701c4327..5e764a65ee4c71 100644 --- a/deps/uv/src/unix/darwin.c +++ b/deps/uv/src/unix/darwin.c @@ -209,7 +209,7 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { if (cpuspeed == 0) /* If sysctl hw.cputype == CPU_TYPE_ARM64, the correct value is unavailable * from Apple, but we can hard-code it here to a plausible value. */ - cpuspeed = 2400000000; + cpuspeed = 2400000000U; if (host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &numcpus, (processor_info_array_t*)&info, @@ -235,7 +235,7 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { cpu_info->cpu_times.irq = 0; cpu_info->model = uv__strdup(model); - cpu_info->speed = cpuspeed/1000000; + cpu_info->speed = (int)(cpuspeed / 1000000); } vm_deallocate(mach_task_self(), (vm_address_t)info, msg_type); diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c index 6b051c124f2fd9..891306daedcc6a 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -41,25 +41,10 @@ #include #include #include -#include #include #include #include -#if defined(__DragonFly__) || \ - defined(__FreeBSD__) || \ - defined(__OpenBSD__) || \ - defined(__NetBSD__) -# define HAVE_PREADV 1 -#else -# define HAVE_PREADV 0 -#endif - -/* preadv() and pwritev() were added in Android N (level 24) */ -#if defined(__linux__) && !(defined(__ANDROID__) && __ANDROID_API__ < 24) -# define TRY_PREADV 1 -#endif - #if defined(__linux__) # include #endif @@ -97,6 +82,15 @@ # include #endif +#if defined(__CYGWIN__) || \ + (defined(__HAIKU__) && B_HAIKU_VERSION < B_HAIKU_VERSION_1_PRE_BETA_5) || \ + (defined(__sun) && !defined(__illumos__)) +#define preadv(fd, bufs, nbufs, off) \ + pread(fd, (bufs)->iov_base, (bufs)->iov_len, off) +#define pwritev(fd, bufs, nbufs, off) \ + pwrite(fd, (bufs)->iov_base, (bufs)->iov_len, off) +#endif + #if defined(_AIX) && _XOPEN_SOURCE <= 600 extern char *mkdtemp(char *template); /* See issue #740 on AIX < 7 */ #endif @@ -410,123 +404,57 @@ static ssize_t uv__fs_open(uv_fs_t* req) { } -#if !HAVE_PREADV -static ssize_t uv__fs_preadv(uv_file fd, - uv_buf_t* bufs, - unsigned int nbufs, - off_t off) { - uv_buf_t* buf; - uv_buf_t* end; - ssize_t result; - ssize_t rc; - size_t pos; - - assert(nbufs > 0); - - result = 0; - pos = 0; - buf = bufs + 0; - end = bufs + nbufs; - - for (;;) { - do - rc = pread(fd, buf->base + pos, buf->len - pos, off + result); - while (rc == -1 && errno == EINTR); - - if (rc == 0) - break; - - if (rc == -1 && result == 0) - return UV__ERR(errno); - - if (rc == -1) - break; /* We read some data so return that, ignore the error. */ - - pos += rc; - result += rc; - - if (pos < buf->len) - continue; - - pos = 0; - buf += 1; - - if (buf == end) - break; - } - - return result; -} -#endif - - static ssize_t uv__fs_read(uv_fs_t* req) { -#if TRY_PREADV - static _Atomic int no_preadv; -#endif + const struct iovec* bufs; unsigned int iovmax; - ssize_t result; + size_t nbufs; + ssize_t r; + off_t off; + int fd; + + fd = req->file; + off = req->off; + bufs = (const struct iovec*) req->bufs; + nbufs = req->nbufs; iovmax = uv__getiovmax(); - if (req->nbufs > iovmax) - req->nbufs = iovmax; - - if (req->off < 0) { - if (req->nbufs == 1) - result = read(req->file, req->bufs[0].base, req->bufs[0].len); - else - result = readv(req->file, (struct iovec*) req->bufs, req->nbufs); + if (nbufs > iovmax) + nbufs = iovmax; + + r = 0; + if (off < 0) { + if (nbufs == 1) + r = read(fd, bufs->iov_base, bufs->iov_len); + else if (nbufs > 1) + r = readv(fd, bufs, nbufs); } else { - if (req->nbufs == 1) { - result = pread(req->file, req->bufs[0].base, req->bufs[0].len, req->off); - goto done; - } - -#if HAVE_PREADV - result = preadv(req->file, (struct iovec*) req->bufs, req->nbufs, req->off); -#else -# if TRY_PREADV - if (atomic_load_explicit(&no_preadv, memory_order_relaxed)) retry: -# endif - { - result = uv__fs_preadv(req->file, req->bufs, req->nbufs, req->off); - } -# if TRY_PREADV - else { - result = preadv(req->file, - (struct iovec*) req->bufs, - req->nbufs, - req->off); - if (result == -1 && errno == ENOSYS) { - atomic_store_explicit(&no_preadv, 1, memory_order_relaxed); - goto retry; - } - } -# endif -#endif + if (nbufs == 1) + r = pread(fd, bufs->iov_base, bufs->iov_len, off); + else if (nbufs > 1) + r = preadv(fd, bufs, nbufs, off); } -done: - /* Early cleanup of bufs allocation, since we're done with it. */ - if (req->bufs != req->bufsml) - uv__free(req->bufs); - - req->bufs = NULL; - req->nbufs = 0; - #ifdef __PASE__ /* PASE returns EOPNOTSUPP when reading a directory, convert to EISDIR */ - if (result == -1 && errno == EOPNOTSUPP) { + if (r == -1 && errno == EOPNOTSUPP) { struct stat buf; ssize_t rc; - rc = uv__fstat(req->file, &buf); + rc = uv__fstat(fd, &buf); if (rc == 0 && S_ISDIR(buf.st_mode)) { errno = EISDIR; } } #endif - return result; + /* We don't own the buffer list in the synchronous case. */ + if (req->cb != NULL) + if (req->bufs != req->bufsml) + uv__free(req->bufs); + + req->bufs = NULL; + req->nbufs = 0; + + return r; } @@ -1161,65 +1089,34 @@ static ssize_t uv__fs_lutime(uv_fs_t* req) { static ssize_t uv__fs_write(uv_fs_t* req) { -#if TRY_PREADV - static _Atomic int no_pwritev; -#endif + const struct iovec* bufs; + size_t nbufs; ssize_t r; + off_t off; + int fd; - /* Serialize writes on OS X, concurrent write() and pwrite() calls result in - * data loss. We can't use a per-file descriptor lock, the descriptor may be - * a dup(). - */ -#if defined(__APPLE__) - static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; - - if (pthread_mutex_lock(&lock)) - abort(); -#endif + fd = req->file; + off = req->off; + bufs = (const struct iovec*) req->bufs; + nbufs = req->nbufs; - if (req->off < 0) { - if (req->nbufs == 1) - r = write(req->file, req->bufs[0].base, req->bufs[0].len); - else - r = writev(req->file, (struct iovec*) req->bufs, req->nbufs); + r = 0; + if (off < 0) { + if (nbufs == 1) + r = write(fd, bufs->iov_base, bufs->iov_len); + else if (nbufs > 1) + r = writev(fd, bufs, nbufs); } else { - if (req->nbufs == 1) { - r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off); - goto done; - } -#if HAVE_PREADV - r = pwritev(req->file, (struct iovec*) req->bufs, req->nbufs, req->off); -#else -# if TRY_PREADV - if (atomic_load_explicit(&no_pwritev, memory_order_relaxed)) retry: -# endif - { - r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off); - } -# if TRY_PREADV - else { - r = pwritev(req->file, - (struct iovec*) req->bufs, - req->nbufs, - req->off); - if (r == -1 && errno == ENOSYS) { - atomic_store_explicit(&no_pwritev, 1, memory_order_relaxed); - goto retry; - } - } -# endif -#endif + if (nbufs == 1) + r = pwrite(fd, bufs->iov_base, bufs->iov_len, off); + else if (nbufs > 1) + r = pwritev(fd, bufs, nbufs, off); } -done: -#if defined(__APPLE__) - if (pthread_mutex_unlock(&lock)) - abort(); -#endif - return r; } + static ssize_t uv__fs_copyfile(uv_fs_t* req) { uv_fs_t fs_req; uv_file srcfd; @@ -1979,9 +1876,14 @@ int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, if (bufs == NULL || nbufs == 0) return UV_EINVAL; + req->off = off; req->file = file; - + req->bufs = (uv_buf_t*) bufs; /* Safe, doesn't mutate |bufs| */ req->nbufs = nbufs; + + if (cb == NULL) + goto post; + req->bufs = req->bufsml; if (nbufs > ARRAY_SIZE(req->bufsml)) req->bufs = uv__malloc(nbufs * sizeof(*bufs)); @@ -1991,12 +1893,10 @@ int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); - req->off = off; - - if (cb != NULL) - if (uv__iou_fs_read_or_write(loop, req, /* is_read */ 1)) - return 0; + if (uv__iou_fs_read_or_write(loop, req, /* is_read */ 1)) + return 0; +post: POST; } diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c index b78242d3be4e3c..94ace58680cf39 100644 --- a/deps/uv/src/unix/kqueue.c +++ b/deps/uv/src/unix/kqueue.c @@ -30,6 +30,9 @@ #include #include #include +#if defined(__FreeBSD__) +#include +#endif #include #include #include @@ -262,6 +265,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { if (nfds == -1) assert(errno == EINTR); + else if (nfds == 0) + /* Unlimited timeout should only return with events or signal. */ + assert(timeout != -1); if (pset != NULL) pthread_sigmask(SIG_UNBLOCK, pset, NULL); @@ -286,8 +292,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { timeout = user_timeout; reset_timeout = 0; } else if (nfds == 0) { - /* Reached the user timeout value. */ - assert(timeout != -1); return; } @@ -479,6 +483,16 @@ static void uv__fs_event(uv_loop_t* loop, uv__io_t* w, unsigned int fflags) { */ if (fcntl(handle->event_watcher.fd, F_GETPATH, pathbuf) == 0) path = uv__basename_r(pathbuf); +#elif defined(F_KINFO) + /* We try to get the file info reference from the file descriptor. + * the struct's kf_structsize must be initialised beforehand + * whether with the KINFO_FILE_SIZE constant or this way. + */ + struct kinfo_file kf; + kf.kf_structsize = sizeof(kf); + + if (fcntl(handle->event_watcher.fd, F_KINFO, &kf) == 0) + path = uv__basename_r(kf.kf_path); #endif handle->cb(handle, path, events, 0); diff --git a/deps/uv/src/unix/linux.c b/deps/uv/src/unix/linux.c index 48b9c2c43e1040..8eeb352e6238a9 100644 --- a/deps/uv/src/unix/linux.c +++ b/deps/uv/src/unix/linux.c @@ -79,6 +79,8 @@ # define __NR_copy_file_range 379 # elif defined(__arc__) # define __NR_copy_file_range 285 +# elif defined(__riscv) +# define __NR_copy_file_range 285 # endif #endif /* __NR_copy_file_range */ @@ -95,6 +97,8 @@ # define __NR_statx 383 # elif defined(__s390__) # define __NR_statx 379 +# elif defined(__riscv) +# define __NR_statx 291 # endif #endif /* __NR_statx */ @@ -111,6 +115,8 @@ # define __NR_getrandom 359 # elif defined(__s390__) # define __NR_getrandom 349 +# elif defined(__riscv) +# define __NR_getrandom 278 # endif #endif /* __NR_getrandom */ @@ -317,17 +323,64 @@ unsigned uv__kernel_version(void) { unsigned major; unsigned minor; unsigned patch; + char v_sig[256]; + char* needle; version = atomic_load_explicit(&cached_version, memory_order_relaxed); if (version != 0) return version; + /* Check /proc/version_signature first as it's the way to get the mainline + * kernel version in Ubuntu. The format is: + * Ubuntu ubuntu_kernel_version mainline_kernel_version + * For example: + * Ubuntu 5.15.0-79.86-generic 5.15.111 + */ + if (0 == uv__slurp("/proc/version_signature", v_sig, sizeof(v_sig))) + if (3 == sscanf(v_sig, "Ubuntu %*s %u.%u.%u", &major, &minor, &patch)) + goto calculate_version; + if (-1 == uname(&u)) return 0; + /* In Debian we need to check `version` instead of `release` to extract the + * mainline kernel version. This is an example of how it looks like: + * #1 SMP Debian 5.10.46-4 (2021-08-03) + */ + needle = strstr(u.version, "Debian "); + if (needle != NULL) + if (3 == sscanf(needle, "Debian %u.%u.%u", &major, &minor, &patch)) + goto calculate_version; + if (3 != sscanf(u.release, "%u.%u.%u", &major, &minor, &patch)) return 0; + /* Handle it when the process runs under the UNAME26 personality: + * + * - kernels >= 3.x identify as 2.6.40+x + * - kernels >= 4.x identify as 2.6.60+x + * + * UNAME26 is a poorly conceived hack that doesn't let us distinguish + * between 4.x kernels and 5.x/6.x kernels so we conservatively assume + * that 2.6.60+x means 4.x. + * + * Fun fact of the day: it's technically possible to observe the actual + * kernel version for a brief moment because uname() first copies out the + * real release string before overwriting it with the backcompat string. + */ + if (major == 2 && minor == 6) { + if (patch >= 60) { + major = 4; + minor = patch - 60; + patch = 0; + } else if (patch >= 40) { + major = 3; + minor = patch - 40; + patch = 0; + } + } + +calculate_version: version = major * 65536 + minor * 256 + patch; atomic_store_explicit(&cached_version, version, memory_order_relaxed); @@ -422,6 +475,9 @@ int uv__io_uring_register(int fd, unsigned opcode, void* arg, unsigned nargs) { static int uv__use_io_uring(void) { #if defined(__ANDROID_API__) return 0; /* Possibly available but blocked by seccomp. */ +#elif defined(__arm__) && __SIZEOF_POINTER__ == 4 + /* See https://github.com/libuv/libuv/issues/4158. */ + return 0; /* All 32 bits kernels appear buggy. */ #else /* Ternary: unknown=0, yes=1, no=-1 */ static _Atomic int use_io_uring; @@ -431,8 +487,14 @@ static int uv__use_io_uring(void) { use = atomic_load_explicit(&use_io_uring, memory_order_relaxed); if (use == 0) { + /* Older kernels have a bug where the sqpoll thread uses 100% CPU. */ + use = uv__kernel_version() >= /* 5.10.186 */ 0x050ABA ? 1 : -1; + + /* But users can still enable it if they so desire. */ val = getenv("UV_USE_IO_URING"); - use = val == NULL || atoi(val) ? 1 : -1; + if (val != NULL) + use = atoi(val) ? 1 : -1; + atomic_store_explicit(&use_io_uring, use, memory_order_relaxed); } @@ -756,7 +818,9 @@ static void uv__iou_submit(struct uv__iou* iou) { int uv__iou_fs_close(uv_loop_t* loop, uv_fs_t* req) { struct uv__io_uring_sqe* sqe; struct uv__iou* iou; + int kv; + kv = uv__kernel_version(); /* Work around a poorly understood bug in older kernels where closing a file * descriptor pointing to /foo/bar results in ETXTBSY errors when trying to * execve("/foo/bar") later on. The bug seems to have been fixed somewhere @@ -764,10 +828,17 @@ int uv__iou_fs_close(uv_loop_t* loop, uv_fs_t* req) { * but good candidates are the several data race fixes. Interestingly, it * seems to manifest only when running under Docker so the possibility of * a Docker bug can't be completely ruled out either. Yay, computers. + * Also, disable on non-longterm versions between 5.16.0 (non-longterm) and + * 6.1.0 (longterm). Starting with longterm 6.1.x, the issue seems to be + * solved. */ - if (uv__kernel_version() < /* 5.15.90 */ 0x050F5A) + if (kv < /* 5.15.90 */ 0x050F5A) + return 0; + + if (kv >= /* 5.16.0 */ 0x050A00 && kv < /* 6.1.0 */ 0x060100) return 0; + iou = &uv__get_internal_fields(loop)->iou; sqe = uv__iou_get_sqe(iou, loop, req); @@ -1364,41 +1435,20 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { */ SAVE_ERRNO(uv__update_time(loop)); - if (nfds == 0) { + if (nfds == -1) + assert(errno == EINTR); + else if (nfds == 0) + /* Unlimited timeout should only return with events or signal. */ assert(timeout != -1); + if (nfds == 0 || nfds == -1) { if (reset_timeout != 0) { timeout = user_timeout; reset_timeout = 0; + } else if (nfds == 0) { + return; } - if (timeout == -1) - continue; - - if (timeout == 0) - break; - - /* We may have been inside the system call for longer than |timeout| - * milliseconds so we need to update the timestamp to avoid drift. - */ - goto update_timeout; - } - - if (nfds == -1) { - if (errno != EINTR) - abort(); - - if (reset_timeout != 0) { - timeout = user_timeout; - reset_timeout = 0; - } - - if (timeout == -1) - continue; - - if (timeout == 0) - break; - /* Interrupted by a signal. Update timeout and poll again. */ goto update_timeout; } @@ -1509,13 +1559,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { break; } +update_timeout: if (timeout == 0) break; if (timeout == -1) continue; -update_timeout: assert(timeout > 0); real_timeout -= (loop->time - base); @@ -1718,7 +1768,8 @@ int uv_cpu_info(uv_cpu_info_t** ci, int* count) { return UV__ERR(errno); } - fgets(buf, sizeof(buf), fp); /* Skip first line. */ + if (NULL == fgets(buf, sizeof(buf), fp)) + abort(); for (;;) { memset(&t, 0, sizeof(t)); @@ -1729,7 +1780,8 @@ int uv_cpu_info(uv_cpu_info_t** ci, int* count) { if (n != 7) break; - fgets(buf, sizeof(buf), fp); /* Skip rest of line. */ + if (NULL == fgets(buf, sizeof(buf), fp)) + abort(); if (cpu >= ARRAY_SIZE(*cpus)) continue; @@ -1809,7 +1861,8 @@ int uv_cpu_info(uv_cpu_info_t** ci, int* count) { if (fp == NULL) continue; - fscanf(fp, "%llu", &(*cpus)[cpu].freq); + if (1 != fscanf(fp, "%llu", &(*cpus)[cpu].freq)) + abort(); fclose(fp); fp = NULL; } diff --git a/deps/uv/src/unix/os390.c b/deps/uv/src/unix/os390.c index bbd37692d1d0da..1b277292aebffb 100644 --- a/deps/uv/src/unix/os390.c +++ b/deps/uv/src/unix/os390.c @@ -19,6 +19,7 @@ * IN THE SOFTWARE. */ +#include "uv.h" #include "internal.h" #include #include @@ -30,6 +31,7 @@ #include #include #include "zos-base.h" +#include "zos-sys-info.h" #if defined(__clang__) #include "csrsic.h" #else @@ -66,9 +68,6 @@ /* Total number of frames currently on all available frame queues. */ #define RCEAFC_OFFSET 0x088 -/* CPC model length from the CSRSI Service. */ -#define CPCMODEL_LENGTH 16 - /* Pointer to the home (current) ASCB. */ #define PSAAOLD 0x224 @@ -258,9 +257,12 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { idx = 0; while (idx < *count) { cpu_info->speed = *(int*)(info.siv1v2si22v1.si22v1cpucapability); - cpu_info->model = uv__malloc(CPCMODEL_LENGTH + 1); - memset(cpu_info->model, '\0', CPCMODEL_LENGTH + 1); - memcpy(cpu_info->model, info.siv1v2si11v1.si11v1cpcmodel, CPCMODEL_LENGTH); + cpu_info->model = uv__malloc(ZOSCPU_MODEL_LENGTH + 1); + if (cpu_info->model == NULL) { + uv_free_cpu_info(*cpu_infos, idx); + return UV_ENOMEM; + } + __get_cpu_model(cpu_info->model, ZOSCPU_MODEL_LENGTH + 1); cpu_info->cpu_times.user = cpu_usage_avg; /* TODO: implement the following */ cpu_info->cpu_times.sys = 0; diff --git a/deps/uv/src/unix/signal.c b/deps/uv/src/unix/signal.c index 63aba5a60e06b9..bc4206e6d864c8 100644 --- a/deps/uv/src/unix/signal.c +++ b/deps/uv/src/unix/signal.c @@ -279,6 +279,8 @@ static int uv__signal_loop_once_init(uv_loop_t* loop) { int uv__signal_loop_fork(uv_loop_t* loop) { + struct uv__queue* q; + if (loop->signal_pipefd[0] == -1) return 0; uv__io_stop(loop, &loop->signal_io_watcher, POLLIN); @@ -286,6 +288,19 @@ int uv__signal_loop_fork(uv_loop_t* loop) { uv__close(loop->signal_pipefd[1]); loop->signal_pipefd[0] = -1; loop->signal_pipefd[1] = -1; + + uv__queue_foreach(q, &loop->handle_queue) { + uv_handle_t* handle = uv__queue_data(q, uv_handle_t, handle_queue); + uv_signal_t* sh; + + if (handle->type != UV_SIGNAL) + continue; + + sh = (uv_signal_t*) handle; + sh->caught_signals = 0; + sh->dispatched_signals = 0; + } + return uv__signal_loop_once_init(loop); } diff --git a/deps/uv/src/unix/tcp.c b/deps/uv/src/unix/tcp.c index d6c848f4610132..a6b53e5913271d 100644 --- a/deps/uv/src/unix/tcp.c +++ b/deps/uv/src/unix/tcp.c @@ -27,6 +27,17 @@ #include #include +#include +#include + +#if defined(__PASE__) +#include +#define ifaddrs ifaddrs_pase +#define getifaddrs Qp2getifaddrs +#define freeifaddrs Qp2freeifaddrs +#else +#include +#endif static int maybe_bind_socket(int fd) { union uv__sockaddr s; @@ -198,11 +209,50 @@ int uv__tcp_bind(uv_tcp_t* tcp, } +static int uv__is_ipv6_link_local(const struct sockaddr* addr) { + const struct sockaddr_in6* a6; + uint8_t b[2]; + + if (addr->sa_family != AF_INET6) + return 0; + + a6 = (const struct sockaddr_in6*) addr; + memcpy(b, &a6->sin6_addr, sizeof(b)); + + return b[0] == 0xFE && b[1] == 0x80; +} + + +static int uv__ipv6_link_local_scope_id(void) { + struct sockaddr_in6* a6; + struct ifaddrs* ifa; + struct ifaddrs* p; + int rv; + + if (getifaddrs(&ifa)) + return 0; + + for (p = ifa; p != NULL; p = p->ifa_next) + if (uv__is_ipv6_link_local(p->ifa_addr)) + break; + + rv = 0; + if (p != NULL) { + a6 = (struct sockaddr_in6*) p->ifa_addr; + rv = a6->sin6_scope_id; + } + + freeifaddrs(ifa); + return rv; +} + + int uv__tcp_connect(uv_connect_t* req, uv_tcp_t* handle, const struct sockaddr* addr, unsigned int addrlen, uv_connect_cb cb) { + struct sockaddr_in6 tmp6; int err; int r; @@ -220,6 +270,14 @@ int uv__tcp_connect(uv_connect_t* req, if (err) return err; + if (uv__is_ipv6_link_local(addr)) { + memcpy(&tmp6, addr, sizeof(tmp6)); + if (tmp6.sin6_scope_id == 0) { + tmp6.sin6_scope_id = uv__ipv6_link_local_scope_id(); + addr = (void*) &tmp6; + } + } + do { errno = 0; r = connect(uv__stream_fd(handle), addr, addrlen); @@ -374,28 +432,39 @@ int uv__tcp_nodelay(int fd, int on) { int uv__tcp_keepalive(int fd, int on, unsigned int delay) { + int intvl; + int cnt; + + (void) &intvl; + (void) &cnt; + if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on))) return UV__ERR(errno); + if (!on) + return 0; + #ifdef TCP_KEEPIDLE - if (on) { - int intvl = 1; /* 1 second; same as default on Win32 */ - int cnt = 10; /* 10 retries; same as hardcoded on Win32 */ - if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay, sizeof(delay))) - return UV__ERR(errno); - if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &intvl, sizeof(intvl))) - return UV__ERR(errno); - if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &cnt, sizeof(cnt))) - return UV__ERR(errno); - } + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay, sizeof(delay))) + return UV__ERR(errno); +/* Solaris/SmartOS, if you don't support keep-alive, + * then don't advertise it in your system headers... + */ +/* FIXME(bnoordhuis) That's possibly because sizeof(delay) should be 1. */ +#elif defined(TCP_KEEPALIVE) && !defined(__sun) + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &delay, sizeof(delay))) + return UV__ERR(errno); #endif - /* Solaris/SmartOS, if you don't support keep-alive, - * then don't advertise it in your system headers... - */ - /* FIXME(bnoordhuis) That's possibly because sizeof(delay) should be 1. */ -#if defined(TCP_KEEPALIVE) && !defined(__sun) - if (on && setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &delay, sizeof(delay))) +#ifdef TCP_KEEPINTVL + intvl = 1; /* 1 second; same as default on Win32 */ + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &intvl, sizeof(intvl))) + return UV__ERR(errno); +#endif + +#ifdef TCP_KEEPCNT + cnt = 10; /* 10 retries; same as hardcoded on Win32 */ + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &cnt, sizeof(cnt))) return UV__ERR(errno); #endif diff --git a/deps/uv/src/unix/thread.c b/deps/uv/src/unix/thread.c index 4d6f4b8232ec6d..f05e6fe0f7dd5a 100644 --- a/deps/uv/src/unix/thread.c +++ b/deps/uv/src/unix/thread.c @@ -789,11 +789,33 @@ void uv_cond_broadcast(uv_cond_t* cond) { abort(); } +#if defined(__APPLE__) && defined(__MACH__) + +void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex) { + int r; + + errno = 0; + r = pthread_cond_wait(cond, mutex); + + /* Workaround for a bug in OS X at least up to 13.6 + * See https://github.com/libuv/libuv/issues/4165 + */ + if (r == EINVAL) + if (errno == EBUSY) + return; + + if (r) + abort(); +} + +#else /* !(defined(__APPLE__) && defined(__MACH__)) */ + void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex) { if (pthread_cond_wait(cond, mutex)) abort(); } +#endif int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) { int r; diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index 916f3f4e00664a..2200fe3f0a41e2 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -559,6 +559,9 @@ static void uv__print_handles(uv_loop_t* loop, int only_active, FILE* stream) { if (loop == NULL) loop = uv_default_loop(); + if (stream == NULL) + stream = stderr; + uv__queue_foreach(q, &loop->handle_queue) { h = uv__queue_data(q, uv_handle_t, handle_queue); diff --git a/deps/uv/src/win/dl.c b/deps/uv/src/win/dl.c index 676be4dc7b5b8a..7880c9595be1f6 100644 --- a/deps/uv/src/win/dl.c +++ b/deps/uv/src/win/dl.c @@ -27,18 +27,17 @@ static int uv__dlerror(uv_lib_t* lib, const char* filename, DWORD errorno); int uv_dlopen(const char* filename, uv_lib_t* lib) { WCHAR filename_w[32768]; + ssize_t r; lib->handle = NULL; lib->errmsg = NULL; - if (!MultiByteToWideChar(CP_UTF8, - 0, - filename, - -1, - filename_w, - ARRAY_SIZE(filename_w))) { - return uv__dlerror(lib, filename, GetLastError()); - } + r = uv_wtf8_length_as_utf16(filename); + if (r < 0) + return uv__dlerror(lib, filename, ERROR_NO_UNICODE_TRANSLATION); + if ((size_t) r > ARRAY_SIZE(filename_w)) + return uv__dlerror(lib, filename, ERROR_INSUFFICIENT_BUFFER); + uv_wtf8_to_utf16(filename, filename_w, r); lib->handle = LoadLibraryExW(filename_w, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (lib->handle == NULL) { diff --git a/deps/uv/src/win/fs-event.c b/deps/uv/src/win/fs-event.c index 6758c7c78bc1d6..4a0ca1f70a22b6 100644 --- a/deps/uv/src/win/fs-event.c +++ b/deps/uv/src/win/fs-event.c @@ -157,7 +157,8 @@ int uv_fs_event_start(uv_fs_event_t* handle, uv_fs_event_cb cb, const char* path, unsigned int flags) { - int name_size, is_path_dir, size; + int is_path_dir; + size_t size; DWORD attr, last_error; WCHAR* dir = NULL, *dir_to_watch, *pathw = NULL; DWORD short_path_buffer_len; @@ -176,23 +177,9 @@ int uv_fs_event_start(uv_fs_event_t* handle, uv__handle_start(handle); - /* Convert name to UTF16. */ - - name_size = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0) * - sizeof(WCHAR); - pathw = (WCHAR*)uv__malloc(name_size); - if (!pathw) { - uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); - } - - if (!MultiByteToWideChar(CP_UTF8, - 0, - path, - -1, - pathw, - name_size / sizeof(WCHAR))) { - return uv_translate_sys_error(GetLastError()); - } + last_error = uv__convert_utf8_to_utf16(path, &pathw); + if (last_error) + goto error_uv; /* Determine whether path is a file or a directory. */ attr = GetFileAttributesW(pathw); @@ -333,6 +320,9 @@ int uv_fs_event_start(uv_fs_event_t* handle, return 0; error: + last_error = uv_translate_sys_error(last_error); + +error_uv: if (handle->path) { uv__free(handle->path); handle->path = NULL; @@ -365,7 +355,7 @@ int uv_fs_event_start(uv_fs_event_t* handle, uv__free(short_path); - return uv_translate_sys_error(last_error); + return last_error; } diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c index fc209c54f470ed..99c8a2bf8bf124 100644 --- a/deps/uv/src/win/fs.c +++ b/deps/uv/src/win/fs.c @@ -31,13 +31,16 @@ #include #include "uv.h" + +/* requires , included via "uv.h" above, but needs to + be included before our "winapi.h", included via "internal.h" below. */ +#include + #include "internal.h" #include "req-inl.h" #include "handle-inl.h" #include "fs-fd-hash-inl.h" -#include - #define UV_FS_FREE_PATHS 0x0002 #define UV_FS_FREE_PTR 0x0008 @@ -144,279 +147,6 @@ void uv__fs_init(void) { } -static int32_t fs__decode_wtf8_char(const char** input) { - uint32_t code_point; - uint8_t b1; - uint8_t b2; - uint8_t b3; - uint8_t b4; - - b1 = **input; - if (b1 <= 0x7F) - return b1; /* ASCII code point */ - if (b1 < 0xC2) - return -1; /* invalid: continuation byte */ - code_point = b1; - - b2 = *++*input; - if ((b2 & 0xC0) != 0x80) - return -1; /* invalid: not a continuation byte */ - code_point = (code_point << 6) | (b2 & 0x3F); - if (b1 <= 0xDF) - return 0x7FF & code_point; /* two-byte character */ - - b3 = *++*input; - if ((b3 & 0xC0) != 0x80) - return -1; /* invalid: not a continuation byte */ - code_point = (code_point << 6) | (b3 & 0x3F); - if (b1 <= 0xEF) - return 0xFFFF & code_point; /* three-byte character */ - - b4 = *++*input; - if ((b4 & 0xC0) != 0x80) - return -1; /* invalid: not a continuation byte */ - code_point = (code_point << 6) | (b4 & 0x3F); - if (b1 <= 0xF4) - if (code_point <= 0x10FFFF) - return code_point; /* four-byte character */ - - /* code point too large */ - return -1; -} - - -static ssize_t fs__get_length_wtf8(const char* source_ptr) { - size_t w_target_len = 0; - int32_t code_point; - - do { - code_point = fs__decode_wtf8_char(&source_ptr); - if (code_point < 0) - return -1; - if (code_point > 0xFFFF) - w_target_len++; - w_target_len++; - } while (*source_ptr++); - return w_target_len; -} - - -static void fs__wtf8_to_wide(const char* source_ptr, WCHAR* w_target) { - int32_t code_point; - - do { - code_point = fs__decode_wtf8_char(&source_ptr); - /* fs__get_length_wtf8 should have been called and checked first. */ - assert(code_point >= 0); - if (code_point > 0x10000) { - assert(code_point < 0x10FFFF); - *w_target++ = (((code_point - 0x10000) >> 10) + 0xD800); - *w_target++ = ((code_point - 0x10000) & 0x3FF) + 0xDC00; - } else { - *w_target++ = code_point; - } - } while (*source_ptr++); -} - - -INLINE static int fs__capture_path(uv_fs_t* req, const char* path, - const char* new_path, const int copy_path) { - WCHAR* buf; - WCHAR* pos; - size_t buf_sz = 0; - size_t path_len = 0; - ssize_t pathw_len = 0; - ssize_t new_pathw_len = 0; - - /* new_path can only be set if path is also set. */ - assert(new_path == NULL || path != NULL); - - if (path != NULL) { - pathw_len = fs__get_length_wtf8(path); - if (pathw_len < 0) - return ERROR_INVALID_NAME; - buf_sz += pathw_len * sizeof(WCHAR); - } - - if (path != NULL && copy_path) { - path_len = 1 + strlen(path); - buf_sz += path_len; - } - - if (new_path != NULL) { - new_pathw_len = fs__get_length_wtf8(new_path); - if (new_pathw_len < 0) - return ERROR_INVALID_NAME; - buf_sz += new_pathw_len * sizeof(WCHAR); - } - - - if (buf_sz == 0) { - req->file.pathw = NULL; - req->fs.info.new_pathw = NULL; - req->path = NULL; - return 0; - } - - buf = uv__malloc(buf_sz); - if (buf == NULL) { - return ERROR_OUTOFMEMORY; - } - - pos = buf; - - if (path != NULL) { - fs__wtf8_to_wide(path, pos); - req->file.pathw = pos; - pos += pathw_len; - } else { - req->file.pathw = NULL; - } - - if (new_path != NULL) { - fs__wtf8_to_wide(new_path, pos); - req->fs.info.new_pathw = pos; - pos += new_pathw_len; - } else { - req->fs.info.new_pathw = NULL; - } - - req->path = path; - if (path != NULL && copy_path) { - memcpy(pos, path, path_len); - assert(path_len == buf_sz - (pos - buf) * sizeof(WCHAR)); - req->path = (char*) pos; - } - - req->flags |= UV_FS_FREE_PATHS; - - return 0; -} - - - -INLINE static void uv__fs_req_init(uv_loop_t* loop, uv_fs_t* req, - uv_fs_type fs_type, const uv_fs_cb cb) { - uv__once_init(); - UV_REQ_INIT(req, UV_FS); - req->loop = loop; - req->flags = 0; - req->fs_type = fs_type; - req->sys_errno_ = 0; - req->result = 0; - req->ptr = NULL; - req->path = NULL; - req->cb = cb; - memset(&req->fs, 0, sizeof(req->fs)); -} - - -static int32_t fs__get_surrogate_value(const WCHAR* w_source_ptr, - size_t w_source_len) { - WCHAR u; - WCHAR next; - - u = w_source_ptr[0]; - if (u >= 0xD800 && u <= 0xDBFF && w_source_len > 1) { - next = w_source_ptr[1]; - if (next >= 0xDC00 && next <= 0xDFFF) - return 0x10000 + ((u - 0xD800) << 10) + (next - 0xDC00); - } - return u; -} - - -static size_t fs__get_length_wide(const WCHAR* w_source_ptr, - size_t w_source_len) { - size_t target_len; - int32_t code_point; - - target_len = 0; - for (; w_source_len; w_source_len--, w_source_ptr++) { - code_point = fs__get_surrogate_value(w_source_ptr, w_source_len); - /* Can be invalid UTF-8 but must be valid WTF-8. */ - assert(code_point >= 0); - if (code_point < 0x80) - target_len += 1; - else if (code_point < 0x800) - target_len += 2; - else if (code_point < 0x10000) - target_len += 3; - else { - target_len += 4; - w_source_ptr++; - w_source_len--; - } - } - return target_len; -} - - -static int fs__wide_to_wtf8(WCHAR* w_source_ptr, - size_t w_source_len, - char** target_ptr, - size_t* target_len_ptr) { - size_t target_len; - char* target; - int32_t code_point; - - /* If *target_ptr is provided, then *target_len_ptr must be its length - * (excluding space for null), otherwise we will compute the target_len_ptr - * length and may return a new allocation in *target_ptr if target_ptr is - * provided. */ - if (target_ptr == NULL || *target_ptr == NULL) { - target_len = fs__get_length_wide(w_source_ptr, w_source_len); - if (target_len_ptr != NULL) - *target_len_ptr = target_len; - } else { - target_len = *target_len_ptr; - } - - if (target_ptr == NULL) - return 0; - - if (*target_ptr == NULL) { - target = uv__malloc(target_len + 1); - if (target == NULL) { - SetLastError(ERROR_OUTOFMEMORY); - return -1; - } - *target_ptr = target; - } else { - target = *target_ptr; - } - - for (; w_source_len; w_source_len--, w_source_ptr++) { - code_point = fs__get_surrogate_value(w_source_ptr, w_source_len); - /* Can be invalid UTF-8 but must be valid WTF-8. */ - assert(code_point >= 0); - - if (code_point < 0x80) { - *target++ = code_point; - } else if (code_point < 0x800) { - *target++ = 0xC0 | (code_point >> 6); - *target++ = 0x80 | (code_point & 0x3F); - } else if (code_point < 0x10000) { - *target++ = 0xE0 | (code_point >> 12); - *target++ = 0x80 | ((code_point >> 6) & 0x3F); - *target++ = 0x80 | (code_point & 0x3F); - } else { - *target++ = 0xF0 | (code_point >> 18); - *target++ = 0x80 | ((code_point >> 12) & 0x3F); - *target++ = 0x80 | ((code_point >> 6) & 0x3F); - *target++ = 0x80 | (code_point & 0x3F); - w_source_ptr++; - w_source_len--; - } - } - assert((size_t) (target - *target_ptr) == target_len); - - *target++ = '\0'; - - return 0; -} - - INLINE static int fs__readlink_handle(HANDLE handle, char** target_ptr, size_t* target_len_ptr) { @@ -550,7 +280,98 @@ INLINE static int fs__readlink_handle(HANDLE handle, } assert(target_ptr == NULL || *target_ptr == NULL); - return fs__wide_to_wtf8(w_target, w_target_len, target_ptr, target_len_ptr); + return uv_utf16_to_wtf8(w_target, w_target_len, target_ptr, target_len_ptr); +} + + +INLINE static int fs__capture_path(uv_fs_t* req, const char* path, + const char* new_path, const int copy_path) { + WCHAR* buf; + WCHAR* pos; + size_t buf_sz = 0; + size_t path_len = 0; + ssize_t pathw_len = 0; + ssize_t new_pathw_len = 0; + + /* new_path can only be set if path is also set. */ + assert(new_path == NULL || path != NULL); + + if (path != NULL) { + pathw_len = uv_wtf8_length_as_utf16(path); + if (pathw_len < 0) + return ERROR_INVALID_NAME; + buf_sz += pathw_len * sizeof(WCHAR); + } + + if (path != NULL && copy_path) { + path_len = 1 + strlen(path); + buf_sz += path_len; + } + + if (new_path != NULL) { + new_pathw_len = uv_wtf8_length_as_utf16(new_path); + if (new_pathw_len < 0) + return ERROR_INVALID_NAME; + buf_sz += new_pathw_len * sizeof(WCHAR); + } + + + if (buf_sz == 0) { + req->file.pathw = NULL; + req->fs.info.new_pathw = NULL; + req->path = NULL; + return 0; + } + + buf = uv__malloc(buf_sz); + if (buf == NULL) { + return ERROR_OUTOFMEMORY; + } + + pos = buf; + + if (path != NULL) { + uv_wtf8_to_utf16(path, pos, pathw_len); + req->file.pathw = pos; + pos += pathw_len; + } else { + req->file.pathw = NULL; + } + + if (new_path != NULL) { + uv_wtf8_to_utf16(new_path, pos, new_pathw_len); + req->fs.info.new_pathw = pos; + pos += new_pathw_len; + } else { + req->fs.info.new_pathw = NULL; + } + + req->path = path; + if (path != NULL && copy_path) { + memcpy(pos, path, path_len); + assert(path_len == buf_sz - (pos - buf) * sizeof(WCHAR)); + req->path = (char*) pos; + } + + req->flags |= UV_FS_FREE_PATHS; + + return 0; +} + + +INLINE static void uv__fs_req_init(uv_loop_t* loop, uv_fs_t* req, + uv_fs_type fs_type, const uv_fs_cb cb) { + uv__once_init(); + UV_REQ_INIT(req, UV_FS); + req->loop = loop; + req->flags = 0; + req->fs_type = fs_type; + req->sys_errno_ = 0; + req->result = 0; + req->ptr = NULL; + req->path = NULL; + req->cb = cb; + memset(&req->fs, 0, sizeof(req->fs)); } @@ -1569,7 +1390,7 @@ void fs__scandir(uv_fs_t* req) { continue; /* Compute the space required to store the filename as WTF-8. */ - wtf8_len = fs__get_length_wide(&info->FileName[0], wchar_len); + wtf8_len = uv_utf16_length_as_wtf8(&info->FileName[0], wchar_len); /* Resize the dirent array if needed. */ if (dirents_used >= dirents_size) { @@ -1597,8 +1418,8 @@ void fs__scandir(uv_fs_t* req) { /* Convert file name to UTF-8. */ wtf8 = &dirent->d_name[0]; - if (fs__wide_to_wtf8(&info->FileName[0], wchar_len, &wtf8, &wtf8_len) == -1) - goto win32_error; + if (uv_utf16_to_wtf8(&info->FileName[0], wchar_len, &wtf8, &wtf8_len) != 0) + goto out_of_memory_error; /* Fill out the type field. */ if (info->FileAttributes & FILE_ATTRIBUTE_DEVICE) @@ -2824,7 +2645,7 @@ static ssize_t fs__realpath_handle(HANDLE handle, char** realpath_ptr) { } assert(*realpath_ptr == NULL); - r = fs__wide_to_wtf8(w_realpath_ptr, w_realpath_len, realpath_ptr, NULL); + r = uv_utf16_to_wtf8(w_realpath_ptr, w_realpath_len, realpath_ptr, NULL); uv__free(w_realpath_buf); return r; } diff --git a/deps/uv/src/win/getaddrinfo.c b/deps/uv/src/win/getaddrinfo.c index dfab860a735e47..8b8406ada8e743 100644 --- a/deps/uv/src/win/getaddrinfo.c +++ b/deps/uv/src/win/getaddrinfo.c @@ -104,13 +104,14 @@ static void uv__getaddrinfo_work(struct uv__work* w) { */ static void uv__getaddrinfo_done(struct uv__work* w, int status) { uv_getaddrinfo_t* req; - int addrinfo_len = 0; - int name_len = 0; + size_t addrinfo_len = 0; + ssize_t name_len = 0; size_t addrinfo_struct_len = ALIGNED_SIZE(sizeof(struct addrinfo)); struct addrinfoW* addrinfow_ptr; struct addrinfo* addrinfo_ptr; char* alloc_ptr = NULL; char* cur_ptr = NULL; + int r; req = container_of(w, uv_getaddrinfo_t, work_req); @@ -131,19 +132,12 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) { addrinfo_len += addrinfo_struct_len + ALIGNED_SIZE(addrinfow_ptr->ai_addrlen); if (addrinfow_ptr->ai_canonname != NULL) { - name_len = WideCharToMultiByte(CP_UTF8, - 0, - addrinfow_ptr->ai_canonname, - -1, - NULL, - 0, - NULL, - NULL); - if (name_len == 0) { - req->retcode = uv_translate_sys_error(GetLastError()); + name_len = uv_utf16_length_as_wtf8(addrinfow_ptr->ai_canonname, -1); + if (name_len < 0) { + req->retcode = name_len; goto complete; } - addrinfo_len += ALIGNED_SIZE(name_len); + addrinfo_len += ALIGNED_SIZE(name_len + 1); } addrinfow_ptr = addrinfow_ptr->ai_next; } @@ -182,27 +176,14 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) { /* convert canonical name to UTF-8 */ if (addrinfow_ptr->ai_canonname != NULL) { - name_len = WideCharToMultiByte(CP_UTF8, - 0, - addrinfow_ptr->ai_canonname, - -1, - NULL, - 0, - NULL, - NULL); - assert(name_len > 0); - assert(cur_ptr + name_len <= alloc_ptr + addrinfo_len); - name_len = WideCharToMultiByte(CP_UTF8, - 0, - addrinfow_ptr->ai_canonname, - -1, - cur_ptr, - name_len, - NULL, - NULL); - assert(name_len > 0); + name_len = alloc_ptr + addrinfo_len - cur_ptr; + r = uv__copy_utf16_to_utf8(addrinfow_ptr->ai_canonname, + -1, + cur_ptr, + (size_t*)&name_len); + assert(r == 0); addrinfo_ptr->ai_canonname = cur_ptr; - cur_ptr += ALIGNED_SIZE(name_len); + cur_ptr += ALIGNED_SIZE(name_len + 1); } assert(cur_ptr <= alloc_ptr + addrinfo_len); @@ -261,12 +242,11 @@ int uv_getaddrinfo(uv_loop_t* loop, const char* service, const struct addrinfo* hints) { char hostname_ascii[256]; - int nodesize = 0; - int servicesize = 0; - int hintssize = 0; + size_t nodesize = 0; + size_t servicesize = 0; + size_t hintssize = 0; char* alloc_ptr = NULL; - int err; - long rc; + ssize_t rc; if (req == NULL || (node == NULL && service == NULL)) { return UV_EINVAL; @@ -286,56 +266,36 @@ int uv_getaddrinfo(uv_loop_t* loop, hostname_ascii + sizeof(hostname_ascii)); if (rc < 0) return rc; - nodesize = ALIGNED_SIZE(MultiByteToWideChar(CP_UTF8, 0, hostname_ascii, - -1, NULL, 0) * sizeof(WCHAR)); - if (nodesize == 0) { - err = GetLastError(); - goto error; - } + nodesize = strlen(hostname_ascii) + 1; node = hostname_ascii; } if (service != NULL) { - servicesize = ALIGNED_SIZE(MultiByteToWideChar(CP_UTF8, - 0, - service, - -1, - NULL, - 0) * - sizeof(WCHAR)); - if (servicesize == 0) { - err = GetLastError(); - goto error; - } + rc = uv_wtf8_length_as_utf16(service); + if (rc < 0) + return rc; + servicesize = rc; } if (hints != NULL) { hintssize = ALIGNED_SIZE(sizeof(struct addrinfoW)); } /* allocate memory for inputs, and partition it as needed */ - alloc_ptr = (char*)uv__malloc(nodesize + servicesize + hintssize); - if (!alloc_ptr) { - err = WSAENOBUFS; - goto error; - } + alloc_ptr = uv__malloc(ALIGNED_SIZE(nodesize * sizeof(WCHAR)) + + ALIGNED_SIZE(servicesize * sizeof(WCHAR)) + + hintssize); + if (!alloc_ptr) + return UV_ENOMEM; /* save alloc_ptr now so we can free if error */ - req->alloc = (void*)alloc_ptr; + req->alloc = (void*) alloc_ptr; /* Convert node string to UTF16 into allocated memory and save pointer in the - * request. */ + * request. The node here has been converted to ascii. */ if (node != NULL) { - req->node = (WCHAR*)alloc_ptr; - if (MultiByteToWideChar(CP_UTF8, - 0, - node, - -1, - (WCHAR*) alloc_ptr, - nodesize / sizeof(WCHAR)) == 0) { - err = GetLastError(); - goto error; - } - alloc_ptr += nodesize; + req->node = (WCHAR*) alloc_ptr; + uv_wtf8_to_utf16(node, (WCHAR*) alloc_ptr, nodesize); + alloc_ptr += ALIGNED_SIZE(nodesize * sizeof(WCHAR)); } else { req->node = NULL; } @@ -343,24 +303,16 @@ int uv_getaddrinfo(uv_loop_t* loop, /* Convert service string to UTF16 into allocated memory and save pointer in * the req. */ if (service != NULL) { - req->service = (WCHAR*)alloc_ptr; - if (MultiByteToWideChar(CP_UTF8, - 0, - service, - -1, - (WCHAR*) alloc_ptr, - servicesize / sizeof(WCHAR)) == 0) { - err = GetLastError(); - goto error; - } - alloc_ptr += servicesize; + req->service = (WCHAR*) alloc_ptr; + uv_wtf8_to_utf16(service, (WCHAR*) alloc_ptr, servicesize); + alloc_ptr += ALIGNED_SIZE(servicesize * sizeof(WCHAR)); } else { req->service = NULL; } /* copy hints to allocated memory and save pointer in req */ if (hints != NULL) { - req->addrinfow = (struct addrinfoW*)alloc_ptr; + req->addrinfow = (struct addrinfoW*) alloc_ptr; req->addrinfow->ai_family = hints->ai_family; req->addrinfow->ai_socktype = hints->ai_socktype; req->addrinfow->ai_protocol = hints->ai_protocol; @@ -387,19 +339,11 @@ int uv_getaddrinfo(uv_loop_t* loop, uv__getaddrinfo_done(&req->work_req, 0); return req->retcode; } - -error: - if (req != NULL) { - uv__free(req->alloc); - req->alloc = NULL; - } - return uv_translate_sys_error(err); } int uv_if_indextoname(unsigned int ifindex, char* buffer, size_t* size) { NET_LUID luid; wchar_t wname[NDIS_IF_MAX_STRING_SIZE + 1]; /* Add one for the NUL. */ - DWORD bufsize; int r; if (buffer == NULL || size == NULL || *size == 0) @@ -415,31 +359,7 @@ int uv_if_indextoname(unsigned int ifindex, char* buffer, size_t* size) { if (r != 0) return uv_translate_sys_error(r); - /* Check how much space we need */ - bufsize = WideCharToMultiByte(CP_UTF8, 0, wname, -1, NULL, 0, NULL, NULL); - - if (bufsize == 0) { - return uv_translate_sys_error(GetLastError()); - } else if (bufsize > *size) { - *size = bufsize; - return UV_ENOBUFS; - } - - /* Convert to UTF-8 */ - bufsize = WideCharToMultiByte(CP_UTF8, - 0, - wname, - -1, - buffer, - *size, - NULL, - NULL); - - if (bufsize == 0) - return uv_translate_sys_error(GetLastError()); - - *size = bufsize - 1; - return 0; + return uv__copy_utf16_to_utf8(wname, -1, buffer, size); } int uv_if_indextoiid(unsigned int ifindex, char* buffer, size_t* size) { diff --git a/deps/uv/src/win/getnameinfo.c b/deps/uv/src/win/getnameinfo.c index b3773380c21d70..32863176ef6403 100644 --- a/deps/uv/src/win/getnameinfo.c +++ b/deps/uv/src/win/getnameinfo.c @@ -42,6 +42,7 @@ static void uv__getnameinfo_work(struct uv__work* w) { uv_getnameinfo_t* req; WCHAR host[NI_MAXHOST]; WCHAR service[NI_MAXSERV]; + size_t size; int ret; req = container_of(w, uv_getnameinfo_t, work_req); @@ -57,29 +58,17 @@ static void uv__getnameinfo_work(struct uv__work* w) { return; } - ret = WideCharToMultiByte(CP_UTF8, - 0, - host, - -1, - req->host, - sizeof(req->host), - NULL, - NULL); - if (ret == 0) { - req->retcode = uv_translate_sys_error(GetLastError()); + size = sizeof(req->host); + ret = uv__copy_utf16_to_utf8(host, -1, req->host, &size); + if (ret < 0) { + req->retcode = ret; return; } - ret = WideCharToMultiByte(CP_UTF8, - 0, - service, - -1, - req->service, - sizeof(req->service), - NULL, - NULL); - if (ret == 0) { - req->retcode = uv_translate_sys_error(GetLastError()); + size = sizeof(req->service); + ret = uv__copy_utf16_to_utf8(service, -1, req->service, &size); + if (ret < 0) { + req->retcode = ret; } } diff --git a/deps/uv/src/win/internal.h b/deps/uv/src/win/internal.h index 9672fbc6826397..867dea5e0ed34f 100644 --- a/deps/uv/src/win/internal.h +++ b/deps/uv/src/win/internal.h @@ -257,8 +257,9 @@ void uv__util_init(void); uint64_t uv__hrtime(unsigned int scale); __declspec(noreturn) void uv_fatal_error(const int errorno, const char* syscall); -int uv__convert_utf16_to_utf8(const WCHAR* utf16, int utf16len, char** utf8); -int uv__convert_utf8_to_utf16(const char* utf8, int utf8len, WCHAR** utf16); +int uv__convert_utf16_to_utf8(const WCHAR* utf16, size_t utf16len, char** utf8); +int uv__copy_utf16_to_utf8(const WCHAR* utf16, size_t utf16len, char* utf8, size_t *size); +int uv__convert_utf8_to_utf16(const char* utf8, WCHAR** utf16); typedef int (WINAPI *uv__peersockfunc)(SOCKET, struct sockaddr*, int*); diff --git a/deps/uv/src/win/pipe.c b/deps/uv/src/win/pipe.c index f0cac3822564e1..cec72ff750b5a1 100644 --- a/deps/uv/src/win/pipe.c +++ b/deps/uv/src/win/pipe.c @@ -49,7 +49,7 @@ static const int default_pending_pipe_instances = 4; /* Pipe prefix */ static char pipe_prefix[] = "\\\\?\\pipe"; -static const int pipe_prefix_len = sizeof(pipe_prefix) - 1; +static const size_t pipe_prefix_len = sizeof(pipe_prefix) - 1; /* IPC incoming xfer queue item. */ typedef struct { @@ -703,7 +703,7 @@ int uv_pipe_bind2(uv_pipe_t* handle, size_t namelen, unsigned int flags) { uv_loop_t* loop = handle->loop; - int i, err, nameSize; + int i, err; uv_pipe_accept_t* req; if (flags & ~UV_PIPE_NO_TRUNCATE) { @@ -742,9 +742,8 @@ int uv_pipe_bind2(uv_pipe_t* handle, handle->pipe.serv.accept_reqs = (uv_pipe_accept_t*) uv__malloc(sizeof(uv_pipe_accept_t) * handle->pipe.serv.pending_instances); - if (!handle->pipe.serv.accept_reqs) { - uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); - } + if (!handle->pipe.serv.accept_reqs) + return UV_ENOMEM; for (i = 0; i < handle->pipe.serv.pending_instances; i++) { req = &handle->pipe.serv.accept_reqs[i]; @@ -754,22 +753,9 @@ int uv_pipe_bind2(uv_pipe_t* handle, req->next_pending = NULL; } - /* Convert name to UTF16. */ - nameSize = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0) * sizeof(WCHAR); - handle->name = uv__malloc(nameSize); - if (!handle->name) { - uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); - } - - if (!MultiByteToWideChar(CP_UTF8, - 0, - name, - -1, - handle->name, - nameSize / sizeof(WCHAR))) { - err = GetLastError(); - goto error; - } + err = uv__convert_utf8_to_utf16(name, &handle->name); + if (err) + return err; /* * Attempt to create the first pipe with FILE_FLAG_FIRST_PIPE_INSTANCE. @@ -795,10 +781,8 @@ int uv_pipe_bind2(uv_pipe_t* handle, return 0; error: - if (handle->name) { - uv__free(handle->name); - handle->name = NULL; - } + uv__free(handle->name); + handle->name = NULL; return uv_translate_sys_error(err); } @@ -861,7 +845,8 @@ int uv_pipe_connect2(uv_connect_t* req, unsigned int flags, uv_connect_cb cb) { uv_loop_t* loop = handle->loop; - int err, nameSize; + int err; + size_t nameSize; HANDLE pipeHandle = INVALID_HANDLE_VALUE; DWORD duplex_flags; @@ -904,26 +889,16 @@ int uv_pipe_connect2(uv_connect_t* req, } uv__pipe_connection_init(handle); - /* Convert name to UTF16. */ - nameSize = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0) * sizeof(WCHAR); - handle->name = uv__malloc(nameSize); - if (!handle->name) { - uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); - } - - if (!MultiByteToWideChar(CP_UTF8, - 0, - name, - -1, - handle->name, - nameSize / sizeof(WCHAR))) { - err = GetLastError(); + err = uv__convert_utf8_to_utf16(name, &handle->name); + if (err) { + err = ERROR_NO_UNICODE_TRANSLATION; goto error; } pipeHandle = open_named_pipe(handle->name, &duplex_flags); if (pipeHandle == INVALID_HANDLE_VALUE) { if (GetLastError() == ERROR_PIPE_BUSY) { + nameSize = (wcslen(handle->name) + 1) * sizeof(WCHAR); req->u.connect.name = uv__malloc(nameSize); if (!req->u.connect.name) { uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); @@ -2439,7 +2414,6 @@ static int uv__pipe_getname(const uv_pipe_t* handle, char* buffer, size_t* size) FILE_NAME_INFORMATION tmp_name_info; FILE_NAME_INFORMATION* name_info; WCHAR* name_buf; - unsigned int addrlen; unsigned int name_size; unsigned int name_len; int err; @@ -2450,46 +2424,7 @@ static int uv__pipe_getname(const uv_pipe_t* handle, char* buffer, size_t* size) if (handle->name != NULL) { /* The user might try to query the name before we are connected, * and this is just easier to return the cached value if we have it. */ - name_buf = handle->name; - name_len = wcslen(name_buf); - - /* check how much space we need */ - addrlen = WideCharToMultiByte(CP_UTF8, - 0, - name_buf, - name_len, - NULL, - 0, - NULL, - NULL); - if (!addrlen) { - *size = 0; - err = uv_translate_sys_error(GetLastError()); - return err; - } else if (addrlen >= *size) { - *size = addrlen + 1; - err = UV_ENOBUFS; - goto error; - } - - addrlen = WideCharToMultiByte(CP_UTF8, - 0, - name_buf, - name_len, - buffer, - addrlen, - NULL, - NULL); - if (!addrlen) { - *size = 0; - err = uv_translate_sys_error(GetLastError()); - return err; - } - - *size = addrlen; - buffer[addrlen] = '\0'; - - return 0; + return uv__copy_utf16_to_utf8(handle->name, -1, buffer, size); } if (handle->handle == INVALID_HANDLE_VALUE) { @@ -2517,8 +2452,7 @@ static int uv__pipe_getname(const uv_pipe_t* handle, char* buffer, size_t* size) name_info = uv__malloc(name_size); if (!name_info) { *size = 0; - err = UV_ENOMEM; - goto cleanup; + return UV_ENOMEM; } nt_status = pNtQueryInformationFile(handle->handle, @@ -2551,51 +2485,19 @@ static int uv__pipe_getname(const uv_pipe_t* handle, char* buffer, size_t* size) name_len /= sizeof(WCHAR); - /* check how much space we need */ - addrlen = WideCharToMultiByte(CP_UTF8, - 0, - name_buf, - name_len, - NULL, - 0, - NULL, - NULL); - if (!addrlen) { + /* "\\\\.\\pipe" + name */ + if (*size < pipe_prefix_len) { *size = 0; - err = uv_translate_sys_error(GetLastError()); - goto error; - } else if (pipe_prefix_len + addrlen >= *size) { - /* "\\\\.\\pipe" + name */ - *size = pipe_prefix_len + addrlen + 1; - err = UV_ENOBUFS; - goto error; } - - memcpy(buffer, pipe_prefix, pipe_prefix_len); - addrlen = WideCharToMultiByte(CP_UTF8, - 0, - name_buf, - name_len, - buffer+pipe_prefix_len, - *size-pipe_prefix_len, - NULL, - NULL); - if (!addrlen) { - *size = 0; - err = uv_translate_sys_error(GetLastError()); - goto error; + else { + memcpy(buffer, pipe_prefix, pipe_prefix_len); + *size -= pipe_prefix_len; } - - addrlen += pipe_prefix_len; - *size = addrlen; - buffer[addrlen] = '\0'; - - err = 0; + err = uv__copy_utf16_to_utf8(name_buf, name_len, buffer+pipe_prefix_len, size); + *size += pipe_prefix_len; error: uv__free(name_info); - -cleanup: return err; } diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c index 3e451e2291d6ed..43059858f3112e 100644 --- a/deps/uv/src/win/process.c +++ b/deps/uv/src/win/process.c @@ -105,38 +105,26 @@ static void uv__init_global_job_handle(void) { &info, sizeof info)) uv_fatal_error(GetLastError(), "SetInformationJobObject"); -} - -static int uv__utf8_to_utf16_alloc(const char* s, WCHAR** ws_ptr) { - int ws_len, r; - WCHAR* ws; - - ws_len = MultiByteToWideChar(CP_UTF8, - 0, - s, - -1, - NULL, - 0); - if (ws_len <= 0) { - return GetLastError(); - } - ws = (WCHAR*) uv__malloc(ws_len * sizeof(WCHAR)); - if (ws == NULL) { - return ERROR_OUTOFMEMORY; + if (!AssignProcessToJobObject(uv_global_job_handle_, GetCurrentProcess())) { + /* Make sure this handle is functional. The Windows kernel has a bug that + * if the first use of AssignProcessToJobObject is for a Windows Store + * program, subsequent attempts to use the handle with fail with + * INVALID_PARAMETER (87). This is possibly because all uses of the handle + * must be for the same Terminal Services session. We can ensure it is tied + * to our current session now by adding ourself to it. We could remove + * ourself afterwards, but there doesn't seem to be a reason to. + */ + DWORD err = GetLastError(); + if (err != ERROR_ACCESS_DENIED) + uv_fatal_error(err, "AssignProcessToJobObject"); } +} - r = MultiByteToWideChar(CP_UTF8, - 0, - s, - -1, - ws, - ws_len); - assert(r == ws_len); - *ws_ptr = ws; - return 0; +static int uv__utf8_to_utf16_alloc(const char* s, WCHAR** ws_ptr) { + return uv__convert_utf8_to_utf16(s, ws_ptr); } @@ -396,7 +384,7 @@ static WCHAR* search_path(const WCHAR *file, name_has_ext); while (result == NULL) { - if (*dir_end == L'\0') { + if (dir_end == NULL || *dir_end == L'\0') { break; } @@ -539,21 +527,15 @@ int make_program_args(char** args, int verbatim_arguments, WCHAR** dst_ptr) { /* Count the required size. */ for (arg = args; *arg; arg++) { - DWORD arg_len; - - arg_len = MultiByteToWideChar(CP_UTF8, - 0, - *arg, - -1, - NULL, - 0); - if (arg_len == 0) { - return GetLastError(); - } + ssize_t arg_len; + + arg_len = uv_wtf8_length_as_utf16(*arg); + if (arg_len < 0) + return arg_len; dst_len += arg_len; - if (arg_len > temp_buffer_len) + if ((size_t) arg_len > temp_buffer_len) temp_buffer_len = arg_len; arg_count++; @@ -564,34 +546,28 @@ int make_program_args(char** args, int verbatim_arguments, WCHAR** dst_ptr) { dst_len = dst_len * 2 + arg_count * 2; /* Allocate buffer for the final command line. */ - dst = (WCHAR*) uv__malloc(dst_len * sizeof(WCHAR)); + dst = uv__malloc(dst_len * sizeof(WCHAR)); if (dst == NULL) { - err = ERROR_OUTOFMEMORY; + err = UV_ENOMEM; goto error; } /* Allocate temporary working buffer. */ - temp_buffer = (WCHAR*) uv__malloc(temp_buffer_len * sizeof(WCHAR)); + temp_buffer = uv__malloc(temp_buffer_len * sizeof(WCHAR)); if (temp_buffer == NULL) { - err = ERROR_OUTOFMEMORY; + err = UV_ENOMEM; goto error; } pos = dst; for (arg = args; *arg; arg++) { - DWORD arg_len; + ssize_t arg_len; /* Convert argument to wide char. */ - arg_len = MultiByteToWideChar(CP_UTF8, - 0, - *arg, - -1, - temp_buffer, - (int) (dst + dst_len - pos)); - if (arg_len == 0) { - err = GetLastError(); - goto error; - } + arg_len = uv_wtf8_length_as_utf16(*arg); + assert(arg_len > 0); + assert(temp_buffer_len >= (size_t) arg_len); + uv_wtf8_to_utf16(*arg, temp_buffer, arg_len); if (verbatim_arguments) { /* Copy verbatim. */ @@ -603,6 +579,7 @@ int make_program_args(char** args, int verbatim_arguments, WCHAR** dst_ptr) { } *pos++ = *(arg + 1) ? L' ' : L'\0'; + assert(pos <= dst + dst_len); } uv__free(temp_buffer); @@ -688,55 +665,43 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) { WCHAR* ptr; char** env; size_t env_len = 0; - int len; + size_t len; size_t i; - DWORD var_size; + size_t var_size; size_t env_block_count = 1; /* 1 for null-terminator */ WCHAR* dst_copy; WCHAR** ptr_copy; WCHAR** env_copy; - DWORD required_vars_value_len[ARRAY_SIZE(required_vars)]; + size_t required_vars_value_len[ARRAY_SIZE(required_vars)]; /* first pass: determine size in UTF-16 */ for (env = env_block; *env; env++) { - int len; + ssize_t len; if (strchr(*env, '=')) { - len = MultiByteToWideChar(CP_UTF8, - 0, - *env, - -1, - NULL, - 0); - if (len <= 0) { - return GetLastError(); - } + len = uv_wtf8_length_as_utf16(*env); + if (len < 0) + return len; env_len += len; env_block_count++; } } /* second pass: copy to UTF-16 environment block */ - dst_copy = (WCHAR*)uv__malloc(env_len * sizeof(WCHAR)); + dst_copy = uv__malloc(env_len * sizeof(WCHAR)); if (dst_copy == NULL && env_len > 0) { - return ERROR_OUTOFMEMORY; + return UV_ENOMEM; } env_copy = alloca(env_block_count * sizeof(WCHAR*)); ptr = dst_copy; ptr_copy = env_copy; for (env = env_block; *env; env++) { + ssize_t len; if (strchr(*env, '=')) { - len = MultiByteToWideChar(CP_UTF8, - 0, - *env, - -1, - ptr, - (int) (env_len - (ptr - dst_copy))); - if (len <= 0) { - DWORD err = GetLastError(); - uv__free(dst_copy); - return err; - } + len = uv_wtf8_length_as_utf16(*env); + assert(len > 0); + assert((size_t) len <= env_len - (ptr - dst_copy)); + uv_wtf8_to_utf16(*env, ptr, len); *ptr_copy++ = ptr; ptr += len; } @@ -754,7 +719,7 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) { cmp = -1; } else { cmp = env_strncmp(required_vars[i].wide_eq, - required_vars[i].len, + required_vars[i].len, *ptr_copy); } if (cmp < 0) { @@ -777,7 +742,7 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) { dst = uv__malloc((1+env_len) * sizeof(WCHAR)); if (!dst) { uv__free(dst_copy); - return ERROR_OUTOFMEMORY; + return UV_ENOMEM; } for (ptr = dst, ptr_copy = env_copy, i = 0; @@ -975,26 +940,26 @@ int uv_spawn(uv_loop_t* loop, err = uv__utf8_to_utf16_alloc(options->file, &application); if (err) - goto done; + goto done_uv; err = make_program_args( options->args, options->flags & UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS, &arguments); if (err) - goto done; + goto done_uv; if (options->env) { err = make_program_env(options->env, &env); if (err) - goto done; + goto done_uv; } if (options->cwd) { /* Explicit cwd */ err = uv__utf8_to_utf16_alloc(options->cwd, &cwd); if (err) - goto done; + goto done_uv; } else { /* Inherit cwd */ @@ -1025,22 +990,19 @@ int uv_spawn(uv_loop_t* loop, DWORD path_len, r; path_len = GetEnvironmentVariableW(L"PATH", NULL, 0); - if (path_len == 0) { - err = GetLastError(); - goto done; - } - - alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR)); - if (alloc_path == NULL) { - err = ERROR_OUTOFMEMORY; - goto done; - } - path = alloc_path; + if (path_len != 0) { + alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR)); + if (alloc_path == NULL) { + err = ERROR_OUTOFMEMORY; + goto done; + } + path = alloc_path; - r = GetEnvironmentVariableW(L"PATH", path, path_len); - if (r == 0 || r >= path_len) { - err = GetLastError(); - goto done; + r = GetEnvironmentVariableW(L"PATH", path, path_len); + if (r == 0 || r >= path_len) { + err = GetLastError(); + goto done; + } } } @@ -1102,6 +1064,7 @@ int uv_spawn(uv_loop_t* loop, * breakaway. */ process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP; + process_flags |= CREATE_SUSPENDED; } if (!CreateProcessW(application_path, @@ -1119,11 +1082,6 @@ int uv_spawn(uv_loop_t* loop, goto done; } - /* Spawn succeeded. Beyond this point, failure is reported asynchronously. */ - - process->process_handle = info.hProcess; - process->pid = info.dwProcessId; - /* If the process isn't spawned as detached, assign to the global job object * so windows will kill it when the parent process dies. */ if (!(options->flags & UV_PROCESS_DETACHED)) { @@ -1146,6 +1104,19 @@ int uv_spawn(uv_loop_t* loop, } } + if (process_flags & CREATE_SUSPENDED) { + if (ResumeThread(info.hThread) == ((DWORD)-1)) { + err = GetLastError(); + TerminateProcess(info.hProcess, 1); + goto done; + } + } + + /* Spawn succeeded. Beyond this point, failure is reported asynchronously. */ + + process->process_handle = info.hProcess; + process->pid = info.dwProcessId; + /* Set IPC pid to all IPC pipes. */ for (i = 0; i < options->stdio_count; i++) { const uv_stdio_container_t* fdopt = &options->stdio[i]; @@ -1173,8 +1144,13 @@ int uv_spawn(uv_loop_t* loop, * made or the handle is closed, whichever happens first. */ uv__handle_start(process); + goto done_uv; + /* Cleanup, whether we succeeded or failed. */ done: + err = uv_translate_sys_error(err); + + done_uv: uv__free(application); uv__free(application_path); uv__free(arguments); @@ -1188,7 +1164,7 @@ int uv_spawn(uv_loop_t* loop, child_stdio_buffer = NULL; } - return uv_translate_sys_error(err); + return err; } diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c index 7e1f15544b1773..ac836930d6f3a1 100644 --- a/deps/uv/src/win/tty.c +++ b/deps/uv/src/win/tty.c @@ -482,9 +482,11 @@ static DWORD CALLBACK uv_tty_line_read_thread(void* data) { uv_loop_t* loop; uv_tty_t* handle; uv_req_t* req; - DWORD bytes, read_bytes; + DWORD bytes; + size_t read_bytes; WCHAR utf16[MAX_INPUT_BUFFER_LENGTH / 3]; - DWORD chars, read_chars; + DWORD chars; + DWORD read_chars; LONG status; COORD pos; BOOL read_console_success; @@ -525,16 +527,13 @@ static DWORD CALLBACK uv_tty_line_read_thread(void* data) { NULL); if (read_console_success) { - read_bytes = WideCharToMultiByte(CP_UTF8, - 0, - utf16, - read_chars, - handle->tty.rd.read_line_buffer.base, - bytes, - NULL, - NULL); + read_bytes = bytes; + uv_utf16_to_wtf8(utf16, + read_chars, + &handle->tty.rd.read_line_buffer.base, + &read_bytes); SET_REQ_SUCCESS(req); - req->u.io.overlapped.InternalHigh = read_bytes; + req->u.io.overlapped.InternalHigh = (DWORD) read_bytes; } else { SET_REQ_ERROR(req, GetLastError()); } @@ -798,7 +797,9 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle, } if (KEV.uChar.UnicodeChar != 0) { - int prefix_len, char_len; + int prefix_len; + size_t char_len; + char* last_key_buf; /* Character key pressed */ if (KEV.uChar.UnicodeChar >= 0xD800 && @@ -819,38 +820,31 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle, prefix_len = 0; } - if (KEV.uChar.UnicodeChar >= 0xDC00 && - KEV.uChar.UnicodeChar < 0xE000) { + char_len = sizeof handle->tty.rd.last_key; + last_key_buf = &handle->tty.rd.last_key[prefix_len]; + if (handle->tty.rd.last_utf16_high_surrogate) { /* UTF-16 surrogate pair */ WCHAR utf16_buffer[2]; utf16_buffer[0] = handle->tty.rd.last_utf16_high_surrogate; utf16_buffer[1] = KEV.uChar.UnicodeChar; - char_len = WideCharToMultiByte(CP_UTF8, - 0, - utf16_buffer, - 2, - &handle->tty.rd.last_key[prefix_len], - sizeof handle->tty.rd.last_key, - NULL, - NULL); + if (uv_utf16_to_wtf8(utf16_buffer, + 2, + &last_key_buf, + &char_len)) + char_len = 0; + handle->tty.rd.last_utf16_high_surrogate = 0; } else { /* Single UTF-16 character */ - char_len = WideCharToMultiByte(CP_UTF8, - 0, - &KEV.uChar.UnicodeChar, - 1, - &handle->tty.rd.last_key[prefix_len], - sizeof handle->tty.rd.last_key, - NULL, - NULL); + if (uv_utf16_to_wtf8(&KEV.uChar.UnicodeChar, + 1, + &last_key_buf, + &char_len)) + char_len = 0; } - /* Whatever happened, the last character wasn't a high surrogate. */ - handle->tty.rd.last_utf16_high_surrogate = 0; - /* If the utf16 character(s) couldn't be converted something must be * wrong. */ - if (!char_len) { + if (char_len == 0) { handle->flags &= ~UV_HANDLE_READING; DECREASE_ACTIVE_COUNT(loop, handle); handle->read_cb((uv_stream_t*) handle, diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index f6ec79cd57b501..91d88a54fb24a6 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -95,7 +95,7 @@ void uv__util_init(void) { int uv_exepath(char* buffer, size_t* size_ptr) { - int utf8_len, utf16_buffer_len, utf16_len; + size_t utf8_len, utf16_buffer_len, utf16_len; WCHAR* utf16_buffer; int err; @@ -123,25 +123,17 @@ int uv_exepath(char* buffer, size_t* size_ptr) { } /* Convert to UTF-8 */ - utf8_len = WideCharToMultiByte(CP_UTF8, - 0, - utf16_buffer, - -1, - buffer, - (int) *size_ptr, - NULL, - NULL); - if (utf8_len == 0) { - err = GetLastError(); - goto error; + utf8_len = *size_ptr - 1; /* Reserve space for NUL */ + err = uv_utf16_to_wtf8(utf16_buffer, utf16_len, &buffer, &utf8_len); + if (err == UV_ENOBUFS) { + utf8_len = *size_ptr - 1; + err = 0; } + *size_ptr = utf8_len; uv__free(utf16_buffer); - /* utf8_len *does* include the terminating null at this point, but the - * returned size shouldn't. */ - *size_ptr = utf8_len - 1; - return 0; + return err; error: uv__free(utf16_buffer); @@ -204,45 +196,14 @@ int uv_cwd(char* buffer, size_t* size) { } r = uv__cwd(&utf16_buffer, &utf16_len); - if (r < 0) { + if (r < 0) return r; - } - /* Check how much space we need */ - r = WideCharToMultiByte(CP_UTF8, - 0, - utf16_buffer, - -1, - NULL, - 0, - NULL, - NULL); - if (r == 0) { - uv__free(utf16_buffer); - return uv_translate_sys_error(GetLastError()); - } else if (r > (int) *size) { - uv__free(utf16_buffer); - *size = r; - return UV_ENOBUFS; - } + r = uv__copy_utf16_to_utf8(utf16_buffer, utf16_len, buffer, size); - /* Convert to UTF-8 */ - r = WideCharToMultiByte(CP_UTF8, - 0, - utf16_buffer, - -1, - buffer, - *size > INT_MAX ? INT_MAX : (int) *size, - NULL, - NULL); uv__free(utf16_buffer); - if (r == 0) { - return uv_translate_sys_error(GetLastError()); - } - - *size = r - 1; - return 0; + return r; } @@ -252,33 +213,10 @@ int uv_chdir(const char* dir) { WCHAR drive_letter, env_var[4]; int r; - if (dir == NULL) { - return UV_EINVAL; - } - - utf16_len = MultiByteToWideChar(CP_UTF8, - 0, - dir, - -1, - NULL, - 0); - if (utf16_len == 0) { - return uv_translate_sys_error(GetLastError()); - } - utf16_buffer = uv__malloc(utf16_len * sizeof(WCHAR)); - if (utf16_buffer == NULL) { - return UV_ENOMEM; - } - - if (MultiByteToWideChar(CP_UTF8, - 0, - dir, - -1, - utf16_buffer, - utf16_len) == 0) { - uv__free(utf16_buffer); - return uv_translate_sys_error(GetLastError()); - } + /* Convert to UTF-16 */ + r = uv__convert_utf8_to_utf16(dir, &utf16_buffer); + if (r) + return r; if (!SetCurrentDirectoryW(utf16_buffer)) { uv__free(utf16_buffer); @@ -416,29 +354,14 @@ int uv_set_process_title(const char* title) { uv__once_init(); - /* Find out how big the buffer for the wide-char title must be */ - length = MultiByteToWideChar(CP_UTF8, 0, title, -1, NULL, 0); - if (!length) { - err = GetLastError(); - goto done; - } - - /* Convert to wide-char string */ - title_w = (WCHAR*)uv__malloc(sizeof(WCHAR) * length); - if (!title_w) { - uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); - } - - length = MultiByteToWideChar(CP_UTF8, 0, title, -1, title_w, length); - if (!length) { - err = GetLastError(); - goto done; - } + err = uv__convert_utf8_to_utf16(title, &title_w); + if (err) + return err; /* If the title must be truncated insert a \0 terminator there */ - if (length > MAX_TITLE_LENGTH) { + length = wcslen(title_w); + if (length >= MAX_TITLE_LENGTH) title_w[MAX_TITLE_LENGTH - 1] = L'\0'; - } if (!SetConsoleTitleW(title_w)) { err = GetLastError(); @@ -460,20 +383,19 @@ int uv_set_process_title(const char* title) { static int uv__get_process_title(void) { WCHAR title_w[MAX_TITLE_LENGTH]; + DWORD wlen; - if (!GetConsoleTitleW(title_w, sizeof(title_w) / sizeof(WCHAR))) { - return -1; - } - - if (uv__convert_utf16_to_utf8(title_w, -1, &process_title) != 0) - return -1; + wlen = GetConsoleTitleW(title_w, sizeof(title_w) / sizeof(WCHAR)); + if (wlen == 0) + return uv_translate_sys_error(GetLastError()); - return 0; + return uv__convert_utf16_to_utf8(title_w, wlen, &process_title); } int uv_get_process_title(char* buffer, size_t size) { size_t len; + int r; if (buffer == NULL || size == 0) return UV_EINVAL; @@ -485,9 +407,12 @@ int uv_get_process_title(char* buffer, size_t size) { * If the process_title was never read before nor explicitly set, * we must query it with getConsoleTitleW */ - if (!process_title && uv__get_process_title() == -1) { - LeaveCriticalSection(&process_title_lock); - return uv_translate_sys_error(GetLastError()); + if (process_title == NULL) { + r = uv__get_process_title(); + if (r) { + LeaveCriticalSection(&process_title_lock); + return r; + } } assert(process_title); @@ -833,19 +758,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr, continue; /* Compute the size of the interface name. */ - name_size = WideCharToMultiByte(CP_UTF8, - 0, - adapter->FriendlyName, - -1, - NULL, - 0, - NULL, - FALSE); - if (name_size <= 0) { - uv__free(win_address_buf); - return uv_translate_sys_error(GetLastError()); - } - uv_address_buf_size += name_size; + name_size = uv_utf16_length_as_wtf8(adapter->FriendlyName, -1); + uv_address_buf_size += name_size + 1; /* Count the number of addresses associated with this interface, and * compute the size. */ @@ -875,30 +789,25 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr, adapter != NULL; adapter = adapter->Next) { IP_ADAPTER_UNICAST_ADDRESS* unicast_address; - int name_size; - size_t max_name_size; + size_t name_size; + int r; if (adapter->OperStatus != IfOperStatusUp || adapter->FirstUnicastAddress == NULL) continue; /* Convert the interface name to UTF8. */ - max_name_size = (char*) uv_address_buf + uv_address_buf_size - name_buf; - if (max_name_size > (size_t) INT_MAX) - max_name_size = INT_MAX; - name_size = WideCharToMultiByte(CP_UTF8, - 0, - adapter->FriendlyName, - -1, - name_buf, - (int) max_name_size, - NULL, - FALSE); - if (name_size <= 0) { + name_size = (char*) uv_address_buf + uv_address_buf_size - name_buf; + r = uv__copy_utf16_to_utf8(adapter->FriendlyName, + -1, + name_buf, + &name_size); + if (r) { uv__free(win_address_buf); uv__free(uv_address_buf); - return uv_translate_sys_error(GetLastError()); + return r; } + name_size += 1; /* Add NUL byte. */ /* Add an uv_interface_address_t element for every unicast address. */ for (unicast_address = (IP_ADAPTER_UNICAST_ADDRESS*) @@ -1061,7 +970,6 @@ int uv_os_homedir(char* buffer, size_t* size) { int uv_os_tmpdir(char* buffer, size_t* size) { wchar_t *path; - DWORD bufsize; size_t len; if (buffer == NULL || size == NULL || *size == 0) @@ -1078,7 +986,7 @@ int uv_os_tmpdir(char* buffer, size_t* size) { if (path == NULL) { return UV_ENOMEM; } - len = GetTempPathW(len, path); + len = GetTempPathW(len, path); if (len == 0) { uv__free(path); @@ -1093,34 +1001,7 @@ int uv_os_tmpdir(char* buffer, size_t* size) { path[len] = L'\0'; } - /* Check how much space we need */ - bufsize = WideCharToMultiByte(CP_UTF8, 0, path, -1, NULL, 0, NULL, NULL); - - if (bufsize == 0) { - uv__free(path); - return uv_translate_sys_error(GetLastError()); - } else if (bufsize > *size) { - uv__free(path); - *size = bufsize; - return UV_ENOBUFS; - } - - /* Convert to UTF-8 */ - bufsize = WideCharToMultiByte(CP_UTF8, - 0, - path, - -1, - buffer, - *size, - NULL, - NULL); - uv__free(path); - - if (bufsize == 0) - return uv_translate_sys_error(GetLastError()); - - *size = bufsize - 1; - return 0; + return uv__copy_utf16_to_utf8(path, len, buffer, size); } @@ -1131,95 +1012,71 @@ int uv_os_tmpdir(char* buffer, size_t* size) { * If utf16 is null terminated, utf16len can be set to -1, otherwise it must * be specified. */ -int uv__convert_utf16_to_utf8(const WCHAR* utf16, int utf16len, char** utf8) { - DWORD bufsize; +int uv__convert_utf16_to_utf8(const WCHAR* utf16, size_t utf16len, char** utf8) { + size_t utf8_len = 0; if (utf16 == NULL) return UV_EINVAL; - /* Check how much space we need */ - bufsize = WideCharToMultiByte(CP_UTF8, - 0, - utf16, - utf16len, - NULL, - 0, - NULL, - NULL); - - if (bufsize == 0) - return uv_translate_sys_error(GetLastError()); - - /* Allocate the destination buffer adding an extra byte for the terminating - * NULL. If utf16len is not -1 WideCharToMultiByte will not add it, so - * we do it ourselves always, just in case. */ - *utf8 = uv__malloc(bufsize + 1); - - if (*utf8 == NULL) - return UV_ENOMEM; - - /* Convert to UTF-8 */ - bufsize = WideCharToMultiByte(CP_UTF8, - 0, - utf16, - utf16len, - *utf8, - bufsize, - NULL, - NULL); - - if (bufsize == 0) { - uv__free(*utf8); - *utf8 = NULL; - return uv_translate_sys_error(GetLastError()); - } - - (*utf8)[bufsize] = '\0'; - return 0; + *utf8 = NULL; + return uv_utf16_to_wtf8(utf16, utf16len, utf8, &utf8_len); } /* * Converts a UTF-8 string into a UTF-16 one. The resulting string is * null-terminated. - * - * If utf8 is null terminated, utf8len can be set to -1, otherwise it must - * be specified. */ -int uv__convert_utf8_to_utf16(const char* utf8, int utf8len, WCHAR** utf16) { +int uv__convert_utf8_to_utf16(const char* utf8, WCHAR** utf16) { int bufsize; if (utf8 == NULL) return UV_EINVAL; - /* Check how much space we need */ - bufsize = MultiByteToWideChar(CP_UTF8, 0, utf8, utf8len, NULL, 0); - - if (bufsize == 0) - return uv_translate_sys_error(GetLastError()); + /* Check how much space we need (including NUL). */ + bufsize = uv_wtf8_length_as_utf16(utf8); + if (bufsize < 0) + return UV__EINVAL; - /* Allocate the destination buffer adding an extra byte for the terminating - * NULL. If utf8len is not -1 MultiByteToWideChar will not add it, so - * we do it ourselves always, just in case. */ - *utf16 = uv__malloc(sizeof(WCHAR) * (bufsize + 1)); + /* Allocate the destination buffer. */ + *utf16 = uv__malloc(sizeof(WCHAR) * bufsize); if (*utf16 == NULL) return UV_ENOMEM; /* Convert to UTF-16 */ - bufsize = MultiByteToWideChar(CP_UTF8, 0, utf8, utf8len, *utf16, bufsize); + uv_wtf8_to_utf16(utf8, *utf16, bufsize); - if (bufsize == 0) { - uv__free(*utf16); - *utf16 = NULL; - return uv_translate_sys_error(GetLastError()); - } - - (*utf16)[bufsize] = L'\0'; return 0; } +/* + * Converts a UTF-16 string into a UTF-8 one in an existing buffer. The + * resulting string is null-terminated. + * + * If utf16 is null terminated, utf16len can be set to -1, otherwise it must + * be specified. + */ +int uv__copy_utf16_to_utf8(const WCHAR* utf16buffer, size_t utf16len, char* utf8, size_t *size) { + int r; + + if (utf8 == NULL || size == NULL) + return UV_EINVAL; + + if (*size == 0) { + *size = uv_utf16_length_as_wtf8(utf16buffer, utf16len); + r = UV_ENOBUFS; + } else { + *size -= 1; /* Reserve space for NUL. */ + r = uv_utf16_to_wtf8(utf16buffer, utf16len, &utf8, size); + } + if (r == UV_ENOBUFS) + *size += 1; /* Add space for NUL. */ + return r; +} + + static int uv__getpwuid_r(uv_passwd_t* pwd) { HANDLE token; wchar_t username[UNLEN + 1]; @@ -1384,14 +1241,13 @@ int uv_os_getenv(const char* name, char* buffer, size_t* size) { wchar_t* var; DWORD varlen; wchar_t* name_w; - DWORD bufsize; size_t len; int r; if (name == NULL || buffer == NULL || size == NULL || *size == 0) return UV_EINVAL; - r = uv__convert_utf8_to_utf16(name, -1, &name_w); + r = uv__convert_utf8_to_utf16(name, &name_w); if (r != 0) return r; @@ -1432,35 +1288,7 @@ int uv_os_getenv(const char* name, char* buffer, size_t* size) { } } - /* Check how much space we need */ - bufsize = WideCharToMultiByte(CP_UTF8, 0, var, -1, NULL, 0, NULL, NULL); - - if (bufsize == 0) { - r = uv_translate_sys_error(GetLastError()); - goto fail; - } else if (bufsize > *size) { - *size = bufsize; - r = UV_ENOBUFS; - goto fail; - } - - /* Convert to UTF-8 */ - bufsize = WideCharToMultiByte(CP_UTF8, - 0, - var, - -1, - buffer, - *size, - NULL, - NULL); - - if (bufsize == 0) { - r = uv_translate_sys_error(GetLastError()); - goto fail; - } - - *size = bufsize - 1; - r = 0; + r = uv__copy_utf16_to_utf8(var, len, buffer, size); fail: @@ -1482,12 +1310,12 @@ int uv_os_setenv(const char* name, const char* value) { if (name == NULL || value == NULL) return UV_EINVAL; - r = uv__convert_utf8_to_utf16(name, -1, &name_w); + r = uv__convert_utf8_to_utf16(name, &name_w); if (r != 0) return r; - r = uv__convert_utf8_to_utf16(value, -1, &value_w); + r = uv__convert_utf8_to_utf16(value, &value_w); if (r != 0) { uv__free(name_w); @@ -1512,7 +1340,7 @@ int uv_os_unsetenv(const char* name) { if (name == NULL) return UV_EINVAL; - r = uv__convert_utf8_to_utf16(name, -1, &name_w); + r = uv__convert_utf8_to_utf16(name, &name_w); if (r != 0) return r; @@ -1529,9 +1357,6 @@ int uv_os_unsetenv(const char* name) { int uv_os_gethostname(char* buffer, size_t* size) { WCHAR buf[UV_MAXHOSTNAMESIZE]; - size_t len; - char* utf8_str; - int convert_result; if (buffer == NULL || size == NULL || *size == 0) return UV_EINVAL; @@ -1544,22 +1369,7 @@ int uv_os_gethostname(char* buffer, size_t* size) { if (pGetHostNameW(buf, UV_MAXHOSTNAMESIZE) != 0) return uv_translate_sys_error(WSAGetLastError()); - convert_result = uv__convert_utf16_to_utf8(buf, -1, &utf8_str); - - if (convert_result != 0) - return convert_result; - - len = strlen(utf8_str); - if (len >= *size) { - *size = len + 1; - uv__free(utf8_str); - return UV_ENOBUFS; - } - - memcpy(buffer, utf8_str, len + 1); - uv__free(utf8_str); - *size = len; - return 0; + return uv__copy_utf16_to_utf8(buf, -1, buffer, size); } @@ -1665,7 +1475,7 @@ int uv_os_uname(uv_utsname_t* buffer) { HKEY registry_key; WCHAR product_name_w[256]; DWORD product_name_w_size; - int version_size; + size_t version_size; int processor_level; int r; @@ -1696,7 +1506,7 @@ int uv_os_uname(uv_utsname_t* buffer) { r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, - KEY_QUERY_VALUE, + KEY_QUERY_VALUE | KEY_WOW64_64KEY, ®istry_key); if (r == ERROR_SUCCESS) { @@ -1727,37 +1537,29 @@ int uv_os_uname(uv_utsname_t* buffer) { } } - version_size = WideCharToMultiByte(CP_UTF8, - 0, - product_name_w, - -1, - buffer->version, - sizeof(buffer->version), - NULL, - NULL); - if (version_size == 0) { - r = uv_translate_sys_error(GetLastError()); + version_size = sizeof(buffer->version); + r = uv__copy_utf16_to_utf8(product_name_w, + -1, + buffer->version, + &version_size); + if (r) goto error; - } } } /* Append service pack information to the version if present. */ if (os_info.szCSDVersion[0] != L'\0') { if (version_size > 0) - buffer->version[version_size - 1] = ' '; - - if (WideCharToMultiByte(CP_UTF8, - 0, - os_info.szCSDVersion, - -1, - buffer->version + version_size, - sizeof(buffer->version) - version_size, - NULL, - NULL) == 0) { - r = uv_translate_sys_error(GetLastError()); + buffer->version[version_size++] = ' '; + + version_size = sizeof(buffer->version) - version_size; + r = uv__copy_utf16_to_utf8(os_info.szCSDVersion, + -1, + buffer->version + + sizeof(buffer->version) - version_size, + &version_size); + if (r) goto error; - } } /* Populate the sysname field. */ diff --git a/deps/uv/test/benchmark-async-pummel.c b/deps/uv/test/benchmark-async-pummel.c index bec91850616150..68864c842e5b09 100644 --- a/deps/uv/test/benchmark-async-pummel.c +++ b/deps/uv/test/benchmark-async-pummel.c @@ -71,21 +71,21 @@ static int test_async_pummel(int nthreads) { tids = calloc(nthreads, sizeof(tids[0])); ASSERT_NOT_NULL(tids); - ASSERT(0 == uv_async_init(uv_default_loop(), &handle, async_cb)); + ASSERT_OK(uv_async_init(uv_default_loop(), &handle, async_cb)); ACCESS_ONCE(const char*, handle.data) = running; for (i = 0; i < nthreads; i++) - ASSERT(0 == uv_thread_create(tids + i, pummel, &handle)); + ASSERT_OK(uv_thread_create(tids + i, pummel, &handle)); time = uv_hrtime(); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); time = uv_hrtime() - time; done = 1; for (i = 0; i < nthreads; i++) - ASSERT(0 == uv_thread_join(tids + i)); + ASSERT_OK(uv_thread_join(tids + i)); printf("async_pummel_%d: %s callbacks in %.2f seconds (%s/sec)\n", nthreads, diff --git a/deps/uv/test/benchmark-async.c b/deps/uv/test/benchmark-async.c index d4b7c8bd91482f..5544c46b3b28ff 100644 --- a/deps/uv/test/benchmark-async.c +++ b/deps/uv/test/benchmark-async.c @@ -43,7 +43,7 @@ struct ctx { static void worker_async_cb(uv_async_t* handle) { struct ctx* ctx = container_of(handle, struct ctx, worker_async); - ASSERT(0 == uv_async_send(&ctx->main_async)); + ASSERT_OK(uv_async_send(&ctx->main_async)); ctx->worker_sent++; ctx->worker_seen++; @@ -55,7 +55,7 @@ static void worker_async_cb(uv_async_t* handle) { static void main_async_cb(uv_async_t* handle) { struct ctx* ctx = container_of(handle, struct ctx, main_async); - ASSERT(0 == uv_async_send(&ctx->worker_async)); + ASSERT_OK(uv_async_send(&ctx->worker_async)); ctx->main_sent++; ctx->main_seen++; @@ -66,8 +66,8 @@ static void main_async_cb(uv_async_t* handle) { static void worker(void* arg) { struct ctx* ctx = arg; - ASSERT(0 == uv_async_send(&ctx->main_async)); - ASSERT(0 == uv_run(&ctx->loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_async_send(&ctx->main_async)); + ASSERT_OK(uv_run(&ctx->loop, UV_RUN_DEFAULT)); uv_loop_close(&ctx->loop); } @@ -85,29 +85,29 @@ static int test_async(int nthreads) { for (i = 0; i < nthreads; i++) { ctx = threads + i; ctx->nthreads = nthreads; - ASSERT(0 == uv_loop_init(&ctx->loop)); - ASSERT(0 == uv_async_init(&ctx->loop, &ctx->worker_async, worker_async_cb)); - ASSERT(0 == uv_async_init(uv_default_loop(), - &ctx->main_async, - main_async_cb)); - ASSERT(0 == uv_thread_create(&ctx->thread, worker, ctx)); + ASSERT_OK(uv_loop_init(&ctx->loop)); + ASSERT_OK(uv_async_init(&ctx->loop, &ctx->worker_async, worker_async_cb)); + ASSERT_OK(uv_async_init(uv_default_loop(), + &ctx->main_async, + main_async_cb)); + ASSERT_OK(uv_thread_create(&ctx->thread, worker, ctx)); } time = uv_hrtime(); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); for (i = 0; i < nthreads; i++) - ASSERT(0 == uv_thread_join(&threads[i].thread)); + ASSERT_OK(uv_thread_join(&threads[i].thread)); time = uv_hrtime() - time; for (i = 0; i < nthreads; i++) { ctx = threads + i; - ASSERT(ctx->worker_sent == NUM_PINGS); - ASSERT(ctx->worker_seen == NUM_PINGS); - ASSERT(ctx->main_sent == (unsigned int) NUM_PINGS); - ASSERT(ctx->main_seen == (unsigned int) NUM_PINGS); + ASSERT_EQ(ctx->worker_sent, NUM_PINGS); + ASSERT_EQ(ctx->worker_seen, NUM_PINGS); + ASSERT_EQ(ctx->main_sent, (unsigned int) NUM_PINGS); + ASSERT_EQ(ctx->main_seen, (unsigned int) NUM_PINGS); } printf("async%d: %.2f sec (%s/sec)\n", diff --git a/deps/uv/test/benchmark-getaddrinfo.c b/deps/uv/test/benchmark-getaddrinfo.c index 1ef7b1ef095937..cb4d2bc935a763 100644 --- a/deps/uv/test/benchmark-getaddrinfo.c +++ b/deps/uv/test/benchmark-getaddrinfo.c @@ -43,7 +43,7 @@ static void getaddrinfo_initiate(uv_getaddrinfo_t* handle); static void getaddrinfo_cb(uv_getaddrinfo_t* handle, int status, struct addrinfo* res) { - ASSERT(status == 0); + ASSERT_OK(status); calls_completed++; if (calls_initiated < TOTAL_CALLS) { getaddrinfo_initiate(handle); @@ -59,7 +59,7 @@ static void getaddrinfo_initiate(uv_getaddrinfo_t* handle) { calls_initiated++; r = uv_getaddrinfo(loop, handle, &getaddrinfo_cb, name, NULL, NULL); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -80,8 +80,8 @@ BENCHMARK_IMPL(getaddrinfo) { uv_update_time(loop); end_time = uv_now(loop); - ASSERT(calls_initiated == TOTAL_CALLS); - ASSERT(calls_completed == TOTAL_CALLS); + ASSERT_EQ(calls_initiated, TOTAL_CALLS); + ASSERT_EQ(calls_completed, TOTAL_CALLS); fprintf(stderr, "getaddrinfo: %.0f req/s\n", (double) calls_completed / (double) (end_time - start_time) * 1000.0); diff --git a/deps/uv/test/benchmark-loop-count.c b/deps/uv/test/benchmark-loop-count.c index 72f25b56ba5f31..0db4aa567a90f0 100644 --- a/deps/uv/test/benchmark-loop-count.c +++ b/deps/uv/test/benchmark-loop-count.c @@ -74,7 +74,7 @@ BENCHMARK_IMPL(loop_count) { uv_run(loop, UV_RUN_DEFAULT); ns = uv_hrtime() - ns; - ASSERT(ticks == NUM_TICKS); + ASSERT_UINT64_EQ(ticks, NUM_TICKS); fprintf(stderr, "loop_count: %d ticks in %.2fs (%.0f/s)\n", NUM_TICKS, diff --git a/deps/uv/test/benchmark-million-async.c b/deps/uv/test/benchmark-million-async.c index 30c21c38af15c4..13b52d488d0f5f 100644 --- a/deps/uv/test/benchmark-million-async.c +++ b/deps/uv/test/benchmark-million-async.c @@ -60,7 +60,7 @@ static void timer_cb(uv_timer_t* handle) { unsigned i; done = 1; - ASSERT(0 == uv_thread_join(&thread_id)); + ASSERT_OK(uv_thread_join(&thread_id)); for (i = 0; i < ARRAY_SIZE(container->async_handles); i++) { uv_async_t* handle = container->async_handles + i; @@ -93,14 +93,14 @@ BENCHMARK_IMPL(million_async) { for (i = 0; i < ARRAY_SIZE(container->async_handles); i++) { handle = container->async_handles + i; - ASSERT(0 == uv_async_init(loop, handle, async_cb)); + ASSERT_OK(uv_async_init(loop, handle, async_cb)); handle->data = NULL; } - ASSERT(0 == uv_timer_init(loop, &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, timeout, 0)); - ASSERT(0 == uv_thread_create(&thread_id, thread_cb, NULL)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_timer_init(loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, timeout, 0)); + ASSERT_OK(uv_thread_create(&thread_id, thread_cb, NULL)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); printf("%s async events in %.1f seconds (%s/s, %s unique handles seen)\n", fmt(&fmtbuf[0], container->async_events), timeout / 1000., diff --git a/deps/uv/test/benchmark-million-timers.c b/deps/uv/test/benchmark-million-timers.c index b35fd5e788224d..fd999c469766f2 100644 --- a/deps/uv/test/benchmark-million-timers.c +++ b/deps/uv/test/benchmark-million-timers.c @@ -57,22 +57,22 @@ BENCHMARK_IMPL(million_timers) { before_all = uv_hrtime(); for (i = 0; i < NUM_TIMERS; i++) { if (i % 1000 == 0) timeout++; - ASSERT(0 == uv_timer_init(loop, timers + i)); - ASSERT(0 == uv_timer_start(timers + i, timer_cb, timeout, 0)); + ASSERT_OK(uv_timer_init(loop, timers + i)); + ASSERT_OK(uv_timer_start(timers + i, timer_cb, timeout, 0)); } before_run = uv_hrtime(); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); after_run = uv_hrtime(); for (i = 0; i < NUM_TIMERS; i++) uv_close((uv_handle_t*) (timers + i), close_cb); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); after_all = uv_hrtime(); - ASSERT(timer_cb_called == NUM_TIMERS); - ASSERT(close_cb_called == NUM_TIMERS); + ASSERT_EQ(timer_cb_called, NUM_TIMERS); + ASSERT_EQ(close_cb_called, NUM_TIMERS); free(timers); fprintf(stderr, "%.2f seconds total\n", (after_all - before_all) / 1e9); diff --git a/deps/uv/test/benchmark-multi-accept.c b/deps/uv/test/benchmark-multi-accept.c index e2026276721b4e..1d19e330b2b7c7 100644 --- a/deps/uv/test/benchmark-multi-accept.c +++ b/deps/uv/test/benchmark-multi-accept.c @@ -117,19 +117,19 @@ static void ipc_connection_cb(uv_stream_t* ipc_pipe, int status) { ASSERT_NOT_NULL(pc); if (ipc_pipe->type == UV_TCP) - ASSERT(0 == uv_tcp_init(loop, (uv_tcp_t*) &pc->peer_handle)); + ASSERT_OK(uv_tcp_init(loop, (uv_tcp_t*) &pc->peer_handle)); else if (ipc_pipe->type == UV_NAMED_PIPE) - ASSERT(0 == uv_pipe_init(loop, (uv_pipe_t*) &pc->peer_handle, 1)); + ASSERT_OK(uv_pipe_init(loop, (uv_pipe_t*) &pc->peer_handle, 1)); else ASSERT(0); - ASSERT(0 == uv_accept(ipc_pipe, (uv_stream_t*) &pc->peer_handle)); - ASSERT(0 == uv_write2(&pc->write_req, - (uv_stream_t*) &pc->peer_handle, - &buf, - 1, - (uv_stream_t*) &sc->server_handle, - ipc_write_cb)); + ASSERT_OK(uv_accept(ipc_pipe, (uv_stream_t*) &pc->peer_handle)); + ASSERT_OK(uv_write2(&pc->write_req, + (uv_stream_t*) &pc->peer_handle, + &buf, + 1, + (uv_stream_t*) &sc->server_handle, + ipc_write_cb)); if (--sc->num_connects == 0) uv_close((uv_handle_t*) ipc_pipe, NULL); @@ -153,10 +153,10 @@ static void ipc_close_cb(uv_handle_t* handle) { static void ipc_connect_cb(uv_connect_t* req, int status) { struct ipc_client_ctx* ctx; ctx = container_of(req, struct ipc_client_ctx, connect_req); - ASSERT(0 == status); - ASSERT(0 == uv_read_start((uv_stream_t*) &ctx->ipc_pipe, - ipc_alloc_cb, - ipc_read_cb)); + ASSERT_OK(status); + ASSERT_OK(uv_read_start((uv_stream_t*) &ctx->ipc_pipe, + ipc_alloc_cb, + ipc_read_cb)); } @@ -182,16 +182,16 @@ static void ipc_read_cb(uv_stream_t* handle, ctx = container_of(ipc_pipe, struct ipc_client_ctx, ipc_pipe); loop = ipc_pipe->loop; - ASSERT(1 == uv_pipe_pending_count(ipc_pipe)); + ASSERT_EQ(1, uv_pipe_pending_count(ipc_pipe)); type = uv_pipe_pending_type(ipc_pipe); if (type == UV_TCP) - ASSERT(0 == uv_tcp_init(loop, (uv_tcp_t*) ctx->server_handle)); + ASSERT_OK(uv_tcp_init(loop, (uv_tcp_t*) ctx->server_handle)); else if (type == UV_NAMED_PIPE) - ASSERT(0 == uv_pipe_init(loop, (uv_pipe_t*) ctx->server_handle, 0)); + ASSERT_OK(uv_pipe_init(loop, (uv_pipe_t*) ctx->server_handle, 0)); else ASSERT(0); - ASSERT(0 == uv_accept(handle, ctx->server_handle)); + ASSERT_OK(uv_accept(handle, ctx->server_handle)); uv_close((uv_handle_t*) &ctx->ipc_pipe, NULL); } @@ -211,10 +211,10 @@ static void send_listen_handles(uv_handle_type type, ctx.num_connects = num_servers; if (type == UV_TCP) { - ASSERT(0 == uv_tcp_init(loop, (uv_tcp_t*) &ctx.server_handle)); - ASSERT(0 == uv_tcp_bind((uv_tcp_t*) &ctx.server_handle, - (const struct sockaddr*) &listen_addr, - 0)); + ASSERT_OK(uv_tcp_init(loop, (uv_tcp_t*) &ctx.server_handle)); + ASSERT_OK(uv_tcp_bind((uv_tcp_t*) &ctx.server_handle, + (const struct sockaddr*) &listen_addr, + 0)); } else ASSERT(0); @@ -223,16 +223,16 @@ static void send_listen_handles(uv_handle_type type, * If we accept a connection then the connected pipe must be initialized * with ipc=1. */ - ASSERT(0 == uv_pipe_init(loop, &ctx.ipc_pipe, 0)); - ASSERT(0 == uv_pipe_bind(&ctx.ipc_pipe, IPC_PIPE_NAME)); - ASSERT(0 == uv_listen((uv_stream_t*) &ctx.ipc_pipe, 128, ipc_connection_cb)); + ASSERT_OK(uv_pipe_init(loop, &ctx.ipc_pipe, 0)); + ASSERT_OK(uv_pipe_bind(&ctx.ipc_pipe, IPC_PIPE_NAME)); + ASSERT_OK(uv_listen((uv_stream_t*) &ctx.ipc_pipe, 128, ipc_connection_cb)); for (i = 0; i < num_servers; i++) uv_sem_post(&servers[i].semaphore); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); uv_close((uv_handle_t*) &ctx.server_handle, NULL); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); for (i = 0; i < num_servers; i++) uv_sem_wait(&servers[i].semaphore); @@ -245,12 +245,12 @@ static void get_listen_handle(uv_loop_t* loop, uv_stream_t* server_handle) { ctx.server_handle = server_handle; ctx.server_handle->data = "server handle"; - ASSERT(0 == uv_pipe_init(loop, &ctx.ipc_pipe, 1)); + ASSERT_OK(uv_pipe_init(loop, &ctx.ipc_pipe, 1)); uv_pipe_connect(&ctx.connect_req, &ctx.ipc_pipe, IPC_PIPE_NAME, ipc_connect_cb); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); } @@ -259,9 +259,9 @@ static void server_cb(void *arg) { uv_loop_t loop; ctx = arg; - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); - ASSERT(0 == uv_async_init(&loop, &ctx->async_handle, sv_async_cb)); + ASSERT_OK(uv_async_init(&loop, &ctx->async_handle, sv_async_cb)); uv_unref((uv_handle_t*) &ctx->async_handle); /* Wait until the main thread is ready. */ @@ -270,10 +270,10 @@ static void server_cb(void *arg) { uv_sem_post(&ctx->semaphore); /* Now start the actual benchmark. */ - ASSERT(0 == uv_listen((uv_stream_t*) &ctx->server_handle, - 128, - sv_connection_cb)); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_listen((uv_stream_t*) &ctx->server_handle, + 128, + sv_connection_cb)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); uv_loop_close(&loop); } @@ -292,20 +292,20 @@ static void sv_connection_cb(uv_stream_t* server_handle, int status) { struct server_ctx* ctx; ctx = container_of(server_handle, struct server_ctx, server_handle); - ASSERT(status == 0); + ASSERT_OK(status); storage = malloc(sizeof(*storage)); ASSERT_NOT_NULL(storage); if (server_handle->type == UV_TCP) - ASSERT(0 == uv_tcp_init(server_handle->loop, (uv_tcp_t*) storage)); + ASSERT_OK(uv_tcp_init(server_handle->loop, (uv_tcp_t*) storage)); else if (server_handle->type == UV_NAMED_PIPE) - ASSERT(0 == uv_pipe_init(server_handle->loop, (uv_pipe_t*) storage, 0)); + ASSERT_OK(uv_pipe_init(server_handle->loop, (uv_pipe_t*) storage, 0)); else ASSERT(0); - ASSERT(0 == uv_accept(server_handle, (uv_stream_t*) storage)); - ASSERT(0 == uv_read_start((uv_stream_t*) storage, sv_alloc_cb, sv_read_cb)); + ASSERT_OK(uv_accept(server_handle, (uv_stream_t*) storage)); + ASSERT_OK(uv_read_start((uv_stream_t*) storage, sv_alloc_cb, sv_read_cb)); ctx->num_connects++; } @@ -322,7 +322,7 @@ static void sv_alloc_cb(uv_handle_t* handle, static void sv_read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); uv_close((uv_handle_t*) handle, (uv_close_cb) free); } @@ -330,7 +330,7 @@ static void sv_read_cb(uv_stream_t* handle, static void cl_connect_cb(uv_connect_t* req, int status) { struct client_ctx* ctx = container_of(req, struct client_ctx, connect_req); uv_idle_start(&ctx->idle_handle, cl_idle_cb); - ASSERT(0 == status); + ASSERT_OK(status); } @@ -351,11 +351,11 @@ static void cl_close_cb(uv_handle_t* handle) { return; } - ASSERT(0 == uv_tcp_init(handle->loop, (uv_tcp_t*) &ctx->client_handle)); - ASSERT(0 == uv_tcp_connect(&ctx->connect_req, - (uv_tcp_t*) &ctx->client_handle, - (const struct sockaddr*) &listen_addr, - cl_connect_cb)); + ASSERT_OK(uv_tcp_init(handle->loop, (uv_tcp_t*) &ctx->client_handle)); + ASSERT_OK(uv_tcp_connect(&ctx->connect_req, + (uv_tcp_t*) &ctx->client_handle, + (const struct sockaddr*) &listen_addr, + cl_connect_cb)); } @@ -367,7 +367,7 @@ static int test_tcp(unsigned int num_servers, unsigned int num_clients) { unsigned int i; double time; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &listen_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &listen_addr)); loop = uv_default_loop(); servers = calloc(num_servers, sizeof(servers[0])); @@ -381,8 +381,8 @@ static int test_tcp(unsigned int num_servers, unsigned int num_clients) { */ for (i = 0; i < num_servers; i++) { struct server_ctx* ctx = servers + i; - ASSERT(0 == uv_sem_init(&ctx->semaphore, 0)); - ASSERT(0 == uv_thread_create(&ctx->thread_id, server_cb, ctx)); + ASSERT_OK(uv_sem_init(&ctx->semaphore, 0)); + ASSERT_OK(uv_thread_create(&ctx->thread_id, server_cb, ctx)); } send_listen_handles(UV_TCP, num_servers, servers); @@ -392,17 +392,17 @@ static int test_tcp(unsigned int num_servers, unsigned int num_clients) { ctx->num_connects = NUM_CONNECTS / num_clients; handle = (uv_tcp_t*) &ctx->client_handle; handle->data = "client handle"; - ASSERT(0 == uv_tcp_init(loop, handle)); - ASSERT(0 == uv_tcp_connect(&ctx->connect_req, - handle, - (const struct sockaddr*) &listen_addr, - cl_connect_cb)); - ASSERT(0 == uv_idle_init(loop, &ctx->idle_handle)); + ASSERT_OK(uv_tcp_init(loop, handle)); + ASSERT_OK(uv_tcp_connect(&ctx->connect_req, + handle, + (const struct sockaddr*) &listen_addr, + cl_connect_cb)); + ASSERT_OK(uv_idle_init(loop, &ctx->idle_handle)); } { uint64_t t = uv_hrtime(); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); t = uv_hrtime() - t; time = t / 1e9; } @@ -410,7 +410,7 @@ static int test_tcp(unsigned int num_servers, unsigned int num_clients) { for (i = 0; i < num_servers; i++) { struct server_ctx* ctx = servers + i; uv_async_send(&ctx->async_handle); - ASSERT(0 == uv_thread_join(&ctx->thread_id)); + ASSERT_OK(uv_thread_join(&ctx->thread_id)); uv_sem_destroy(&ctx->semaphore); } diff --git a/deps/uv/test/benchmark-ping-pongs.c b/deps/uv/test/benchmark-ping-pongs.c index 0357704e66e3c9..fd5f40b91030d6 100644 --- a/deps/uv/test/benchmark-ping-pongs.c +++ b/deps/uv/test/benchmark-ping-pongs.c @@ -90,7 +90,7 @@ static void pinger_close_cb(uv_handle_t* handle) { static void pinger_write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); free(req); } @@ -110,14 +110,14 @@ static void pinger_write_ping(pinger_t* pinger) { static void pinger_shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); pinger_shutdown_cb_called++; /* * The close callback has not been triggered yet. We must wait for EOF * until we close the connection. */ - ASSERT(completed_pingers == 0); + ASSERT_OK(completed_pingers); } @@ -130,13 +130,13 @@ static void pinger_read_cb(uv_stream_t* tcp, pinger = (pinger_t*)tcp->data; if (nread < 0) { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); if (buf->base) { buf_free(buf); } - ASSERT(pinger_shutdown_cb_called == 1); + ASSERT_EQ(1, pinger_shutdown_cb_called); uv_close((uv_handle_t*)tcp, pinger_close_cb); return; @@ -144,7 +144,7 @@ static void pinger_read_cb(uv_stream_t* tcp, /* Now we count the pings */ for (i = 0; i < nread; i++) { - ASSERT(buf->base[i] == PING[pinger->state]); + ASSERT_EQ(buf->base[i], PING[pinger->state]); pinger->state = (pinger->state + 1) % (sizeof(PING) - 1); if (pinger->state == 0) { pinger->pongs++; @@ -166,7 +166,7 @@ static void pinger_read_cb(uv_stream_t* tcp, static void pinger_connect_cb(uv_connect_t* req, int status) { pinger_t *pinger = (pinger_t*)req->handle->data; - ASSERT(status == 0); + ASSERT_OK(status); pinger_write_ping(pinger); @@ -182,8 +182,8 @@ static void pinger_new(void) { pinger_t *pinger; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &client_addr)); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", 0, &client_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); pinger = malloc(sizeof(*pinger)); pinger->state = 0; pinger->pongs = 0; @@ -194,9 +194,9 @@ static void pinger_new(void) { pinger->tcp.data = pinger; - ASSERT(0 == uv_tcp_bind(&pinger->tcp, - (const struct sockaddr*) &client_addr, - 0)); + ASSERT_OK(uv_tcp_bind(&pinger->tcp, + (const struct sockaddr*) &client_addr, + 0)); r = uv_tcp_connect(&pinger->connect_req, &pinger->tcp, @@ -214,7 +214,7 @@ BENCHMARK_IMPL(ping_pongs) { pinger_new(); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(completed_pingers == 1); + ASSERT_EQ(1, completed_pingers); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/benchmark-ping-udp.c b/deps/uv/test/benchmark-ping-udp.c index 3db8765bf9cf4c..2d2fe9c633926d 100644 --- a/deps/uv/test/benchmark-ping-udp.c +++ b/deps/uv/test/benchmark-ping-udp.c @@ -95,11 +95,11 @@ static void pinger_read_cb(uv_udp_t* udp, pinger = (pinger_t*)udp->data; /* No data here means something went wrong */ - ASSERT(nread > 0); + ASSERT_GT(nread, 0); /* Now we count the pings */ for (i = 0; i < nread; i++) { - ASSERT(buf->base[i] == PING[pinger->state]); + ASSERT_EQ(buf->base[i], PING[pinger->state]); pinger->state = (pinger->state + 1) % (sizeof(PING) - 1); if (pinger->state == 0) { pinger->pongs++; @@ -119,15 +119,15 @@ static void udp_pinger_new(void) { pinger_t* pinger = malloc(sizeof(*pinger)); int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &pinger->server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &pinger->server_addr)); pinger->state = 0; pinger->pongs = 0; /* Try to do NUM_PINGS ping-pongs (connection-less). */ r = uv_udp_init(loop, &pinger->udp); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&pinger->udp, (const struct sockaddr*) &pinger->server_addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); pinger->udp.data = pinger; @@ -148,7 +148,7 @@ static int ping_udp(unsigned pingers) { udp_pinger_new(); } uv_run(loop, UV_RUN_DEFAULT); - ASSERT(completed_pingers >= 1); + ASSERT_GE(completed_pingers, 1); fprintf(stderr, "ping_pongs: %d pingers, ~ %lu roundtrips/s\n", completed_pingers, completed_pings / (TIME/1000)); diff --git a/deps/uv/test/benchmark-pound.c b/deps/uv/test/benchmark-pound.c index acfe4497a2ed48..83ce522779a28b 100644 --- a/deps/uv/test/benchmark-pound.c +++ b/deps/uv/test/benchmark-pound.c @@ -115,7 +115,7 @@ static void connect_cb(uv_connect_t* req, int status) { } ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); conn = (conn_rec*)req->data; ASSERT_NOT_NULL(conn); @@ -125,13 +125,13 @@ static void connect_cb(uv_connect_t* req, int status) { #endif r = uv_read_start(&conn->stream, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); buf.base = buffer; buf.len = sizeof(buffer) - 1; r = uv_write(&conn->write_req, &conn->stream, &buf, 1, after_write); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -200,9 +200,9 @@ static void tcp_make_connect(conn_rec* p) { tp = (tcp_conn_rec*) p; r = uv_tcp_init(loop, (uv_tcp_t*)&p->stream); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_connect(&tp->conn_req, (uv_tcp_t*) &p->stream, @@ -227,7 +227,7 @@ static void pipe_make_connect(conn_rec* p) { int r; r = uv_pipe_init(loop, (uv_pipe_t*)&p->stream, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_connect(&((pipe_conn_rec*) p)->conn_req, (uv_pipe_t*) &p->stream, diff --git a/deps/uv/test/benchmark-pump.c b/deps/uv/test/benchmark-pump.c index 316c680996065e..8797668ee930ef 100644 --- a/deps/uv/test/benchmark-pump.c +++ b/deps/uv/test/benchmark-pump.c @@ -159,9 +159,9 @@ static void start_stats_collection(void) { /* Show-stats timer */ stats_left = STATS_COUNT; r = uv_timer_init(loop, &timer_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer_handle, show_stats, STATS_INTERVAL, STATS_INTERVAL); - ASSERT(r == 0); + ASSERT_OK(r); uv_update_time(loop); start_time = uv_now(loop); @@ -170,7 +170,7 @@ static void start_stats_collection(void) { static void read_cb(uv_stream_t* stream, ssize_t bytes, const uv_buf_t* buf) { if (nrecv_total == 0) { - ASSERT(start_time == 0); + ASSERT_OK(start_time); uv_update_time(loop); start_time = uv_now(loop); } @@ -188,7 +188,7 @@ static void read_cb(uv_stream_t* stream, ssize_t bytes, const uv_buf_t* buf) { static void write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); req_free((uv_req_t*) req); @@ -209,7 +209,7 @@ static void do_write(uv_stream_t* stream) { req = (uv_write_t*) req_alloc(); r = uv_write(req, stream, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -220,7 +220,7 @@ static void connect_cb(uv_connect_t* req, int status) { fprintf(stderr, "%s", uv_strerror(status)); fflush(stderr); } - ASSERT(status == 0); + ASSERT_OK(status); write_sockets++; req_free((uv_req_t*) req); @@ -253,19 +253,19 @@ static void maybe_connect_some(void) { tcp = &tcp_write_handles[max_connect_socket++]; r = uv_tcp_init(loop, tcp); - ASSERT(r == 0); + ASSERT_OK(r); req = (uv_connect_t*) req_alloc(); r = uv_tcp_connect(req, tcp, (const struct sockaddr*) &connect_addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); } else { pipe = &pipe_write_handles[max_connect_socket++]; r = uv_pipe_init(loop, pipe, 0); - ASSERT(r == 0); + ASSERT_OK(r); req = (uv_connect_t*) req_alloc(); uv_pipe_connect(req, pipe, TEST_PIPENAME, connect_cb); @@ -278,24 +278,24 @@ static void connection_cb(uv_stream_t* s, int status) { uv_stream_t* stream; int r; - ASSERT(server == s); - ASSERT(status == 0); + ASSERT_PTR_EQ(server, s); + ASSERT_OK(status); if (type == TCP) { stream = (uv_stream_t*)malloc(sizeof(uv_tcp_t)); r = uv_tcp_init(loop, (uv_tcp_t*)stream); - ASSERT(r == 0); + ASSERT_OK(r); } else { stream = (uv_stream_t*)malloc(sizeof(uv_pipe_t)); r = uv_pipe_init(loop, (uv_pipe_t*)stream, 0); - ASSERT(r == 0); + ASSERT_OK(r); } r = uv_accept(s, stream); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start(stream, buf_alloc, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); read_sockets++; max_read_sockets++; @@ -379,16 +379,16 @@ HELPER_IMPL(tcp_pump_server) { type = TCP; loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &listen_addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &listen_addr)); /* Server */ server = (uv_stream_t*)&tcpServer; r = uv_tcp_init(loop, &tcpServer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcpServer, (const struct sockaddr*) &listen_addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&tcpServer, MAX_WRITE_HANDLES, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); notify_parent_process(); uv_run(loop, UV_RUN_DEFAULT); @@ -406,11 +406,11 @@ HELPER_IMPL(pipe_pump_server) { /* Server */ server = (uv_stream_t*)&pipeServer; r = uv_pipe_init(loop, &pipeServer, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&pipeServer, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&pipeServer, MAX_WRITE_HANDLES, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); notify_parent_process(); uv_run(loop, UV_RUN_DEFAULT); @@ -421,13 +421,13 @@ HELPER_IMPL(pipe_pump_server) { static void tcp_pump(int n) { - ASSERT(n <= MAX_WRITE_HANDLES); + ASSERT_LE(n, MAX_WRITE_HANDLES); TARGET_CONNECTIONS = n; type = TCP; loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &connect_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &connect_addr)); /* Start making connections */ maybe_connect_some(); @@ -439,7 +439,7 @@ static void tcp_pump(int n) { static void pipe_pump(int n) { - ASSERT(n <= MAX_WRITE_HANDLES); + ASSERT_LE(n, MAX_WRITE_HANDLES); TARGET_CONNECTIONS = n; type = PIPE; diff --git a/deps/uv/test/benchmark-queue-work.c b/deps/uv/test/benchmark-queue-work.c index 6e7b74becf63b4..5ae0883101fed8 100644 --- a/deps/uv/test/benchmark-queue-work.c +++ b/deps/uv/test/benchmark-queue-work.c @@ -40,7 +40,7 @@ static void work_cb(uv_work_t* req) { static void after_work_cb(uv_work_t* req, int status) { events++; if (!done) - ASSERT_EQ(0, uv_queue_work(req->loop, req, work_cb, after_work_cb)); + ASSERT_OK(uv_queue_work(req->loop, req, work_cb, after_work_cb)); } static void timer_cb(uv_timer_t* handle) { done = 1; } @@ -55,11 +55,11 @@ BENCHMARK_IMPL(queue_work) { loop = uv_default_loop(); timeout = 5000; - ASSERT_EQ(0, uv_timer_init(loop, &timer_handle)); - ASSERT_EQ(0, uv_timer_start(&timer_handle, timer_cb, timeout, 0)); + ASSERT_OK(uv_timer_init(loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, timeout, 0)); - ASSERT_EQ(0, uv_queue_work(loop, &work, work_cb, after_work_cb)); - ASSERT_EQ(0, uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_queue_work(loop, &work, work_cb, after_work_cb)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); printf("%s async jobs in %.1f seconds (%s/s)\n", fmt(&fmtbuf[0], events), diff --git a/deps/uv/test/benchmark-spawn.c b/deps/uv/test/benchmark-spawn.c index bdaf6c1a254e19..ef27b385e7a04f 100644 --- a/deps/uv/test/benchmark-spawn.c +++ b/deps/uv/test/benchmark-spawn.c @@ -58,7 +58,7 @@ static void maybe_spawn(void) { static void process_close_cb(uv_handle_t* handle) { - ASSERT(process_open == 1); + ASSERT_EQ(1, process_open); process_open = 0; maybe_spawn(); } @@ -67,8 +67,8 @@ static void process_close_cb(uv_handle_t* handle) { static void exit_cb(uv_process_t* process, int64_t exit_status, int term_signal) { - ASSERT(exit_status == 42); - ASSERT(term_signal == 0); + ASSERT_EQ(42, exit_status); + ASSERT_OK(term_signal); uv_close((uv_handle_t*)process, process_close_cb); } @@ -82,7 +82,7 @@ static void on_alloc(uv_handle_t* handle, static void pipe_close_cb(uv_handle_t* pipe) { - ASSERT(pipe_open == 1); + ASSERT_EQ(1, pipe_open); pipe_open = 0; maybe_spawn(); } @@ -90,7 +90,7 @@ static void pipe_close_cb(uv_handle_t* pipe) { static void on_read(uv_stream_t* pipe, ssize_t nread, const uv_buf_t* buf) { if (nread > 0) { - ASSERT(pipe_open == 1); + ASSERT_EQ(1, pipe_open); output_used += nread; } else if (nread < 0) { if (nread == UV_EOF) { @@ -104,8 +104,8 @@ static void spawn(void) { uv_stdio_container_t stdio[2]; int r; - ASSERT(process_open == 0); - ASSERT(pipe_open == 0); + ASSERT_OK(process_open); + ASSERT_OK(pipe_open); args[0] = exepath; args[1] = "spawn_helper"; @@ -123,14 +123,14 @@ static void spawn(void) { options.stdio[1].data.stream = (uv_stream_t*)&out; r = uv_spawn(loop, &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); process_open = 1; pipe_open = 1; output_used = 0; r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -141,7 +141,7 @@ BENCHMARK_IMPL(spawn) { loop = uv_default_loop(); r = uv_exepath(exepath, &exepath_size); - ASSERT(r == 0); + ASSERT_OK(r); exepath[exepath_size] = '\0'; uv_update_time(loop); @@ -150,7 +150,7 @@ BENCHMARK_IMPL(spawn) { spawn(); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); uv_update_time(loop); end_time = uv_now(loop); diff --git a/deps/uv/test/benchmark-tcp-write-batch.c b/deps/uv/test/benchmark-tcp-write-batch.c index aedefb742559c5..9dfcf14eb09e16 100644 --- a/deps/uv/test/benchmark-tcp-write-batch.c +++ b/deps/uv/test/benchmark-tcp-write-batch.c @@ -55,16 +55,16 @@ static void connect_cb(uv_connect_t* req, int status) { int i; int r; - ASSERT(req->handle == (uv_stream_t*)&tcp_client); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*)&tcp_client); for (i = 0; i < NUM_WRITE_REQS; i++) { w = &write_reqs[i]; r = uv_write(&w->req, req->handle, &w->buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } r = uv_shutdown(&shutdown_req, req->handle, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); connect_cb_called++; } @@ -72,14 +72,14 @@ static void connect_cb(uv_connect_t* req, int status) { static void write_cb(uv_write_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); write_cb_called++; } static void shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(req->handle == (uv_stream_t*)&tcp_client); - ASSERT(req->handle->write_queue_size == 0); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*)&tcp_client); + ASSERT_OK(req->handle->write_queue_size); uv_close((uv_handle_t*)req->handle, close_cb); free(write_reqs); @@ -89,7 +89,7 @@ static void shutdown_cb(uv_shutdown_t* req, int status) { static void close_cb(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*)&tcp_client); + ASSERT_PTR_EQ(handle, (uv_handle_t*)&tcp_client); close_cb_called++; } @@ -112,28 +112,28 @@ BENCHMARK_IMPL(tcp_write_batch) { } loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(loop, &tcp_client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &tcp_client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); start = uv_hrtime(); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); stop = uv_hrtime(); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == NUM_WRITE_REQS); - ASSERT(shutdown_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(write_cb_called, NUM_WRITE_REQS); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, close_cb_called); printf("%ld write requests in %.2fs.\n", (long)NUM_WRITE_REQS, diff --git a/deps/uv/test/benchmark-thread.c b/deps/uv/test/benchmark-thread.c index b37a7fd6d01c92..b339e7caad920d 100644 --- a/deps/uv/test/benchmark-thread.c +++ b/deps/uv/test/benchmark-thread.c @@ -31,7 +31,7 @@ static volatile int num_threads; static void thread_entry(void* arg) { - ASSERT(arg == (void *) 42); + ASSERT_PTR_EQ(arg, (void *) 42); num_threads++; /* FIXME write barrier? */ } @@ -47,15 +47,15 @@ BENCHMARK_IMPL(thread_create) { for (i = 0; i < NUM_THREADS; i++) { r = uv_thread_create(&tid, thread_entry, (void *) 42); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_thread_join(&tid); - ASSERT(r == 0); + ASSERT_OK(r); } duration = (uv_hrtime() - start_time) / 1e9; - ASSERT(num_threads == NUM_THREADS); + ASSERT_EQ(num_threads, NUM_THREADS); printf("%d threads created in %.2f seconds (%.0f/s)\n", NUM_THREADS, duration, NUM_THREADS / duration); diff --git a/deps/uv/test/benchmark-udp-pummel.c b/deps/uv/test/benchmark-udp-pummel.c index f89913b6cebad0..7b7e1afad7d491 100644 --- a/deps/uv/test/benchmark-udp-pummel.c +++ b/deps/uv/test/benchmark-udp-pummel.c @@ -63,7 +63,7 @@ static void alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { static char slab[65536]; - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -75,7 +75,7 @@ static void send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); if (status != 0) { - ASSERT(status == UV_ECANCELED); + ASSERT_EQ(status, UV_ECANCELED); return; } @@ -83,7 +83,7 @@ static void send_cb(uv_udp_send_t* req, int status) { return; s = container_of(req, struct sender_state, send_req); - ASSERT(req->handle == &s->udp_handle); + ASSERT_PTR_EQ(req->handle, &s->udp_handle); if (timed) goto send; @@ -96,12 +96,12 @@ static void send_cb(uv_udp_send_t* req, int status) { packet_counter--; send: - ASSERT(0 == uv_udp_send(&s->send_req, - &s->udp_handle, - bufs, - ARRAY_SIZE(bufs), - (const struct sockaddr*) &s->addr, - send_cb)); + ASSERT_OK(uv_udp_send(&s->send_req, + &s->udp_handle, + bufs, + ARRAY_SIZE(bufs), + (const struct sockaddr*) &s->addr, + send_cb)); send_cb_called++; } @@ -115,11 +115,11 @@ static void recv_cb(uv_udp_t* handle, return; if (nread < 0) { - ASSERT(nread == UV_ECANCELED); + ASSERT_EQ(nread, UV_ECANCELED); return; } - ASSERT(addr->sa_family == AF_INET); + ASSERT_EQ(addr->sa_family, AF_INET); ASSERT(!memcmp(buf->base, EXPECTED, nread)); recv_cb_called++; @@ -153,8 +153,8 @@ static int pummel(unsigned int n_senders, uv_loop_t* loop; unsigned int i; - ASSERT(n_senders <= ARRAY_SIZE(senders)); - ASSERT(n_receivers <= ARRAY_SIZE(receivers)); + ASSERT_LE(n_senders, ARRAY_SIZE(senders)); + ASSERT_LE(n_receivers, ARRAY_SIZE(receivers)); loop = uv_default_loop(); @@ -162,8 +162,8 @@ static int pummel(unsigned int n_senders, n_receivers_ = n_receivers; if (timeout) { - ASSERT(0 == uv_timer_init(loop, &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timeout_cb, timeout, 0)); + ASSERT_OK(uv_timer_init(loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timeout_cb, timeout, 0)); /* Timer should not keep loop alive. */ uv_unref((uv_handle_t*)&timer_handle); timed = 1; @@ -172,10 +172,10 @@ static int pummel(unsigned int n_senders, for (i = 0; i < n_receivers; i++) { struct receiver_state* s = receivers + i; struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", BASE_PORT + i, &addr)); - ASSERT(0 == uv_udp_init(loop, &s->udp_handle)); - ASSERT(0 == uv_udp_bind(&s->udp_handle, (const struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_udp_recv_start(&s->udp_handle, alloc_cb, recv_cb)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", BASE_PORT + i, &addr)); + ASSERT_OK(uv_udp_init(loop, &s->udp_handle)); + ASSERT_OK(uv_udp_bind(&s->udp_handle, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_udp_recv_start(&s->udp_handle, alloc_cb, recv_cb)); uv_unref((uv_handle_t*)&s->udp_handle); } @@ -187,20 +187,20 @@ static int pummel(unsigned int n_senders, for (i = 0; i < n_senders; i++) { struct sender_state* s = senders + i; - ASSERT(0 == uv_ip4_addr("127.0.0.1", - BASE_PORT + (i % n_receivers), - &s->addr)); - ASSERT(0 == uv_udp_init(loop, &s->udp_handle)); - ASSERT(0 == uv_udp_send(&s->send_req, - &s->udp_handle, - bufs, - ARRAY_SIZE(bufs), - (const struct sockaddr*) &s->addr, - send_cb)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", + BASE_PORT + (i % n_receivers), + &s->addr)); + ASSERT_OK(uv_udp_init(loop, &s->udp_handle)); + ASSERT_OK(uv_udp_send(&s->send_req, + &s->udp_handle, + bufs, + ARRAY_SIZE(bufs), + (const struct sockaddr*) &s->addr, + send_cb)); } duration = uv_hrtime(); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); duration = uv_hrtime() - duration; /* convert from nanoseconds to milliseconds */ duration = duration / (uint64_t) 1e6; diff --git a/deps/uv/test/blackhole-server.c b/deps/uv/test/blackhole-server.c index 0a8758e1a1733b..79d6146f47920d 100644 --- a/deps/uv/test/blackhole-server.c +++ b/deps/uv/test/blackhole-server.c @@ -43,20 +43,20 @@ static void connection_cb(uv_stream_t* stream, int status) { conn_rec* conn; int r; - ASSERT(status == 0); - ASSERT(stream == (uv_stream_t*)&tcp_server); + ASSERT_OK(status); + ASSERT_PTR_EQ(stream, (uv_stream_t*)&tcp_server); conn = malloc(sizeof *conn); ASSERT_NOT_NULL(conn); r = uv_tcp_init(stream->loop, &conn->handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_accept(stream, (uv_stream_t*)&conn->handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*)&conn->handle, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -76,12 +76,12 @@ static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { if (nread >= 0) return; - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); conn = container_of(stream, conn_rec, handle); r = uv_shutdown(&conn->shutdown_req, stream, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -103,16 +103,16 @@ HELPER_IMPL(tcp4_blackhole_server) { int r; loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(loop, &tcp_server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&tcp_server, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); notify_parent_process(); r = uv_run(loop, UV_RUN_DEFAULT); diff --git a/deps/uv/test/echo-server.c b/deps/uv/test/echo-server.c index 058c9925475c94..572f87df51ed7f 100644 --- a/deps/uv/test/echo-server.c +++ b/deps/uv/test/echo-server.c @@ -65,14 +65,14 @@ static void after_write(uv_write_t* req, int status) { static void after_shutdown(uv_shutdown_t* req, int status) { - ASSERT_EQ(status, 0); + ASSERT_OK(status); uv_close((uv_handle_t*) req->handle, on_close); free(req); } static void on_shutdown(uv_shutdown_t* req, int status) { - ASSERT_EQ(status, 0); + ASSERT_OK(status); free(req); } @@ -92,7 +92,7 @@ static void after_read(uv_stream_t* handle, free(buf->base); sreq = malloc(sizeof* sreq); if (uv_is_writable(handle)) { - ASSERT_EQ(0, uv_shutdown(sreq, handle, after_shutdown)); + ASSERT_OK(uv_shutdown(sreq, handle, after_shutdown)); } return; } @@ -118,7 +118,7 @@ static void after_read(uv_stream_t* handle, if (i + 2 < nread && buf->base[i + 2] == 'H') reset = 1; if (reset && handle->type == UV_TCP) - ASSERT_EQ(0, uv_tcp_close_reset((uv_tcp_t*) handle, on_close)); + ASSERT_OK(uv_tcp_close_reset((uv_tcp_t*) handle, on_close)); else if (shutdown) break; else @@ -141,7 +141,7 @@ static void after_read(uv_stream_t* handle, } if (shutdown) - ASSERT_EQ(0, uv_shutdown(malloc(sizeof* sreq), handle, on_shutdown)); + ASSERT_OK(uv_shutdown(malloc(sizeof* sreq), handle, on_shutdown)); } @@ -173,21 +173,21 @@ static void on_connection(uv_stream_t* server, int status) { if (status != 0) { fprintf(stderr, "Connect error %s\n", uv_err_name(status)); } - ASSERT(status == 0); + ASSERT_OK(status); switch (serverType) { case TCP: stream = malloc(sizeof(uv_tcp_t)); ASSERT_NOT_NULL(stream); r = uv_tcp_init(loop, (uv_tcp_t*)stream); - ASSERT(r == 0); + ASSERT_OK(r); break; case PIPE: stream = malloc(sizeof(uv_pipe_t)); ASSERT_NOT_NULL(stream); r = uv_pipe_init(loop, (uv_pipe_t*)stream, 0); - ASSERT(r == 0); + ASSERT_OK(r); break; default: @@ -199,15 +199,15 @@ static void on_connection(uv_stream_t* server, int status) { stream->data = server; r = uv_accept(server, stream); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start(stream, echo_alloc, after_read); - ASSERT(r == 0); + ASSERT_OK(r); } static void on_server_close(uv_handle_t* handle) { - ASSERT(handle == server); + ASSERT_PTR_EQ(handle, server); } static uv_udp_send_t* send_alloc(void) { @@ -221,7 +221,7 @@ static uv_udp_send_t* send_alloc(void) { static void on_send(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); req->data = send_freelist; send_freelist = req; } @@ -239,20 +239,20 @@ static void on_recv(uv_udp_t* handle, return; } - ASSERT(nread > 0); - ASSERT(addr->sa_family == AF_INET); + ASSERT_GT(nread, 0); + ASSERT_EQ(addr->sa_family, AF_INET); req = send_alloc(); ASSERT_NOT_NULL(req); sndbuf = uv_buf_init(rcvbuf->base, nread); - ASSERT(0 <= uv_udp_send(req, handle, &sndbuf, 1, addr, on_send)); + ASSERT_LE(0, uv_udp_send(req, handle, &sndbuf, 1, addr, on_send)); } static int tcp4_echo_start(int port) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", port, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", port, &addr)); server = (uv_handle_t*)&tcpServer; serverType = TCP; @@ -286,7 +286,7 @@ static int tcp6_echo_start(int port) { struct sockaddr_in6 addr6; int r; - ASSERT(0 == uv_ip6_addr("::1", port, &addr6)); + ASSERT_OK(uv_ip6_addr("::1", port, &addr6)); server = (uv_handle_t*)&tcpServer; serverType = TCP; @@ -321,7 +321,7 @@ static int udp4_echo_start(int port) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", port, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", port, &addr)); server = (uv_handle_t*)&udpServer; serverType = UDP; diff --git a/deps/uv/test/run-tests.c b/deps/uv/test/run-tests.c index d8cfe297c49524..97fec52f1d8b06 100644 --- a/deps/uv/test/run-tests.c +++ b/deps/uv/test/run-tests.c @@ -145,7 +145,7 @@ static int maybe_run_test(int argc, char **argv) { if (strcmp(argv[1], "spawn_helper3") == 0) { char buffer[256]; notify_parent_process(); - ASSERT(buffer == fgets(buffer, sizeof(buffer) - 1, stdin)); + ASSERT_PTR_EQ(buffer, fgets(buffer, sizeof(buffer) - 1, stdin)); buffer[sizeof(buffer) - 1] = '\0'; fputs(buffer, stdout); return 1; @@ -183,10 +183,10 @@ static int maybe_run_test(int argc, char **argv) { notify_parent_process(); r = fprintf(stdout, "hello world\n"); - ASSERT(r > 0); + ASSERT_GT(r, 0); r = fprintf(stderr, "hello errworld\n"); - ASSERT(r > 0); + ASSERT_GT(r, 0); return 1; } @@ -202,7 +202,7 @@ static int maybe_run_test(int argc, char **argv) { ASSERT_NOT_NULL(test); r = fprintf(stdout, "%s", test); - ASSERT(r > 0); + ASSERT_GT(r, 0); return 1; } @@ -216,23 +216,24 @@ static int maybe_run_test(int argc, char **argv) { sCompareObjectHandles pCompareObjectHandles; /* function introduced in Windows 10 */ #endif notify_parent_process(); - ASSERT(sizeof(closed_fd) == read(0, &closed_fd, sizeof(closed_fd))); - ASSERT(sizeof(open_fd) == read(0, &open_fd, sizeof(open_fd))); + ASSERT_EQ(sizeof(closed_fd), read(0, &closed_fd, sizeof(closed_fd))); + ASSERT_EQ(sizeof(open_fd), read(0, &open_fd, sizeof(open_fd))); #ifdef _WIN32 - ASSERT((intptr_t) closed_fd > 0); - ASSERT((intptr_t) open_fd > 0); - ASSERT(0 != GetHandleInformation(open_fd, &flags)); + ASSERT_GT((intptr_t) closed_fd, 0); + ASSERT_GT((intptr_t) open_fd, 0); + ASSERT_NE(0, GetHandleInformation(open_fd, &flags)); kernelbase_module = GetModuleHandleA("kernelbase.dll"); pCompareObjectHandles = (sCompareObjectHandles) GetProcAddress(kernelbase_module, "CompareObjectHandles"); - ASSERT(pCompareObjectHandles == NULL || !pCompareObjectHandles(open_fd, closed_fd)); + ASSERT_NE(pCompareObjectHandles == NULL || \ + !pCompareObjectHandles(open_fd, closed_fd), 0); #else - ASSERT(open_fd > 2); - ASSERT(closed_fd > 2); + ASSERT_GT(open_fd, 2); + ASSERT_GT(closed_fd, 2); # if defined(__PASE__) /* On IBMi PASE, write() returns 1 */ - ASSERT(1 == write(closed_fd, "x", 1)); + ASSERT_EQ(1, write(closed_fd, "x", 1)); # else - ASSERT(-1 == write(closed_fd, "x", 1)); + ASSERT_EQ(-1, write(closed_fd, "x", 1)); # endif /* !__PASE__ */ #endif return 1; @@ -249,8 +250,8 @@ static int maybe_run_test(int argc, char **argv) { uv_uid_t uid = atoi(argv[2]); uv_gid_t gid = atoi(argv[3]); - ASSERT(uid == getuid()); - ASSERT(gid == getgid()); + ASSERT_EQ(uid, getuid()); + ASSERT_EQ(gid, getgid()); notify_parent_process(); return 1; diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c index 8c2a00b8a620c2..61d6f1431be9e3 100644 --- a/deps/uv/test/runner-win.c +++ b/deps/uv/test/runner-win.c @@ -185,7 +185,7 @@ int process_wait(process_info_t *vec, int n, int timeout) { if (n == 0) return 0; - ASSERT(n <= MAXIMUM_WAIT_OBJECTS); + ASSERT_LE(n, MAXIMUM_WAIT_OBJECTS); for (i = 0; i < n; i++) handles[i] = vec[i].process; @@ -245,7 +245,7 @@ int process_read_last_line(process_info_t *p, DWORD start; OVERLAPPED overlapped; - ASSERT(buffer_len > 0); + ASSERT_GT(buffer_len, 0); size = GetFileSize(p->stdio_out, NULL); if (size == INVALID_FILE_SIZE) diff --git a/deps/uv/test/task.h b/deps/uv/test/task.h index fa6cc0ed535a5c..8b8353263da90f 100644 --- a/deps/uv/test/task.h +++ b/deps/uv/test/task.h @@ -244,13 +244,16 @@ typedef enum { #define ASSERT_PTR_NE(a, b) \ ASSERT_BASE(a, !=, b, void*, "p") +#define ASSERT_PTR_LT(a, b) \ + ASSERT_BASE(a, <, b, void*, "p") + /* This macro cleans up the event loop. This is used to avoid valgrind * warnings about memory being "leaked" by the event loop. */ #define MAKE_VALGRIND_HAPPY(loop) \ do { \ close_loop(loop); \ - ASSERT(0 == uv_loop_close(loop)); \ + ASSERT_EQ(0, uv_loop_close(loop)); \ uv_library_shutdown(); \ } while (0) diff --git a/deps/uv/test/test-active.c b/deps/uv/test/test-active.c index aaff97087b190d..fadbd10d228db8 100644 --- a/deps/uv/test/test-active.c +++ b/deps/uv/test/test-active.c @@ -45,39 +45,39 @@ TEST_IMPL(active) { uv_timer_t timer; r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); + ASSERT_OK(r); /* uv_is_active() and uv_is_closing() should always return either 0 or 1. */ - ASSERT(0 == uv_is_active((uv_handle_t*) &timer)); - ASSERT(0 == uv_is_closing((uv_handle_t*) &timer)); + ASSERT_OK(uv_is_active((uv_handle_t*) &timer)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &timer)); r = uv_timer_start(&timer, timer_cb, 1000, 0); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(1 == uv_is_active((uv_handle_t*) &timer)); - ASSERT(0 == uv_is_closing((uv_handle_t*) &timer)); + ASSERT_EQ(1, uv_is_active((uv_handle_t*) &timer)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &timer)); r = uv_timer_stop(&timer); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_is_active((uv_handle_t*) &timer)); - ASSERT(0 == uv_is_closing((uv_handle_t*) &timer)); + ASSERT_OK(uv_is_active((uv_handle_t*) &timer)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &timer)); r = uv_timer_start(&timer, timer_cb, 1000, 0); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(1 == uv_is_active((uv_handle_t*) &timer)); - ASSERT(0 == uv_is_closing((uv_handle_t*) &timer)); + ASSERT_EQ(1, uv_is_active((uv_handle_t*) &timer)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &timer)); uv_close((uv_handle_t*) &timer, close_cb); - ASSERT(0 == uv_is_active((uv_handle_t*) &timer)); - ASSERT(1 == uv_is_closing((uv_handle_t*) &timer)); + ASSERT_OK(uv_is_active((uv_handle_t*) &timer)); + ASSERT_EQ(1, uv_is_closing((uv_handle_t*) &timer)); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-async-null-cb.c b/deps/uv/test/test-async-null-cb.c index 1bdd0e032497a9..ac9fc899c7aa4b 100644 --- a/deps/uv/test/test-async-null-cb.c +++ b/deps/uv/test/test-async-null-cb.c @@ -36,7 +36,7 @@ static void thread_cb(void* dummy) { static void check_cb(uv_check_t* handle) { - ASSERT(check_cb_called == 0); + ASSERT_OK(check_cb_called); uv_close((uv_handle_t*) &async_handle, NULL); uv_close((uv_handle_t*) &check_handle, NULL); check_cb_called++; @@ -52,13 +52,13 @@ TEST_IMPL(async_null_cb) { */ memset(&async_handle, 0xff, sizeof(async_handle)); - ASSERT(0 == uv_async_init(uv_default_loop(), &async_handle, NULL)); - ASSERT(0 == uv_check_init(uv_default_loop(), &check_handle)); - ASSERT(0 == uv_check_start(&check_handle, check_cb)); - ASSERT(0 == uv_thread_create(&thread, thread_cb, NULL)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == uv_thread_join(&thread)); - ASSERT(1 == check_cb_called); + ASSERT_OK(uv_async_init(uv_default_loop(), &async_handle, NULL)); + ASSERT_OK(uv_check_init(uv_default_loop(), &check_handle)); + ASSERT_OK(uv_check_start(&check_handle, check_cb)); + ASSERT_OK(uv_thread_create(&thread, thread_cb, NULL)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_thread_join(&thread)); + ASSERT_EQ(1, check_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } diff --git a/deps/uv/test/test-async.c b/deps/uv/test/test-async.c index 73664ea5d67efa..935436ec0930b4 100644 --- a/deps/uv/test/test-async.c +++ b/deps/uv/test/test-async.c @@ -49,7 +49,7 @@ static void thread_cb(void *arg) { } r = uv_async_send(&async); - ASSERT(r == 0); + ASSERT_OK(r); /* Work around a bug in Valgrind. * @@ -78,7 +78,7 @@ static void close_cb(uv_handle_t* handle) { static void async_cb(uv_async_t* handle) { int n; - ASSERT(handle == &async); + ASSERT_PTR_EQ(handle, &async); uv_mutex_lock(&mutex); n = ++async_cb_called; @@ -94,13 +94,13 @@ static void async_cb(uv_async_t* handle) { static void prepare_cb(uv_prepare_t* handle) { int r; - ASSERT(handle == &prepare); + ASSERT_PTR_EQ(handle, &prepare); if (prepare_cb_called++) return; r = uv_thread_create(&thread, thread_cb, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_mutex_unlock(&mutex); } @@ -109,25 +109,25 @@ TEST_IMPL(async) { int r; r = uv_mutex_init(&mutex); - ASSERT(r == 0); + ASSERT_OK(r); uv_mutex_lock(&mutex); r = uv_prepare_init(uv_default_loop(), &prepare); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_prepare_start(&prepare, prepare_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_async_init(uv_default_loop(), &async, async_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(prepare_cb_called > 0); - ASSERT(async_cb_called == 3); - ASSERT(close_cb_called == 2); + ASSERT_GT(prepare_cb_called, 0); + ASSERT_EQ(3, async_cb_called); + ASSERT_EQ(2, close_cb_called); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-barrier.c b/deps/uv/test/test-barrier.c index c780f0cf2dd48b..5e904c40bc4f05 100644 --- a/deps/uv/test/test-barrier.c +++ b/deps/uv/test/test-barrier.c @@ -53,13 +53,13 @@ TEST_IMPL(barrier_1) { memset(&wc, 0, sizeof(wc)); wc.niter = 1; - ASSERT_EQ(0, uv_barrier_init(&wc.barrier, 2)); - ASSERT_EQ(0, uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_barrier_init(&wc.barrier, 2)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); uv_sleep(100); wc.main_barrier_wait_rval = uv_barrier_wait(&wc.barrier); - ASSERT_EQ(0, uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); uv_barrier_destroy(&wc.barrier); ASSERT_EQ(1, (wc.main_barrier_wait_rval ^ wc.worker_barrier_wait_rval)); @@ -76,12 +76,12 @@ TEST_IMPL(barrier_2) { wc.delay = 100; wc.niter = 1; - ASSERT_EQ(0, uv_barrier_init(&wc.barrier, 2)); - ASSERT_EQ(0, uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_barrier_init(&wc.barrier, 2)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); wc.main_barrier_wait_rval = uv_barrier_wait(&wc.barrier); - ASSERT_EQ(0, uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); uv_barrier_destroy(&wc.barrier); ASSERT_EQ(1, (wc.main_barrier_wait_rval ^ wc.worker_barrier_wait_rval)); @@ -98,13 +98,13 @@ TEST_IMPL(barrier_3) { memset(&wc, 0, sizeof(wc)); wc.niter = 5; - ASSERT_EQ(0, uv_barrier_init(&wc.barrier, 2)); - ASSERT_EQ(0, uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_barrier_init(&wc.barrier, 2)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); for (i = 0; i < wc.niter; i++) wc.main_barrier_wait_rval += uv_barrier_wait(&wc.barrier); - ASSERT_EQ(0, uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); uv_barrier_destroy(&wc.barrier); ASSERT_EQ(wc.niter, wc.main_barrier_wait_rval + wc.worker_barrier_wait_rval); @@ -133,10 +133,10 @@ TEST_IMPL(barrier_serial_thread) { uv_barrier_t barrier; unsigned i; - ASSERT_EQ(0, uv_barrier_init(&barrier, ARRAY_SIZE(threads) + 1)); + ASSERT_OK(uv_barrier_init(&barrier, ARRAY_SIZE(threads) + 1)); for (i = 0; i < ARRAY_SIZE(threads); ++i) - ASSERT_EQ(0, uv_thread_create(&threads[i], serial_worker, &barrier)); + ASSERT_OK(uv_thread_create(&threads[i], serial_worker, &barrier)); for (i = 0; i < 5; i++) uv_barrier_wait(&barrier); @@ -144,7 +144,7 @@ TEST_IMPL(barrier_serial_thread) { uv_barrier_destroy(&barrier); for (i = 0; i < ARRAY_SIZE(threads); ++i) - ASSERT_EQ(0, uv_thread_join(&threads[i])); + ASSERT_OK(uv_thread_join(&threads[i])); return 0; } @@ -153,7 +153,7 @@ TEST_IMPL(barrier_serial_thread) { TEST_IMPL(barrier_serial_thread_single) { uv_barrier_t barrier; - ASSERT_EQ(0, uv_barrier_init(&barrier, 1)); + ASSERT_OK(uv_barrier_init(&barrier, 1)); ASSERT_LT(0, uv_barrier_wait(&barrier)); uv_barrier_destroy(&barrier); return 0; diff --git a/deps/uv/test/test-callback-stack.c b/deps/uv/test/test-callback-stack.c index 5dad8d75d2aa9a..dfd102c0247cde 100644 --- a/deps/uv/test/test-callback-stack.c +++ b/deps/uv/test/test-callback-stack.c @@ -60,7 +60,7 @@ static void close_cb(uv_handle_t* handle) { static void shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); ASSERT(nested == 0 && "shutdown_cb must be called from a fresh stack"); shutdown_cb_called++; @@ -77,7 +77,7 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { return; } else if (nread < 0) { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); nested++; uv_close((uv_handle_t*)tcp, close_cb); @@ -105,7 +105,7 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer); + ASSERT_PTR_EQ(handle, &timer); ASSERT(nested == 0 && "timer_cb must be called from a fresh stack"); puts("Timeout complete. Now read data..."); @@ -125,7 +125,7 @@ static void timer_cb(uv_timer_t* handle) { static void write_cb(uv_write_t* req, int status) { int r; - ASSERT(status == 0); + ASSERT_OK(status); ASSERT(nested == 0 && "write_cb must be called from a fresh stack"); puts("Data written. 500ms timeout..."); @@ -136,9 +136,9 @@ static void write_cb(uv_write_t* req, int status) { * for the backend to use dirty stack for calling read_cb. */ nested++; r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb, 500, 0); - ASSERT(r == 0); + ASSERT_OK(r); nested--; write_cb_called++; @@ -150,7 +150,7 @@ static void connect_cb(uv_connect_t* req, int status) { puts("Connected. Write some data to echo server..."); - ASSERT(status == 0); + ASSERT_OK(status); ASSERT(nested == 0 && "connect_cb must be called from a fresh stack"); nested++; @@ -171,7 +171,7 @@ static void connect_cb(uv_connect_t* req, int status) { TEST_IMPL(callback_stack) { struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); if (uv_tcp_init(uv_default_loop(), &client)) { FATAL("uv_tcp_init failed"); @@ -191,13 +191,18 @@ TEST_IMPL(callback_stack) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(nested == 0); - ASSERT(connect_cb_called == 1 && "connect_cb must be called exactly once"); - ASSERT(write_cb_called == 1 && "write_cb must be called exactly once"); - ASSERT(timer_cb_called == 1 && "timer_cb must be called exactly once"); - ASSERT(bytes_received == sizeof MESSAGE); - ASSERT(shutdown_cb_called == 1 && "shutdown_cb must be called exactly once"); - ASSERT(close_cb_called == 2 && "close_cb must be called exactly twice"); + ASSERT_OK(nested); + ASSERT_NE(connect_cb_called == 1 && \ + "connect_cb must be called exactly once", 0); + ASSERT_NE(write_cb_called == 1 && "write_cb must be called exactly once", + 0); + ASSERT_NE(timer_cb_called == 1 && "timer_cb must be called exactly once", + 0); + ASSERT_EQ(bytes_received, sizeof MESSAGE); + ASSERT_NE(shutdown_cb_called == 1 && \ + "shutdown_cb must be called exactly once", 0); + ASSERT_NE(close_cb_called == 2 && "close_cb must be called exactly twice", + 0); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-close-fd.c b/deps/uv/test/test-close-fd.c index d8e12653f77feb..c072fdbb79ac4c 100644 --- a/deps/uv/test/test-close-fd.c +++ b/deps/uv/test/test-close-fd.c @@ -36,11 +36,11 @@ static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { switch (++read_cb_called) { case 1: - ASSERT(nread == 1); + ASSERT_EQ(1, nread); uv_read_stop(handle); break; case 2: - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); uv_close((uv_handle_t *) handle, NULL); break; default: @@ -55,29 +55,29 @@ TEST_IMPL(close_fd) { uv_file fd[2]; bufs[0] = uv_buf_init("", 1); - ASSERT(0 == uv_pipe(fd, 0, 0)); - ASSERT(0 == uv_pipe_init(uv_default_loop(), &pipe_handle, 0)); - ASSERT(0 == uv_pipe_open(&pipe_handle, fd[0])); + ASSERT_OK(uv_pipe(fd, 0, 0)); + ASSERT_OK(uv_pipe_init(uv_default_loop(), &pipe_handle, 0)); + ASSERT_OK(uv_pipe_open(&pipe_handle, fd[0])); /* uv_pipe_open() takes ownership of the file descriptor. */ fd[0] = -1; - ASSERT(1 == uv_fs_write(NULL, &req, fd[1], bufs, 1, -1, NULL)); - ASSERT(1 == req.result); + ASSERT_EQ(1, uv_fs_write(NULL, &req, fd[1], bufs, 1, -1, NULL)); + ASSERT_EQ(1, req.result); uv_fs_req_cleanup(&req); #ifdef _WIN32 - ASSERT(0 == _close(fd[1])); + ASSERT_OK(_close(fd[1])); #else - ASSERT(0 == close(fd[1])); + ASSERT_OK(close(fd[1])); #endif fd[1] = -1; - ASSERT(0 == uv_read_start((uv_stream_t *) &pipe_handle, alloc_cb, read_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(1 == read_cb_called); - ASSERT(0 == uv_is_active((const uv_handle_t *) &pipe_handle)); - ASSERT(0 == uv_read_start((uv_stream_t *) &pipe_handle, alloc_cb, read_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(2 == read_cb_called); - ASSERT(0 != uv_is_closing((const uv_handle_t *) &pipe_handle)); + ASSERT_OK(uv_read_start((uv_stream_t *) &pipe_handle, alloc_cb, read_cb)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, read_cb_called); + ASSERT_OK(uv_is_active((const uv_handle_t *) &pipe_handle)); + ASSERT_OK(uv_read_start((uv_stream_t *) &pipe_handle, alloc_cb, read_cb)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(2, read_cb_called); + ASSERT_NE(0, uv_is_closing((const uv_handle_t *) &pipe_handle)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-close-order.c b/deps/uv/test/test-close-order.c index 768e1ceedbe474..e1aae93b7a8fbf 100644 --- a/deps/uv/test/test-close-order.c +++ b/deps/uv/test/test-close-order.c @@ -39,9 +39,9 @@ static void close_cb(uv_handle_t* handle) { /* check_cb should run before any close_cb */ static void check_cb(uv_check_t* handle) { - ASSERT(check_cb_called == 0); - ASSERT(timer_cb_called == 1); - ASSERT(close_cb_called == 0); + ASSERT_OK(check_cb_called); + ASSERT_EQ(1, timer_cb_called); + ASSERT_OK(close_cb_called); uv_close((uv_handle_t*) handle, close_cb); uv_close((uv_handle_t*) &timer_handle2, close_cb); check_cb_called++; @@ -65,15 +65,15 @@ TEST_IMPL(close_order) { uv_timer_init(loop, &timer_handle2); uv_timer_start(&timer_handle2, timer_cb, 100000, 0); - ASSERT(check_cb_called == 0); - ASSERT(close_cb_called == 0); - ASSERT(timer_cb_called == 0); + ASSERT_OK(check_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_OK(timer_cb_called); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(check_cb_called == 1); - ASSERT(close_cb_called == 3); - ASSERT(timer_cb_called == 1); + ASSERT_EQ(1, check_cb_called); + ASSERT_EQ(3, close_cb_called); + ASSERT_EQ(1, timer_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-condvar.c b/deps/uv/test/test-condvar.c index 61592d0e2d159a..2711f8cc1b3678 100644 --- a/deps/uv/test/test-condvar.c +++ b/deps/uv/test/test-condvar.c @@ -55,10 +55,10 @@ void worker_config_init(worker_config* wc, wc->use_broadcast = use_broadcast; /* Init. */ - ASSERT(0 == uv_sem_init(&wc->sem_waiting, 0)); - ASSERT(0 == uv_sem_init(&wc->sem_signaled, 0)); - ASSERT(0 == uv_cond_init(&wc->cond)); - ASSERT(0 == uv_mutex_init(&wc->mutex)); + ASSERT_OK(uv_sem_init(&wc->sem_waiting, 0)); + ASSERT_OK(uv_sem_init(&wc->sem_signaled, 0)); + ASSERT_OK(uv_cond_init(&wc->cond)); + ASSERT_OK(uv_mutex_init(&wc->mutex)); } void worker_config_destroy(worker_config* wc) { @@ -87,7 +87,7 @@ static void condvar_signal(worker_config* c, int* flag) { uv_mutex_lock(&c->mutex); /* Help waiter differentiate between spurious and legitimate wakeup. */ - ASSERT(*flag == 0); + ASSERT_OK(*flag); *flag = 1; if (c->use_broadcast) @@ -113,7 +113,7 @@ static int condvar_wait(worker_config* c, const int* flag) { do { uv_cond_wait(&c->cond, &c->mutex); } while (*flag == 0); - ASSERT(*flag == 1); + ASSERT_EQ(1, *flag); uv_mutex_unlock(&c->mutex); @@ -130,13 +130,13 @@ TEST_IMPL(condvar_1) { /* Helper signal-then-wait. */ worker_config_init(&wc, 0, condvar_signal, condvar_wait); - ASSERT(0 == uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); /* We wait-then-signal. */ - ASSERT(0 == wc.wait_cond(&wc, &wc.posted_1)); + ASSERT_OK(wc.wait_cond(&wc, &wc.posted_1)); wc.signal_cond(&wc, &wc.posted_2); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); worker_config_destroy(&wc); return 0; @@ -149,13 +149,13 @@ TEST_IMPL(condvar_2) { /* Helper to signal-then-wait. */ worker_config_init(&wc, 1, condvar_signal, condvar_wait); - ASSERT(0 == uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); /* We wait-then-signal. */ - ASSERT(0 == wc.wait_cond(&wc, &wc.posted_1)); + ASSERT_OK(wc.wait_cond(&wc, &wc.posted_1)); wc.signal_cond(&wc, &wc.posted_2); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); worker_config_destroy(&wc); return 0; @@ -176,9 +176,9 @@ static int condvar_timedwait(worker_config* c, const int* flag) { /* Wait until I get a non-spurious signal. */ do { r = uv_cond_timedwait(&c->cond, &c->mutex, (uint64_t)(1 * 1e9)); /* 1 s */ - ASSERT(r == 0); /* Should not time out. */ + ASSERT_OK(r); /* Should not time out. */ } while (*flag == 0); - ASSERT(*flag == 1); + ASSERT_EQ(1, *flag); uv_mutex_unlock(&c->mutex); @@ -194,13 +194,13 @@ TEST_IMPL(condvar_3) { /* Helper to signal-then-wait. */ worker_config_init(&wc, 0, condvar_signal, condvar_timedwait); - ASSERT(0 == uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); /* We wait-then-signal. */ wc.wait_cond(&wc, &wc.posted_1); wc.signal_cond(&wc, &wc.posted_2); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); worker_config_destroy(&wc); return 0; @@ -213,13 +213,13 @@ TEST_IMPL(condvar_4) { /* Helper to signal-then-wait. */ worker_config_init(&wc, 1, condvar_signal, condvar_timedwait); - ASSERT(0 == uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); /* We wait-then-signal. */ wc.wait_cond(&wc, &wc.posted_1); wc.signal_cond(&wc, &wc.posted_2); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); worker_config_destroy(&wc); return 0; diff --git a/deps/uv/test/test-connect-unspecified.c b/deps/uv/test/test-connect-unspecified.c index ecbe98538edc9d..73e59a9972b670 100644 --- a/deps/uv/test/test-connect-unspecified.c +++ b/deps/uv/test/test-connect-unspecified.c @@ -23,11 +23,11 @@ #include "task.h" static void connect_4(uv_connect_t* req, int status) { - ASSERT(status != UV_EADDRNOTAVAIL); + ASSERT_NE(status, UV_EADDRNOTAVAIL); } static void connect_6(uv_connect_t* req, int status) { - ASSERT(status != UV_EADDRNOTAVAIL); + ASSERT_NE(status, UV_EADDRNOTAVAIL); } TEST_IMPL(connect_unspecified) { @@ -41,23 +41,23 @@ TEST_IMPL(connect_unspecified) { loop = uv_default_loop(); - ASSERT(uv_tcp_init(loop, &socket4) == 0); - ASSERT(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr4) == 0); - ASSERT(uv_tcp_connect(&connect4, - &socket4, - (const struct sockaddr*) &addr4, - connect_4) == 0); + ASSERT_OK(uv_tcp_init(loop, &socket4)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr4)); + ASSERT_OK(uv_tcp_connect(&connect4, + &socket4, + (const struct sockaddr*) &addr4, + connect_4)); if (can_ipv6()) { - ASSERT(uv_tcp_init(loop, &socket6) == 0); - ASSERT(uv_ip6_addr("::", TEST_PORT, &addr6) == 0); - ASSERT(uv_tcp_connect(&connect6, - &socket6, - (const struct sockaddr*) &addr6, - connect_6) == 0); + ASSERT_OK(uv_tcp_init(loop, &socket6)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT, &addr6)); + ASSERT_OK(uv_tcp_connect(&connect6, + &socket6, + (const struct sockaddr*) &addr6, + connect_6)); } - ASSERT(uv_run(loop, UV_RUN_DEFAULT) == 0); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-connection-fail.c b/deps/uv/test/test-connection-fail.c index aa7db30d85a2d1..9efd3ac907a035 100644 --- a/deps/uv/test/test-connection-fail.c +++ b/deps/uv/test/test-connection-fail.c @@ -54,8 +54,8 @@ static void timer_cb(uv_timer_t* handle) { * but libuv hasn't automatically closed the socket. The user must * uv_close the handle manually. */ - ASSERT(close_cb_calls == 0); - ASSERT(connect_cb_calls == 1); + ASSERT_OK(close_cb_calls); + ASSERT_EQ(1, connect_cb_calls); /* Close the tcp handle. */ uv_close((uv_handle_t*)&tcp, on_close); @@ -66,22 +66,22 @@ static void timer_cb(uv_timer_t* handle) { static void on_connect_with_close(uv_connect_t *req, int status) { - ASSERT((uv_stream_t*) &tcp == req->handle); - ASSERT(status == UV_ECONNREFUSED); + ASSERT_PTR_EQ((uv_stream_t*) &tcp, req->handle); + ASSERT_EQ(status, UV_ECONNREFUSED); connect_cb_calls++; - ASSERT(close_cb_calls == 0); + ASSERT_OK(close_cb_calls); uv_close((uv_handle_t*)req->handle, on_close); } static void on_connect_without_close(uv_connect_t *req, int status) { - ASSERT(status == UV_ECONNREFUSED); + ASSERT_EQ(status, UV_ECONNREFUSED); connect_cb_calls++; uv_timer_start(&timer, timer_cb, 100, 0); - ASSERT(close_cb_calls == 0); + ASSERT_OK(close_cb_calls); } @@ -89,10 +89,10 @@ static void connection_fail(uv_connect_cb connect_cb) { struct sockaddr_in client_addr, server_addr; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &client_addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", 0, &client_addr)); /* There should be no servers listening on this port. */ - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); /* Try to connect to the server and do NUM_PINGS ping-pongs. */ r = uv_tcp_init(uv_default_loop(), &tcp); @@ -100,7 +100,7 @@ static void connection_fail(uv_connect_cb connect_cb) { /* We are never doing multiple reads/connects at a time anyway. so these * handles can be pre-initialized. */ - ASSERT(0 == uv_tcp_bind(&tcp, (const struct sockaddr*) &client_addr, 0)); + ASSERT_OK(uv_tcp_bind(&tcp, (const struct sockaddr*) &client_addr, 0)); r = uv_tcp_connect(&req, &tcp, @@ -110,8 +110,8 @@ static void connection_fail(uv_connect_cb connect_cb) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_calls == 1); - ASSERT(close_cb_calls == 1); + ASSERT_EQ(1, connect_cb_calls); + ASSERT_EQ(1, close_cb_calls); } @@ -127,8 +127,8 @@ TEST_IMPL(connection_fail) { connection_fail(on_connect_with_close); - ASSERT(timer_close_cb_calls == 0); - ASSERT(timer_cb_calls == 0); + ASSERT_OK(timer_close_cb_calls); + ASSERT_OK(timer_cb_calls); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -149,12 +149,12 @@ TEST_IMPL(connection_fail_doesnt_auto_close) { int r; r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); + ASSERT_OK(r); connection_fail(on_connect_without_close); - ASSERT(timer_close_cb_calls == 1); - ASSERT(timer_cb_calls == 1); + ASSERT_EQ(1, timer_close_cb_calls); + ASSERT_EQ(1, timer_cb_calls); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-cwd-and-chdir.c b/deps/uv/test/test-cwd-and-chdir.c index faeed021030e83..e4a0eef07670cd 100644 --- a/deps/uv/test/test-cwd-and-chdir.c +++ b/deps/uv/test/test-cwd-and-chdir.c @@ -34,24 +34,24 @@ TEST_IMPL(cwd_and_chdir) { size1 = 1; err = uv_cwd(buffer_orig, &size1); - ASSERT(err == UV_ENOBUFS); - ASSERT(size1 > 1); + ASSERT_EQ(err, UV_ENOBUFS); + ASSERT_GT(size1, 1); size1 = sizeof buffer_orig; err = uv_cwd(buffer_orig, &size1); - ASSERT(err == 0); - ASSERT(size1 > 0); - ASSERT(buffer_orig[size1] != '/'); + ASSERT_OK(err); + ASSERT_GT(size1, 0); + ASSERT_NE(buffer_orig[size1], '/'); err = uv_chdir(buffer_orig); - ASSERT(err == 0); + ASSERT_OK(err); size2 = sizeof buffer_new; err = uv_cwd(buffer_new, &size2); - ASSERT(err == 0); + ASSERT_OK(err); - ASSERT(size1 == size2); - ASSERT(strcmp(buffer_orig, buffer_new) == 0); + ASSERT_EQ(size1, size2); + ASSERT_OK(strcmp(buffer_orig, buffer_new)); return 0; } diff --git a/deps/uv/test/test-default-loop-close.c b/deps/uv/test/test-default-loop-close.c index 8d960e1130a7cb..d08a33ea551d34 100644 --- a/deps/uv/test/test-default-loop-close.c +++ b/deps/uv/test/test-default-loop-close.c @@ -39,19 +39,19 @@ TEST_IMPL(default_loop_close) { loop = uv_default_loop(); ASSERT_NOT_NULL(loop); - ASSERT(0 == uv_timer_init(loop, &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 1, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == timer_cb_called); - ASSERT(0 == uv_loop_close(loop)); + ASSERT_OK(uv_timer_init(loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 1, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, timer_cb_called); + ASSERT_OK(uv_loop_close(loop)); loop = uv_default_loop(); ASSERT_NOT_NULL(loop); - ASSERT(0 == uv_timer_init(loop, &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 1, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(2 == timer_cb_called); + ASSERT_OK(uv_timer_init(loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 1, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(2, timer_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-delayed-accept.c b/deps/uv/test/test-delayed-accept.c index c1d6ce0b45b203..f7cf80ab7b369c 100644 --- a/deps/uv/test/test-delayed-accept.c +++ b/deps/uv/test/test-delayed-accept.c @@ -54,11 +54,11 @@ static void do_accept(uv_timer_t* timer_handle) { ASSERT_NOT_NULL(accepted_handle); r = uv_tcp_init(uv_default_loop(), accepted_handle); - ASSERT(r == 0); + ASSERT_OK(r); server = (uv_tcp_t*)timer_handle->data; r = uv_accept((uv_stream_t*)server, (uv_stream_t*)accepted_handle); - ASSERT(r == 0); + ASSERT_OK(r); do_accept_called++; @@ -79,19 +79,19 @@ static void connection_cb(uv_stream_t* tcp, int status) { int r; uv_timer_t* timer_handle; - ASSERT(status == 0); + ASSERT_OK(status); timer_handle = (uv_timer_t*)malloc(sizeof *timer_handle); ASSERT_NOT_NULL(timer_handle); /* Accept the client after 1 second */ r = uv_timer_init(uv_default_loop(), timer_handle); - ASSERT(r == 0); + ASSERT_OK(r); timer_handle->data = tcp; r = uv_timer_start(timer_handle, do_accept, 1000, 0); - ASSERT(r == 0); + ASSERT_OK(r); connection_cb_called++; } @@ -102,16 +102,16 @@ static void start_server(void) { uv_tcp_t* server = (uv_tcp_t*)malloc(sizeof *server); int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); ASSERT_NOT_NULL(server); r = uv_tcp_init(uv_default_loop(), server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)server, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -123,10 +123,10 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { } if (nread >= 0) { - ASSERT(nread == 0); + ASSERT_OK(nread); } else { ASSERT_NOT_NULL(tcp); - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); uv_close((uv_handle_t*)tcp, close_cb); } } @@ -136,12 +136,12 @@ static void connect_cb(uv_connect_t* req, int status) { int r; ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); /* Not that the server will send anything, but otherwise we'll never know * when the server closes the connection. */ r = uv_read_start((uv_stream_t*)(req->handle), alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); connect_cb_called++; @@ -155,18 +155,18 @@ static void client_connect(void) { uv_connect_t* connect_req = malloc(sizeof *connect_req); int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); ASSERT_NOT_NULL(client); ASSERT_NOT_NULL(connect_req); r = uv_tcp_init(uv_default_loop(), client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(connect_req, client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -179,10 +179,10 @@ TEST_IMPL(delayed_accept) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connection_cb_called == 2); - ASSERT(do_accept_called == 2); - ASSERT(connect_cb_called == 2); - ASSERT(close_cb_called == 7); + ASSERT_EQ(2, connection_cb_called); + ASSERT_EQ(2, do_accept_called); + ASSERT_EQ(2, connect_cb_called); + ASSERT_EQ(7, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-dlerror.c b/deps/uv/test/test-dlerror.c index 631e67cc5f3e89..dec0da3afc8533 100644 --- a/deps/uv/test/test-dlerror.c +++ b/deps/uv/test/test-dlerror.c @@ -38,7 +38,7 @@ TEST_IMPL(dlerror) { ASSERT_NOT_NULL(strstr(msg, dlerror_no_error)); r = uv_dlopen(path, &lib); - ASSERT(r == -1); + ASSERT_EQ(r, -1); msg = uv_dlerror(&lib); ASSERT_NOT_NULL(msg); diff --git a/deps/uv/test/test-eintr-handling.c b/deps/uv/test/test-eintr-handling.c index d37aba4aa529ba..1f75e77e251bf1 100644 --- a/deps/uv/test/test-eintr-handling.c +++ b/deps/uv/test/test-eintr-handling.c @@ -48,13 +48,13 @@ struct thread_ctx { static void thread_main(void* arg) { int nwritten; - ASSERT(0 == kill(getpid(), SIGUSR1)); + ASSERT_OK(kill(getpid(), SIGUSR1)); do nwritten = write(pipe_fds[1], test_buf, sizeof(test_buf)); while (nwritten == -1 && errno == EINTR); - ASSERT(nwritten == sizeof(test_buf)); + ASSERT_EQ(nwritten, sizeof(test_buf)); } static void sig_func(uv_signal_t* handle, int signum) { @@ -70,24 +70,24 @@ TEST_IMPL(eintr_handling) { iov = uv_buf_init(buf, sizeof(buf)); loop = uv_default_loop(); - ASSERT(0 == uv_signal_init(loop, &signal)); - ASSERT(0 == uv_signal_start(&signal, sig_func, SIGUSR1)); + ASSERT_OK(uv_signal_init(loop, &signal)); + ASSERT_OK(uv_signal_start(&signal, sig_func, SIGUSR1)); - ASSERT(0 == pipe(pipe_fds)); - ASSERT(0 == uv_thread_create(&thread, thread_main, &ctx)); + ASSERT_OK(pipe(pipe_fds)); + ASSERT_OK(uv_thread_create(&thread, thread_main, &ctx)); nread = uv_fs_read(loop, &read_req, pipe_fds[0], &iov, 1, -1, NULL); - ASSERT(nread == sizeof(test_buf)); - ASSERT(0 == strcmp(buf, test_buf)); + ASSERT_EQ(nread, sizeof(test_buf)); + ASSERT_OK(strcmp(buf, test_buf)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(0 == close(pipe_fds[0])); - ASSERT(0 == close(pipe_fds[1])); + ASSERT_OK(close(pipe_fds[0])); + ASSERT_OK(close(pipe_fds[1])); uv_close((uv_handle_t*) &signal, NULL); - ASSERT_EQ(0, uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-embed.c b/deps/uv/test/test-embed.c index bbe56e176db17a..6e9917239aa562 100644 --- a/deps/uv/test/test-embed.c +++ b/deps/uv/test/test-embed.c @@ -36,7 +36,7 @@ static uv_barrier_t barrier; static void thread_main(void* arg) { ASSERT_LE(0, uv_barrier_wait(&barrier)); uv_sleep(250); - ASSERT_EQ(0, uv_async_send(&async)); + ASSERT_OK(uv_async_send(&async)); } @@ -50,9 +50,9 @@ TEST_IMPL(embed) { uv_loop_t* loop; loop = uv_default_loop(); - ASSERT_EQ(0, uv_async_init(loop, &async, async_cb)); - ASSERT_EQ(0, uv_barrier_init(&barrier, 2)); - ASSERT_EQ(0, uv_thread_create(&thread, thread_main, NULL)); + ASSERT_OK(uv_async_init(loop, &async, async_cb)); + ASSERT_OK(uv_barrier_init(&barrier, 2)); + ASSERT_OK(uv_thread_create(&thread, thread_main, NULL)); ASSERT_LE(0, uv_barrier_wait(&barrier)); while (uv_loop_alive(loop)) { @@ -71,7 +71,7 @@ TEST_IMPL(embed) { #endif } - ASSERT_EQ(0, uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); uv_barrier_destroy(&barrier); MAKE_VALGRIND_HAPPY(loop); diff --git a/deps/uv/test/test-emfile.c b/deps/uv/test/test-emfile.c index 343c9521dc7eba..ef2338cdfbb165 100644 --- a/deps/uv/test/test-emfile.c +++ b/deps/uv/test/test-emfile.c @@ -54,37 +54,37 @@ TEST_IMPL(emfile) { /* Lower the file descriptor limit and use up all fds save one. */ limits.rlim_cur = limits.rlim_max = maxfd + 1; if (setrlimit(RLIMIT_NOFILE, &limits)) { - ASSERT(errno == EPERM); /* Valgrind blocks the setrlimit() call. */ + ASSERT_EQ(errno, EPERM); /* Valgrind blocks the setrlimit() call. */ RETURN_SKIP("setrlimit(RLIMIT_NOFILE) failed, running under valgrind?"); } loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(loop, &server_handle)); - ASSERT(0 == uv_tcp_init(loop, &client_handle)); - ASSERT(0 == uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 8, connection_cb)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_tcp_init(loop, &server_handle)); + ASSERT_OK(uv_tcp_init(loop, &client_handle)); + ASSERT_OK(uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server_handle, 8, connection_cb)); /* Remember the first one so we can clean up afterwards. */ do first_fd = dup(0); while (first_fd == -1 && errno == EINTR); - ASSERT(first_fd > 0); + ASSERT_GT(first_fd, 0); while (dup(0) != -1 || errno == EINTR); - ASSERT(errno == EMFILE); + ASSERT_EQ(errno, EMFILE); close(maxfd); /* Now connect and use up the last available file descriptor. The EMFILE * handling logic in src/unix/stream.c should ensure that connect_cb() runs * whereas connection_cb() should *not* run. */ - ASSERT(0 == uv_tcp_connect(&connect_req, - &client_handle, - (const struct sockaddr*) &addr, - connect_cb)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == connect_cb_called); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client_handle, + (const struct sockaddr*) &addr, + connect_cb)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, connect_cb_called); /* Close the dups again. Ignore errors in the unlikely event that the * file descriptors were not contiguous. @@ -108,7 +108,7 @@ static void connect_cb(uv_connect_t* req, int status) { /* |status| should equal 0 because the connection should have been accepted, * it's just that the server immediately closes it again. */ - ASSERT(0 == status); + ASSERT_OK(status); connect_cb_called += 1; uv_close((uv_handle_t*) &server_handle, NULL); uv_close((uv_handle_t*) &client_handle, NULL); diff --git a/deps/uv/test/test-env-vars.c b/deps/uv/test/test-env-vars.c index 8118e3da5d7c59..016f0733c6e424 100644 --- a/deps/uv/test/test-env-vars.c +++ b/deps/uv/test/test-env-vars.c @@ -35,83 +35,83 @@ TEST_IMPL(env_vars) { /* Reject invalid inputs when setting an environment variable */ r = uv_os_setenv(NULL, "foo"); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_os_setenv(name, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_os_setenv(NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Reject invalid inputs when retrieving an environment variable */ size = BUF_SIZE; r = uv_os_getenv(NULL, buf, &size); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_os_getenv(name, NULL, &size); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_os_getenv(name, buf, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); size = 0; r = uv_os_getenv(name, buf, &size); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Reject invalid inputs when deleting an environment variable */ r = uv_os_unsetenv(NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Successfully set an environment variable */ r = uv_os_setenv(name, "123456789"); - ASSERT(r == 0); + ASSERT_OK(r); /* Successfully read an environment variable */ size = BUF_SIZE; buf[0] = '\0'; r = uv_os_getenv(name, buf, &size); - ASSERT(r == 0); - ASSERT(strcmp(buf, "123456789") == 0); - ASSERT(size == BUF_SIZE - 1); + ASSERT_OK(r); + ASSERT_OK(strcmp(buf, "123456789")); + ASSERT_EQ(size, BUF_SIZE - 1); /* Return UV_ENOBUFS if the buffer cannot hold the environment variable */ size = BUF_SIZE - 1; buf[0] = '\0'; r = uv_os_getenv(name, buf, &size); - ASSERT(r == UV_ENOBUFS); - ASSERT(size == BUF_SIZE); + ASSERT_EQ(r, UV_ENOBUFS); + ASSERT_EQ(size, BUF_SIZE); /* Successfully delete an environment variable */ r = uv_os_unsetenv(name); - ASSERT(r == 0); + ASSERT_OK(r); /* Return UV_ENOENT retrieving an environment variable that does not exist */ r = uv_os_getenv(name, buf, &size); - ASSERT(r == UV_ENOENT); + ASSERT_EQ(r, UV_ENOENT); /* Successfully delete an environment variable that does not exist */ r = uv_os_unsetenv(name); - ASSERT(r == 0); + ASSERT_OK(r); /* Setting an environment variable to the empty string does not delete it. */ r = uv_os_setenv(name, ""); - ASSERT(r == 0); + ASSERT_OK(r); size = BUF_SIZE; r = uv_os_getenv(name, buf, &size); - ASSERT(r == 0); - ASSERT(size == 0); - ASSERT(strlen(buf) == 0); + ASSERT_OK(r); + ASSERT_OK(size); + ASSERT_OK(strlen(buf)); /* Check getting all env variables. */ r = uv_os_setenv(name, "123456789"); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_os_setenv(name2, ""); - ASSERT(r == 0); + ASSERT_OK(r); #ifdef _WIN32 /* Create a special environment variable on Windows in case there are no naturally occurring ones. */ r = uv_os_setenv("=Z:", "\\"); - ASSERT(r == 0); + ASSERT_OK(r); #endif r = uv_os_environ(&envitems, &envcount); - ASSERT(r == 0); - ASSERT(envcount > 0); + ASSERT_OK(r); + ASSERT_GT(envcount, 0); found = 0; found_win_special = 0; @@ -120,16 +120,16 @@ TEST_IMPL(env_vars) { /* printf("Env: %s = %s\n", envitems[i].name, envitems[i].value); */ if (strcmp(envitems[i].name, name) == 0) { found++; - ASSERT(strcmp(envitems[i].value, "123456789") == 0); + ASSERT_OK(strcmp(envitems[i].value, "123456789")); } else if (strcmp(envitems[i].name, name2) == 0) { found++; - ASSERT(strlen(envitems[i].value) == 0); + ASSERT_OK(strlen(envitems[i].value)); } else if (envitems[i].name[0] == '=') { found_win_special++; } } - ASSERT(found == 2); + ASSERT_EQ(2, found); #ifdef _WIN32 ASSERT_GT(found_win_special, 0); #else @@ -140,10 +140,10 @@ TEST_IMPL(env_vars) { uv_os_free_environ(envitems, envcount); r = uv_os_unsetenv(name); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_os_unsetenv(name2); - ASSERT(r == 0); + ASSERT_OK(r); for (i = 1; i <= 4; i++) { size_t n; @@ -158,14 +158,14 @@ TEST_IMPL(env_vars) { memset(p, 'x', n); p[n] = '\0'; - ASSERT_EQ(0, uv_os_setenv(name, p)); - ASSERT_EQ(0, uv_os_getenv(name, p, &size)); + ASSERT_OK(uv_os_setenv(name, p)); + ASSERT_OK(uv_os_getenv(name, p, &size)); ASSERT_EQ(n, size); for (n = 0; n < size; n++) ASSERT_EQ('x', p[n]); - ASSERT_EQ(0, uv_os_unsetenv(name)); + ASSERT_OK(uv_os_unsetenv(name)); free(p); } diff --git a/deps/uv/test/test-error.c b/deps/uv/test/test-error.c index f0fb864607f36c..2c6d0ca49790e0 100644 --- a/deps/uv/test/test-error.c +++ b/deps/uv/test/test-error.c @@ -51,8 +51,8 @@ TEST_IMPL(error_message) { } ASSERT_NULL(strstr(uv_strerror(UV_EINVAL), "Success")); - ASSERT(strcmp(uv_strerror(1337), "Unknown error") == 0); - ASSERT(strcmp(uv_strerror(-1337), "Unknown error") == 0); + ASSERT_OK(strcmp(uv_strerror(1337), "Unknown error")); + ASSERT_OK(strcmp(uv_strerror(-1337), "Unknown error")); ASSERT_NULL(strstr(uv_strerror_r(UV_EINVAL, buf, sizeof(buf)), "Success")); ASSERT_NOT_NULL(strstr(uv_strerror_r(1337, buf, sizeof(buf)), "1337")); @@ -64,19 +64,19 @@ TEST_IMPL(error_message) { TEST_IMPL(sys_error) { #if defined(_WIN32) - ASSERT(uv_translate_sys_error(ERROR_NOACCESS) == UV_EACCES); - ASSERT(uv_translate_sys_error(ERROR_ELEVATION_REQUIRED) == UV_EACCES); - ASSERT(uv_translate_sys_error(WSAEADDRINUSE) == UV_EADDRINUSE); - ASSERT(uv_translate_sys_error(ERROR_BAD_PIPE) == UV_EPIPE); + ASSERT_EQ(uv_translate_sys_error(ERROR_NOACCESS), UV_EACCES); + ASSERT_EQ(uv_translate_sys_error(ERROR_ELEVATION_REQUIRED), UV_EACCES); + ASSERT_EQ(uv_translate_sys_error(WSAEADDRINUSE), UV_EADDRINUSE); + ASSERT_EQ(uv_translate_sys_error(ERROR_BAD_PIPE), UV_EPIPE); #else - ASSERT(uv_translate_sys_error(EPERM) == UV_EPERM); - ASSERT(uv_translate_sys_error(EPIPE) == UV_EPIPE); - ASSERT(uv_translate_sys_error(EINVAL) == UV_EINVAL); + ASSERT_EQ(uv_translate_sys_error(EPERM), UV_EPERM); + ASSERT_EQ(uv_translate_sys_error(EPIPE), UV_EPIPE); + ASSERT_EQ(uv_translate_sys_error(EINVAL), UV_EINVAL); #endif - ASSERT(uv_translate_sys_error(UV_EINVAL) == UV_EINVAL); - ASSERT(uv_translate_sys_error(UV_ERANGE) == UV_ERANGE); - ASSERT(uv_translate_sys_error(UV_EACCES) == UV_EACCES); - ASSERT(uv_translate_sys_error(0) == 0); + ASSERT_EQ(uv_translate_sys_error(UV_EINVAL), UV_EINVAL); + ASSERT_EQ(uv_translate_sys_error(UV_ERANGE), UV_ERANGE); + ASSERT_EQ(uv_translate_sys_error(UV_EACCES), UV_EACCES); + ASSERT_OK(uv_translate_sys_error(0)); return 0; } diff --git a/deps/uv/test/test-fork.c b/deps/uv/test/test-fork.c index 29ed132a488f7d..fe42f03daf515d 100644 --- a/deps/uv/test/test-fork.c +++ b/deps/uv/test/test-fork.c @@ -51,12 +51,12 @@ static char socket_cb_read_buf[1024]; static void socket_cb(uv_poll_t* poll, int status, int events) { ssize_t cnt; socket_cb_called++; - ASSERT(0 == status); + ASSERT_OK(status); printf("Socket cb got events %d\n", events); - ASSERT(UV_READABLE == (events & UV_READABLE)); + ASSERT_EQ(UV_READABLE, (events & UV_READABLE)); if (socket_cb_read_fd) { cnt = read(socket_cb_read_fd, socket_cb_read_buf, socket_cb_read_size); - ASSERT(cnt == socket_cb_read_size); + ASSERT_EQ(cnt, socket_cb_read_size); } uv_close((uv_handle_t*) poll, NULL); } @@ -66,15 +66,15 @@ static void run_timer_loop_once(void) { uv_loop_t loop; uv_timer_t timer_handle; - ASSERT_EQ(0, uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); timer_cb_called = 0; /* Reset for the child. */ - ASSERT(0 == uv_timer_init(&loop, &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 1, 0)); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); - ASSERT(1 == timer_cb_called); - ASSERT_EQ(0, uv_loop_close(&loop)); + ASSERT_OK(uv_timer_init(&loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 1, 0)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, timer_cb_called); + ASSERT_OK(uv_loop_close(&loop)); } @@ -87,10 +87,10 @@ static void assert_wait_child(pid_t child_pid) { if (waited_pid == -1) { perror("Failed to wait"); } - ASSERT(child_pid == waited_pid); + ASSERT_EQ(child_pid, waited_pid); ASSERT(WIFEXITED(child_stat)); /* Clean exit, not a signal. */ ASSERT(!WIFSIGNALED(child_stat)); - ASSERT(0 == WEXITSTATUS(child_stat)); + ASSERT_OK(WEXITSTATUS(child_stat)); } @@ -109,14 +109,14 @@ TEST_IMPL(fork_timer) { #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* parent */ assert_wait_child(child_pid); } else { /* child */ - ASSERT(0 == uv_loop_fork(uv_default_loop())); + ASSERT_OK(uv_loop_fork(uv_default_loop())); run_timer_loop_once(); } @@ -135,30 +135,30 @@ TEST_IMPL(fork_socketpair) { /* Prime the loop. */ run_timer_loop_once(); - ASSERT(0 == socketpair(AF_UNIX, SOCK_STREAM, 0, socket_fds)); + ASSERT_OK(socketpair(AF_UNIX, SOCK_STREAM, 0, socket_fds)); /* Create the server watcher in the parent, use it in the child. */ - ASSERT(0 == uv_poll_init(uv_default_loop(), &poll_handle, socket_fds[0])); + ASSERT_OK(uv_poll_init(uv_default_loop(), &poll_handle, socket_fds[0])); #if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) child_pid = -1; #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* parent */ - ASSERT(3 == send(socket_fds[1], "hi\n", 3, 0)); + ASSERT_EQ(3, send(socket_fds[1], "hi\n", 3, 0)); assert_wait_child(child_pid); } else { /* child */ - ASSERT(0 == uv_loop_fork(uv_default_loop())); - ASSERT(0 == socket_cb_called); - ASSERT(0 == uv_poll_start(&poll_handle, UV_READABLE, socket_cb)); + ASSERT_OK(uv_loop_fork(uv_default_loop())); + ASSERT_OK(socket_cb_called); + ASSERT_OK(uv_poll_start(&poll_handle, UV_READABLE, socket_cb)); printf("Going to run the loop in the child\n"); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(1 == socket_cb_called); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, socket_cb_called); } MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -176,57 +176,57 @@ TEST_IMPL(fork_socketpair_started) { char sync_buf[1]; uv_poll_t poll_handle; - ASSERT(0 == pipe(sync_pipe)); + ASSERT_OK(pipe(sync_pipe)); /* Prime the loop. */ run_timer_loop_once(); - ASSERT(0 == socketpair(AF_UNIX, SOCK_STREAM, 0, socket_fds)); + ASSERT_OK(socketpair(AF_UNIX, SOCK_STREAM, 0, socket_fds)); /* Create and start the server watcher in the parent, use it in the child. */ - ASSERT(0 == uv_poll_init(uv_default_loop(), &poll_handle, socket_fds[0])); - ASSERT(0 == uv_poll_start(&poll_handle, UV_READABLE, socket_cb)); + ASSERT_OK(uv_poll_init(uv_default_loop(), &poll_handle, socket_fds[0])); + ASSERT_OK(uv_poll_start(&poll_handle, UV_READABLE, socket_cb)); /* Run the loop AFTER the poll watcher is registered to make sure it gets passed to the kernel. Use NOWAIT and expect a non-zero return to prove the poll watcher is active. */ - ASSERT(1 == uv_run(uv_default_loop(), UV_RUN_NOWAIT)); + ASSERT_EQ(1, uv_run(uv_default_loop(), UV_RUN_NOWAIT)); #if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) child_pid = -1; #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* parent */ - ASSERT(0 == uv_poll_stop(&poll_handle)); + ASSERT_OK(uv_poll_stop(&poll_handle)); uv_close((uv_handle_t*)&poll_handle, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == socket_cb_called); - ASSERT(1 == write(sync_pipe[1], "1", 1)); /* alert child */ - ASSERT(3 == send(socket_fds[1], "hi\n", 3, 0)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(socket_cb_called); + ASSERT_EQ(1, write(sync_pipe[1], "1", 1)); /* alert child */ + ASSERT_EQ(3, send(socket_fds[1], "hi\n", 3, 0)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == socket_cb_called); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(socket_cb_called); assert_wait_child(child_pid); } else { /* child */ printf("Child is %d\n", getpid()); - ASSERT(1 == read(sync_pipe[0], sync_buf, 1)); /* wait for parent */ - ASSERT(0 == uv_loop_fork(uv_default_loop())); - ASSERT(0 == socket_cb_called); + ASSERT_EQ(1, read(sync_pipe[0], sync_buf, 1)); /* wait for parent */ + ASSERT_OK(uv_loop_fork(uv_default_loop())); + ASSERT_OK(socket_cb_called); printf("Going to run the loop in the child\n"); socket_cb_read_fd = socket_fds[0]; socket_cb_read_size = 3; - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(1 == socket_cb_called); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, socket_cb_called); printf("Buf %s\n", socket_cb_read_buf); - ASSERT(0 == strcmp("hi\n", socket_cb_read_buf)); + ASSERT_OK(strcmp("hi\n", socket_cb_read_buf)); } MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -253,41 +253,43 @@ TEST_IMPL(fork_signal_to_child) { fork_signal_cb_called = 0; /* reset */ - ASSERT(0 == pipe(sync_pipe)); + ASSERT_OK(pipe(sync_pipe)); /* Prime the loop. */ run_timer_loop_once(); - ASSERT(0 == uv_signal_init(uv_default_loop(), &signal_handle)); - ASSERT(0 == uv_signal_start(&signal_handle, fork_signal_to_child_cb, SIGUSR1)); + ASSERT_OK(uv_signal_init(uv_default_loop(), &signal_handle)); + ASSERT_OK(uv_signal_start(&signal_handle, + fork_signal_to_child_cb, + SIGUSR1)); #if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) child_pid = -1; #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* parent */ - ASSERT(1 == read(sync_pipe[0], sync_buf, 1)); /* wait for child */ - ASSERT(0 == kill(child_pid, SIGUSR1)); + ASSERT_EQ(1, read(sync_pipe[0], sync_buf, 1)); /* wait for child */ + ASSERT_OK(kill(child_pid, SIGUSR1)); /* Run the loop, make sure we don't get the signal. */ printf("Running loop in parent\n"); uv_unref((uv_handle_t*)&signal_handle); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_NOWAIT)); - ASSERT(0 == fork_signal_cb_called); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_NOWAIT)); + ASSERT_OK(fork_signal_cb_called); printf("Waiting for child in parent\n"); assert_wait_child(child_pid); } else { /* child */ - ASSERT(0 == uv_loop_fork(uv_default_loop())); - ASSERT(1 == write(sync_pipe[1], "1", 1)); /* alert parent */ + ASSERT_OK(uv_loop_fork(uv_default_loop())); + ASSERT_EQ(1, write(sync_pipe[1], "1", 1)); /* alert parent */ /* Get the signal. */ - ASSERT(0 != uv_loop_alive(uv_default_loop())); + ASSERT_NE(0, uv_loop_alive(uv_default_loop())); printf("Running loop in child\n"); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); - ASSERT(SIGUSR1 == fork_signal_cb_called); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_EQ(SIGUSR1, fork_signal_cb_called); } MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -308,47 +310,49 @@ TEST_IMPL(fork_signal_to_child_closed) { fork_signal_cb_called = 0; /* reset */ - ASSERT(0 == pipe(sync_pipe)); - ASSERT(0 == pipe(sync_pipe2)); + ASSERT_OK(pipe(sync_pipe)); + ASSERT_OK(pipe(sync_pipe2)); /* Prime the loop. */ run_timer_loop_once(); - ASSERT(0 == uv_signal_init(uv_default_loop(), &signal_handle)); - ASSERT(0 == uv_signal_start(&signal_handle, fork_signal_to_child_cb, SIGUSR1)); + ASSERT_OK(uv_signal_init(uv_default_loop(), &signal_handle)); + ASSERT_OK(uv_signal_start(&signal_handle, + fork_signal_to_child_cb, + SIGUSR1)); #if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) child_pid = -1; #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* parent */ printf("Wating on child in parent\n"); - ASSERT(1 == read(sync_pipe[0], sync_buf, 1)); /* wait for child */ + ASSERT_EQ(1, read(sync_pipe[0], sync_buf, 1)); /* wait for child */ printf("Parent killing child\n"); - ASSERT(0 == kill(child_pid, SIGUSR1)); + ASSERT_OK(kill(child_pid, SIGUSR1)); /* Run the loop, make sure we don't get the signal. */ printf("Running loop in parent\n"); uv_unref((uv_handle_t*)&signal_handle); /* so the loop can exit; we *shouldn't* get any signals */ run_timer_loop_once(); /* but while we share a pipe, we do, so have something active. */ - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); printf("Signal in parent %d\n", fork_signal_cb_called); - ASSERT(0 == fork_signal_cb_called); - ASSERT(1 == write(sync_pipe2[1], "1", 1)); /* alert child */ + ASSERT_OK(fork_signal_cb_called); + ASSERT_EQ(1, write(sync_pipe2[1], "1", 1)); /* alert child */ printf("Waiting for child in parent\n"); assert_wait_child(child_pid); } else { /* Child. Our signal handler should still be installed. */ - ASSERT(0 == uv_loop_fork(uv_default_loop())); + ASSERT_OK(uv_loop_fork(uv_default_loop())); printf("Checking loop in child\n"); - ASSERT(0 != uv_loop_alive(uv_default_loop())); + ASSERT_NE(0, uv_loop_alive(uv_default_loop())); printf("Alerting parent in child\n"); - ASSERT(1 == write(sync_pipe[1], "1", 1)); /* alert parent */ + ASSERT_EQ(1, write(sync_pipe[1], "1", 1)); /* alert parent */ /* Don't run the loop. Wait for the parent to call us */ printf("Waiting on parent in child\n"); /* Wait for parent. read may fail if the parent tripped an ASSERT @@ -356,7 +360,7 @@ TEST_IMPL(fork_signal_to_child_closed) { */ r = read(sync_pipe2[0], sync_buf, 1); ASSERT(-1 <= r && r <= 1); - ASSERT(0 == fork_signal_cb_called); + ASSERT_OK(fork_signal_cb_called); printf("Exiting child \n"); /* Note that we're deliberately not running the loop * in the child, and also not closing the loop's handles, @@ -371,6 +375,47 @@ TEST_IMPL(fork_signal_to_child_closed) { return 0; } +static void fork_signal_cb(uv_signal_t* h, int s) { + fork_signal_cb_called = s; +} +static void empty_close_cb(uv_handle_t* h){} + +TEST_IMPL(fork_close_signal_in_child) { + uv_loop_t loop; + uv_signal_t signal_handle; + pid_t child_pid; + + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_OK(uv_signal_init(&loop, &signal_handle)); + ASSERT_OK(uv_signal_start(&signal_handle, &fork_signal_cb, SIGHUP)); + + ASSERT_OK(kill(getpid(), SIGHUP)); + child_pid = fork(); + ASSERT_NE(child_pid, -1); + ASSERT_OK(fork_signal_cb_called); + + if (!child_pid) { + uv_loop_fork(&loop); + uv_close((uv_handle_t*)&signal_handle, &empty_close_cb); + uv_run(&loop, UV_RUN_DEFAULT); + /* Child doesn't receive the signal */ + ASSERT_OK(fork_signal_cb_called); + } else { + /* Parent. Runing once to receive the signal */ + uv_run(&loop, UV_RUN_ONCE); + ASSERT_EQ(SIGHUP, fork_signal_cb_called); + + /* loop should stop after closing the only handle */ + uv_close((uv_handle_t*)&signal_handle, &empty_close_cb); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); + + assert_wait_child(child_pid); + } + + MAKE_VALGRIND_HAPPY(&loop); + return 0; +} + static void create_file(const char* name) { int r; @@ -378,11 +423,11 @@ static void create_file(const char* name) { uv_fs_t req; r = uv_fs_open(NULL, &req, name, O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); file = r; uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); } @@ -394,17 +439,17 @@ static void touch_file(const char* name) { uv_buf_t buf; r = uv_fs_open(NULL, &req, name, O_RDWR, 0, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); file = r; uv_fs_req_cleanup(&req); buf = uv_buf_init("foo", 4); r = uv_fs_write(NULL, &req, file, &buf, 1, -1, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); } @@ -424,11 +469,11 @@ static void fs_event_cb_file_current_dir(uv_fs_event_t* handle, const char* filename, int events, int status) { - ASSERT(fs_event_cb_called == 0); + ASSERT_OK(fs_event_cb_called); ++fs_event_cb_called; - ASSERT(status == 0); + ASSERT_OK(status); #if defined(__APPLE__) || defined(__linux__) - ASSERT(strcmp(filename, "watch_file") == 0); + ASSERT_OK(strcmp(filename, "watch_file")); #else ASSERT(filename == NULL || strcmp(filename, "watch_file") == 0); #endif @@ -446,28 +491,28 @@ static void assert_watch_file_current_dir(uv_loop_t* const loop, int file_or_dir create_file("watch_file"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); /* watching a dir is the only way to get fsevents involved on apple platforms */ r = uv_fs_event_start(&fs_event, fs_event_cb_file_current_dir, file_or_dir == 1 ? "." : "watch_file", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb_touch, 100, 0); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(timer_cb_touch_called == 0); - ASSERT(fs_event_cb_called == 0); + ASSERT_OK(timer_cb_touch_called); + ASSERT_OK(fs_event_cb_called); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(timer_cb_touch_called == 1); - ASSERT(fs_event_cb_called == 1); + ASSERT_EQ(1, timer_cb_touch_called); + ASSERT_EQ(1, fs_event_cb_called); /* Cleanup */ remove("watch_file"); @@ -492,7 +537,7 @@ static int _do_fork_fs_events_child(int file_or_dir) { #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* parent */ @@ -508,10 +553,10 @@ static int _do_fork_fs_events_child(int file_or_dir) { uv_loop_init(&loop); printf("Child first watch\n"); assert_watch_file_current_dir(&loop, file_or_dir); - ASSERT(0 == uv_loop_close(&loop)); + ASSERT_OK(uv_loop_close(&loop)); printf("Child second watch default loop\n"); /* Ee can watch in the default loop. */ - ASSERT(0 == uv_loop_fork(uv_default_loop())); + ASSERT_OK(uv_loop_fork(uv_default_loop())); /* On some platforms (OS X), if we don't update the time now, * the timer cb fires before the event loop enters uv__io_poll, * instead of after, meaning we don't see the change! This may be @@ -524,7 +569,7 @@ static int _do_fork_fs_events_child(int file_or_dir) { especially important on Apple platforms where if we're not careful trying to touch the CFRunLoop, even just to shut it down, that we allocated in the FS_TEST_DIR case would crash. */ - ASSERT(0 == uv_loop_close(uv_default_loop())); + ASSERT_OK(uv_loop_close(uv_default_loop())); printf("Exiting child \n"); } @@ -587,40 +632,40 @@ TEST_IMPL(fork_fs_events_file_parent_child) { create_file("watch_file"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_file_current_dir, "watch_file", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); #if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) child_pid = -1; #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* parent */ assert_wait_child(child_pid); } else { /* child */ printf("Running child\n"); - ASSERT(0 == uv_loop_fork(loop)); + ASSERT_OK(uv_loop_fork(loop)); r = uv_timer_start(&timer, timer_cb_touch, 100, 0); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(timer_cb_touch_called == 0); - ASSERT(fs_event_cb_called == 0); + ASSERT_OK(timer_cb_touch_called); + ASSERT_OK(fs_event_cb_called); printf("Running loop in child \n"); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(timer_cb_touch_called == 1); - ASSERT(fs_event_cb_called == 1); + ASSERT_EQ(1, timer_cb_touch_called); + ASSERT_EQ(1, fs_event_cb_called); /* Cleanup */ remove("watch_file"); @@ -646,7 +691,7 @@ static void work_cb(uv_work_t* req) { static void after_work_cb(uv_work_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); after_work_cb_count++; } @@ -655,16 +700,16 @@ static void assert_run_work(uv_loop_t* const loop) { uv_work_t work_req; int r; - ASSERT(work_cb_count == 0); - ASSERT(after_work_cb_count == 0); + ASSERT_OK(work_cb_count); + ASSERT_OK(after_work_cb_count); printf("Queue in %d\n", getpid()); r = uv_queue_work(loop, &work_req, work_cb, after_work_cb); - ASSERT(r == 0); + ASSERT_OK(r); printf("Running in %d\n", getpid()); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(work_cb_count == 1); - ASSERT(after_work_cb_count == 1); + ASSERT_EQ(1, work_cb_count); + ASSERT_EQ(1, after_work_cb_count); /* cleanup */ work_cb_count = 0; @@ -691,7 +736,7 @@ TEST_IMPL(fork_threadpool_queue_work_simple) { #else child_pid = fork(); #endif - ASSERT(child_pid != -1); + ASSERT_NE(child_pid, -1); if (child_pid != 0) { /* Parent. We can still run work. */ @@ -706,7 +751,7 @@ TEST_IMPL(fork_threadpool_queue_work_simple) { uv_loop_close(&loop); printf("Child second watch default loop\n"); /* We can work in the default loop. */ - ASSERT(0 == uv_loop_fork(uv_default_loop())); + ASSERT_OK(uv_loop_fork(uv_default_loop())); assert_run_work(uv_default_loop()); printf("Exiting child \n"); } diff --git a/deps/uv/test/test-fs-copyfile.c b/deps/uv/test/test-fs-copyfile.c index d7f04cf4cddea8..3f159aeb68fa89 100644 --- a/deps/uv/test/test-fs-copyfile.c +++ b/deps/uv/test/test-fs-copyfile.c @@ -48,19 +48,19 @@ static void handle_result(uv_fs_t* req) { uint64_t mode; int r; - ASSERT(req->fs_type == UV_FS_COPYFILE); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_COPYFILE); + ASSERT_OK(req->result); /* Verify that the file size and mode are the same. */ r = uv_fs_stat(NULL, &stat_req, req->path, NULL); - ASSERT(r == 0); + ASSERT_OK(r); size = stat_req.statbuf.st_size; mode = stat_req.statbuf.st_mode; uv_fs_req_cleanup(&stat_req); r = uv_fs_stat(NULL, &stat_req, dst, NULL); - ASSERT(r == 0); - ASSERT(stat_req.statbuf.st_size == size); - ASSERT(stat_req.statbuf.st_mode == mode); + ASSERT_OK(r); + ASSERT_EQ(stat_req.statbuf.st_size, size); + ASSERT_EQ(stat_req.statbuf.st_mode, mode); uv_fs_req_cleanup(&stat_req); uv_fs_req_cleanup(req); result_check_count++; @@ -77,7 +77,7 @@ static void touch_file(const char* name, unsigned int size) { r = uv_fs_open(NULL, &req, name, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR, NULL); uv_fs_req_cleanup(&req); - ASSERT(r >= 0); + ASSERT_GE(r, 0); file = r; buf = uv_buf_init("a", 1); @@ -86,12 +86,12 @@ static void touch_file(const char* name, unsigned int size) { for (i = 0; i < size; i++) { r = uv_fs_write(NULL, &req, file, &buf, 1, i, NULL); uv_fs_req_cleanup(&req); - ASSERT(r >= 0); + ASSERT_GE(r, 0); } r = uv_fs_close(NULL, &req, file, NULL); uv_fs_req_cleanup(&req); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -105,102 +105,102 @@ TEST_IMPL(fs_copyfile) { /* Fails with EINVAL if bad flags are passed. */ r = uv_fs_copyfile(NULL, &req, src, dst, -1, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_fs_req_cleanup(&req); /* Fails with ENOENT if source does not exist. */ unlink(src); unlink(dst); r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); - ASSERT(req.result == UV_ENOENT); - ASSERT(r == UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); + ASSERT_EQ(r, UV_ENOENT); uv_fs_req_cleanup(&req); /* The destination should not exist. */ r = uv_fs_stat(NULL, &req, dst, NULL); - ASSERT(r != 0); + ASSERT(r); uv_fs_req_cleanup(&req); /* Succeeds if src and dst files are identical. */ touch_file(src, 12); r = uv_fs_copyfile(NULL, &req, src, src, 0, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); /* Verify that the src file did not get truncated. */ r = uv_fs_stat(NULL, &req, src, NULL); - ASSERT_EQ(r, 0); - ASSERT_EQ(req.statbuf.st_size, 12); + ASSERT_OK(r); + ASSERT_EQ(12, req.statbuf.st_size); uv_fs_req_cleanup(&req); unlink(src); /* Copies file synchronously. Creates new file. */ unlink(dst); r = uv_fs_copyfile(NULL, &req, fixture, dst, 0, NULL); - ASSERT(r == 0); + ASSERT_OK(r); handle_result(&req); /* Copies a file of size zero. */ unlink(dst); touch_file(src, 0); r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); - ASSERT(r == 0); + ASSERT_OK(r); handle_result(&req); /* Copies file synchronously. Overwrites existing file. */ r = uv_fs_copyfile(NULL, &req, fixture, dst, 0, NULL); - ASSERT(r == 0); + ASSERT_OK(r); handle_result(&req); /* Fails to overwrites existing file. */ - ASSERT_EQ(uv_fs_chmod(NULL, &req, dst, 0644, NULL), 0); + ASSERT_OK(uv_fs_chmod(NULL, &req, dst, 0644, NULL)); uv_fs_req_cleanup(&req); r = uv_fs_copyfile(NULL, &req, fixture, dst, UV_FS_COPYFILE_EXCL, NULL); - ASSERT(r == UV_EEXIST); + ASSERT_EQ(r, UV_EEXIST); uv_fs_req_cleanup(&req); /* Truncates when an existing destination is larger than the source file. */ - ASSERT_EQ(uv_fs_chmod(NULL, &req, dst, 0644, NULL), 0); + ASSERT_OK(uv_fs_chmod(NULL, &req, dst, 0644, NULL)); uv_fs_req_cleanup(&req); touch_file(src, 1); r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); handle_result(&req); /* Copies a larger file. */ unlink(dst); touch_file(src, 4096 * 2); r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); - ASSERT(r == 0); + ASSERT_OK(r); handle_result(&req); unlink(src); /* Copies file asynchronously */ unlink(dst); r = uv_fs_copyfile(loop, &req, fixture, dst, 0, handle_result); - ASSERT(r == 0); - ASSERT(result_check_count == 5); + ASSERT_OK(r); + ASSERT_EQ(5, result_check_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(result_check_count == 6); + ASSERT_EQ(6, result_check_count); /* Ensure file is user-writable (not copied from src). */ - ASSERT_EQ(uv_fs_chmod(NULL, &req, dst, 0644, NULL), 0); + ASSERT_OK(uv_fs_chmod(NULL, &req, dst, 0644, NULL)); uv_fs_req_cleanup(&req); /* If the flags are invalid, the loop should not be kept open */ unlink(dst); r = uv_fs_copyfile(loop, &req, fixture, dst, -1, fail_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(loop, UV_RUN_DEFAULT); /* Copies file using UV_FS_COPYFILE_FICLONE. */ unlink(dst); r = uv_fs_copyfile(NULL, &req, fixture, dst, UV_FS_COPYFILE_FICLONE, NULL); - ASSERT(r == 0); + ASSERT_OK(r); handle_result(&req); /* Copies file using UV_FS_COPYFILE_FICLONE_FORCE. */ unlink(dst); r = uv_fs_copyfile(NULL, &req, fixture, dst, UV_FS_COPYFILE_FICLONE_FORCE, NULL); - ASSERT(r <= 0); + ASSERT_LE(r, 0); if (r == 0) handle_result(&req); @@ -213,8 +213,8 @@ TEST_IMPL(fs_copyfile) { r = uv_fs_copyfile(NULL, &req, fixture, dst, 0, NULL); /* On IBMi PASE, qsecofr users can overwrite read-only files */ # ifndef __PASE__ - ASSERT(req.result == UV_EACCES); - ASSERT(r == UV_EACCES); + ASSERT_EQ(req.result, UV_EACCES); + ASSERT_EQ(r, UV_EACCES); # endif uv_fs_req_cleanup(&req); #endif diff --git a/deps/uv/test/test-fs-event.c b/deps/uv/test/test-fs-event.c index 9f231ebfc01e9a..7b5c0d8eb3d967 100644 --- a/deps/uv/test/test-fs-event.c +++ b/deps/uv/test/test-fs-event.c @@ -81,11 +81,11 @@ static void create_file(const char* name) { uv_fs_t req; r = uv_fs_open(NULL, &req, name, O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); file = r; uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); } @@ -96,17 +96,17 @@ static void touch_file(const char* name) { uv_buf_t buf; r = uv_fs_open(NULL, &req, name, O_RDWR, 0, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); file = r; uv_fs_req_cleanup(&req); buf = uv_buf_init("foo", 4); r = uv_fs_write(NULL, &req, file, &buf, 1, -1, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); } @@ -125,15 +125,15 @@ static void fail_cb(uv_fs_event_t* handle, static void fs_event_cb_dir(uv_fs_event_t* handle, const char* filename, int events, int status) { ++fs_event_cb_called; - ASSERT(handle == &fs_event); - ASSERT(status == 0); - ASSERT(events == UV_CHANGE); + ASSERT_PTR_EQ(handle, &fs_event); + ASSERT_OK(status); + ASSERT_EQ(events, UV_CHANGE); #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) - ASSERT(strcmp(filename, "file1") == 0); + ASSERT_OK(strcmp(filename, "file1")); #else ASSERT(filename == NULL || strcmp(filename, "file1") == 0); #endif - ASSERT(0 == uv_fs_event_stop(handle)); + ASSERT_OK(uv_fs_event_stop(handle)); uv_close((uv_handle_t*)handle, close_cb); } @@ -148,7 +148,7 @@ static const char* fs_event_get_filename(int i) { static void fs_event_create_files(uv_timer_t* handle) { /* Make sure we're not attempting to create files we do not intend */ - ASSERT(fs_event_created < fs_event_file_count); + ASSERT_LT(fs_event_created, fs_event_file_count); /* Create the file */ create_file(fs_event_get_filename(fs_event_created)); @@ -156,7 +156,7 @@ static void fs_event_create_files(uv_timer_t* handle) { if (++fs_event_created < fs_event_file_count) { /* Create another file on a different event loop tick. We do it this way * to avoid fs events coalescing into one fs event. */ - ASSERT_EQ(0, uv_timer_start(&timer, fs_event_create_files, 100, 0)); + ASSERT_OK(uv_timer_start(&timer, fs_event_create_files, 100, 0)); } } @@ -170,19 +170,19 @@ static void fs_event_unlink_files(uv_timer_t* handle) { for (i = 0; i < 16; i++) { r = remove(fs_event_get_filename(i)); if (handle != NULL) - ASSERT(r == 0); + ASSERT_OK(r); } } else { /* Make sure we're not attempting to remove files we do not intend */ - ASSERT(fs_event_removed < fs_event_file_count); + ASSERT_LT(fs_event_removed, fs_event_file_count); /* Remove the file */ - ASSERT(0 == remove(fs_event_get_filename(fs_event_removed))); + ASSERT_OK(remove(fs_event_get_filename(fs_event_removed))); if (++fs_event_removed < fs_event_file_count) { /* Remove another file on a different event loop tick. We do it this way * to avoid fs events coalescing into one fs event. */ - ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files, 1, 0)); + ASSERT_OK(uv_timer_start(&timer, fs_event_unlink_files, 1, 0)); } } } @@ -192,19 +192,19 @@ static void fs_event_cb_dir_multi_file(uv_fs_event_t* handle, int events, int status) { fs_event_cb_called++; - ASSERT(handle == &fs_event); - ASSERT(status == 0); + ASSERT_PTR_EQ(handle, &fs_event); + ASSERT_OK(status); ASSERT(events == UV_CHANGE || events == UV_RENAME); #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) - ASSERT(strncmp(filename, file_prefix, sizeof(file_prefix) - 1) == 0); + ASSERT_OK(strncmp(filename, file_prefix, sizeof(file_prefix) - 1)); #else - ASSERT(filename == NULL || - strncmp(filename, file_prefix, sizeof(file_prefix) - 1) == 0); + ASSERT_NE(filename == NULL || + strncmp(filename, file_prefix, sizeof(file_prefix) - 1) == 0, 0); #endif if (fs_event_created + fs_event_removed == fs_event_file_count) { /* Once we've processed all create events, delete all files */ - ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files, 1, 0)); + ASSERT_OK(uv_timer_start(&timer, fs_event_unlink_files, 1, 0)); } else if (fs_event_cb_called == 2 * fs_event_file_count) { /* Once we've processed all create and delete events, stop watching */ uv_close((uv_handle_t*) &timer, close_cb); @@ -224,7 +224,7 @@ static const char* fs_event_get_filename_in_subdir(int i) { static void fs_event_create_files_in_subdir(uv_timer_t* handle) { /* Make sure we're not attempting to create files we do not intend */ - ASSERT(fs_event_created < fs_event_file_count); + ASSERT_LT(fs_event_created, fs_event_file_count); /* Create the file */ create_file(fs_event_get_filename_in_subdir(fs_event_created)); @@ -232,8 +232,7 @@ static void fs_event_create_files_in_subdir(uv_timer_t* handle) { if (++fs_event_created < fs_event_file_count) { /* Create another file on a different event loop tick. We do it this way * to avoid fs events coalescing into one fs event. */ - ASSERT_EQ(0, - uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0)); + ASSERT_OK(uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0)); } } @@ -247,19 +246,22 @@ static void fs_event_unlink_files_in_subdir(uv_timer_t* handle) { for (i = 0; i < 16; i++) { r = remove(fs_event_get_filename_in_subdir(i)); if (handle != NULL) - ASSERT(r == 0); + ASSERT_OK(r); } } else { /* Make sure we're not attempting to remove files we do not intend */ - ASSERT(fs_event_removed < fs_event_file_count); + ASSERT_LT(fs_event_removed, fs_event_file_count); /* Remove the file */ - ASSERT(0 == remove(fs_event_get_filename_in_subdir(fs_event_removed))); + ASSERT_OK(remove(fs_event_get_filename_in_subdir(fs_event_removed))); if (++fs_event_removed < fs_event_file_count) { /* Remove another file on a different event loop tick. We do it this way * to avoid fs events coalescing into one fs event. */ - ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files_in_subdir, 1, 0)); + ASSERT_OK(uv_timer_start(&timer, + fs_event_unlink_files_in_subdir, + 1, + 0)); } } } @@ -283,27 +285,30 @@ static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle, return; fs_multievent_cb_called++; - ASSERT(handle == &fs_event); - ASSERT(status == 0); + ASSERT_PTR_EQ(handle, &fs_event); + ASSERT_OK(status); ASSERT(events == UV_CHANGE || events == UV_RENAME); #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) - ASSERT(strncmp(filename, - file_prefix_in_subdir, - sizeof(file_prefix_in_subdir) - 1) == 0); + ASSERT_OK(strncmp(filename, + file_prefix_in_subdir, + sizeof(file_prefix_in_subdir) - 1)); #else - ASSERT(filename == NULL || - strncmp(filename, - file_prefix_in_subdir, - sizeof(file_prefix_in_subdir) - 1) == 0); + ASSERT_NE(filename == NULL || + strncmp(filename, + file_prefix_in_subdir, + sizeof(file_prefix_in_subdir) - 1) == 0, 0); #endif if (fs_event_created == fs_event_file_count && fs_multievent_cb_called == fs_event_created) { /* Once we've processed all create events, delete all files */ - ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files_in_subdir, 1, 0)); + ASSERT_OK(uv_timer_start(&timer, + fs_event_unlink_files_in_subdir, + 1, + 0)); } else if (fs_multievent_cb_called == 2 * fs_event_file_count) { /* Once we've processed all create and delete events, stop watching */ - ASSERT(fs_event_removed == fs_event_file_count); + ASSERT_EQ(fs_event_removed, fs_event_file_count); uv_close((uv_handle_t*) &timer, close_cb); uv_close((uv_handle_t*) handle, close_cb); } @@ -313,15 +318,15 @@ static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle, static void fs_event_cb_file(uv_fs_event_t* handle, const char* filename, int events, int status) { ++fs_event_cb_called; - ASSERT(handle == &fs_event); - ASSERT(status == 0); - ASSERT(events == UV_CHANGE); + ASSERT_PTR_EQ(handle, &fs_event); + ASSERT_OK(status); + ASSERT_EQ(events, UV_CHANGE); #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) - ASSERT(strcmp(filename, "file2") == 0); + ASSERT_OK(strcmp(filename, "file2")); #else ASSERT(filename == NULL || strcmp(filename, "file2") == 0); #endif - ASSERT(0 == uv_fs_event_stop(handle)); + ASSERT_OK(uv_fs_event_stop(handle)); uv_close((uv_handle_t*)handle, close_cb); } @@ -329,11 +334,11 @@ static void fs_event_cb_file_current_dir(uv_fs_event_t* handle, const char* filename, int events, int status) { ++fs_event_cb_called; - ASSERT(handle == &fs_event); - ASSERT(status == 0); - ASSERT(events == UV_CHANGE); + ASSERT_PTR_EQ(handle, &fs_event); + ASSERT_OK(status); + ASSERT_EQ(events, UV_CHANGE); #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) - ASSERT(strcmp(filename, "watch_file") == 0); + ASSERT_OK(strcmp(filename, "watch_file")); #else ASSERT(filename == NULL || strcmp(filename, "watch_file") == 0); #endif @@ -366,7 +371,7 @@ static void timer_cb_exact(uv_timer_t* handle) { } else { uv_close((uv_handle_t*)handle, NULL); r = uv_fs_event_stop(&fs_event); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &fs_event, NULL); } @@ -384,9 +389,9 @@ static void fs_event_cb_close(uv_fs_event_t* handle, const char* filename, int events, int status) { - ASSERT(status == 0); + ASSERT_OK(status); - ASSERT(fs_event_cb_called < 3); + ASSERT_LT(fs_event_cb_called, 3); ++fs_event_cb_called; if (fs_event_cb_called == 3) { @@ -400,6 +405,8 @@ TEST_IMPL(fs_event_watch_dir) { RETURN_SKIP(NO_FS_EVENTS); #elif defined(__MVS__) RETURN_SKIP("Directory watching not supported on this platform."); +#elif defined(__APPLE__) && defined(__TSAN__) + RETURN_SKIP("Times out under TSAN."); #endif uv_loop_t* loop = uv_default_loop(); @@ -413,18 +420,18 @@ TEST_IMPL(fs_event_watch_dir) { create_dir("watch_dir"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_dir_multi_file, "watch_dir", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, fs_event_create_files, 100, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fs_event_cb_called == fs_event_created + fs_event_removed); - ASSERT(close_cb_called == 2); + ASSERT_EQ(fs_event_cb_called, fs_event_created + fs_event_removed); + ASSERT_EQ(2, close_cb_called); /* Cleanup */ fs_event_unlink_files(NULL); @@ -438,7 +445,9 @@ TEST_IMPL(fs_event_watch_dir) { TEST_IMPL(fs_event_watch_dir_recursive) { -#if defined(__APPLE__) || defined(_WIN32) +#if defined(__APPLE__) && defined(__TSAN__) + RETURN_SKIP("Times out under TSAN."); +#elif defined(__APPLE__) || defined(_WIN32) uv_loop_t* loop; int r; uv_fs_event_t fs_event_root; @@ -454,27 +463,27 @@ TEST_IMPL(fs_event_watch_dir_recursive) { create_dir("watch_dir/subdir"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_dir_multi_file_in_subdir, "watch_dir", UV_FS_EVENT_RECURSIVE); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0); - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 /* Also try to watch the root directory. * This will be noisier, so we're just checking for any couple events to happen. */ r = uv_fs_event_init(loop, &fs_event_root); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event_root, fs_event_cb_close, "/", UV_FS_EVENT_RECURSIVE); - ASSERT(r == 0); + ASSERT_OK(r); #else fs_event_cb_called += 3; close_cb_called += 1; @@ -483,9 +492,9 @@ TEST_IMPL(fs_event_watch_dir_recursive) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fs_multievent_cb_called == fs_event_created + fs_event_removed); - ASSERT(fs_event_cb_called == 3); - ASSERT(close_cb_called == 3); + ASSERT_EQ(fs_multievent_cb_called, fs_event_created + fs_event_removed); + ASSERT_EQ(3, fs_event_cb_called); + ASSERT_EQ(3, close_cb_called); /* Cleanup */ fs_event_unlink_files_in_subdir(NULL); @@ -522,19 +531,19 @@ TEST_IMPL(fs_event_watch_dir_short_path) { has_shortnames = uv_fs_stat(NULL, &req, "watch_~1", NULL) != UV_ENOENT; if (has_shortnames) { r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_dir, "watch_~1", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb_file, 100, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fs_event_cb_called == 1); - ASSERT(timer_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, fs_event_cb_called); + ASSERT_EQ(1, timer_cb_called); + ASSERT_EQ(1, close_cb_called); } /* Cleanup */ @@ -568,19 +577,19 @@ TEST_IMPL(fs_event_watch_file) { create_file("watch_dir/file2"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_file, "watch_dir/file2", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb_file, 100, 100); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fs_event_cb_called == 1); - ASSERT(timer_cb_called == 2); - ASSERT(close_cb_called == 2); + ASSERT_EQ(1, fs_event_cb_called); + ASSERT_EQ(2, timer_cb_called); + ASSERT_EQ(2, close_cb_called); /* Cleanup */ remove("watch_dir/file2"); @@ -624,16 +633,16 @@ TEST_IMPL(fs_event_watch_file_exact_path) { #endif r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_fail, "watch_dir/file.jsx", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb_exact, 100, 100); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(timer_cb_exact_called == 2); + ASSERT_OK(r); + ASSERT_EQ(2, timer_cb_exact_called); /* Cleanup */ remove("watch_dir/file.js"); @@ -656,13 +665,13 @@ TEST_IMPL(fs_event_watch_file_twice) { loop = uv_default_loop(); timer.data = watchers; - ASSERT(0 == uv_fs_event_init(loop, watchers + 0)); - ASSERT(0 == uv_fs_event_start(watchers + 0, fail_cb, path, 0)); - ASSERT(0 == uv_fs_event_init(loop, watchers + 1)); - ASSERT(0 == uv_fs_event_start(watchers + 1, fail_cb, path, 0)); - ASSERT(0 == uv_timer_init(loop, &timer)); - ASSERT(0 == uv_timer_start(&timer, timer_cb_watch_twice, 10, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_fs_event_init(loop, watchers + 0)); + ASSERT_OK(uv_fs_event_start(watchers + 0, fail_cb, path, 0)); + ASSERT_OK(uv_fs_event_init(loop, watchers + 1)); + ASSERT_OK(uv_fs_event_start(watchers + 1, fail_cb, path, 0)); + ASSERT_OK(uv_timer_init(loop, &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_cb_watch_twice, 10, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -690,31 +699,31 @@ TEST_IMPL(fs_event_watch_file_current_dir) { #endif r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_file_current_dir, "watch_file", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); timer.data = "watch_file"; r = uv_timer_start(&timer, timer_cb_touch, 1100, 0); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(timer_cb_touch_called == 0); - ASSERT(fs_event_cb_called == 0); - ASSERT(close_cb_called == 0); + ASSERT_OK(timer_cb_touch_called); + ASSERT_OK(fs_event_cb_called); + ASSERT_OK(close_cb_called); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(timer_cb_touch_called == 1); + ASSERT_EQ(1, timer_cb_touch_called); /* FSEvents on macOS sometimes sends one change event, sometimes two. */ ASSERT_NE(0, fs_event_cb_called); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); /* Cleanup */ remove("watch_file"); @@ -737,11 +746,11 @@ TEST_IMPL(fs_event_watch_file_root_dir) { loop = uv_default_loop(); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fail_cb, path, 0); if (r == UV_ENOENT) RETURN_SKIP("bootsect.bak doesn't exist in system root.\n"); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &fs_event, NULL); @@ -765,20 +774,20 @@ TEST_IMPL(fs_event_no_callback_after_close) { create_file("watch_dir/file1"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_file, "watch_dir/file1", 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*)&fs_event, close_cb); touch_file("watch_dir/file1"); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fs_event_cb_called == 0); - ASSERT(close_cb_called == 1); + ASSERT_OK(fs_event_cb_called); + ASSERT_EQ(1, close_cb_called); /* Cleanup */ remove("watch_dir/file1"); @@ -803,19 +812,19 @@ TEST_IMPL(fs_event_no_callback_on_close) { create_file("watch_dir/file1"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_file, "watch_dir/file1", 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*)&fs_event, close_cb); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fs_event_cb_called == 0); - ASSERT(close_cb_called == 1); + ASSERT_OK(fs_event_cb_called); + ASSERT_EQ(1, close_cb_called); /* Cleanup */ remove("watch_dir/file1"); @@ -830,9 +839,9 @@ static void timer_cb(uv_timer_t* handle) { int r; r = uv_fs_event_init(handle->loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_fail, ".", 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*)&fs_event, close_cb); uv_close((uv_handle_t*)handle, close_cb); @@ -850,14 +859,14 @@ TEST_IMPL(fs_event_immediate_close) { loop = uv_default_loop(); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb, 1, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -877,9 +886,9 @@ TEST_IMPL(fs_event_close_with_pending_event) { create_file("watch_dir/file"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_fail, "watch_dir", 0); - ASSERT(r == 0); + ASSERT_OK(r); /* Generate an fs event. */ touch_file("watch_dir/file"); @@ -888,7 +897,7 @@ TEST_IMPL(fs_event_close_with_pending_event) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); /* Clean up */ remove("watch_dir/file"); @@ -911,9 +920,9 @@ TEST_IMPL(fs_event_close_with_pending_delete_event) { create_file("watch_dir/file"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_fail, "watch_dir/file", 0); - ASSERT(r == 0); + ASSERT_OK(r); /* Generate an fs event. */ remove("watch_dir/file"); @@ -927,7 +936,7 @@ TEST_IMPL(fs_event_close_with_pending_delete_event) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); /* Clean up */ remove("watch_dir/"); @@ -941,6 +950,8 @@ TEST_IMPL(fs_event_close_in_callback) { RETURN_SKIP(NO_FS_EVENTS); #elif defined(__MVS__) RETURN_SKIP("Directory watching not supported on this platform."); +#elif defined(__APPLE__) && defined(__TSAN__) + RETURN_SKIP("Times out under TSAN."); #endif uv_loop_t* loop; int r; @@ -951,14 +962,14 @@ TEST_IMPL(fs_event_close_in_callback) { create_dir("watch_dir"); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_close, "watch_dir", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, fs_event_create_files, 100, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); @@ -966,8 +977,8 @@ TEST_IMPL(fs_event_close_in_callback) { uv_run(loop, UV_RUN_ONCE); - ASSERT(close_cb_called == 2); - ASSERT(fs_event_cb_called == 3); + ASSERT_EQ(2, close_cb_called); + ASSERT_EQ(3, fs_event_cb_called); /* Clean up */ fs_event_unlink_files(NULL); @@ -991,21 +1002,21 @@ TEST_IMPL(fs_event_start_and_close) { create_dir("watch_dir"); r = uv_fs_event_init(loop, &fs_event1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event1, fs_event_cb_dir, "watch_dir", 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_init(loop, &fs_event2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event2, fs_event_cb_dir, "watch_dir", 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &fs_event2, close_cb); uv_close((uv_handle_t*) &fs_event1, close_cb); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, close_cb_called); remove("watch_dir/"); MAKE_VALGRIND_HAPPY(loop); @@ -1035,28 +1046,28 @@ TEST_IMPL(fs_event_getpath) { for (i = 0; i < ARRAY_SIZE(watch_dir); i++) { r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); len = sizeof buf; r = uv_fs_event_getpath(&fs_event, buf, &len); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_event_start(&fs_event, fail_cb, watch_dir[i], 0); - ASSERT(r == 0); + ASSERT_OK(r); len = 0; r = uv_fs_event_getpath(&fs_event, buf, &len); - ASSERT(r == UV_ENOBUFS); - ASSERT(len < sizeof buf); /* sanity check */ - ASSERT(len == strlen(watch_dir[i]) + 1); + ASSERT_EQ(r, UV_ENOBUFS); + ASSERT_LT(len, sizeof buf); /* sanity check */ + ASSERT_EQ(len, strlen(watch_dir[i]) + 1); r = uv_fs_event_getpath(&fs_event, buf, &len); - ASSERT(r == 0); - ASSERT(len == strlen(watch_dir[i])); + ASSERT_OK(r); + ASSERT_EQ(len, strlen(watch_dir[i])); ASSERT(strcmp(buf, watch_dir[i]) == 0); r = uv_fs_event_stop(&fs_event); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &fs_event, close_cb); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); close_cb_called = 0; } @@ -1108,43 +1119,43 @@ TEST_IMPL(fs_event_error_reporting) { */ for (i = 0; i < ARRAY_SIZE(loops); i++) { loop = &loops[i]; - ASSERT(0 == uv_loop_init(loop)); + ASSERT_OK(uv_loop_init(loop)); event = &events[i]; timer_cb_called = 0; close_cb_called = 0; - ASSERT(0 == uv_fs_event_init(loop, event)); - ASSERT(0 == uv_fs_event_start(event, - fs_event_error_report_cb, - "watch_dir", - 0)); + ASSERT_OK(uv_fs_event_init(loop, event)); + ASSERT_OK(uv_fs_event_start(event, + fs_event_error_report_cb, + "watch_dir", + 0)); uv_unref((uv_handle_t*) event); /* Let loop run for some time */ - ASSERT(0 == uv_timer_init(loop, &timer)); - ASSERT(0 == uv_timer_start(&timer, timer_cb_nop, 2, 0)); + ASSERT_OK(uv_timer_init(loop, &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_cb_nop, 2, 0)); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(1 == timer_cb_called); - ASSERT(1 == close_cb_called); + ASSERT_EQ(1, timer_cb_called); + ASSERT_EQ(1, close_cb_called); if (fs_event_error_reported != 0) break; } /* At least one loop should fail */ - ASSERT(fs_event_error_reported == UV_EMFILE); + ASSERT_EQ(fs_event_error_reported, UV_EMFILE); /* Stop and close all events, and destroy loops */ do { loop = &loops[i]; event = &events[i]; - ASSERT(0 == uv_fs_event_stop(event)); + ASSERT_OK(uv_fs_event_stop(event)); uv_ref((uv_handle_t*) event); uv_close((uv_handle_t*) event, fs_event_error_report_close_cb); close_cb_called = 0; uv_run(loop, UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); uv_loop_close(loop); } while (i-- != 0); @@ -1175,13 +1186,13 @@ TEST_IMPL(fs_event_watch_invalid_path) { loop = uv_default_loop(); r = uv_fs_event_init(loop, &fs_event); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event, fs_event_cb_file, "<:;", 0); - ASSERT(r != 0); - ASSERT(uv_is_active((uv_handle_t*) &fs_event) == 0); + ASSERT(r); + ASSERT_OK(uv_is_active((uv_handle_t*) &fs_event)); r = uv_fs_event_start(&fs_event, fs_event_cb_file, "", 0); - ASSERT(r != 0); - ASSERT(uv_is_active((uv_handle_t*) &fs_event) == 0); + ASSERT(r); + ASSERT_OK(uv_is_active((uv_handle_t*) &fs_event)); MAKE_VALGRIND_HAPPY(loop); return 0; } @@ -1206,24 +1217,24 @@ TEST_IMPL(fs_event_stop_in_cb) { remove(path); create_file(path); - ASSERT_EQ(0, uv_fs_event_init(uv_default_loop(), &fs)); - ASSERT_EQ(0, uv_fs_event_start(&fs, fs_event_cb_stop, path, 0)); + ASSERT_OK(uv_fs_event_init(uv_default_loop(), &fs)); + ASSERT_OK(uv_fs_event_start(&fs, fs_event_cb_stop, path, 0)); /* Note: timer_cb_touch() closes the handle. */ timer.data = path; - ASSERT_EQ(0, uv_timer_init(uv_default_loop(), &timer)); - ASSERT_EQ(0, uv_timer_start(&timer, timer_cb_touch, 100, 0)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_cb_touch, 100, 0)); - ASSERT_EQ(0, fs_event_cb_stop_calls); - ASSERT_EQ(0, timer_cb_touch_called); + ASSERT_OK(fs_event_cb_stop_calls); + ASSERT_OK(timer_cb_touch_called); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); ASSERT_EQ(1, fs_event_cb_stop_calls); ASSERT_EQ(1, timer_cb_touch_called); uv_close((uv_handle_t*) &fs, NULL); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); ASSERT_EQ(1, fs_event_cb_stop_calls); remove(path); diff --git a/deps/uv/test/test-fs-fd-hash.c b/deps/uv/test/test-fs-fd-hash.c index 8b4bc0351b334e..4ed3d548e62171 100644 --- a/deps/uv/test/test-fs-fd-hash.c +++ b/deps/uv/test/test-fs-fd-hash.c @@ -43,7 +43,7 @@ void assert_nonexistent(int fd) { void assert_existent(int fd) { struct uv__fd_info_s info = { 0 }; ASSERT(uv__fd_hash_get(fd, &info)); - ASSERT(info.flags == fd + FD_DIFF); + ASSERT_EQ(info.flags, fd + FD_DIFF); } void assert_insertion(int fd) { @@ -58,7 +58,7 @@ void assert_removal(int fd) { struct uv__fd_info_s info = { 0 }; assert_existent(fd); uv__fd_hash_remove(fd, &info); - ASSERT(info.flags == fd + FD_DIFF); + ASSERT_EQ(info.flags, fd + FD_DIFF); assert_nonexistent(fd); } @@ -106,7 +106,7 @@ TEST_IMPL(fs_fd_hash) { { struct uv__fd_info_s info = { 0 }; ASSERT(uv__fd_hash_get(0, &info)); - ASSERT(info.flags == FD_DIFF + FD_DIFF); + ASSERT_EQ(info.flags, FD_DIFF + FD_DIFF); } { /* Leave as it was, will be again tested below */ diff --git a/deps/uv/test/test-fs-open-flags.c b/deps/uv/test/test-fs-open-flags.c index ea9be25afc1593..e64ac20d72b5f4 100644 --- a/deps/uv/test/test-fs-open-flags.c +++ b/deps/uv/test/test-fs-open-flags.c @@ -68,8 +68,8 @@ static void setup(void) { uv_fs_req_cleanup(&rmdir_req); r = uv_fs_mkdir(NULL, &mkdir_req, empty_dir, 0755, NULL); - ASSERT(r == 0); - ASSERT(mkdir_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(mkdir_req.result); uv_fs_req_cleanup(&mkdir_req); } @@ -89,13 +89,13 @@ static void refresh(void) { r = uv_fs_open(NULL, &open_req, empty_file, UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_WRONLY, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req.result, 0); uv_fs_req_cleanup(&open_req); r = uv_fs_close(NULL, &close_req, open_req.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* dummy_file */ @@ -103,19 +103,19 @@ static void refresh(void) { r = uv_fs_open(NULL, &open_req, dummy_file, UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_WRONLY, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req.result, 0); uv_fs_req_cleanup(&open_req); iov = uv_buf_init("a", 1); r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == 1); - ASSERT(write_req.result == 1); + ASSERT_EQ(1, r); + ASSERT_EQ(1, write_req.result); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); } @@ -131,14 +131,14 @@ static void openFail(char *file, int error) { refresh(); r = uv_fs_open(NULL, &open_req, file, flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r == error); - ASSERT(open_req.result == error); + ASSERT_EQ(r, error); + ASSERT_EQ(open_req.result, error); uv_fs_req_cleanup(&open_req); /* Ensure the first call does not create the file */ r = uv_fs_open(NULL, &open_req, file, flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r == error); - ASSERT(open_req.result == error); + ASSERT_EQ(r, error); + ASSERT_EQ(open_req.result, error); uv_fs_req_cleanup(&open_req); cleanup(); @@ -150,8 +150,8 @@ static void refreshOpen(char *file) { refresh(); r = uv_fs_open(NULL, &open_req, file, flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req.result, 0); uv_fs_req_cleanup(&open_req); } @@ -162,37 +162,37 @@ static void writeExpect(char *file, char *expected, int size) { iov = uv_buf_init("b", 1); r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == 1); - ASSERT(write_req.result == 1); + ASSERT_EQ(1, r); + ASSERT_EQ(1, write_req.result); uv_fs_req_cleanup(&write_req); iov = uv_buf_init("c", 1); r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == 1); - ASSERT(write_req.result == 1); + ASSERT_EQ(1, r); + ASSERT_EQ(1, write_req.result); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Check contents */ r = uv_fs_open(NULL, &open_req, file, UV_FS_O_RDONLY, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req.result, 0); uv_fs_req_cleanup(&open_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == size); - ASSERT(read_req.result == size); - ASSERT(strncmp(buf, expected, size) == 0); + ASSERT_EQ(r, size); + ASSERT_EQ(read_req.result, size); + ASSERT_OK(strncmp(buf, expected, size)); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); cleanup(); @@ -205,19 +205,19 @@ static void writeFail(char *file, int error) { iov = uv_buf_init("z", 1); r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == error); - ASSERT(write_req.result == error); + ASSERT_EQ(r, error); + ASSERT_EQ(write_req.result, error); uv_fs_req_cleanup(&write_req); iov = uv_buf_init("z", 1); r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == error); - ASSERT(write_req.result == error); + ASSERT_EQ(r, error); + ASSERT_EQ(write_req.result, error); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); cleanup(); @@ -230,14 +230,14 @@ static void readExpect(char *file, char *expected, int size) { iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == size); - ASSERT(read_req.result == size); - ASSERT(strncmp(buf, expected, size) == 0); + ASSERT_EQ(r, size); + ASSERT_EQ(read_req.result, size); + ASSERT_OK(strncmp(buf, expected, size)); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); cleanup(); @@ -250,19 +250,19 @@ static void readFail(char *file, int error) { iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == error); - ASSERT(read_req.result == error); + ASSERT_EQ(r, error); + ASSERT_EQ(read_req.result, error); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); - ASSERT(r == error); - ASSERT(read_req.result == error); + ASSERT_EQ(r, error); + ASSERT_EQ(read_req.result, error); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); cleanup(); diff --git a/deps/uv/test/test-fs-poll.c b/deps/uv/test/test-fs-poll.c index af486023d10c87..5f95baf3d3f464 100644 --- a/deps/uv/test/test-fs-poll.c +++ b/deps/uv/test/test-fs-poll.c @@ -103,44 +103,44 @@ static void poll_cb(uv_fs_poll_t* handle, memset(&zero_statbuf, 0, sizeof(zero_statbuf)); - ASSERT(handle == &poll_handle); - ASSERT(1 == uv_is_active((uv_handle_t*) handle)); + ASSERT_PTR_EQ(handle, &poll_handle); + ASSERT_EQ(1, uv_is_active((uv_handle_t*) handle)); ASSERT_NOT_NULL(prev); ASSERT_NOT_NULL(curr); switch (poll_cb_called++) { case 0: - ASSERT(status == UV_ENOENT); - ASSERT(0 == memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); - ASSERT(0 == memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_EQ(status, UV_ENOENT); + ASSERT_OK(memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_OK(memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); touch_file(FIXTURE); break; case 1: - ASSERT(status == 0); - ASSERT(0 == memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); - ASSERT(0 != memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 20, 0)); + ASSERT_OK(status); + ASSERT_OK(memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_NE(0, memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 20, 0)); break; case 2: - ASSERT(status == 0); - ASSERT(0 != memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); - ASSERT(0 != memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 200, 0)); + ASSERT_OK(status); + ASSERT_NE(0, memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_NE(0, memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 200, 0)); break; case 3: - ASSERT(status == 0); - ASSERT(0 != memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); - ASSERT(0 != memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_OK(status); + ASSERT_NE(0, memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_NE(0, memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); remove(FIXTURE); break; case 4: - ASSERT(status == UV_ENOENT); - ASSERT(0 != memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); - ASSERT(0 == memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_EQ(status, UV_ENOENT); + ASSERT_NE(0, memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); + ASSERT_OK(memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); uv_close((uv_handle_t*)handle, close_cb); break; @@ -155,14 +155,14 @@ TEST_IMPL(fs_poll) { remove(FIXTURE); - ASSERT(0 == uv_timer_init(loop, &timer_handle)); - ASSERT(0 == uv_fs_poll_init(loop, &poll_handle)); - ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb, FIXTURE, 100)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_timer_init(loop, &timer_handle)); + ASSERT_OK(uv_fs_poll_init(loop, &poll_handle)); + ASSERT_OK(uv_fs_poll_start(&poll_handle, poll_cb, FIXTURE, 100)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(poll_cb_called == 5); - ASSERT(timer_cb_called == 2); - ASSERT(close_cb_called == 1); + ASSERT_EQ(5, poll_cb_called); + ASSERT_EQ(2, timer_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -176,21 +176,21 @@ TEST_IMPL(fs_poll_getpath) { remove(FIXTURE); - ASSERT(0 == uv_fs_poll_init(loop, &poll_handle)); + ASSERT_OK(uv_fs_poll_init(loop, &poll_handle)); len = sizeof buf; - ASSERT(UV_EINVAL == uv_fs_poll_getpath(&poll_handle, buf, &len)); - ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); + ASSERT_EQ(UV_EINVAL, uv_fs_poll_getpath(&poll_handle, buf, &len)); + ASSERT_OK(uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); len = sizeof buf; - ASSERT(0 == uv_fs_poll_getpath(&poll_handle, buf, &len)); - ASSERT(buf[len - 1] != 0); - ASSERT(buf[len] == '\0'); - ASSERT(0 == memcmp(buf, FIXTURE, len)); + ASSERT_OK(uv_fs_poll_getpath(&poll_handle, buf, &len)); + ASSERT_NE(0, buf[len - 1]); + ASSERT_EQ(buf[len], '\0'); + ASSERT_OK(memcmp(buf, FIXTURE, len)); uv_close((uv_handle_t*) &poll_handle, close_cb); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -203,14 +203,14 @@ TEST_IMPL(fs_poll_close_request) { remove(FIXTURE); - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); - ASSERT(0 == uv_fs_poll_init(&loop, &poll_handle)); - ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); + ASSERT_OK(uv_fs_poll_init(&loop, &poll_handle)); + ASSERT_OK(uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); uv_close((uv_handle_t*) &poll_handle, close_cb); while (close_cb_called == 0) uv_run(&loop, UV_RUN_ONCE); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; @@ -223,18 +223,18 @@ TEST_IMPL(fs_poll_close_request_multi_start_stop) { remove(FIXTURE); - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); - ASSERT(0 == uv_fs_poll_init(&loop, &poll_handle)); + ASSERT_OK(uv_fs_poll_init(&loop, &poll_handle)); for (i = 0; i < 10; ++i) { - ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); - ASSERT(0 == uv_fs_poll_stop(&poll_handle)); + ASSERT_OK(uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); + ASSERT_OK(uv_fs_poll_stop(&poll_handle)); } uv_close((uv_handle_t*) &poll_handle, close_cb); while (close_cb_called == 0) uv_run(&loop, UV_RUN_ONCE); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; @@ -247,18 +247,18 @@ TEST_IMPL(fs_poll_close_request_multi_stop_start) { remove(FIXTURE); - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); - ASSERT(0 == uv_fs_poll_init(&loop, &poll_handle)); + ASSERT_OK(uv_fs_poll_init(&loop, &poll_handle)); for (i = 0; i < 10; ++i) { - ASSERT(0 == uv_fs_poll_stop(&poll_handle)); - ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); + ASSERT_OK(uv_fs_poll_stop(&poll_handle)); + ASSERT_OK(uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100)); } uv_close((uv_handle_t*) &poll_handle, close_cb); while (close_cb_called == 0) uv_run(&loop, UV_RUN_ONCE); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; @@ -271,21 +271,21 @@ TEST_IMPL(fs_poll_close_request_stop_when_active) { remove(FIXTURE); - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); /* Set up all handles. */ - ASSERT(0 == uv_fs_poll_init(&loop, &poll_handle)); - ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb_noop, FIXTURE, 100)); + ASSERT_OK(uv_fs_poll_init(&loop, &poll_handle)); + ASSERT_OK(uv_fs_poll_start(&poll_handle, poll_cb_noop, FIXTURE, 100)); uv_run(&loop, UV_RUN_ONCE); /* Close the timer handle, and do not crash. */ - ASSERT(0 == uv_fs_poll_stop(&poll_handle)); + ASSERT_OK(uv_fs_poll_stop(&poll_handle)); uv_run(&loop, UV_RUN_ONCE); /* Clean up after the test. */ uv_close((uv_handle_t*) &poll_handle, close_cb); uv_run(&loop, UV_RUN_ONCE); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; diff --git a/deps/uv/test/test-fs-readdir.c b/deps/uv/test/test-fs-readdir.c index 43c9edf178be98..b6b5b7ff2c1d71 100644 --- a/deps/uv/test/test-fs-readdir.c +++ b/deps/uv/test/test-fs-readdir.c @@ -47,9 +47,9 @@ static void cleanup_test_files(void) { } static void empty_closedir_cb(uv_fs_t* req) { - ASSERT(req == &closedir_req); - ASSERT(req->fs_type == UV_FS_CLOSEDIR); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &closedir_req); + ASSERT_EQ(req->fs_type, UV_FS_CLOSEDIR); + ASSERT_OK(req->result); ++empty_closedir_cb_count; uv_fs_req_cleanup(req); } @@ -58,25 +58,25 @@ static void empty_readdir_cb(uv_fs_t* req) { uv_dir_t* dir; int r; - ASSERT(req == &readdir_req); - ASSERT(req->fs_type == UV_FS_READDIR); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &readdir_req); + ASSERT_EQ(req->fs_type, UV_FS_READDIR); + ASSERT_OK(req->result); dir = req->ptr; uv_fs_req_cleanup(req); r = uv_fs_closedir(uv_default_loop(), &closedir_req, dir, empty_closedir_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void empty_opendir_cb(uv_fs_t* req) { uv_dir_t* dir; int r; - ASSERT(req == &opendir_req); - ASSERT(req->fs_type == UV_FS_OPENDIR); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &opendir_req); + ASSERT_EQ(req->fs_type, UV_FS_OPENDIR); + ASSERT_OK(req->result); ASSERT_NOT_NULL(req->ptr); dir = req->ptr; dir->dirents = dirents; @@ -85,7 +85,7 @@ static void empty_opendir_cb(uv_fs_t* req) { &readdir_req, dir, empty_readdir_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(req); ++empty_opendir_cb_count; } @@ -115,9 +115,9 @@ TEST_IMPL(fs_readdir_empty_dir) { &opendir_req, path, NULL); - ASSERT(r == 0); - ASSERT(opendir_req.fs_type == UV_FS_OPENDIR); - ASSERT(opendir_req.result == 0); + ASSERT_OK(r); + ASSERT_EQ(opendir_req.fs_type, UV_FS_OPENDIR); + ASSERT_OK(opendir_req.result); ASSERT_NOT_NULL(opendir_req.ptr); dir = opendir_req.ptr; uv_fs_req_cleanup(&opendir_req); @@ -130,13 +130,13 @@ TEST_IMPL(fs_readdir_empty_dir) { &readdir_req, dir, NULL); - ASSERT(nb_entries_read == 0); + ASSERT_OK(nb_entries_read); uv_fs_req_cleanup(&readdir_req); /* Fill the req to ensure that required fields are cleaned up. */ memset(&closedir_req, 0xdb, sizeof(closedir_req)); uv_fs_closedir(uv_default_loop(), &closedir_req, dir, NULL); - ASSERT(closedir_req.result == 0); + ASSERT_OK(closedir_req.result); uv_fs_req_cleanup(&closedir_req); /* Testing the asynchronous flavor. */ @@ -147,13 +147,13 @@ TEST_IMPL(fs_readdir_empty_dir) { memset(&closedir_req, 0xdb, sizeof(closedir_req)); r = uv_fs_opendir(uv_default_loop(), &opendir_req, path, empty_opendir_cb); - ASSERT(r == 0); - ASSERT(empty_opendir_cb_count == 0); - ASSERT(empty_closedir_cb_count == 0); + ASSERT_OK(r); + ASSERT_OK(empty_opendir_cb_count); + ASSERT_OK(empty_closedir_cb_count); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(empty_opendir_cb_count == 1); - ASSERT(empty_closedir_cb_count == 1); + ASSERT_OK(r); + ASSERT_EQ(1, empty_opendir_cb_count); + ASSERT_EQ(1, empty_closedir_cb_count); uv_fs_rmdir(uv_default_loop(), &rmdir_req, path, NULL); uv_fs_req_cleanup(&rmdir_req); MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -168,9 +168,9 @@ TEST_IMPL(fs_readdir_empty_dir) { static int non_existing_opendir_cb_count; static void non_existing_opendir_cb(uv_fs_t* req) { - ASSERT(req == &opendir_req); - ASSERT(req->fs_type == UV_FS_OPENDIR); - ASSERT(req->result == UV_ENOENT); + ASSERT_PTR_EQ(req, &opendir_req); + ASSERT_EQ(req->fs_type, UV_FS_OPENDIR); + ASSERT_EQ(req->result, UV_ENOENT); ASSERT_NULL(req->ptr); uv_fs_req_cleanup(req); @@ -188,9 +188,9 @@ TEST_IMPL(fs_readdir_non_existing_dir) { /* Testing the synchronous flavor. */ r = uv_fs_opendir(uv_default_loop(), &opendir_req, path, NULL); - ASSERT(r == UV_ENOENT); - ASSERT(opendir_req.fs_type == UV_FS_OPENDIR); - ASSERT(opendir_req.result == UV_ENOENT); + ASSERT_EQ(r, UV_ENOENT); + ASSERT_EQ(opendir_req.fs_type, UV_FS_OPENDIR); + ASSERT_EQ(opendir_req.result, UV_ENOENT); ASSERT_NULL(opendir_req.ptr); uv_fs_req_cleanup(&opendir_req); @@ -202,11 +202,11 @@ TEST_IMPL(fs_readdir_non_existing_dir) { &opendir_req, path, non_existing_opendir_cb); - ASSERT(r == 0); - ASSERT(non_existing_opendir_cb_count == 0); + ASSERT_OK(r); + ASSERT_OK(non_existing_opendir_cb_count); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(non_existing_opendir_cb_count == 1); + ASSERT_OK(r); + ASSERT_EQ(1, non_existing_opendir_cb_count); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -220,9 +220,9 @@ TEST_IMPL(fs_readdir_non_existing_dir) { static int file_opendir_cb_count; static void file_opendir_cb(uv_fs_t* req) { - ASSERT(req == &opendir_req); - ASSERT(req->fs_type == UV_FS_OPENDIR); - ASSERT(req->result == UV_ENOTDIR); + ASSERT_PTR_EQ(req, &opendir_req); + ASSERT_EQ(req->fs_type, UV_FS_OPENDIR); + ASSERT_EQ(req->result, UV_ENOTDIR); ASSERT_NULL(req->ptr); uv_fs_req_cleanup(req); @@ -241,9 +241,9 @@ TEST_IMPL(fs_readdir_file) { /* Testing the synchronous flavor. */ r = uv_fs_opendir(uv_default_loop(), &opendir_req, path, NULL); - ASSERT(r == UV_ENOTDIR); - ASSERT(opendir_req.fs_type == UV_FS_OPENDIR); - ASSERT(opendir_req.result == UV_ENOTDIR); + ASSERT_EQ(r, UV_ENOTDIR); + ASSERT_EQ(opendir_req.fs_type, UV_FS_OPENDIR); + ASSERT_EQ(opendir_req.result, UV_ENOTDIR); ASSERT_NULL(opendir_req.ptr); uv_fs_req_cleanup(&opendir_req); @@ -253,11 +253,11 @@ TEST_IMPL(fs_readdir_file) { /* Testing the async flavor. */ r = uv_fs_opendir(uv_default_loop(), &opendir_req, path, file_opendir_cb); - ASSERT(r == 0); - ASSERT(file_opendir_cb_count == 0); + ASSERT_OK(r); + ASSERT_OK(file_opendir_cb_count); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(file_opendir_cb_count == 1); + ASSERT_OK(r); + ASSERT_EQ(1, file_opendir_cb_count); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } @@ -273,8 +273,8 @@ static int non_empty_readdir_cb_count; static int non_empty_closedir_cb_count; static void non_empty_closedir_cb(uv_fs_t* req) { - ASSERT(req == &closedir_req); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &closedir_req); + ASSERT_OK(req->result); uv_fs_req_cleanup(req); ++non_empty_closedir_cb_count; } @@ -282,30 +282,30 @@ static void non_empty_closedir_cb(uv_fs_t* req) { static void non_empty_readdir_cb(uv_fs_t* req) { uv_dir_t* dir; - ASSERT(req == &readdir_req); - ASSERT(req->fs_type == UV_FS_READDIR); + ASSERT_PTR_EQ(req, &readdir_req); + ASSERT_EQ(req->fs_type, UV_FS_READDIR); dir = req->ptr; if (req->result == 0) { uv_fs_req_cleanup(req); - ASSERT(non_empty_readdir_cb_count == 3); + ASSERT_EQ(3, non_empty_readdir_cb_count); uv_fs_closedir(uv_default_loop(), &closedir_req, dir, non_empty_closedir_cb); } else { - ASSERT(req->result == 1); - ASSERT(dir->dirents == dirents); + ASSERT_EQ(1, req->result); + ASSERT_PTR_EQ(dir->dirents, dirents); ASSERT(strcmp(dirents[0].name, "file1") == 0 || strcmp(dirents[0].name, "file2") == 0 || strcmp(dirents[0].name, "test_subdir") == 0); #ifdef HAVE_DIRENT_TYPES if (!strcmp(dirents[0].name, "test_subdir")) - ASSERT(dirents[0].type == UV_DIRENT_DIR); + ASSERT_EQ(dirents[0].type, UV_DIRENT_DIR); else - ASSERT(dirents[0].type == UV_DIRENT_FILE); + ASSERT_EQ(dirents[0].type, UV_DIRENT_FILE); #else - ASSERT(dirents[0].type == UV_DIRENT_UNKNOWN); + ASSERT_EQ(dirents[0].type, UV_DIRENT_UNKNOWN); #endif /* HAVE_DIRENT_TYPES */ ++non_empty_readdir_cb_count; @@ -323,9 +323,9 @@ static void non_empty_opendir_cb(uv_fs_t* req) { uv_dir_t* dir; int r; - ASSERT(req == &opendir_req); - ASSERT(req->fs_type == UV_FS_OPENDIR); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &opendir_req); + ASSERT_EQ(req->fs_type, UV_FS_OPENDIR); + ASSERT_OK(req->result); ASSERT_NOT_NULL(req->ptr); dir = req->ptr; @@ -336,7 +336,7 @@ static void non_empty_opendir_cb(uv_fs_t* req) { &readdir_req, dir, non_empty_readdir_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(req); ++non_empty_opendir_cb_count; } @@ -353,7 +353,7 @@ TEST_IMPL(fs_readdir_non_empty_dir) { cleanup_test_files(); r = uv_fs_mkdir(uv_default_loop(), &mkdir_req, "test_dir", 0755, NULL); - ASSERT(r == 0); + ASSERT_OK(r); /* Create two files synchronously. */ r = uv_fs_open(uv_default_loop(), @@ -361,13 +361,13 @@ TEST_IMPL(fs_readdir_non_empty_dir) { "test_dir/file1", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&create_req); r = uv_fs_close(uv_default_loop(), &close_req, create_req.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); r = uv_fs_open(uv_default_loop(), @@ -375,13 +375,13 @@ TEST_IMPL(fs_readdir_non_empty_dir) { "test_dir/file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&create_req); r = uv_fs_close(uv_default_loop(), &close_req, create_req.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); r = uv_fs_mkdir(uv_default_loop(), @@ -389,7 +389,7 @@ TEST_IMPL(fs_readdir_non_empty_dir) { "test_dir/test_subdir", 0755, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&mkdir_req); /* Fill the req to ensure that required fields are cleaned up. */ @@ -397,9 +397,9 @@ TEST_IMPL(fs_readdir_non_empty_dir) { /* Testing the synchronous flavor. */ r = uv_fs_opendir(uv_default_loop(), &opendir_req, "test_dir", NULL); - ASSERT(r == 0); - ASSERT(opendir_req.fs_type == UV_FS_OPENDIR); - ASSERT(opendir_req.result == 0); + ASSERT_OK(r); + ASSERT_EQ(opendir_req.fs_type, UV_FS_OPENDIR); + ASSERT_OK(opendir_req.result); ASSERT_NOT_NULL(opendir_req.ptr); entries_count = 0; @@ -417,23 +417,23 @@ TEST_IMPL(fs_readdir_non_empty_dir) { strcmp(dirents[0].name, "test_subdir") == 0); #ifdef HAVE_DIRENT_TYPES if (!strcmp(dirents[0].name, "test_subdir")) - ASSERT(dirents[0].type == UV_DIRENT_DIR); + ASSERT_EQ(dirents[0].type, UV_DIRENT_DIR); else - ASSERT(dirents[0].type == UV_DIRENT_FILE); + ASSERT_EQ(dirents[0].type, UV_DIRENT_FILE); #else - ASSERT(dirents[0].type == UV_DIRENT_UNKNOWN); + ASSERT_EQ(dirents[0].type, UV_DIRENT_UNKNOWN); #endif /* HAVE_DIRENT_TYPES */ uv_fs_req_cleanup(&readdir_req); ++entries_count; } - ASSERT(entries_count == 3); + ASSERT_EQ(3, entries_count); uv_fs_req_cleanup(&readdir_req); /* Fill the req to ensure that required fields are cleaned up. */ memset(&closedir_req, 0xdb, sizeof(closedir_req)); uv_fs_closedir(uv_default_loop(), &closedir_req, dir, NULL); - ASSERT(closedir_req.result == 0); + ASSERT_OK(closedir_req.result); uv_fs_req_cleanup(&closedir_req); /* Testing the asynchronous flavor. */ @@ -445,13 +445,13 @@ TEST_IMPL(fs_readdir_non_empty_dir) { &opendir_req, "test_dir", non_empty_opendir_cb); - ASSERT(r == 0); - ASSERT(non_empty_opendir_cb_count == 0); - ASSERT(non_empty_closedir_cb_count == 0); + ASSERT_OK(r); + ASSERT_OK(non_empty_opendir_cb_count); + ASSERT_OK(non_empty_closedir_cb_count); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(non_empty_opendir_cb_count == 1); - ASSERT(non_empty_closedir_cb_count == 1); + ASSERT_OK(r); + ASSERT_EQ(1, non_empty_opendir_cb_count); + ASSERT_EQ(1, non_empty_closedir_cb_count); uv_fs_rmdir(uv_default_loop(), &rmdir_req, "test_subdir", NULL); uv_fs_req_cleanup(&rmdir_req); diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index e687dde3e2577f..1acdc5c67082c7 100644 --- a/deps/uv/test/test-fs.c +++ b/deps/uv/test/test-fs.c @@ -170,8 +170,8 @@ static void check_permission(const char* filename, unsigned int mode) { uv_stat_t* s; r = uv_fs_stat(NULL, &req, filename, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); s = &req.statbuf; #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MSYS__) @@ -195,24 +195,24 @@ static void dummy_cb(uv_fs_t* req) { static void link_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_LINK); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_LINK); + ASSERT_OK(req->result); link_cb_count++; uv_fs_req_cleanup(req); } static void symlink_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_SYMLINK); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_SYMLINK); + ASSERT_OK(req->result); symlink_cb_count++; uv_fs_req_cleanup(req); } static void readlink_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_READLINK); - ASSERT(req->result == 0); - ASSERT(strcmp(req->ptr, "test_file_symlink2") == 0); + ASSERT_EQ(req->fs_type, UV_FS_READLINK); + ASSERT_OK(req->result); + ASSERT_OK(strcmp(req->ptr, "test_file_symlink2")); readlink_cb_count++; uv_fs_req_cleanup(req); } @@ -221,16 +221,16 @@ static void readlink_cb(uv_fs_t* req) { static void realpath_cb(uv_fs_t* req) { char test_file_abs_buf[PATHMAX]; size_t test_file_abs_size = sizeof(test_file_abs_buf); - ASSERT(req->fs_type == UV_FS_REALPATH); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_REALPATH); + ASSERT_OK(req->result); uv_cwd(test_file_abs_buf, &test_file_abs_size); #ifdef _WIN32 strcat(test_file_abs_buf, "\\test_file"); - ASSERT(stricmp(req->ptr, test_file_abs_buf) == 0); + ASSERT_OK(stricmp(req->ptr, test_file_abs_buf)); #else strcat(test_file_abs_buf, "/test_file"); - ASSERT(strcmp(req->ptr, test_file_abs_buf) == 0); + ASSERT_OK(strcmp(req->ptr, test_file_abs_buf)); #endif realpath_cb_count++; uv_fs_req_cleanup(req); @@ -238,15 +238,15 @@ static void realpath_cb(uv_fs_t* req) { static void access_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_ACCESS); + ASSERT_EQ(req->fs_type, UV_FS_ACCESS); access_cb_count++; uv_fs_req_cleanup(req); } static void fchmod_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_FCHMOD); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_FCHMOD); + ASSERT_OK(req->result); fchmod_cb_count++; uv_fs_req_cleanup(req); check_permission("test_file", *(int*)req->data); @@ -254,8 +254,8 @@ static void fchmod_cb(uv_fs_t* req) { static void chmod_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_CHMOD); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_CHMOD); + ASSERT_OK(req->result); chmod_cb_count++; uv_fs_req_cleanup(req); check_permission("test_file", *(int*)req->data); @@ -263,42 +263,42 @@ static void chmod_cb(uv_fs_t* req) { static void fchown_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_FCHOWN); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_FCHOWN); + ASSERT_OK(req->result); fchown_cb_count++; uv_fs_req_cleanup(req); } static void chown_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_CHOWN); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_CHOWN); + ASSERT_OK(req->result); chown_cb_count++; uv_fs_req_cleanup(req); } static void lchown_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_LCHOWN); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_LCHOWN); + ASSERT_OK(req->result); lchown_cb_count++; uv_fs_req_cleanup(req); } static void chown_root_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_CHOWN); + ASSERT_EQ(req->fs_type, UV_FS_CHOWN); #if defined(_WIN32) || defined(__MSYS__) /* On windows, chown is a no-op and always succeeds. */ - ASSERT(req->result == 0); + ASSERT_OK(req->result); #else /* On unix, chown'ing the root directory is not allowed - * unless you're root, of course. */ if (geteuid() == 0) - ASSERT(req->result == 0); + ASSERT_OK(req->result); else # if defined(__CYGWIN__) /* On Cygwin, uid 0 is invalid (no root). */ - ASSERT(req->result == UV_EINVAL); + ASSERT_EQ(req->result, UV_EINVAL); # elif defined(__PASE__) /* On IBMi PASE, there is no root user. uid 0 is user qsecofr. * User may grant qsecofr's privileges, including changing @@ -306,7 +306,7 @@ static void chown_root_cb(uv_fs_t* req) { */ ASSERT(req->result == 0 || req->result == UV_EPERM); # else - ASSERT(req->result == UV_EPERM); + ASSERT_EQ(req->result, UV_EPERM); # endif #endif chown_cb_count++; @@ -314,18 +314,18 @@ static void chown_root_cb(uv_fs_t* req) { } static void unlink_cb(uv_fs_t* req) { - ASSERT(req == &unlink_req); - ASSERT(req->fs_type == UV_FS_UNLINK); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &unlink_req); + ASSERT_EQ(req->fs_type, UV_FS_UNLINK); + ASSERT_OK(req->result); unlink_cb_count++; uv_fs_req_cleanup(req); } static void fstat_cb(uv_fs_t* req) { uv_stat_t* s = req->ptr; - ASSERT(req->fs_type == UV_FS_FSTAT); - ASSERT(req->result == 0); - ASSERT(s->st_size == sizeof(test_buf)); + ASSERT_EQ(req->fs_type, UV_FS_FSTAT); + ASSERT_OK(req->result); + ASSERT_EQ(s->st_size, sizeof(test_buf)); uv_fs_req_cleanup(req); fstat_cb_count++; } @@ -334,29 +334,29 @@ static void fstat_cb(uv_fs_t* req) { static void statfs_cb(uv_fs_t* req) { uv_statfs_t* stats; - ASSERT(req->fs_type == UV_FS_STATFS); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_STATFS); + ASSERT_OK(req->result); ASSERT_NOT_NULL(req->ptr); stats = req->ptr; #if defined(_WIN32) || defined(__sun) || defined(_AIX) || defined(__MVS__) || \ defined(__OpenBSD__) || defined(__NetBSD__) - ASSERT(stats->f_type == 0); + ASSERT_OK(stats->f_type); #else - ASSERT(stats->f_type > 0); + ASSERT_GT(stats->f_type, 0); #endif - ASSERT(stats->f_bsize > 0); - ASSERT(stats->f_blocks > 0); - ASSERT(stats->f_bfree <= stats->f_blocks); - ASSERT(stats->f_bavail <= stats->f_bfree); + ASSERT_GT(stats->f_bsize, 0); + ASSERT_GT(stats->f_blocks, 0); + ASSERT_LE(stats->f_bfree, stats->f_blocks); + ASSERT_LE(stats->f_bavail, stats->f_bfree); #ifdef _WIN32 - ASSERT(stats->f_files == 0); - ASSERT(stats->f_ffree == 0); + ASSERT_OK(stats->f_files); + ASSERT_OK(stats->f_ffree); #else /* There is no assertion for stats->f_files that makes sense, so ignore it. */ - ASSERT(stats->f_ffree <= stats->f_files); + ASSERT_LE(stats->f_ffree, stats->f_files); #endif uv_fs_req_cleanup(req); ASSERT_NULL(req->ptr); @@ -366,27 +366,27 @@ static void statfs_cb(uv_fs_t* req) { static void close_cb(uv_fs_t* req) { int r; - ASSERT(req == &close_req); - ASSERT(req->fs_type == UV_FS_CLOSE); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &close_req); + ASSERT_EQ(req->fs_type, UV_FS_CLOSE); + ASSERT_OK(req->result); close_cb_count++; uv_fs_req_cleanup(req); if (close_cb_count == 3) { r = uv_fs_unlink(loop, &unlink_req, "test_file2", unlink_cb); - ASSERT(r == 0); + ASSERT_OK(r); } } static void ftruncate_cb(uv_fs_t* req) { int r; - ASSERT(req == &ftruncate_req); - ASSERT(req->fs_type == UV_FS_FTRUNCATE); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &ftruncate_req); + ASSERT_EQ(req->fs_type, UV_FS_FTRUNCATE); + ASSERT_OK(req->result); ftruncate_cb_count++; uv_fs_req_cleanup(req); r = uv_fs_close(loop, &close_req, open_req1.result, close_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void fail_cb(uv_fs_t* req) { @@ -395,45 +395,45 @@ static void fail_cb(uv_fs_t* req) { static void read_cb(uv_fs_t* req) { int r; - ASSERT(req == &read_req); - ASSERT(req->fs_type == UV_FS_READ); - ASSERT(req->result >= 0); /* FIXME(bnoordhuis) Check if requested size? */ + ASSERT_PTR_EQ(req, &read_req); + ASSERT_EQ(req->fs_type, UV_FS_READ); + ASSERT_GE(req->result, 0); /* FIXME(bnoordhuis) Check if requested size? */ read_cb_count++; uv_fs_req_cleanup(req); if (read_cb_count == 1) { - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_OK(strcmp(buf, test_buf)); r = uv_fs_ftruncate(loop, &ftruncate_req, open_req1.result, 7, ftruncate_cb); } else { - ASSERT(strcmp(buf, "test-bu") == 0); + ASSERT_OK(strcmp(buf, "test-bu")); r = uv_fs_close(loop, &close_req, open_req1.result, close_cb); } - ASSERT(r == 0); + ASSERT_OK(r); } static void open_cb(uv_fs_t* req) { int r; - ASSERT(req == &open_req1); - ASSERT(req->fs_type == UV_FS_OPEN); + ASSERT_PTR_EQ(req, &open_req1); + ASSERT_EQ(req->fs_type, UV_FS_OPEN); if (req->result < 0) { fprintf(stderr, "async open error: %d\n", (int) req->result); ASSERT(0); } open_cb_count++; ASSERT(req->path); - ASSERT(memcmp(req->path, "test_file2\0", 11) == 0); + ASSERT_OK(memcmp(req->path, "test_file2\0", 11)); uv_fs_req_cleanup(req); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void open_cb_simple(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_OPEN); + ASSERT_EQ(req->fs_type, UV_FS_OPEN); if (req->result < 0) { fprintf(stderr, "async open error: %d\n", (int) req->result); ASSERT(0); @@ -446,69 +446,69 @@ static void open_cb_simple(uv_fs_t* req) { static void fsync_cb(uv_fs_t* req) { int r; - ASSERT(req == &fsync_req); - ASSERT(req->fs_type == UV_FS_FSYNC); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &fsync_req); + ASSERT_EQ(req->fs_type, UV_FS_FSYNC); + ASSERT_OK(req->result); fsync_cb_count++; uv_fs_req_cleanup(req); r = uv_fs_close(loop, &close_req, open_req1.result, close_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void fdatasync_cb(uv_fs_t* req) { int r; - ASSERT(req == &fdatasync_req); - ASSERT(req->fs_type == UV_FS_FDATASYNC); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &fdatasync_req); + ASSERT_EQ(req->fs_type, UV_FS_FDATASYNC); + ASSERT_OK(req->result); fdatasync_cb_count++; uv_fs_req_cleanup(req); r = uv_fs_fsync(loop, &fsync_req, open_req1.result, fsync_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void write_cb(uv_fs_t* req) { int r; - ASSERT(req == &write_req); - ASSERT(req->fs_type == UV_FS_WRITE); - ASSERT(req->result >= 0); /* FIXME(bnoordhuis) Check if requested size? */ + ASSERT_PTR_EQ(req, &write_req); + ASSERT_EQ(req->fs_type, UV_FS_WRITE); + ASSERT_GE(req->result, 0); /* FIXME(bnoordhuis) Check if requested size? */ write_cb_count++; uv_fs_req_cleanup(req); r = uv_fs_fdatasync(loop, &fdatasync_req, open_req1.result, fdatasync_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void create_cb(uv_fs_t* req) { int r; - ASSERT(req == &open_req1); - ASSERT(req->fs_type == UV_FS_OPEN); - ASSERT(req->result >= 0); + ASSERT_PTR_EQ(req, &open_req1); + ASSERT_EQ(req->fs_type, UV_FS_OPEN); + ASSERT_GE(req->result, 0); create_cb_count++; uv_fs_req_cleanup(req); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(loop, &write_req, req->result, &iov, 1, -1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void rename_cb(uv_fs_t* req) { - ASSERT(req == &rename_req); - ASSERT(req->fs_type == UV_FS_RENAME); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &rename_req); + ASSERT_EQ(req->fs_type, UV_FS_RENAME); + ASSERT_OK(req->result); rename_cb_count++; uv_fs_req_cleanup(req); } static void mkdir_cb(uv_fs_t* req) { - ASSERT(req == &mkdir_req); - ASSERT(req->fs_type == UV_FS_MKDIR); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &mkdir_req); + ASSERT_EQ(req->fs_type, UV_FS_MKDIR); + ASSERT_OK(req->result); mkdir_cb_count++; ASSERT(req->path); - ASSERT(memcmp(req->path, "test_dir\0", 9) == 0); + ASSERT_OK(memcmp(req->path, "test_dir\0", 9)); uv_fs_req_cleanup(req); } @@ -516,24 +516,24 @@ static void mkdir_cb(uv_fs_t* req) { static void check_mkdtemp_result(uv_fs_t* req) { int r; - ASSERT(req->fs_type == UV_FS_MKDTEMP); - ASSERT(req->result == 0); + ASSERT_EQ(req->fs_type, UV_FS_MKDTEMP); + ASSERT_OK(req->result); ASSERT(req->path); - ASSERT(strlen(req->path) == 15); - ASSERT(memcmp(req->path, "test_dir_", 9) == 0); - ASSERT(memcmp(req->path + 9, "XXXXXX", 6) != 0); + ASSERT_EQ(15, strlen(req->path)); + ASSERT_OK(memcmp(req->path, "test_dir_", 9)); + ASSERT_NE(0, memcmp(req->path + 9, "XXXXXX", 6)); check_permission(req->path, 0700); /* Check if req->path is actually a directory */ r = uv_fs_stat(NULL, &stat_req, req->path, NULL); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(((uv_stat_t*)stat_req.ptr)->st_mode & S_IFDIR); uv_fs_req_cleanup(&stat_req); } static void mkdtemp_cb(uv_fs_t* req) { - ASSERT(req == &mkdtemp_req1); + ASSERT_PTR_EQ(req, &mkdtemp_req1); check_mkdtemp_result(req); mkdtemp_cb_count++; } @@ -542,36 +542,36 @@ static void mkdtemp_cb(uv_fs_t* req) { static void check_mkstemp_result(uv_fs_t* req) { int r; - ASSERT(req->fs_type == UV_FS_MKSTEMP); - ASSERT(req->result >= 0); + ASSERT_EQ(req->fs_type, UV_FS_MKSTEMP); + ASSERT_GE(req->result, 0); ASSERT(req->path); - ASSERT(strlen(req->path) == 16); - ASSERT(memcmp(req->path, "test_file_", 10) == 0); - ASSERT(memcmp(req->path + 10, "XXXXXX", 6) != 0); + ASSERT_EQ(16, strlen(req->path)); + ASSERT_OK(memcmp(req->path, "test_file_", 10)); + ASSERT_NE(0, memcmp(req->path + 10, "XXXXXX", 6)); check_permission(req->path, 0600); /* Check if req->path is actually a file */ r = uv_fs_stat(NULL, &stat_req, req->path, NULL); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(stat_req.statbuf.st_mode & S_IFREG); uv_fs_req_cleanup(&stat_req); } static void mkstemp_cb(uv_fs_t* req) { - ASSERT(req == &mkstemp_req1); + ASSERT_PTR_EQ(req, &mkstemp_req1); check_mkstemp_result(req); mkstemp_cb_count++; } static void rmdir_cb(uv_fs_t* req) { - ASSERT(req == &rmdir_req); - ASSERT(req->fs_type == UV_FS_RMDIR); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &rmdir_req); + ASSERT_EQ(req->fs_type, UV_FS_RMDIR); + ASSERT_OK(req->result); rmdir_cb_count++; ASSERT(req->path); - ASSERT(memcmp(req->path, "test_dir\0", 9) == 0); + ASSERT_OK(memcmp(req->path, "test_dir\0", 9)); uv_fs_req_cleanup(req); } @@ -588,21 +588,21 @@ static void assert_is_file_type(uv_dirent_t dent) { * https://github.com/libuv/libuv/issues/501 */ #if defined(__APPLE__) || defined(_WIN32) - ASSERT(dent.type == UV_DIRENT_FILE); + ASSERT_EQ(dent.type, UV_DIRENT_FILE); #else ASSERT(dent.type == UV_DIRENT_FILE || dent.type == UV_DIRENT_UNKNOWN); #endif #else - ASSERT(dent.type == UV_DIRENT_UNKNOWN); + ASSERT_EQ(dent.type, UV_DIRENT_UNKNOWN); #endif } static void scandir_cb(uv_fs_t* req) { uv_dirent_t dent; - ASSERT(req == &scandir_req); - ASSERT(req->fs_type == UV_FS_SCANDIR); - ASSERT(req->result == 2); + ASSERT_PTR_EQ(req, &scandir_req); + ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); + ASSERT_EQ(2, req->result); ASSERT(req->ptr); while (UV_EOF != uv_fs_scandir_next(req, &dent)) { @@ -611,7 +611,7 @@ static void scandir_cb(uv_fs_t* req) { } scandir_cb_count++; ASSERT(req->path); - ASSERT(memcmp(req->path, "test_dir\0", 9) == 0); + ASSERT_OK(memcmp(req->path, "test_dir\0", 9)); uv_fs_req_cleanup(req); ASSERT(!req->ptr); } @@ -620,11 +620,11 @@ static void scandir_cb(uv_fs_t* req) { static void empty_scandir_cb(uv_fs_t* req) { uv_dirent_t dent; - ASSERT(req == &scandir_req); - ASSERT(req->fs_type == UV_FS_SCANDIR); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &scandir_req); + ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); + ASSERT_OK(req->result); ASSERT_NULL(req->ptr); - ASSERT(UV_EOF == uv_fs_scandir_next(req, &dent)); + ASSERT_EQ(UV_EOF, uv_fs_scandir_next(req, &dent)); uv_fs_req_cleanup(req); scandir_cb_count++; } @@ -632,20 +632,20 @@ static void empty_scandir_cb(uv_fs_t* req) { static void non_existent_scandir_cb(uv_fs_t* req) { uv_dirent_t dent; - ASSERT(req == &scandir_req); - ASSERT(req->fs_type == UV_FS_SCANDIR); - ASSERT(req->result == UV_ENOENT); + ASSERT_PTR_EQ(req, &scandir_req); + ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); + ASSERT_EQ(req->result, UV_ENOENT); ASSERT_NULL(req->ptr); - ASSERT(UV_ENOENT == uv_fs_scandir_next(req, &dent)); + ASSERT_EQ(UV_ENOENT, uv_fs_scandir_next(req, &dent)); uv_fs_req_cleanup(req); scandir_cb_count++; } static void file_scandir_cb(uv_fs_t* req) { - ASSERT(req == &scandir_req); - ASSERT(req->fs_type == UV_FS_SCANDIR); - ASSERT(req->result == UV_ENOTDIR); + ASSERT_PTR_EQ(req, &scandir_req); + ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); + ASSERT_EQ(req->result, UV_ENOTDIR); ASSERT_NULL(req->ptr); uv_fs_req_cleanup(req); scandir_cb_count++; @@ -653,9 +653,9 @@ static void file_scandir_cb(uv_fs_t* req) { static void stat_cb(uv_fs_t* req) { - ASSERT(req == &stat_req); + ASSERT_PTR_EQ(req, &stat_req); ASSERT(req->fs_type == UV_FS_STAT || req->fs_type == UV_FS_LSTAT); - ASSERT(req->result == 0); + ASSERT_OK(req->result); ASSERT(req->ptr); stat_cb_count++; uv_fs_req_cleanup(req); @@ -664,7 +664,7 @@ static void stat_cb(uv_fs_t* req) { static void stat_batch_cb(uv_fs_t* req) { ASSERT(req->fs_type == UV_FS_STAT || req->fs_type == UV_FS_LSTAT); - ASSERT(req->result == 0); + ASSERT_OK(req->result); ASSERT(req->ptr); stat_cb_count++; uv_fs_req_cleanup(req); @@ -673,40 +673,40 @@ static void stat_batch_cb(uv_fs_t* req) { static void sendfile_cb(uv_fs_t* req) { - ASSERT(req == &sendfile_req); - ASSERT(req->fs_type == UV_FS_SENDFILE); - ASSERT(req->result == 65545); + ASSERT_PTR_EQ(req, &sendfile_req); + ASSERT_EQ(req->fs_type, UV_FS_SENDFILE); + ASSERT_EQ(65545, req->result); sendfile_cb_count++; uv_fs_req_cleanup(req); } static void sendfile_nodata_cb(uv_fs_t* req) { - ASSERT(req == &sendfile_req); - ASSERT(req->fs_type == UV_FS_SENDFILE); - ASSERT(req->result == 0); + ASSERT_PTR_EQ(req, &sendfile_req); + ASSERT_EQ(req->fs_type, UV_FS_SENDFILE); + ASSERT_OK(req->result); sendfile_cb_count++; uv_fs_req_cleanup(req); } static void open_noent_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_OPEN); - ASSERT(req->result == UV_ENOENT); + ASSERT_EQ(req->fs_type, UV_FS_OPEN); + ASSERT_EQ(req->result, UV_ENOENT); open_cb_count++; uv_fs_req_cleanup(req); } static void open_nametoolong_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_OPEN); - ASSERT(req->result == UV_ENAMETOOLONG); + ASSERT_EQ(req->fs_type, UV_FS_OPEN); + ASSERT_EQ(req->result, UV_ENAMETOOLONG); open_cb_count++; uv_fs_req_cleanup(req); } static void open_loop_cb(uv_fs_t* req) { - ASSERT(req->fs_type == UV_FS_OPEN); - ASSERT(req->result == UV_ELOOP); + ASSERT_EQ(req->fs_type, UV_FS_OPEN); + ASSERT_EQ(req->result, UV_ELOOP); open_cb_count++; uv_fs_req_cleanup(req); } @@ -719,16 +719,16 @@ TEST_IMPL(fs_file_noent) { loop = uv_default_loop(); r = uv_fs_open(NULL, &req, "does_not_exist", O_RDONLY, 0, NULL); - ASSERT(r == UV_ENOENT); - ASSERT(req.result == UV_ENOENT); + ASSERT_EQ(r, UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); uv_fs_req_cleanup(&req); r = uv_fs_open(loop, &req, "does_not_exist", O_RDONLY, 0, open_noent_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(open_cb_count == 0); + ASSERT_OK(open_cb_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(open_cb_count == 1); + ASSERT_EQ(1, open_cb_count); /* TODO add EACCES test */ @@ -747,16 +747,16 @@ TEST_IMPL(fs_file_nametoolong) { name[TOO_LONG_NAME_LENGTH] = 0; r = uv_fs_open(NULL, &req, name, O_RDONLY, 0, NULL); - ASSERT(r == UV_ENAMETOOLONG); - ASSERT(req.result == UV_ENAMETOOLONG); + ASSERT_EQ(r, UV_ENAMETOOLONG); + ASSERT_EQ(req.result, UV_ENAMETOOLONG); uv_fs_req_cleanup(&req); r = uv_fs_open(loop, &req, name, O_RDONLY, 0, open_nametoolong_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(open_cb_count == 0); + ASSERT_OK(open_cb_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(open_cb_count == 1); + ASSERT_EQ(1, open_cb_count); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -783,20 +783,20 @@ TEST_IMPL(fs_file_loop) { if (r == UV_ENOENT) return 0; #endif - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); r = uv_fs_open(NULL, &req, "test_symlink", O_RDONLY, 0, NULL); - ASSERT(r == UV_ELOOP); - ASSERT(req.result == UV_ELOOP); + ASSERT_EQ(r, UV_ELOOP); + ASSERT_EQ(req.result, UV_ELOOP); uv_fs_req_cleanup(&req); r = uv_fs_open(loop, &req, "test_symlink", O_RDONLY, 0, open_loop_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(open_cb_count == 0); + ASSERT_OK(open_cb_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(open_cb_count == 1); + ASSERT_EQ(1, open_cb_count); unlink("test_symlink"); @@ -817,9 +817,9 @@ static void check_utime(const char* path, else r = uv_fs_stat(loop, &req, path, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(req.result, 0); + ASSERT_OK(req.result); s = &req.statbuf; if (s->st_atim.tv_nsec == 0 && s->st_mtim.tv_nsec == 0) { @@ -868,9 +868,9 @@ static void check_utime(const char* path, static void utime_cb(uv_fs_t* req) { utime_check_t* c; - ASSERT(req == &utime_req); - ASSERT(req->result == 0); - ASSERT(req->fs_type == UV_FS_UTIME); + ASSERT_PTR_EQ(req, &utime_req); + ASSERT_OK(req->result); + ASSERT_EQ(req->fs_type, UV_FS_UTIME); c = req->data; check_utime(c->path, c->atime, c->mtime, /* test_lutime */ 0); @@ -883,9 +883,9 @@ static void utime_cb(uv_fs_t* req) { static void futime_cb(uv_fs_t* req) { utime_check_t* c; - ASSERT(req == &futime_req); - ASSERT(req->result == 0); - ASSERT(req->fs_type == UV_FS_FUTIME); + ASSERT_PTR_EQ(req, &futime_req); + ASSERT_OK(req->result); + ASSERT_EQ(req->fs_type, UV_FS_FUTIME); c = req->data; check_utime(c->path, c->atime, c->mtime, /* test_lutime */ 0); @@ -898,8 +898,8 @@ static void futime_cb(uv_fs_t* req) { static void lutime_cb(uv_fs_t* req) { utime_check_t* c; - ASSERT(req->result == 0); - ASSERT(req->fs_type == UV_FS_LUTIME); + ASSERT_OK(req->result); + ASSERT_EQ(req->fs_type, UV_FS_LUTIME); c = req->data; check_utime(c->path, c->atime, c->mtime, /* test_lutime */ 1); @@ -920,48 +920,48 @@ TEST_IMPL(fs_file_async) { r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR, create_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(create_cb_count == 1); - ASSERT(write_cb_count == 1); - ASSERT(fsync_cb_count == 1); - ASSERT(fdatasync_cb_count == 1); - ASSERT(close_cb_count == 1); + ASSERT_EQ(1, create_cb_count); + ASSERT_EQ(1, write_cb_count); + ASSERT_EQ(1, fsync_cb_count); + ASSERT_EQ(1, fdatasync_cb_count); + ASSERT_EQ(1, close_cb_count); r = uv_fs_rename(loop, &rename_req, "test_file", "test_file2", rename_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(create_cb_count == 1); - ASSERT(write_cb_count == 1); - ASSERT(close_cb_count == 1); - ASSERT(rename_cb_count == 1); + ASSERT_EQ(1, create_cb_count); + ASSERT_EQ(1, write_cb_count); + ASSERT_EQ(1, close_cb_count); + ASSERT_EQ(1, rename_cb_count); r = uv_fs_open(loop, &open_req1, "test_file2", O_RDWR, 0, open_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(open_cb_count == 1); - ASSERT(read_cb_count == 1); - ASSERT(close_cb_count == 2); - ASSERT(rename_cb_count == 1); - ASSERT(create_cb_count == 1); - ASSERT(write_cb_count == 1); - ASSERT(ftruncate_cb_count == 1); + ASSERT_EQ(1, open_cb_count); + ASSERT_EQ(1, read_cb_count); + ASSERT_EQ(2, close_cb_count); + ASSERT_EQ(1, rename_cb_count); + ASSERT_EQ(1, create_cb_count); + ASSERT_EQ(1, write_cb_count); + ASSERT_EQ(1, ftruncate_cb_count); r = uv_fs_open(loop, &open_req1, "test_file2", O_RDONLY, 0, open_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(open_cb_count == 2); - ASSERT(read_cb_count == 2); - ASSERT(close_cb_count == 3); - ASSERT(rename_cb_count == 1); - ASSERT(unlink_cb_count == 1); - ASSERT(create_cb_count == 1); - ASSERT(write_cb_count == 1); - ASSERT(ftruncate_cb_count == 1); + ASSERT_EQ(2, open_cb_count); + ASSERT_EQ(2, read_cb_count); + ASSERT_EQ(3, close_cb_count); + ASSERT_EQ(1, rename_cb_count); + ASSERT_EQ(1, unlink_cb_count); + ASSERT_EQ(1, create_cb_count); + ASSERT_EQ(1, write_cb_count); + ASSERT_EQ(1, ftruncate_cb_count); /* Cleanup. */ unlink("test_file"); @@ -983,70 +983,70 @@ static void fs_file_sync(int add_flags) { r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(write_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(write_req.result, 0); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR | add_flags, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(read_req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(read_req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); uv_fs_req_cleanup(&read_req); r = uv_fs_ftruncate(NULL, &ftruncate_req, open_req1.result, 7, NULL); - ASSERT(r == 0); - ASSERT(ftruncate_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(ftruncate_req.result); uv_fs_req_cleanup(&ftruncate_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_rename(NULL, &rename_req, "test_file", "test_file2", NULL); - ASSERT(r == 0); - ASSERT(rename_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(rename_req.result); uv_fs_req_cleanup(&rename_req); r = uv_fs_open(NULL, &open_req1, "test_file2", O_RDONLY | add_flags, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(read_req.result >= 0); - ASSERT(strcmp(buf, "test-bu") == 0); + ASSERT_GE(r, 0); + ASSERT_GE(read_req.result, 0); + ASSERT_OK(strcmp(buf, "test-bu")); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_unlink(NULL, &unlink_req, "test_file2", NULL); - ASSERT(r == 0); - ASSERT(unlink_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(unlink_req.result); uv_fs_req_cleanup(&unlink_req); /* Cleanup */ @@ -1072,19 +1072,19 @@ static void fs_file_write_null_buffer(int add_flags) { r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(NULL, 0); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 0); - ASSERT(write_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(write_req.result); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); unlink("test_file"); @@ -1110,38 +1110,38 @@ TEST_IMPL(fs_async_dir) { loop = uv_default_loop(); r = uv_fs_mkdir(loop, &mkdir_req, "test_dir", 0755, mkdir_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(mkdir_cb_count == 1); + ASSERT_EQ(1, mkdir_cb_count); /* Create 2 files synchronously. */ r = uv_fs_open(NULL, &open_req1, "test_dir/file1", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_dir/file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); r = uv_fs_scandir(loop, &scandir_req, "test_dir", 0, scandir_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(scandir_cb_count == 1); + ASSERT_EQ(1, scandir_cb_count); /* sync uv_fs_scandir */ r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); - ASSERT(r == 2); - ASSERT(scandir_req.result == 2); + ASSERT_EQ(2, r); + ASSERT_EQ(2, scandir_req.result); ASSERT(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0); @@ -1151,37 +1151,37 @@ TEST_IMPL(fs_async_dir) { ASSERT(!scandir_req.ptr); r = uv_fs_stat(loop, &stat_req, "test_dir", stat_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); r = uv_fs_stat(loop, &stat_req, "test_dir/", stat_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); r = uv_fs_lstat(loop, &stat_req, "test_dir", stat_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); r = uv_fs_lstat(loop, &stat_req, "test_dir/", stat_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(stat_cb_count == 4); + ASSERT_EQ(4, stat_cb_count); r = uv_fs_unlink(loop, &unlink_req, "test_dir/file1", unlink_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(unlink_cb_count == 1); + ASSERT_EQ(1, unlink_cb_count); r = uv_fs_unlink(loop, &unlink_req, "test_dir/file2", unlink_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(unlink_cb_count == 2); + ASSERT_EQ(2, unlink_cb_count); r = uv_fs_rmdir(loop, &rmdir_req, "test_dir", rmdir_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(rmdir_cb_count == 1); + ASSERT_EQ(1, rmdir_cb_count); /* Cleanup */ unlink("test_dir/file1"); @@ -1206,58 +1206,58 @@ static int test_sendfile(void (*setup)(int), uv_fs_cb cb, off_t expected_size) { unlink("test_file2"); f = open("test_file", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR); - ASSERT(f != -1); + ASSERT_NE(f, -1); if (setup != NULL) setup(f); r = close(f); - ASSERT(r == 0); + ASSERT_OK(r); /* Test starts here. */ r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_open(NULL, &open_req2, "test_file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req2.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req2.result, 0); uv_fs_req_cleanup(&open_req2); r = uv_fs_sendfile(loop, &sendfile_req, open_req2.result, open_req1.result, 1, 131072, cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(sendfile_cb_count == 1); + ASSERT_EQ(1, sendfile_cb_count); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); r = uv_fs_close(NULL, &close_req, open_req2.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); memset(&s1, 0, sizeof(s1)); memset(&s2, 0, sizeof(s2)); - ASSERT(0 == stat("test_file", &s1)); - ASSERT(0 == stat("test_file2", &s2)); - ASSERT(s2.st_size == expected_size); + ASSERT_OK(stat("test_file", &s1)); + ASSERT_OK(stat("test_file2", &s2)); + ASSERT_EQ(s2.st_size, expected_size); if (expected_size > 0) { ASSERT_UINT64_EQ(s1.st_size, s2.st_size + 1); r = uv_fs_open(NULL, &open_req1, "test_file2", O_RDWR, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); memset(buf1, 0, sizeof(buf1)); iov = uv_buf_init(buf1, sizeof(buf1)); r = uv_fs_read(NULL, &req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); ASSERT_EQ(buf1[0], 'e'); /* 'e' from begin */ uv_fs_req_cleanup(&req); } else { @@ -1274,9 +1274,9 @@ static int test_sendfile(void (*setup)(int), uv_fs_cb cb, off_t expected_size) { static void sendfile_setup(int f) { - ASSERT(6 == write(f, "begin\n", 6)); - ASSERT(65542 == lseek(f, 65536, SEEK_CUR)); - ASSERT(4 == write(f, "end\n", 4)); + ASSERT_EQ(6, write(f, "begin\n", 6)); + ASSERT_EQ(65542, lseek(f, 65536, SEEK_CUR)); + ASSERT_EQ(4, write(f, "end\n", 4)); } @@ -1297,18 +1297,18 @@ TEST_IMPL(fs_mkdtemp) { loop = uv_default_loop(); r = uv_fs_mkdtemp(loop, &mkdtemp_req1, path_template, mkdtemp_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(mkdtemp_cb_count == 1); + ASSERT_EQ(1, mkdtemp_cb_count); /* sync mkdtemp */ r = uv_fs_mkdtemp(NULL, &mkdtemp_req2, path_template, NULL); - ASSERT(r == 0); + ASSERT_OK(r); check_mkdtemp_result(&mkdtemp_req2); /* mkdtemp return different values on subsequent calls */ - ASSERT(strcmp(mkdtemp_req1.path, mkdtemp_req2.path) != 0); + ASSERT_NE(0, strcmp(mkdtemp_req1.path, mkdtemp_req2.path)); /* Cleanup */ rmdir(mkdtemp_req1.path); @@ -1330,32 +1330,32 @@ TEST_IMPL(fs_mkstemp) { loop = uv_default_loop(); r = uv_fs_mkstemp(loop, &mkstemp_req1, path_template, mkstemp_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(mkstemp_cb_count == 1); + ASSERT_EQ(1, mkstemp_cb_count); /* sync mkstemp */ r = uv_fs_mkstemp(NULL, &mkstemp_req2, path_template, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); check_mkstemp_result(&mkstemp_req2); /* mkstemp return different values on subsequent calls */ - ASSERT(strcmp(mkstemp_req1.path, mkstemp_req2.path) != 0); + ASSERT_NE(0, strcmp(mkstemp_req1.path, mkstemp_req2.path)); /* invalid template returns EINVAL */ ASSERT_EQ(UV_EINVAL, uv_fs_mkstemp(NULL, &mkstemp_req3, "test_file", NULL)); /* Make sure that path is empty string */ - ASSERT_EQ(0, strlen(mkstemp_req3.path)); + ASSERT_OK(strlen(mkstemp_req3.path)); uv_fs_req_cleanup(&mkstemp_req3); /* We can write to the opened file */ iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &req, mkstemp_req1.result, &iov, 1, -1, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(req.result == sizeof(test_buf)); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_EQ(req.result, sizeof(test_buf)); uv_fs_req_cleanup(&req); /* Cleanup */ @@ -1365,15 +1365,15 @@ TEST_IMPL(fs_mkstemp) { uv_fs_req_cleanup(&req); fd = uv_fs_open(NULL, &req, mkstemp_req1.path , O_RDONLY, 0, NULL); - ASSERT(fd >= 0); + ASSERT_GE(fd, 0); uv_fs_req_cleanup(&req); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &req, fd, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); uv_fs_req_cleanup(&req); uv_fs_close(NULL, &req, fd, NULL); @@ -1412,20 +1412,20 @@ TEST_IMPL(fs_fstat) { r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); #ifndef _WIN32 memset(&t, 0, sizeof(t)); - ASSERT(0 == fstat(file, &t)); - ASSERT(0 == uv_fs_fstat(NULL, &req, file, NULL)); - ASSERT(req.result == 0); + ASSERT_OK(fstat(file, &t)); + ASSERT_OK(uv_fs_fstat(NULL, &req, file, NULL)); + ASSERT_OK(req.result); s = req.ptr; # if defined(__APPLE__) - ASSERT(s->st_birthtim.tv_sec == t.st_birthtimespec.tv_sec); - ASSERT(s->st_birthtim.tv_nsec == t.st_birthtimespec.tv_nsec); + ASSERT_EQ(s->st_birthtim.tv_sec, t.st_birthtimespec.tv_sec); + ASSERT_EQ(s->st_birthtim.tv_nsec, t.st_birthtimespec.tv_nsec); # elif defined(__linux__) /* If statx() is supported, the birth time should be equal to the change time * because we just created the file. On older kernels, it's set to zero. @@ -1439,53 +1439,53 @@ TEST_IMPL(fs_fstat) { iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(req.result == sizeof(test_buf)); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_EQ(req.result, sizeof(test_buf)); uv_fs_req_cleanup(&req); memset(&req.statbuf, 0xaa, sizeof(req.statbuf)); r = uv_fs_fstat(NULL, &req, file, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); s = req.ptr; - ASSERT(s->st_size == sizeof(test_buf)); + ASSERT_EQ(s->st_size, sizeof(test_buf)); #ifndef _WIN32 r = fstat(file, &t); - ASSERT(r == 0); - - ASSERT(s->st_dev == (uint64_t) t.st_dev); - ASSERT(s->st_mode == (uint64_t) t.st_mode); - ASSERT(s->st_nlink == (uint64_t) t.st_nlink); - ASSERT(s->st_uid == (uint64_t) t.st_uid); - ASSERT(s->st_gid == (uint64_t) t.st_gid); - ASSERT(s->st_rdev == (uint64_t) t.st_rdev); - ASSERT(s->st_ino == (uint64_t) t.st_ino); - ASSERT(s->st_size == (uint64_t) t.st_size); - ASSERT(s->st_blksize == (uint64_t) t.st_blksize); - ASSERT(s->st_blocks == (uint64_t) t.st_blocks); + ASSERT_OK(r); + + ASSERT_EQ(s->st_dev, (uint64_t) t.st_dev); + ASSERT_EQ(s->st_mode, (uint64_t) t.st_mode); + ASSERT_EQ(s->st_nlink, (uint64_t) t.st_nlink); + ASSERT_EQ(s->st_uid, (uint64_t) t.st_uid); + ASSERT_EQ(s->st_gid, (uint64_t) t.st_gid); + ASSERT_EQ(s->st_rdev, (uint64_t) t.st_rdev); + ASSERT_EQ(s->st_ino, (uint64_t) t.st_ino); + ASSERT_EQ(s->st_size, (uint64_t) t.st_size); + ASSERT_EQ(s->st_blksize, (uint64_t) t.st_blksize); + ASSERT_EQ(s->st_blocks, (uint64_t) t.st_blocks); #if defined(__APPLE__) - ASSERT(s->st_atim.tv_sec == t.st_atimespec.tv_sec); - ASSERT(s->st_atim.tv_nsec == t.st_atimespec.tv_nsec); - ASSERT(s->st_mtim.tv_sec == t.st_mtimespec.tv_sec); - ASSERT(s->st_mtim.tv_nsec == t.st_mtimespec.tv_nsec); - ASSERT(s->st_ctim.tv_sec == t.st_ctimespec.tv_sec); - ASSERT(s->st_ctim.tv_nsec == t.st_ctimespec.tv_nsec); + ASSERT_EQ(s->st_atim.tv_sec, t.st_atimespec.tv_sec); + ASSERT_EQ(s->st_atim.tv_nsec, t.st_atimespec.tv_nsec); + ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtimespec.tv_sec); + ASSERT_EQ(s->st_mtim.tv_nsec, t.st_mtimespec.tv_nsec); + ASSERT_EQ(s->st_ctim.tv_sec, t.st_ctimespec.tv_sec); + ASSERT_EQ(s->st_ctim.tv_nsec, t.st_ctimespec.tv_nsec); #elif defined(_AIX) || \ defined(__MVS__) - ASSERT(s->st_atim.tv_sec == t.st_atime); - ASSERT(s->st_atim.tv_nsec == 0); - ASSERT(s->st_mtim.tv_sec == t.st_mtime); - ASSERT(s->st_mtim.tv_nsec == 0); - ASSERT(s->st_ctim.tv_sec == t.st_ctime); - ASSERT(s->st_ctim.tv_nsec == 0); + ASSERT_EQ(s->st_atim.tv_sec, t.st_atime); + ASSERT_OK(s->st_atim.tv_nsec); + ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtime); + ASSERT_OK(s->st_mtim.tv_nsec); + ASSERT_EQ(s->st_ctim.tv_sec, t.st_ctime); + ASSERT_OK(s->st_ctim.tv_nsec); #elif defined(__ANDROID__) - ASSERT(s->st_atim.tv_sec == t.st_atime); - ASSERT(s->st_atim.tv_nsec == t.st_atimensec); - ASSERT(s->st_mtim.tv_sec == t.st_mtime); - ASSERT(s->st_mtim.tv_nsec == t.st_mtimensec); - ASSERT(s->st_ctim.tv_sec == t.st_ctime); - ASSERT(s->st_ctim.tv_nsec == t.st_ctimensec); + ASSERT_EQ(s->st_atim.tv_sec, t.st_atime); + ASSERT_EQ(s->st_atim.tv_nsec, t.st_atimensec); + ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtime); + ASSERT_EQ(s->st_mtim.tv_nsec, t.st_mtimensec); + ASSERT_EQ(s->st_ctim.tv_sec, t.st_ctime); + ASSERT_EQ(s->st_ctim.tv_nsec, t.st_ctimensec); #elif defined(__sun) || \ defined(__DragonFly__) || \ defined(__FreeBSD__) || \ @@ -1496,47 +1496,47 @@ TEST_IMPL(fs_fstat) { defined(_SVID_SOURCE) || \ defined(_XOPEN_SOURCE) || \ defined(_DEFAULT_SOURCE) - ASSERT(s->st_atim.tv_sec == t.st_atim.tv_sec); - ASSERT(s->st_atim.tv_nsec == t.st_atim.tv_nsec); - ASSERT(s->st_mtim.tv_sec == t.st_mtim.tv_sec); - ASSERT(s->st_mtim.tv_nsec == t.st_mtim.tv_nsec); - ASSERT(s->st_ctim.tv_sec == t.st_ctim.tv_sec); - ASSERT(s->st_ctim.tv_nsec == t.st_ctim.tv_nsec); + ASSERT_EQ(s->st_atim.tv_sec, t.st_atim.tv_sec); + ASSERT_EQ(s->st_atim.tv_nsec, t.st_atim.tv_nsec); + ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtim.tv_sec); + ASSERT_EQ(s->st_mtim.tv_nsec, t.st_mtim.tv_nsec); + ASSERT_EQ(s->st_ctim.tv_sec, t.st_ctim.tv_sec); + ASSERT_EQ(s->st_ctim.tv_nsec, t.st_ctim.tv_nsec); # if defined(__FreeBSD__) || \ defined(__NetBSD__) - ASSERT(s->st_birthtim.tv_sec == t.st_birthtim.tv_sec); - ASSERT(s->st_birthtim.tv_nsec == t.st_birthtim.tv_nsec); + ASSERT_EQ(s->st_birthtim.tv_sec, t.st_birthtim.tv_sec); + ASSERT_EQ(s->st_birthtim.tv_nsec, t.st_birthtim.tv_nsec); # endif #else - ASSERT(s->st_atim.tv_sec == t.st_atime); - ASSERT(s->st_atim.tv_nsec == 0); - ASSERT(s->st_mtim.tv_sec == t.st_mtime); - ASSERT(s->st_mtim.tv_nsec == 0); - ASSERT(s->st_ctim.tv_sec == t.st_ctime); - ASSERT(s->st_ctim.tv_nsec == 0); + ASSERT_EQ(s->st_atim.tv_sec, t.st_atime); + ASSERT_OK(s->st_atim.tv_nsec); + ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtime); + ASSERT_OK(s->st_mtim.tv_nsec); + ASSERT_EQ(s->st_ctim.tv_sec, t.st_ctime); + ASSERT_OK(s->st_ctim.tv_nsec); #endif #endif #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) - ASSERT(s->st_flags == t.st_flags); - ASSERT(s->st_gen == t.st_gen); + ASSERT_EQ(s->st_flags, t.st_flags); + ASSERT_EQ(s->st_gen, t.st_gen); #else - ASSERT(s->st_flags == 0); - ASSERT(s->st_gen == 0); + ASSERT_OK(s->st_flags); + ASSERT_OK(s->st_gen); #endif uv_fs_req_cleanup(&req); /* Now do the uv_fs_fstat call asynchronously */ r = uv_fs_fstat(loop, &req, file, fstat_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fstat_cb_count == 1); + ASSERT_EQ(1, fstat_cb_count); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* @@ -1564,8 +1564,8 @@ TEST_IMPL(fs_fstat_stdio) { for (fd = 0; fd <= 2; ++fd) { res = uv_fs_fstat(NULL, &req, fd, NULL); - ASSERT(res == 0); - ASSERT(req.result == 0); + ASSERT_OK(res); + ASSERT_OK(req.result); #ifdef _WIN32 st = req.ptr; @@ -1573,9 +1573,11 @@ TEST_IMPL(fs_fstat_stdio) { switch (ft) { case UV_TTY: case UV_NAMED_PIPE: - ASSERT(st->st_mode == (ft == UV_TTY ? S_IFCHR : S_IFIFO)); - ASSERT(st->st_nlink == 1); - ASSERT(st->st_rdev == (ft == UV_TTY ? FILE_DEVICE_CONSOLE : FILE_DEVICE_NAMED_PIPE) << 16); + ASSERT_EQ(st->st_mode, (ft == UV_TTY ? S_IFCHR : S_IFIFO)); + ASSERT_EQ(1, st->st_nlink); + ASSERT_EQ(st->st_rdev, + (ft == UV_TTY ? FILE_DEVICE_CONSOLE : FILE_DEVICE_NAMED_PIPE) + << 16); break; default: break; @@ -1603,52 +1605,52 @@ TEST_IMPL(fs_access) { /* File should not exist */ r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); - ASSERT(r < 0); - ASSERT(req.result < 0); + ASSERT_LT(r, 0); + ASSERT_LT(req.result, 0); uv_fs_req_cleanup(&req); /* File should not exist */ r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(access_cb_count == 1); + ASSERT_EQ(1, access_cb_count); access_cb_count = 0; /* reset for the next test */ /* Create file */ r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); /* File should exist */ r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* File should exist */ r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(access_cb_count == 1); + ASSERT_EQ(1, access_cb_count); access_cb_count = 0; /* reset for the next test */ /* Close file */ r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* Directory access */ r = uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); r = uv_fs_access(NULL, &req, "test_dir", W_OK, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* @@ -1678,22 +1680,22 @@ TEST_IMPL(fs_chmod) { r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(req.result == sizeof(test_buf)); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_EQ(req.result, sizeof(test_buf)); uv_fs_req_cleanup(&req); #ifndef _WIN32 /* Make the file write-only */ r = uv_fs_chmod(NULL, &req, "test_file", 0200, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); check_permission("test_file", 0200); @@ -1701,16 +1703,16 @@ TEST_IMPL(fs_chmod) { /* Make the file read-only */ r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); check_permission("test_file", 0400); /* Make the file read+write with sync uv_fs_fchmod */ r = uv_fs_fchmod(NULL, &req, file, 0600, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); check_permission("test_file", 0600); @@ -1722,9 +1724,9 @@ TEST_IMPL(fs_chmod) { req.data = &mode; } r = uv_fs_chmod(loop, &req, "test_file", 0200, chmod_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(chmod_cb_count == 1); + ASSERT_EQ(1, chmod_cb_count); chmod_cb_count = 0; /* reset for the next test */ #endif @@ -1734,9 +1736,9 @@ TEST_IMPL(fs_chmod) { req.data = &mode; } r = uv_fs_chmod(loop, &req, "test_file", 0400, chmod_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(chmod_cb_count == 1); + ASSERT_EQ(1, chmod_cb_count); /* async fchmod */ { @@ -1744,9 +1746,9 @@ TEST_IMPL(fs_chmod) { req.data = &mode; } r = uv_fs_fchmod(loop, &req, file, 0600, fchmod_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fchmod_cb_count == 1); + ASSERT_EQ(1, fchmod_cb_count); uv_fs_close(loop, &req, file, NULL); @@ -1780,31 +1782,31 @@ TEST_IMPL(fs_unlink_readonly) { O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(req.result == sizeof(test_buf)); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_EQ(req.result, sizeof(test_buf)); uv_fs_req_cleanup(&req); uv_fs_close(loop, &req, file, NULL); /* Make the file read-only */ r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); check_permission("test_file", 0400); /* Try to unlink the file */ r = uv_fs_unlink(NULL, &req, "test_file", NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* @@ -1839,30 +1841,30 @@ TEST_IMPL(fs_unlink_archive_readonly) { O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(req.result == sizeof(test_buf)); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_EQ(req.result, sizeof(test_buf)); uv_fs_req_cleanup(&req); uv_fs_close(loop, &req, file, NULL); /* Make the file read-only and clear archive flag */ r = SetFileAttributes("test_file", FILE_ATTRIBUTE_READONLY); - ASSERT(r != 0); + ASSERT(r); uv_fs_req_cleanup(&req); check_permission("test_file", 0400); /* Try to unlink the file */ r = uv_fs_unlink(NULL, &req, "test_file", NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* @@ -1894,69 +1896,69 @@ TEST_IMPL(fs_chown) { r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); /* sync chown */ r = uv_fs_chown(NULL, &req, "test_file", -1, -1, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* sync fchown */ r = uv_fs_fchown(NULL, &req, file, -1, -1, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* async chown */ r = uv_fs_chown(loop, &req, "test_file", -1, -1, chown_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(chown_cb_count == 1); + ASSERT_EQ(1, chown_cb_count); #ifndef __MVS__ /* chown to root (fail) */ chown_cb_count = 0; r = uv_fs_chown(loop, &req, "test_file", 0, 0, chown_root_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(chown_cb_count == 1); + ASSERT_EQ(1, chown_cb_count); #endif /* async fchown */ r = uv_fs_fchown(loop, &req, file, -1, -1, fchown_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fchown_cb_count == 1); + ASSERT_EQ(1, fchown_cb_count); #ifndef __HAIKU__ /* Haiku doesn't support hardlink */ /* sync link */ r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* sync lchown */ r = uv_fs_lchown(NULL, &req, "test_file_link", -1, -1, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* async lchown */ r = uv_fs_lchown(loop, &req, "test_file_link", -1, -1, lchown_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(lchown_cb_count == 1); + ASSERT_EQ(1, lchown_cb_count); #endif /* Close file */ r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* @@ -1989,58 +1991,58 @@ TEST_IMPL(fs_link) { r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(req.result == sizeof(test_buf)); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_EQ(req.result, sizeof(test_buf)); uv_fs_req_cleanup(&req); uv_fs_close(loop, &req, file, NULL); /* sync link */ r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); r = uv_fs_open(NULL, &req, "test_file_link", O_RDWR, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); link = req.result; uv_fs_req_cleanup(&req); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); close(link); /* async link */ r = uv_fs_link(loop, &req, "test_file", "test_file_link2", link_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(link_cb_count == 1); + ASSERT_EQ(1, link_cb_count); r = uv_fs_open(NULL, &req, "test_file_link2", O_RDWR, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); link = req.result; uv_fs_req_cleanup(&req); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); uv_fs_close(loop, &req, link, NULL); @@ -2066,16 +2068,16 @@ TEST_IMPL(fs_readlink) { uv_fs_t req; loop = uv_default_loop(); - ASSERT(0 == uv_fs_readlink(loop, &req, "no_such_file", dummy_cb)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(dummy_cb_count == 1); + ASSERT_OK(uv_fs_readlink(loop, &req, "no_such_file", dummy_cb)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, dummy_cb_count); ASSERT_NULL(req.ptr); - ASSERT(req.result == UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); uv_fs_req_cleanup(&req); - ASSERT(UV_ENOENT == uv_fs_readlink(NULL, &req, "no_such_file", NULL)); + ASSERT_EQ(UV_ENOENT, uv_fs_readlink(NULL, &req, "no_such_file", NULL)); ASSERT_NULL(req.ptr); - ASSERT(req.result == UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); uv_fs_req_cleanup(&req); } @@ -2096,8 +2098,8 @@ TEST_IMPL(fs_readlink) { uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT_EQ(r, 0); - ASSERT_EQ(req.result, 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* Test */ @@ -2118,16 +2120,16 @@ TEST_IMPL(fs_realpath) { uv_fs_t req; loop = uv_default_loop(); - ASSERT(0 == uv_fs_realpath(loop, &req, "no_such_file", dummy_cb)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(dummy_cb_count == 1); + ASSERT_OK(uv_fs_realpath(loop, &req, "no_such_file", dummy_cb)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, dummy_cb_count); ASSERT_NULL(req.ptr); - ASSERT(req.result == UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); uv_fs_req_cleanup(&req); - ASSERT(UV_ENOENT == uv_fs_realpath(NULL, &req, "no_such_file", NULL)); + ASSERT_EQ(UV_ENOENT, uv_fs_realpath(NULL, &req, "no_such_file", NULL)); ASSERT_NULL(req.ptr); - ASSERT(req.result == UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); uv_fs_req_cleanup(&req); MAKE_VALGRIND_HAPPY(loop); @@ -2162,15 +2164,15 @@ TEST_IMPL(fs_symlink) { r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(req.result == sizeof(test_buf)); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_EQ(req.result, sizeof(test_buf)); uv_fs_req_cleanup(&req); uv_fs_close(loop, &req, file, NULL); @@ -2194,22 +2196,22 @@ TEST_IMPL(fs_symlink) { } } #endif - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); r = uv_fs_open(NULL, &req, "test_file_symlink", O_RDWR, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); link = req.result; uv_fs_req_cleanup(&req); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); uv_fs_close(loop, &req, link, NULL); @@ -2219,7 +2221,7 @@ TEST_IMPL(fs_symlink) { "test_file_symlink_symlink", 0, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); #if defined(__MSYS__) @@ -2227,16 +2229,16 @@ TEST_IMPL(fs_symlink) { #endif r = uv_fs_readlink(NULL, &req, "test_file_symlink_symlink", NULL); - ASSERT(r == 0); - ASSERT(strcmp(req.ptr, "test_file_symlink") == 0); + ASSERT_OK(r); + ASSERT_OK(strcmp(req.ptr, "test_file_symlink")); uv_fs_req_cleanup(&req); r = uv_fs_realpath(NULL, &req, "test_file_symlink_symlink", NULL); - ASSERT(r == 0); + ASSERT_OK(r); #ifdef _WIN32 - ASSERT(stricmp(req.ptr, test_file_abs_buf) == 0); + ASSERT_OK(stricmp(req.ptr, test_file_abs_buf)); #else - ASSERT(strcmp(req.ptr, test_file_abs_buf) == 0); + ASSERT_OK(strcmp(req.ptr, test_file_abs_buf)); #endif uv_fs_req_cleanup(&req); @@ -2247,22 +2249,22 @@ TEST_IMPL(fs_symlink) { "test_file_symlink2", 0, symlink_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(symlink_cb_count == 1); + ASSERT_EQ(1, symlink_cb_count); r = uv_fs_open(NULL, &req, "test_file_symlink2", O_RDWR, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); link = req.result; uv_fs_req_cleanup(&req); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); uv_fs_close(loop, &req, link, NULL); @@ -2272,18 +2274,18 @@ TEST_IMPL(fs_symlink) { "test_file_symlink2_symlink", 0, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); r = uv_fs_readlink(loop, &req, "test_file_symlink2_symlink", readlink_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(readlink_cb_count == 1); + ASSERT_EQ(1, readlink_cb_count); r = uv_fs_realpath(loop, &req, "test_file", realpath_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(realpath_cb_count == 1); + ASSERT_EQ(1, realpath_cb_count); /* * Run the loop just to check we don't have make any extraneous uv_ref() @@ -2344,71 +2346,71 @@ int test_symlink_dir_impl(int type) { "creation of directory symlinks"); } fprintf(stderr, "r == %i\n", r); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); r = uv_fs_stat(NULL, &req, "test_dir_symlink", NULL); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFDIR); uv_fs_req_cleanup(&req); r = uv_fs_lstat(NULL, &req, "test_dir_symlink", NULL); - ASSERT(r == 0); + ASSERT_OK(r); #if defined(__MSYS__) RETURN_SKIP("symlink reading is not supported on MSYS2"); #endif ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFLNK); #ifdef _WIN32 - ASSERT(((uv_stat_t*)req.ptr)->st_size == strlen(test_dir + 4)); + ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen(test_dir + 4)); #else # ifdef __PASE__ /* On IBMi PASE, st_size returns the length of the symlink itself. */ - ASSERT(((uv_stat_t*)req.ptr)->st_size == strlen("test_dir_symlink")); + ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen("test_dir_symlink")); # else - ASSERT(((uv_stat_t*)req.ptr)->st_size == strlen(test_dir)); + ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen(test_dir)); # endif #endif uv_fs_req_cleanup(&req); r = uv_fs_readlink(NULL, &req, "test_dir_symlink", NULL); - ASSERT(r == 0); + ASSERT_OK(r); #ifdef _WIN32 - ASSERT(strcmp(req.ptr, test_dir + 4) == 0); + ASSERT_OK(strcmp(req.ptr, test_dir + 4)); #else - ASSERT(strcmp(req.ptr, test_dir) == 0); + ASSERT_OK(strcmp(req.ptr, test_dir)); #endif uv_fs_req_cleanup(&req); r = uv_fs_realpath(NULL, &req, "test_dir_symlink", NULL); - ASSERT(r == 0); + ASSERT_OK(r); #ifdef _WIN32 - ASSERT(strlen(req.ptr) == test_dir_abs_size - 5); - ASSERT(strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 5) == 0); + ASSERT_EQ(strlen(req.ptr), test_dir_abs_size - 5); + ASSERT_OK(strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 5)); #else - ASSERT(strcmp(req.ptr, test_dir_abs_buf) == 0); + ASSERT_OK(strcmp(req.ptr, test_dir_abs_buf)); #endif uv_fs_req_cleanup(&req); r = uv_fs_open(NULL, &open_req1, "test_dir/file1", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_dir/file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); r = uv_fs_scandir(NULL, &scandir_req, "test_dir_symlink", 0, NULL); - ASSERT(r == 2); - ASSERT(scandir_req.result == 2); + ASSERT_EQ(2, r); + ASSERT_EQ(2, scandir_req.result); ASSERT(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0); @@ -2419,16 +2421,16 @@ int test_symlink_dir_impl(int type) { /* unlink will remove the directory symlink */ r = uv_fs_unlink(NULL, &req, "test_dir_symlink", NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); r = uv_fs_scandir(NULL, &scandir_req, "test_dir_symlink", 0, NULL); - ASSERT(r == UV_ENOENT); + ASSERT_EQ(r, UV_ENOENT); uv_fs_req_cleanup(&scandir_req); r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); - ASSERT(r == 2); - ASSERT(scandir_req.result == 2); + ASSERT_EQ(2, r); + ASSERT_EQ(2, scandir_req.result); ASSERT(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0); @@ -2481,7 +2483,7 @@ TEST_IMPL(fs_non_symlink_reparse_point) { FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); - ASSERT(file_handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(file_handle, INVALID_HANDLE_VALUE); memset(&reparse_buffer, 0, REPARSE_GUID_DATA_BUFFER_HEADER_SIZE); reparse_buffer.ReparseTag = REPARSE_TAG; @@ -2496,7 +2498,7 @@ TEST_IMPL(fs_non_symlink_reparse_point) { 0, &bytes_returned, NULL); - ASSERT(r != 0); + ASSERT(r); CloseHandle(file_handle); @@ -2510,11 +2512,11 @@ TEST_IMPL(fs_non_symlink_reparse_point) { shared via SMB as "Macintosh HD". r = uv_fs_stat(NULL, &req, "\\\\\\Macintosh HD\\.DS_Store", NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); r = uv_fs_lstat(NULL, &req, "\\\\\\Macintosh HD\\.DS_Store", NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); */ @@ -2525,25 +2527,25 @@ TEST_IMPL(fs_non_symlink_reparse_point) { the scope of this test. r = uv_fs_stat(NULL, &req, "test_dir/test_file", NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); r = uv_fs_lstat(NULL, &req, "test_dir/test_file", NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); */ r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); - ASSERT(r == 1); - ASSERT(scandir_req.result == 1); + ASSERT_EQ(1, r); + ASSERT_EQ(1, scandir_req.result); ASSERT(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { - ASSERT(strcmp(dent.name, "test_file") == 0); + ASSERT_OK(strcmp(dent.name, "test_file")); /* uv_fs_scandir incorrectly identifies non-symlink reparse points as links because it doesn't open the file and verify the reparse point tag. The PowerShell Get-ChildItem command shares this behavior, so it's reasonable to leave it as is. */ - ASSERT(dent.type == UV_DIRENT_LINK); + ASSERT_EQ(dent.type, UV_DIRENT_LINK); } uv_fs_req_cleanup(&scandir_req); ASSERT(!scandir_req.ptr); @@ -2575,7 +2577,7 @@ TEST_IMPL(fs_lstat_windows_store_apps) { MAKE_VALGRIND_HAPPY(loop); return TEST_SKIP; } - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = snprintf(windowsapps_path, sizeof(localappdata), "%s\\Microsoft\\WindowsApps", @@ -2601,7 +2603,7 @@ TEST_IMPL(fs_lstat_windows_store_apps) { dirent.name) < 0) { continue; } - ASSERT_EQ(uv_fs_lstat(loop, &stat_req, file_path, NULL), 0); + ASSERT_OK(uv_fs_lstat(loop, &stat_req, file_path, NULL)); } MAKE_VALGRIND_HAPPY(loop); return 0; @@ -2621,16 +2623,16 @@ TEST_IMPL(fs_utime) { loop = uv_default_loop(); unlink(path); r = uv_fs_open(NULL, &req, path, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); uv_fs_req_cleanup(&req); uv_fs_close(loop, &req, r, NULL); atime = mtime = 400497753.25; /* 1982-09-10 11:22:33.25 */ r = uv_fs_utime(NULL, &req, path, atime, mtime, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); check_utime(path, atime, mtime, /* test_lutime */ 0); @@ -2643,9 +2645,9 @@ TEST_IMPL(fs_utime) { /* async utime */ utime_req.data = &checkme; r = uv_fs_utime(loop, &utime_req, path, atime, mtime, utime_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(utime_cb_count == 1); + ASSERT_EQ(1, utime_cb_count); /* Cleanup. */ unlink(path); @@ -2668,7 +2670,7 @@ TEST_IMPL(fs_utime_round) { ASSERT_GE(r, 0); ASSERT_GE(req.result, 0); uv_fs_req_cleanup(&req); - ASSERT_EQ(0, uv_fs_close(loop, &req, r, NULL)); + ASSERT_OK(uv_fs_close(loop, &req, r, NULL)); atime = mtime = -14245440.25; /* 1969-07-20T02:56:00.25Z */ @@ -2683,8 +2685,8 @@ TEST_IMPL(fs_utime_round) { RETURN_SKIP("utime on some OS (z/OS, IBM i PASE, AIX) or filesystems may reject pre-epoch timestamps"); } #endif - ASSERT_EQ(0, r); - ASSERT_EQ(0, req.result); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); check_utime(path, atime, mtime, /* test_lutime */ 0); unlink(path); @@ -2699,26 +2701,26 @@ TEST_IMPL(fs_stat_root) { int r; r = uv_fs_stat(NULL, &stat_req, "\\", NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_stat(NULL, &stat_req, "..\\..\\..\\..\\..\\..\\..", NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_stat(NULL, &stat_req, "..", NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_stat(NULL, &stat_req, "..\\", NULL); - ASSERT(r == 0); + ASSERT_OK(r); /* stats the current directory on c: */ r = uv_fs_stat(NULL, &stat_req, "c:", NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_stat(NULL, &stat_req, "c:\\", NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_stat(NULL, &stat_req, "\\\\?\\C:\\", NULL); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -2742,26 +2744,26 @@ TEST_IMPL(fs_futime) { loop = uv_default_loop(); unlink(path); r = uv_fs_open(NULL, &req, path, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); uv_fs_req_cleanup(&req); uv_fs_close(loop, &req, r, NULL); atime = mtime = 400497753.25; /* 1982-09-10 11:22:33.25 */ r = uv_fs_open(NULL, &req, path, O_RDWR, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; /* FIXME probably not how it's supposed to be used */ uv_fs_req_cleanup(&req); r = uv_fs_futime(NULL, &req, file, atime, mtime, NULL); #if defined(__CYGWIN__) || defined(__MSYS__) - ASSERT(r == UV_ENOSYS); + ASSERT_EQ(r, UV_ENOSYS); RETURN_SKIP("futime not supported on Cygwin"); #else - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); #endif uv_fs_req_cleanup(&req); @@ -2776,9 +2778,9 @@ TEST_IMPL(fs_futime) { /* async futime */ futime_req.data = &checkme; r = uv_fs_futime(loop, &futime_req, file, atime, mtime, futime_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(futime_cb_count == 1); + ASSERT_EQ(1, futime_cb_count); /* Cleanup. */ unlink(path); @@ -2819,8 +2821,8 @@ TEST_IMPL(fs_lutime) { "Symlink creation requires elevated console (with admin rights)"); } #endif - ASSERT_EQ(s, 0); - ASSERT_EQ(req.result, 0); + ASSERT_OK(s); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); /* Test the synchronous version. */ @@ -2837,9 +2839,9 @@ TEST_IMPL(fs_lutime) { ASSERT_EQ(r, UV_ENOSYS); RETURN_SKIP("lutime is not implemented for z/OS and AIX versions below 7.1"); #endif - ASSERT_EQ(r, 0); + ASSERT_OK(r); lutime_cb(&req); - ASSERT_EQ(lutime_cb_count, 1); + ASSERT_EQ(1, lutime_cb_count); /* Test the asynchronous version. */ atime = mtime = 1291404900; /* 2010-12-03 20:35:00 */ @@ -2849,9 +2851,9 @@ TEST_IMPL(fs_lutime) { checkme.path = symlink_path; r = uv_fs_lutime(loop, &req, symlink_path, atime, mtime, lutime_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT_EQ(lutime_cb_count, 2); + ASSERT_EQ(2, lutime_cb_count); /* Cleanup. */ unlink(path); @@ -2869,8 +2871,8 @@ TEST_IMPL(fs_stat_missing_path) { loop = uv_default_loop(); r = uv_fs_stat(NULL, &req, "non_existent_file", NULL); - ASSERT(r == UV_ENOENT); - ASSERT(req.result == UV_ENOENT); + ASSERT_EQ(r, UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); uv_fs_req_cleanup(&req); MAKE_VALGRIND_HAPPY(loop); @@ -2894,18 +2896,18 @@ TEST_IMPL(fs_scandir_empty_dir) { memset(&req, 0xdb, sizeof(req)); r = uv_fs_scandir(NULL, &req, path, 0, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); ASSERT_NULL(req.ptr); - ASSERT(UV_EOF == uv_fs_scandir_next(&req, &dent)); + ASSERT_EQ(UV_EOF, uv_fs_scandir_next(&req, &dent)); uv_fs_req_cleanup(&req); r = uv_fs_scandir(loop, &scandir_req, path, 0, empty_scandir_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(scandir_cb_count == 0); + ASSERT_OK(scandir_cb_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(scandir_cb_count == 1); + ASSERT_EQ(1, scandir_cb_count); uv_fs_rmdir(NULL, &req, path, NULL); uv_fs_req_cleanup(&req); @@ -2931,18 +2933,18 @@ TEST_IMPL(fs_scandir_non_existent_dir) { memset(&req, 0xdb, sizeof(req)); r = uv_fs_scandir(NULL, &req, path, 0, NULL); - ASSERT(r == UV_ENOENT); - ASSERT(req.result == UV_ENOENT); + ASSERT_EQ(r, UV_ENOENT); + ASSERT_EQ(req.result, UV_ENOENT); ASSERT_NULL(req.ptr); - ASSERT(UV_ENOENT == uv_fs_scandir_next(&req, &dent)); + ASSERT_EQ(UV_ENOENT, uv_fs_scandir_next(&req, &dent)); uv_fs_req_cleanup(&req); r = uv_fs_scandir(loop, &scandir_req, path, 0, non_existent_scandir_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(scandir_cb_count == 0); + ASSERT_OK(scandir_cb_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(scandir_cb_count == 1); + ASSERT_EQ(1, scandir_cb_count); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -2956,15 +2958,15 @@ TEST_IMPL(fs_scandir_file) { loop = uv_default_loop(); r = uv_fs_scandir(NULL, &scandir_req, path, 0, NULL); - ASSERT(r == UV_ENOTDIR); + ASSERT_EQ(r, UV_ENOTDIR); uv_fs_req_cleanup(&scandir_req); r = uv_fs_scandir(loop, &scandir_req, path, 0, file_scandir_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(scandir_cb_count == 0); + ASSERT_OK(scandir_cb_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(scandir_cb_count == 1); + ASSERT_EQ(1, scandir_cb_count); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -2998,21 +3000,21 @@ TEST_IMPL(fs_open_dir) { loop = uv_default_loop(); r = uv_fs_open(NULL, &req, path, O_RDONLY, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); ASSERT_NULL(req.ptr); file = r; uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_open(loop, &req, path, O_RDONLY, 0, open_cb_simple); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(open_cb_count == 0); + ASSERT_OK(open_cb_count); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(open_cb_count == 1); + ASSERT_EQ(1, open_cb_count); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -3029,57 +3031,57 @@ static void fs_file_open_append(int add_flags) { r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(write_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(write_req.result, 0); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR | O_APPEND | add_flags, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(write_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(write_req.result, 0); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); printf("read = %d\n", r); - ASSERT(r == 26); - ASSERT(read_req.result == 26); - ASSERT(memcmp(buf, - "test-buffer\n\0test-buffer\n\0", - sizeof("test-buffer\n\0test-buffer\n\0") - 1) == 0); + ASSERT_EQ(26, r); + ASSERT_EQ(26, read_req.result); + ASSERT_OK(memcmp(buf, + "test-buffer\n\0test-buffer\n\0", + sizeof("test-buffer\n\0test-buffer\n\0") - 1)); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -3105,53 +3107,53 @@ TEST_IMPL(fs_rename_to_existing_file) { r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(write_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(write_req.result, 0); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_rename(NULL, &rename_req, "test_file", "test_file2", NULL); - ASSERT(r == 0); - ASSERT(rename_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(rename_req.result); uv_fs_req_cleanup(&rename_req); r = uv_fs_open(NULL, &open_req1, "test_file2", O_RDONLY, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(read_req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(read_req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -3167,49 +3169,49 @@ static void fs_read_bufs(int add_flags) { char scratch[768]; uv_buf_t bufs[4]; - ASSERT(0 <= uv_fs_open(NULL, &open_req1, - "test/fixtures/lorem_ipsum.txt", - O_RDONLY | add_flags, 0, NULL)); - ASSERT(open_req1.result >= 0); + ASSERT_LE(0, uv_fs_open(NULL, &open_req1, + "test/fixtures/lorem_ipsum.txt", + O_RDONLY | add_flags, 0, NULL)); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); - ASSERT(UV_EINVAL == uv_fs_read(NULL, &read_req, open_req1.result, - NULL, 0, 0, NULL)); - ASSERT(UV_EINVAL == uv_fs_read(NULL, &read_req, open_req1.result, - NULL, 1, 0, NULL)); - ASSERT(UV_EINVAL == uv_fs_read(NULL, &read_req, open_req1.result, - bufs, 0, 0, NULL)); + ASSERT_EQ(UV_EINVAL, uv_fs_read(NULL, &read_req, open_req1.result, + NULL, 0, 0, NULL)); + ASSERT_EQ(UV_EINVAL, uv_fs_read(NULL, &read_req, open_req1.result, + NULL, 1, 0, NULL)); + ASSERT_EQ(UV_EINVAL, uv_fs_read(NULL, &read_req, open_req1.result, + bufs, 0, 0, NULL)); bufs[0] = uv_buf_init(scratch + 0, 256); bufs[1] = uv_buf_init(scratch + 256, 256); bufs[2] = uv_buf_init(scratch + 512, 128); bufs[3] = uv_buf_init(scratch + 640, 128); - ASSERT(446 == uv_fs_read(NULL, - &read_req, - open_req1.result, - bufs + 0, - 2, /* 2x 256 bytes. */ - 0, /* Positional read. */ - NULL)); - ASSERT(read_req.result == 446); + ASSERT_EQ(446, uv_fs_read(NULL, + &read_req, + open_req1.result, + bufs + 0, + 2, /* 2x 256 bytes. */ + 0, /* Positional read. */ + NULL)); + ASSERT_EQ(446, read_req.result); uv_fs_req_cleanup(&read_req); - ASSERT(190 == uv_fs_read(NULL, - &read_req, - open_req1.result, - bufs + 2, - 2, /* 2x 128 bytes. */ - 256, /* Positional read. */ - NULL)); - ASSERT(read_req.result == /* 446 - 256 */ 190); + ASSERT_EQ(190, uv_fs_read(NULL, + &read_req, + open_req1.result, + bufs + 2, + 2, /* 2x 128 bytes. */ + 256, /* Positional read. */ + NULL)); + ASSERT_EQ(read_req.result, /* 446 - 256 */ 190); uv_fs_req_cleanup(&read_req); - ASSERT(0 == memcmp(bufs[1].base + 0, bufs[2].base, 128)); - ASSERT(0 == memcmp(bufs[1].base + 128, bufs[3].base, 190 - 128)); + ASSERT_OK(memcmp(bufs[1].base + 0, bufs[2].base, 128)); + ASSERT_OK(memcmp(bufs[1].base + 128, bufs[3].base, 190 - 128)); - ASSERT(0 == uv_fs_close(NULL, &close_req, open_req1.result, NULL)); - ASSERT(close_req.result == 0); + ASSERT_OK(uv_fs_close(NULL, &close_req, open_req1.result, NULL)); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); } TEST_IMPL(fs_read_bufs) { @@ -3234,45 +3236,45 @@ static void fs_read_file_eof(int add_flags) { r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(write_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(write_req.result, 0); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r >= 0); - ASSERT(read_req.result >= 0); - ASSERT(strcmp(buf, test_buf) == 0); + ASSERT_GE(r, 0); + ASSERT_GE(read_req.result, 0); + ASSERT_OK(strcmp(buf, test_buf)); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, read_req.result, NULL); - ASSERT(r == 0); - ASSERT(read_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(read_req.result); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -3298,26 +3300,26 @@ static void fs_write_multiple_bufs(int add_flags) { r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iovs[0] = uv_buf_init(test_buf, sizeof(test_buf)); iovs[1] = uv_buf_init(test_buf2, sizeof(test_buf2)); r = uv_fs_write(NULL, &write_req, open_req1.result, iovs, 2, 0, NULL); - ASSERT(r >= 0); - ASSERT(write_req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(write_req.result, 0); uv_fs_req_cleanup(&write_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); @@ -3325,48 +3327,48 @@ static void fs_write_multiple_bufs(int add_flags) { /* Read the strings back to separate buffers. */ iovs[0] = uv_buf_init(buf, sizeof(test_buf)); iovs[1] = uv_buf_init(buf2, sizeof(test_buf2)); - ASSERT(lseek(open_req1.result, 0, SEEK_CUR) == 0); + ASSERT_OK(lseek(open_req1.result, 0, SEEK_CUR)); r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, 2, -1, NULL); - ASSERT(r >= 0); - ASSERT(read_req.result == sizeof(test_buf) + sizeof(test_buf2)); - ASSERT(strcmp(buf, test_buf) == 0); - ASSERT(strcmp(buf2, test_buf2) == 0); + ASSERT_GE(r, 0); + ASSERT_EQ(read_req.result, sizeof(test_buf) + sizeof(test_buf2)); + ASSERT_OK(strcmp(buf, test_buf)); + ASSERT_OK(strcmp(buf2, test_buf2)); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 0); - ASSERT(read_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(read_req.result); uv_fs_req_cleanup(&read_req); /* Read the strings back to separate buffers. */ iovs[0] = uv_buf_init(buf, sizeof(test_buf)); iovs[1] = uv_buf_init(buf2, sizeof(test_buf2)); r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, 2, 0, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); if (read_req.result == sizeof(test_buf)) { /* Infer that preadv is not available. */ uv_fs_req_cleanup(&read_req); r = uv_fs_read(NULL, &read_req, open_req1.result, &iovs[1], 1, read_req.result, NULL); - ASSERT(r >= 0); - ASSERT(read_req.result == sizeof(test_buf2)); + ASSERT_GE(r, 0); + ASSERT_EQ(read_req.result, sizeof(test_buf2)); } else { - ASSERT(read_req.result == sizeof(test_buf) + sizeof(test_buf2)); + ASSERT_EQ(read_req.result, sizeof(test_buf) + sizeof(test_buf2)); } - ASSERT(strcmp(buf, test_buf) == 0); - ASSERT(strcmp(buf2, test_buf2) == 0); + ASSERT_OK(strcmp(buf, test_buf)); + ASSERT_OK(strcmp(buf2, test_buf2)); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, sizeof(test_buf) + sizeof(test_buf2), NULL); - ASSERT(r == 0); - ASSERT(read_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(read_req.result); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -3406,8 +3408,8 @@ static void fs_write_alotof_bufs(int add_flags) { O_RDWR | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); for (index = 0; index < iovcount; ++index) @@ -3420,8 +3422,8 @@ static void fs_write_alotof_bufs(int add_flags) { iovcount, -1, NULL); - ASSERT(r >= 0); - ASSERT((size_t)write_req.result == sizeof(test_buf) * iovcount); + ASSERT_GE(r, 0); + ASSERT_EQ((size_t)write_req.result, sizeof(test_buf) * iovcount); uv_fs_req_cleanup(&write_req); /* Read the strings back to separate buffers. */ @@ -3433,31 +3435,32 @@ static void fs_write_alotof_bufs(int add_flags) { sizeof(test_buf)); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, iovcount, -1, NULL); if (iovcount > iovmax) iovcount = iovmax; - ASSERT(r >= 0); - ASSERT((size_t)read_req.result == sizeof(test_buf) * iovcount); + ASSERT_GE(r, 0); + ASSERT_EQ((size_t)read_req.result, sizeof(test_buf) * iovcount); for (index = 0; index < iovcount; ++index) - ASSERT(strncmp(buffer + index * sizeof(test_buf), - test_buf, - sizeof(test_buf)) == 0); + ASSERT_OK(strncmp(buffer + index * sizeof(test_buf), + test_buf, + sizeof(test_buf))); uv_fs_req_cleanup(&read_req); free(buffer); - ASSERT(lseek(open_req1.result, write_req.result, SEEK_SET) == write_req.result); + ASSERT_EQ(lseek(open_req1.result, write_req.result, SEEK_SET), + write_req.result); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, @@ -3466,13 +3469,13 @@ static void fs_write_alotof_bufs(int add_flags) { 1, -1, NULL); - ASSERT(r == 0); - ASSERT(read_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(read_req.result); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -3518,14 +3521,14 @@ static void fs_write_alotof_bufs_with_offset(int add_flags) { O_RDWR | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(filler, filler_len); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == filler_len); - ASSERT(write_req.result == filler_len); + ASSERT_EQ(r, filler_len); + ASSERT_EQ(write_req.result, filler_len); uv_fs_req_cleanup(&write_req); offset = (int64_t)r; @@ -3539,8 +3542,8 @@ static void fs_write_alotof_bufs_with_offset(int add_flags) { iovcount, offset, NULL); - ASSERT(r >= 0); - ASSERT((size_t)write_req.result == sizeof(test_buf) * iovcount); + ASSERT_GE(r, 0); + ASSERT_EQ((size_t)write_req.result, sizeof(test_buf) * iovcount); uv_fs_req_cleanup(&write_req); /* Read the strings back to separate buffers. */ @@ -3553,25 +3556,25 @@ static void fs_write_alotof_bufs_with_offset(int add_flags) { r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, iovcount, offset, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); if (r == sizeof(test_buf)) iovcount = 1; /* Infer that preadv is not available. */ else if (iovcount > iovmax) iovcount = iovmax; - ASSERT((size_t)read_req.result == sizeof(test_buf) * iovcount); + ASSERT_EQ((size_t)read_req.result, sizeof(test_buf) * iovcount); for (index = 0; index < iovcount; ++index) - ASSERT(strncmp(buffer + index * sizeof(test_buf), - test_buf, - sizeof(test_buf)) == 0); + ASSERT_OK(strncmp(buffer + index * sizeof(test_buf), + test_buf, + sizeof(test_buf))); uv_fs_req_cleanup(&read_req); free(buffer); r = uv_fs_stat(NULL, &stat_req, "test_file", NULL); - ASSERT(r == 0); - ASSERT((int64_t)((uv_stat_t*)stat_req.ptr)->st_size == - offset + (int64_t)write_req.result); + ASSERT_OK(r); + ASSERT_EQ((int64_t)((uv_stat_t*)stat_req.ptr)->st_size, + offset + (int64_t)write_req.result); uv_fs_req_cleanup(&stat_req); iov = uv_buf_init(buf, sizeof(buf)); @@ -3582,13 +3585,13 @@ static void fs_write_alotof_bufs_with_offset(int add_flags) { 1, offset + write_req.result, NULL); - ASSERT(r == 0); - ASSERT(read_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(read_req.result); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -3611,9 +3614,9 @@ TEST_IMPL(fs_read_dir) { /* Setup */ rmdir("test_dir"); r = uv_fs_mkdir(loop, &mkdir_req, "test_dir", 0755, mkdir_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(mkdir_cb_count == 1); + ASSERT_EQ(1, mkdir_cb_count); /* Setup Done Here */ /* Get a file descriptor for the directory */ @@ -3623,7 +3626,7 @@ TEST_IMPL(fs_read_dir) { UV_FS_O_RDONLY | UV_FS_O_DIRECTORY, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); + ASSERT_GE(r, 0); uv_fs_req_cleanup(&open_req1); /* Try to read data from the directory */ @@ -3643,12 +3646,12 @@ TEST_IMPL(fs_read_dir) { */ ASSERT((r >= 0) || (r == UV_EISDIR)); #else - ASSERT(r == UV_EISDIR); + ASSERT_EQ(r, UV_EISDIR); #endif uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -3695,7 +3698,7 @@ static void thread_main(void* arg) { if (ctx->doread) { result = write(ctx->fd, data, nbytes); /* Should not see EINTR (or other errors) */ - ASSERT(result == nbytes); + ASSERT_EQ(result, nbytes); } else { result = read(ctx->fd, data, nbytes); /* Should not see EINTR (or other errors), @@ -3757,13 +3760,13 @@ static void test_fs_partial(int doread) { loop = uv_default_loop(); - ASSERT(0 == uv_signal_init(loop, &signal)); - ASSERT(0 == uv_signal_start(&signal, sig_func, SIGUSR1)); + ASSERT_OK(uv_signal_init(loop, &signal)); + ASSERT_OK(uv_signal_start(&signal, sig_func, SIGUSR1)); - ASSERT(0 == pipe(pipe_fds)); + ASSERT_OK(pipe(pipe_fds)); ctx.fd = pipe_fds[doread]; - ASSERT(0 == uv_thread_create(&thread, thread_main, &ctx)); + ASSERT_OK(uv_thread_create(&thread, thread_main, &ctx)); if (doread) { uv_buf_t* read_iovs; @@ -3780,34 +3783,34 @@ static void test_fs_partial(int doread) { iovcount -= read_iovcount; nread += result; } else { - ASSERT(result == UV_EINTR); + ASSERT_EQ(result, UV_EINTR); } uv_fs_req_cleanup(&read_req); } } else { int result; result = uv_fs_write(loop, &write_req, pipe_fds[1], iovs, iovcount, -1, NULL); - ASSERT(write_req.result == result); - ASSERT(result == ctx.size); + ASSERT_EQ(write_req.result, result); + ASSERT_EQ(result, ctx.size); uv_fs_req_cleanup(&write_req); } - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); ASSERT_MEM_EQ(buffer, ctx.data, ctx.size); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(0 == close(pipe_fds[1])); + ASSERT_OK(close(pipe_fds[1])); uv_close((uv_handle_t*) &signal, NULL); { /* Make sure we read everything that we wrote. */ int result; result = uv_fs_read(loop, &read_req, pipe_fds[0], iovs, 1, -1, NULL); - ASSERT(result == 0); + ASSERT_OK(result); uv_fs_req_cleanup(&read_req); } - ASSERT(0 == close(pipe_fds[0])); + ASSERT_OK(close(pipe_fds[0])); free(iovs); free(buffer); @@ -3832,13 +3835,13 @@ TEST_IMPL(fs_read_write_null_arguments) { int r; r = uv_fs_read(NULL, &read_req, 0, NULL, 0, -1, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_fs_req_cleanup(&read_req); r = uv_fs_write(NULL, &write_req, 0, NULL, 0, -1, NULL); /* Validate some memory management on failed input validation before sending fs work to the thread pool. */ - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); ASSERT_NULL(write_req.path); ASSERT_NULL(write_req.ptr); #ifdef _WIN32 @@ -3853,36 +3856,36 @@ TEST_IMPL(fs_read_write_null_arguments) { iov = uv_buf_init(NULL, 0); r = uv_fs_read(NULL, &read_req, 0, &iov, 0, -1, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(NULL, 0); r = uv_fs_write(NULL, &write_req, 0, &iov, 0, -1, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_fs_req_cleanup(&write_req); /* If the arguments are invalid, the loop should not be kept open */ loop = uv_default_loop(); r = uv_fs_read(loop, &read_req, 0, NULL, 0, -1, fail_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(loop, UV_RUN_DEFAULT); uv_fs_req_cleanup(&read_req); r = uv_fs_write(loop, &write_req, 0, NULL, 0, -1, fail_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(loop, UV_RUN_DEFAULT); uv_fs_req_cleanup(&write_req); iov = uv_buf_init(NULL, 0); r = uv_fs_read(loop, &read_req, 0, &iov, 0, -1, fail_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(loop, UV_RUN_DEFAULT); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(NULL, 0); r = uv_fs_write(loop, &write_req, 0, &iov, 0, -1, fail_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(loop, UV_RUN_DEFAULT); uv_fs_req_cleanup(&write_req); @@ -3906,20 +3909,20 @@ TEST_IMPL(get_osfhandle_valid_handle) { O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); fd = uv_get_osfhandle(open_req1.result); #ifdef _WIN32 - ASSERT(fd != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(fd, INVALID_HANDLE_VALUE); #else - ASSERT(fd >= 0); + ASSERT_GE(fd, 0); #endif r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup. */ @@ -3945,27 +3948,27 @@ TEST_IMPL(open_osfhandle_valid_handle) { O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); handle = uv_get_osfhandle(open_req1.result); #ifdef _WIN32 - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); #else - ASSERT(handle >= 0); + ASSERT_GE(handle, 0); #endif fd = uv_open_osfhandle(handle); #ifdef _WIN32 - ASSERT(fd > 0); + ASSERT_GT(fd, 0); #else - ASSERT(fd == open_req1.result); + ASSERT_EQ(fd, open_req1.result); #endif r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup. */ @@ -3988,24 +3991,24 @@ TEST_IMPL(fs_file_pos_after_op_with_offset) { O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r > 0); + ASSERT_GT(r, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 0, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(lseek(open_req1.result, 0, SEEK_CUR) == 0); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_OK(lseek(open_req1.result, 0, SEEK_CUR)); uv_fs_req_cleanup(&write_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, 0, NULL); - ASSERT(r == sizeof(test_buf)); - ASSERT(strcmp(buf, test_buf) == 0); - ASSERT(lseek(open_req1.result, 0, SEEK_CUR) == 0); + ASSERT_EQ(r, sizeof(test_buf)); + ASSERT_OK(strcmp(buf, test_buf)); + ASSERT_OK(lseek(open_req1.result, 0, SEEK_CUR)); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -4021,30 +4024,30 @@ static void fs_file_pos_common(void) { iov = uv_buf_init("abc", 3); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 3); + ASSERT_EQ(3, r); uv_fs_req_cleanup(&write_req); /* Read with offset should not change the position */ iov = uv_buf_init(buf, 1); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, 1, NULL); - ASSERT(r == 1); - ASSERT(buf[0] == 'b'); + ASSERT_EQ(1, r); + ASSERT_EQ(buf[0], 'b'); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&read_req); /* Write without offset should change the position */ iov = uv_buf_init("d", 1); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 1); + ASSERT_EQ(1, r); uv_fs_req_cleanup(&write_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&read_req); } @@ -4053,23 +4056,23 @@ static void fs_file_pos_close_check(const char *contents, int size) { /* Close */ r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); /* Confirm file contents */ r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, 0, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == size); - ASSERT(strncmp(buf, contents, size) == 0); + ASSERT_EQ(r, size); + ASSERT_OK(strncmp(buf, contents, size)); uv_fs_req_cleanup(&read_req); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -4088,7 +4091,7 @@ static void fs_file_pos_write(int add_flags) { O_TRUNC | O_CREAT | O_RDWR | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r > 0); + ASSERT_GT(r, 0); uv_fs_req_cleanup(&open_req1); fs_file_pos_common(); @@ -4096,12 +4099,12 @@ static void fs_file_pos_write(int add_flags) { /* Write with offset should not change the position */ iov = uv_buf_init("e", 1); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 1, NULL); - ASSERT(r == 1); + ASSERT_EQ(1, r); uv_fs_req_cleanup(&write_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&read_req); fs_file_pos_close_check("aecd", 4); @@ -4126,7 +4129,7 @@ static void fs_file_pos_append(int add_flags) { O_APPEND | O_CREAT | O_RDWR | add_flags, S_IWUSR | S_IRUSR, NULL); - ASSERT(r > 0); + ASSERT_GT(r, 0); uv_fs_req_cleanup(&open_req1); fs_file_pos_common(); @@ -4135,13 +4138,13 @@ static void fs_file_pos_append(int add_flags) { * but does not change the position */ iov = uv_buf_init("e", 1); r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 1, NULL); - ASSERT(r == 1); + ASSERT_EQ(1, r); uv_fs_req_cleanup(&write_req); iov = uv_buf_init(buf, sizeof(buf)); r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); - ASSERT(r == 1); - ASSERT(buf[0] == 'e'); + ASSERT_EQ(1, r); + ASSERT_EQ(buf[0], 'e'); uv_fs_req_cleanup(&read_req); fs_file_pos_close_check("abcde", 5); @@ -4160,97 +4163,97 @@ TEST_IMPL(fs_null_req) { int r; r = uv_fs_open(NULL, NULL, NULL, 0, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_close(NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_read(NULL, NULL, 0, NULL, 0, -1, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_write(NULL, NULL, 0, NULL, 0, -1, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_unlink(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_mkdir(NULL, NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_mkdtemp(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_mkstemp(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_rmdir(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_scandir(NULL, NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_link(NULL, NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_symlink(NULL, NULL, NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_readlink(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_realpath(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_chown(NULL, NULL, NULL, 0, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_fchown(NULL, NULL, 0, 0, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_stat(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_lstat(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_fstat(NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_rename(NULL, NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_fsync(NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_fdatasync(NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_ftruncate(NULL, NULL, 0, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_copyfile(NULL, NULL, NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_sendfile(NULL, NULL, 0, 0, 0, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_access(NULL, NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_chmod(NULL, NULL, NULL, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_fchmod(NULL, NULL, 0, 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_utime(NULL, NULL, NULL, 0.0, 0.0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_futime(NULL, NULL, 0, 0.0, 0.0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_fs_statfs(NULL, NULL, NULL, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* This should be a no-op. */ uv_fs_req_cleanup(NULL); @@ -4265,7 +4268,7 @@ TEST_IMPL(fs_exclusive_sharing_mode) { /* Setup. */ unlink("test_file"); - ASSERT(UV_FS_O_EXLOCK > 0); + ASSERT_GT(UV_FS_O_EXLOCK, 0); r = uv_fs_open(NULL, &open_req1, @@ -4273,8 +4276,8 @@ TEST_IMPL(fs_exclusive_sharing_mode) { O_RDWR | O_CREAT | UV_FS_O_EXLOCK, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_open(NULL, @@ -4283,13 +4286,13 @@ TEST_IMPL(fs_exclusive_sharing_mode) { O_RDONLY | UV_FS_O_EXLOCK, S_IWUSR | S_IRUSR, NULL); - ASSERT(r < 0); - ASSERT(open_req2.result < 0); + ASSERT_LT(r, 0); + ASSERT_LT(open_req2.result, 0); uv_fs_req_cleanup(&open_req2); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); r = uv_fs_open(NULL, @@ -4298,13 +4301,13 @@ TEST_IMPL(fs_exclusive_sharing_mode) { O_RDONLY | UV_FS_O_EXLOCK, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req2.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req2.result, 0); uv_fs_req_cleanup(&open_req2); r = uv_fs_close(NULL, &close_req, open_req2.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Cleanup */ @@ -4322,10 +4325,10 @@ TEST_IMPL(fs_file_flag_no_buffering) { /* Setup. */ unlink("test_file"); - ASSERT(UV_FS_O_APPEND > 0); - ASSERT(UV_FS_O_CREAT > 0); - ASSERT(UV_FS_O_DIRECT > 0); - ASSERT(UV_FS_O_RDWR > 0); + ASSERT_GT(UV_FS_O_APPEND, 0); + ASSERT_GT(UV_FS_O_CREAT, 0); + ASSERT_GT(UV_FS_O_DIRECT, 0); + ASSERT_GT(UV_FS_O_RDWR, 0); /* FILE_APPEND_DATA must be excluded from FILE_GENERIC_WRITE: */ r = uv_fs_open(NULL, @@ -4334,13 +4337,13 @@ TEST_IMPL(fs_file_flag_no_buffering) { UV_FS_O_RDWR | UV_FS_O_CREAT | UV_FS_O_DIRECT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* FILE_APPEND_DATA and FILE_FLAG_NO_BUFFERING are mutually exclusive: */ @@ -4350,8 +4353,8 @@ TEST_IMPL(fs_file_flag_no_buffering) { UV_FS_O_APPEND | UV_FS_O_DIRECT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r == UV_EINVAL); - ASSERT(open_req2.result == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); + ASSERT_EQ(open_req2.result, UV_EINVAL); uv_fs_req_cleanup(&open_req2); /* Cleanup */ @@ -4392,7 +4395,7 @@ TEST_IMPL(fs_open_readonly_acl) { /* Setup - clear the ACL and remove the file */ loop = uv_default_loop(); r = uv_os_get_passwd(&pwd); - ASSERT(r == 0); + ASSERT_OK(r); call_icacls("icacls test_file_icacls /remove \"%s\" /inheritance:e", pwd.username); uv_fs_chmod(loop, &req, "test_file_icacls", S_IWUSR, NULL); @@ -4405,12 +4408,12 @@ TEST_IMPL(fs_open_readonly_acl) { O_RDONLY | O_CREAT, S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(open_req1.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(open_req1.result, 0); uv_fs_req_cleanup(&open_req1); r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); - ASSERT(r == 0); - ASSERT(close_req.result == 0); + ASSERT_OK(r); + ASSERT_OK(close_req.result); uv_fs_req_cleanup(&close_req); /* Set up ACL */ @@ -4442,7 +4445,7 @@ TEST_IMPL(fs_open_readonly_acl) { pwd.username); unlink("test_file_icacls"); uv_os_free_passwd(&pwd); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; } @@ -4463,35 +4466,35 @@ TEST_IMPL(fs_fchmod_archive_readonly) { O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); /* Make the file read-only and clear archive flag */ r = SetFileAttributes("test_file", FILE_ATTRIBUTE_READONLY); - ASSERT(r != 0); + ASSERT(r); check_permission("test_file", 0400); /* Try fchmod */ r = uv_fs_open(NULL, &req, "test_file", O_RDONLY, 0, NULL); - ASSERT(r >= 0); - ASSERT(req.result >= 0); + ASSERT_GE(r, 0); + ASSERT_GE(req.result, 0); file = req.result; uv_fs_req_cleanup(&req); r = uv_fs_fchmod(NULL, &req, file, S_IWUSR, NULL); - ASSERT(r == 0); - ASSERT(req.result == 0); + ASSERT_OK(r); + ASSERT_OK(req.result); uv_fs_req_cleanup(&req); r = uv_fs_close(NULL, &req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&req); check_permission("test_file", S_IWUSR); /* Restore Archive flag for rest of the tests */ r = SetFileAttributes("test_file", FILE_ATTRIBUTE_ARCHIVE); - ASSERT(r != 0); + ASSERT(r); return 0; } @@ -4503,7 +4506,7 @@ TEST_IMPL(fs_invalid_mkdir_name) { loop = uv_default_loop(); r = uv_fs_mkdir(loop, &req, "invalid>", 0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); ASSERT_EQ(UV_EINVAL, uv_fs_mkdir(loop, &req, "test:lol", 0, NULL)); return 0; @@ -4518,15 +4521,15 @@ TEST_IMPL(fs_statfs) { /* Test the synchronous version. */ r = uv_fs_statfs(NULL, &req, ".", NULL); - ASSERT(r == 0); + ASSERT_OK(r); statfs_cb(&req); - ASSERT(statfs_cb_count == 1); + ASSERT_EQ(1, statfs_cb_count); /* Test the asynchronous version. */ r = uv_fs_statfs(loop, &req, ".", statfs_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(statfs_cb_count == 2); + ASSERT_EQ(2, statfs_cb_count); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -4538,13 +4541,13 @@ TEST_IMPL(fs_get_system_error) { int system_error; r = uv_fs_statfs(NULL, &req, "non_existing_file", NULL); - ASSERT(r != 0); + ASSERT(r); system_error = uv_fs_get_system_error(&req); #ifdef _WIN32 - ASSERT(system_error == ERROR_FILE_NOT_FOUND); + ASSERT_EQ(system_error, ERROR_FILE_NOT_FOUND); #else - ASSERT(system_error == ENOENT); + ASSERT_EQ(system_error, ENOENT); #endif return 0; @@ -4559,13 +4562,13 @@ TEST_IMPL(fs_stat_batch_multiple) { rmdir("test_dir"); r = uv_fs_mkdir(NULL, &mkdir_req, "test_dir", 0755, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); loop = uv_default_loop(); for (i = 0; i < (int) ARRAY_SIZE(req); ++i) { r = uv_fs_stat(loop, &req[i], "test_dir", stat_batch_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } uv_run(loop, UV_RUN_DEFAULT); @@ -4590,7 +4593,7 @@ TEST_IMPL(fs_wtf) { loop = uv_default_loop(); r = uv_fs_mkdir(NULL, &mkdir_req, "test_dir", 0777, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_fs_req_cleanup(&mkdir_req); file_handle = CreateFileW(L"test_dir/hi\xD801\x0037", @@ -4601,19 +4604,19 @@ TEST_IMPL(fs_wtf) { FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); - ASSERT(file_handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(file_handle, INVALID_HANDLE_VALUE); CloseHandle(file_handle); r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); - ASSERT_EQ(r, 1); - ASSERT_EQ(scandir_req.result, 1); + ASSERT_EQ(1, r); + ASSERT_EQ(1, scandir_req.result); ASSERT_NOT_NULL(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { snprintf(test_file_buf, sizeof(test_file_buf), "test_dir\\%s", dent.name); printf("stat %s\n", test_file_buf); r = uv_fs_stat(NULL, &stat_req, test_file_buf, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } uv_fs_req_cleanup(&scandir_req); ASSERT_NULL(scandir_req.ptr); diff --git a/deps/uv/test/test-get-currentexe.c b/deps/uv/test/test-get-currentexe.c index becaf5c1bb8613..c813d3a5c4f883 100644 --- a/deps/uv/test/test-get-currentexe.c +++ b/deps/uv/test/test-get-currentexe.c @@ -60,43 +60,43 @@ TEST_IMPL(get_currentexe) { * executable_path. */ ASSERT(match && !strcmp(match, path)); - ASSERT(size == strlen(buffer)); + ASSERT_EQ(size, strlen(buffer)); /* Negative tests */ size = sizeof(buffer) / sizeof(buffer[0]); r = uv_exepath(NULL, &size); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_exepath(buffer, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); size = 0; r = uv_exepath(buffer, &size); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); memset(buffer, -1, sizeof(buffer)); size = 1; r = uv_exepath(buffer, &size); - ASSERT(r == 0); - ASSERT(size == 0); - ASSERT(buffer[0] == '\0'); + ASSERT_OK(r); + ASSERT_OK(size); + ASSERT_EQ(buffer[0], '\0'); memset(buffer, -1, sizeof(buffer)); size = 2; r = uv_exepath(buffer, &size); - ASSERT(r == 0); - ASSERT(size == 1); - ASSERT(buffer[0] != '\0'); - ASSERT(buffer[1] == '\0'); + ASSERT_OK(r); + ASSERT_EQ(1, size); + ASSERT_NE(buffer[0], '\0'); + ASSERT_EQ(buffer[1], '\0'); /* Verify uv_exepath is not affected by uv_set_process_title(). */ r = uv_set_process_title("foobar"); - ASSERT_EQ(r, 0); + ASSERT_OK(r); size = sizeof(buffer); r = uv_exepath(buffer, &size); - ASSERT_EQ(r, 0); + ASSERT_OK(r); match = strstr(buffer, path); /* Verify that the path returned from uv_exepath is a subdirectory of diff --git a/deps/uv/test/test-get-loadavg.c b/deps/uv/test/test-get-loadavg.c index 4762e47576d064..ef1719c047f8d5 100644 --- a/deps/uv/test/test-get-loadavg.c +++ b/deps/uv/test/test-get-loadavg.c @@ -27,9 +27,9 @@ TEST_IMPL(get_loadavg) { double avg[3] = {-1, -1, -1}; uv_loadavg(avg); - ASSERT(avg[0] >= 0); - ASSERT(avg[1] >= 0); - ASSERT(avg[2] >= 0); + ASSERT_GE(avg[0], 0); + ASSERT_GE(avg[1], 0); + ASSERT_GE(avg[2], 0); return 0; } diff --git a/deps/uv/test/test-get-memory.c b/deps/uv/test/test-get-memory.c index 9ac42c383c918b..2a23f79470f599 100644 --- a/deps/uv/test/test-get-memory.c +++ b/deps/uv/test/test-get-memory.c @@ -35,13 +35,13 @@ TEST_IMPL(get_memory) { (unsigned long long) constrained_mem, (unsigned long long) available_mem); - ASSERT(free_mem > 0); - ASSERT(total_mem > 0); + ASSERT_GT(free_mem, 0); + ASSERT_GT(total_mem, 0); /* On IBMi PASE, the amount of memory in use is always zero. */ #ifdef __PASE__ - ASSERT(total_mem == free_mem); + ASSERT_EQ(total_mem, free_mem); #else - ASSERT(total_mem > free_mem); + ASSERT_GT(total_mem, free_mem); #endif ASSERT_LE(available_mem, total_mem); /* we'd really want to test if available <= free, but that is fragile: diff --git a/deps/uv/test/test-get-passwd.c b/deps/uv/test/test-get-passwd.c index 29a2bd1243d2b8..b1e762009757ab 100644 --- a/deps/uv/test/test-get-passwd.c +++ b/deps/uv/test/test-get-passwd.c @@ -39,7 +39,7 @@ TEST_IMPL(get_passwd) { /* Test the normal case */ r = uv_os_get_passwd(&pwd); - ASSERT_EQ(r, 0); + ASSERT_OK(r); len = strlen(pwd.username); ASSERT_GT(len, 0); @@ -114,7 +114,7 @@ TEST_IMPL(get_passwd2) { /* Test the normal case */ r = uv_os_get_passwd(&pwd); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_os_get_passwd2(&pwd2, pwd.uid); @@ -123,7 +123,7 @@ TEST_IMPL(get_passwd2) { (void) &len; #else - ASSERT_EQ(r, 0); + ASSERT_OK(r); ASSERT_EQ(pwd.uid, pwd2.uid); ASSERT_STR_EQ(pwd.username, pwd2.username); ASSERT_STR_EQ(pwd.shell, pwd2.shell); @@ -131,15 +131,20 @@ TEST_IMPL(get_passwd2) { uv_os_free_passwd(&pwd2); r = uv_os_get_passwd2(&pwd2, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); len = strlen(pwd2.username); ASSERT_GT(len, 0); +#if defined(__PASE__) + // uid 0 is qsecofr on IBM i + ASSERT_STR_EQ(pwd2.username, "qsecofr"); +#else ASSERT_STR_EQ(pwd2.username, "root"); - +#endif len = strlen(pwd2.homedir); +# ifndef __PASE__ ASSERT_GT(len, 0); - +#endif len = strlen(pwd2.shell); # ifndef __PASE__ ASSERT_GT(len, 0); @@ -174,7 +179,7 @@ TEST_IMPL(get_group) { int r; r = uv_os_get_passwd(&pwd); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_os_get_group(&grp, pwd.gid); @@ -183,7 +188,7 @@ TEST_IMPL(get_group) { (void) &len; #else - ASSERT_EQ(r, 0); + ASSERT_OK(r); ASSERT_EQ(pwd.gid, grp.gid); len = strlen(grp.groupname); diff --git a/deps/uv/test/test-getaddrinfo.c b/deps/uv/test/test-getaddrinfo.c index 1032537ad563a0..76137f06ca074c 100644 --- a/deps/uv/test/test-getaddrinfo.c +++ b/deps/uv/test/test-getaddrinfo.c @@ -40,8 +40,8 @@ static void getaddrinfo_fail_cb(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { - ASSERT(fail_cb_called == 0); - ASSERT(status < 0); + ASSERT_OK(fail_cb_called); + ASSERT_LT(status, 0); ASSERT_NULL(res); uv_freeaddrinfo(res); /* Should not crash. */ fail_cb_called++; @@ -51,7 +51,7 @@ static void getaddrinfo_fail_cb(uv_getaddrinfo_t* req, static void getaddrinfo_basic_cb(uv_getaddrinfo_t* handle, int status, struct addrinfo* res) { - ASSERT(handle == getaddrinfo_handle); + ASSERT_PTR_EQ(handle, getaddrinfo_handle); getaddrinfo_cbs++; free(handle); uv_freeaddrinfo(res); @@ -66,7 +66,7 @@ static void getaddrinfo_cuncurrent_cb(uv_getaddrinfo_t* handle, for (i = 0; i < CONCURRENT_COUNT; i++) { if (&getaddrinfo_handles[i] == handle) { - ASSERT(i == *data); + ASSERT_EQ(i, *data); callback_counts[i]++; break; @@ -89,22 +89,22 @@ TEST_IMPL(getaddrinfo_fail) { uv_getaddrinfo_t req; - ASSERT(UV_EINVAL == uv_getaddrinfo(uv_default_loop(), - &req, - (uv_getaddrinfo_cb) abort, - NULL, - NULL, - NULL)); + ASSERT_EQ(UV_EINVAL, uv_getaddrinfo(uv_default_loop(), + &req, + (uv_getaddrinfo_cb) abort, + NULL, + NULL, + NULL)); /* Use a FQDN by ending in a period */ - ASSERT(0 == uv_getaddrinfo(uv_default_loop(), - &req, - getaddrinfo_fail_cb, - "example.invalid.", - NULL, - NULL)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(fail_cb_called == 1); + ASSERT_OK(uv_getaddrinfo(uv_default_loop(), + &req, + getaddrinfo_fail_cb, + "example.invalid.", + NULL, + NULL)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, fail_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -119,12 +119,12 @@ TEST_IMPL(getaddrinfo_fail_sync) { uv_getaddrinfo_t req; /* Use a FQDN by ending in a period */ - ASSERT(0 > uv_getaddrinfo(uv_default_loop(), - &req, - NULL, - "example.invalid.", - NULL, - NULL)); + ASSERT_GT(0, uv_getaddrinfo(uv_default_loop(), + &req, + NULL, + "example.invalid.", + NULL, + NULL)); uv_freeaddrinfo(req.addrinfo); MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -147,11 +147,11 @@ TEST_IMPL(getaddrinfo_basic) { name, NULL, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(getaddrinfo_cbs == 1); + ASSERT_EQ(1, getaddrinfo_cbs); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -165,12 +165,12 @@ TEST_IMPL(getaddrinfo_basic_sync) { #endif uv_getaddrinfo_t req; - ASSERT(0 == uv_getaddrinfo(uv_default_loop(), - &req, - NULL, - name, - NULL, - NULL)); + ASSERT_OK(uv_getaddrinfo(uv_default_loop(), + &req, + NULL, + name, + NULL, + NULL)); uv_freeaddrinfo(req.addrinfo); MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -201,13 +201,13 @@ TEST_IMPL(getaddrinfo_concurrent) { name, NULL, NULL); - ASSERT(r == 0); + ASSERT_OK(r); } uv_run(uv_default_loop(), UV_RUN_DEFAULT); for (i = 0; i < CONCURRENT_COUNT; i++) { - ASSERT(callback_counts[i] == 1); + ASSERT_EQ(1, callback_counts[i]); } MAKE_VALGRIND_HAPPY(uv_default_loop()); diff --git a/deps/uv/test/test-gethostname.c b/deps/uv/test/test-gethostname.c index dc29cd69234a13..cc15a8253ebf5a 100644 --- a/deps/uv/test/test-gethostname.c +++ b/deps/uv/test/test-gethostname.c @@ -32,27 +32,27 @@ TEST_IMPL(gethostname) { /* Reject invalid inputs */ size = 1; r = uv_os_gethostname(NULL, &size); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_os_gethostname(buf, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); size = 0; r = uv_os_gethostname(buf, &size); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Return UV_ENOBUFS if the buffer cannot hold the hostname */ enobufs_size = 1; buf[0] = '\0'; r = uv_os_gethostname(buf, &enobufs_size); ASSERT_EQ(r, UV_ENOBUFS); - ASSERT(buf[0] == '\0'); - ASSERT(enobufs_size > 1); + ASSERT_EQ(buf[0], '\0'); + ASSERT_GT(enobufs_size, 1); /* Successfully get the hostname */ size = UV_MAXHOSTNAMESIZE; r = uv_os_gethostname(buf, &size); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(size > 0 && size == strlen(buf)); - ASSERT(size + 1 == enobufs_size); + ASSERT_EQ(size + 1, enobufs_size); return 0; } diff --git a/deps/uv/test/test-getnameinfo.c b/deps/uv/test/test-getnameinfo.c index cea57b012f1322..415e48a4f961df 100644 --- a/deps/uv/test/test-getnameinfo.c +++ b/deps/uv/test/test-getnameinfo.c @@ -39,7 +39,7 @@ static void getnameinfo_req(uv_getnameinfo_t* handle, const char* hostname, const char* service) { ASSERT_NOT_NULL(handle); - ASSERT(status == 0); + ASSERT_OK(status); ASSERT_NOT_NULL(hostname); ASSERT_NOT_NULL(service); } @@ -54,14 +54,14 @@ TEST_IMPL(getnameinfo_basic_ip4) { int r; r = uv_ip4_addr(address_ip4, port, &addr4); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getnameinfo(uv_default_loop(), &req, &getnameinfo_req, (const struct sockaddr*)&addr4, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); @@ -76,15 +76,15 @@ TEST_IMPL(getnameinfo_basic_ip4_sync) { RETURN_SKIP("Test does not currently work in QEMU"); #endif - ASSERT(0 == uv_ip4_addr(address_ip4, port, &addr4)); + ASSERT_OK(uv_ip4_addr(address_ip4, port, &addr4)); - ASSERT(0 == uv_getnameinfo(uv_default_loop(), - &req, - NULL, - (const struct sockaddr*)&addr4, - 0)); - ASSERT(req.host[0] != '\0'); - ASSERT(req.service[0] != '\0'); + ASSERT_OK(uv_getnameinfo(uv_default_loop(), + &req, + NULL, + (const struct sockaddr*)&addr4, + 0)); + ASSERT_NE(req.host[0], '\0'); + ASSERT_NE(req.service[0], '\0'); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -100,14 +100,14 @@ TEST_IMPL(getnameinfo_basic_ip6) { int r; r = uv_ip6_addr(address_ip6, port, &addr6); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getnameinfo(uv_default_loop(), &req, &getnameinfo_req, (const struct sockaddr*)&addr6, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-getsockname.c b/deps/uv/test/test-getsockname.c index 1d4d9f12bdaab3..7bc0ba2e9f2f68 100644 --- a/deps/uv/test/test-getsockname.c +++ b/deps/uv/test/test-getsockname.c @@ -73,7 +73,7 @@ static void after_read(uv_stream_t* handle, req = (uv_shutdown_t*) malloc(sizeof *req); r = uv_shutdown(req, handle, after_shutdown); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -84,22 +84,22 @@ static void check_sockname(struct sockaddr* addr, const char* compare_ip, char check_ip[17]; int r; - ASSERT(0 == uv_ip4_addr(compare_ip, compare_port, &compare_addr)); + ASSERT_OK(uv_ip4_addr(compare_ip, compare_port, &compare_addr)); /* Both addresses should be ipv4 */ - ASSERT(check_addr.sin_family == AF_INET); - ASSERT(compare_addr.sin_family == AF_INET); + ASSERT_EQ(check_addr.sin_family, AF_INET); + ASSERT_EQ(compare_addr.sin_family, AF_INET); /* Check if the ip matches */ - ASSERT(memcmp(&check_addr.sin_addr, - &compare_addr.sin_addr, - sizeof compare_addr.sin_addr) == 0); + ASSERT_OK(memcmp(&check_addr.sin_addr, + &compare_addr.sin_addr, + sizeof compare_addr.sin_addr)); /* Check if the port matches. If port == 0 anything goes. */ ASSERT(compare_port == 0 || check_addr.sin_port == compare_addr.sin_port); r = uv_ip4_name(&check_addr, (char*) check_ip, sizeof check_ip); - ASSERT(r == 0); + ASSERT_OK(r); printf("%s: %s:%d\n", context, check_ip, ntohs(check_addr.sin_port)); } @@ -114,34 +114,34 @@ static void on_connection(uv_stream_t* server, int status) { if (status != 0) { fprintf(stderr, "Connect error %s\n", uv_err_name(status)); } - ASSERT(status == 0); + ASSERT_OK(status); handle = malloc(sizeof(*handle)); ASSERT_NOT_NULL(handle); r = uv_tcp_init(loop, handle); - ASSERT(r == 0); + ASSERT_OK(r); /* associate server with stream */ handle->data = server; r = uv_accept(server, (uv_stream_t*)handle); - ASSERT(r == 0); + ASSERT_OK(r); namelen = sizeof sockname; r = uv_tcp_getsockname(handle, &sockname, &namelen); - ASSERT(r == 0); + ASSERT_OK(r); check_sockname(&sockname, "127.0.0.1", server_port, "accepted socket"); getsocknamecount_tcp++; namelen = sizeof peername; r = uv_tcp_getpeername(handle, &peername, &namelen); - ASSERT(r == 0); + ASSERT_OK(r); check_sockname(&peername, "127.0.0.1", connect_port, "accepted socket peer"); getpeernamecount++; r = uv_read_start((uv_stream_t*)handle, alloc, after_read); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -149,17 +149,17 @@ static void on_connect(uv_connect_t* req, int status) { struct sockaddr sockname, peername; int r, namelen; - ASSERT(status == 0); + ASSERT_OK(status); namelen = sizeof sockname; r = uv_tcp_getsockname((uv_tcp_t*) req->handle, &sockname, &namelen); - ASSERT(r == 0); + ASSERT_OK(r); check_sockname(&sockname, "127.0.0.1", 0, "connected socket"); getsocknamecount_tcp++; namelen = sizeof peername; r = uv_tcp_getpeername((uv_tcp_t*) req->handle, &peername, &namelen); - ASSERT(r == 0); + ASSERT_OK(r); check_sockname(&peername, "127.0.0.1", server_port, "connected socket peer"); getpeernamecount++; @@ -173,7 +173,7 @@ static int tcp_listener(void) { int namelen; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", server_port, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", server_port, &addr)); r = uv_tcp_init(loop, &tcpServer); if (r) { @@ -196,13 +196,13 @@ static int tcp_listener(void) { memset(&sockname, -1, sizeof sockname); namelen = sizeof sockname; r = uv_tcp_getsockname(&tcpServer, &sockname, &namelen); - ASSERT(r == 0); + ASSERT_OK(r); check_sockname(&sockname, "0.0.0.0", server_port, "server socket"); getsocknamecount_tcp++; namelen = sizeof sockname; r = uv_tcp_getpeername(&tcpServer, &peername, &namelen); - ASSERT(r == UV_ENOTCONN); + ASSERT_EQ(r, UV_ENOTCONN); getpeernamecount++; return 0; @@ -214,7 +214,7 @@ static void tcp_connector(void) { struct sockaddr sockname; int r, namelen; - ASSERT(0 == uv_ip4_addr("127.0.0.1", server_port, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", server_port, &server_addr)); r = uv_tcp_init(loop, &tcp); tcp.data = &connect_req; @@ -230,9 +230,9 @@ static void tcp_connector(void) { namelen = sizeof sockname; r = uv_tcp_getsockname(&tcp, &sockname, &namelen); ASSERT(!r); - ASSERT(sockname.sa_family == AF_INET); + ASSERT_EQ(sockname.sa_family, AF_INET); connect_port = ntohs(((struct sockaddr_in*) &sockname)->sin_port); - ASSERT(connect_port > 0); + ASSERT_GT(connect_port, 0); } @@ -245,7 +245,7 @@ static void udp_recv(uv_udp_t* handle, int namelen; int r; - ASSERT(nread >= 0); + ASSERT_GE(nread, 0); free(buf->base); if (nread == 0) { @@ -255,7 +255,7 @@ static void udp_recv(uv_udp_t* handle, memset(&sockname, -1, sizeof sockname); namelen = sizeof(sockname); r = uv_udp_getsockname(&udp, &sockname, &namelen); - ASSERT(r == 0); + ASSERT_OK(r); check_sockname(&sockname, "0.0.0.0", 0, "udp receiving socket"); getsocknamecount_udp++; @@ -275,7 +275,7 @@ static int udp_listener(void) { int namelen; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", server_port, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", server_port, &addr)); r = uv_udp_init(loop, &udpServer); if (r) { @@ -292,12 +292,12 @@ static int udp_listener(void) { memset(&sockname, -1, sizeof sockname); namelen = sizeof sockname; r = uv_udp_getsockname(&udpServer, &sockname, &namelen); - ASSERT(r == 0); + ASSERT_OK(r); check_sockname(&sockname, "0.0.0.0", server_port, "udp listener socket"); getsocknamecount_udp++; r = uv_udp_recv_start(&udpServer, alloc, udp_recv); - ASSERT(r == 0); + ASSERT_OK(r); return 0; } @@ -312,7 +312,7 @@ static void udp_sender(void) { ASSERT(!r); buf = uv_buf_init("PING", 4); - ASSERT(0 == uv_ip4_addr("127.0.0.1", server_port, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", server_port, &server_addr)); r = uv_udp_send(&send_req, &udp, @@ -334,8 +334,8 @@ TEST_IMPL(getsockname_tcp) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(getsocknamecount_tcp == 3); - ASSERT(getpeernamecount == 3); + ASSERT_EQ(3, getsocknamecount_tcp); + ASSERT_EQ(3, getpeernamecount); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -352,10 +352,10 @@ TEST_IMPL(getsockname_udp) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(getsocknamecount_udp == 2); + ASSERT_EQ(2, getsocknamecount_udp); - ASSERT(udp.send_queue_size == 0); - ASSERT(udpServer.send_queue_size == 0); + ASSERT_OK(udp.send_queue_size); + ASSERT_OK(udpServer.send_queue_size); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-getters-setters.c b/deps/uv/test/test-getters-setters.c index 9869f7b9da8b1f..e4c6717d3bca64 100644 --- a/deps/uv/test/test-getters-setters.c +++ b/deps/uv/test/test-getters-setters.c @@ -30,9 +30,9 @@ int cookie3; TEST_IMPL(handle_type_name) { - ASSERT(strcmp(uv_handle_type_name(UV_NAMED_PIPE), "pipe") == 0); - ASSERT(strcmp(uv_handle_type_name(UV_UDP), "udp") == 0); - ASSERT(strcmp(uv_handle_type_name(UV_FILE), "file") == 0); + ASSERT_OK(strcmp(uv_handle_type_name(UV_NAMED_PIPE), "pipe")); + ASSERT_OK(strcmp(uv_handle_type_name(UV_UDP), "udp")); + ASSERT_OK(strcmp(uv_handle_type_name(UV_FILE), "file")); ASSERT_NULL(uv_handle_type_name(UV_HANDLE_TYPE_MAX)); ASSERT_NULL(uv_handle_type_name(UV_HANDLE_TYPE_MAX + 1)); ASSERT_NULL(uv_handle_type_name(UV_UNKNOWN_HANDLE)); @@ -41,9 +41,9 @@ TEST_IMPL(handle_type_name) { TEST_IMPL(req_type_name) { - ASSERT(strcmp(uv_req_type_name(UV_REQ), "req") == 0); - ASSERT(strcmp(uv_req_type_name(UV_UDP_SEND), "udp_send") == 0); - ASSERT(strcmp(uv_req_type_name(UV_WORK), "work") == 0); + ASSERT_OK(strcmp(uv_req_type_name(UV_REQ), "req")); + ASSERT_OK(strcmp(uv_req_type_name(UV_UDP_SEND), "udp_send")); + ASSERT_OK(strcmp(uv_req_type_name(UV_WORK), "work")); ASSERT_NULL(uv_req_type_name(UV_REQ_TYPE_MAX)); ASSERT_NULL(uv_req_type_name(UV_REQ_TYPE_MAX + 1)); ASSERT_NULL(uv_req_type_name(UV_UNKNOWN_REQ)); @@ -60,48 +60,48 @@ TEST_IMPL(getters_setters) { loop = malloc(uv_loop_size()); ASSERT_NOT_NULL(loop); r = uv_loop_init(loop); - ASSERT(r == 0); + ASSERT_OK(r); uv_loop_set_data(loop, &cookie1); - ASSERT(loop->data == &cookie1); - ASSERT(uv_loop_get_data(loop) == &cookie1); + ASSERT_PTR_EQ(loop->data, &cookie1); + ASSERT_PTR_EQ(uv_loop_get_data(loop), &cookie1); pipe = malloc(uv_handle_size(UV_NAMED_PIPE)); r = uv_pipe_init(loop, pipe, 0); - ASSERT(r == 0); - ASSERT(uv_handle_get_type((uv_handle_t*)pipe) == UV_NAMED_PIPE); + ASSERT_OK(r); + ASSERT_EQ(uv_handle_get_type((uv_handle_t*)pipe), UV_NAMED_PIPE); - ASSERT(uv_handle_get_loop((uv_handle_t*)pipe) == loop); + ASSERT_PTR_EQ(uv_handle_get_loop((uv_handle_t*)pipe), loop); pipe->data = &cookie2; - ASSERT(uv_handle_get_data((uv_handle_t*)pipe) == &cookie2); + ASSERT_PTR_EQ(uv_handle_get_data((uv_handle_t*)pipe), &cookie2); uv_handle_set_data((uv_handle_t*)pipe, &cookie1); - ASSERT(uv_handle_get_data((uv_handle_t*)pipe) == &cookie1); - ASSERT(pipe->data == &cookie1); + ASSERT_PTR_EQ(uv_handle_get_data((uv_handle_t*)pipe), &cookie1); + ASSERT_PTR_EQ(pipe->data, &cookie1); - ASSERT(uv_stream_get_write_queue_size((uv_stream_t*)pipe) == 0); + ASSERT_OK(uv_stream_get_write_queue_size((uv_stream_t*)pipe)); pipe->write_queue_size++; - ASSERT(uv_stream_get_write_queue_size((uv_stream_t*)pipe) == 1); + ASSERT_EQ(1, uv_stream_get_write_queue_size((uv_stream_t*)pipe)); pipe->write_queue_size--; uv_close((uv_handle_t*)pipe, NULL); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); fs = malloc(uv_req_size(UV_FS)); uv_fs_stat(loop, fs, ".", NULL); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(uv_fs_get_type(fs) == UV_FS_STAT); - ASSERT(uv_fs_get_result(fs) == 0); - ASSERT(uv_fs_get_ptr(fs) == uv_fs_get_statbuf(fs)); + ASSERT_EQ(uv_fs_get_type(fs), UV_FS_STAT); + ASSERT_OK(uv_fs_get_result(fs)); + ASSERT_PTR_EQ(uv_fs_get_ptr(fs), uv_fs_get_statbuf(fs)); ASSERT(uv_fs_get_statbuf(fs)->st_mode & S_IFDIR); - ASSERT(strcmp(uv_fs_get_path(fs), ".") == 0); + ASSERT_OK(strcmp(uv_fs_get_path(fs), ".")); uv_fs_req_cleanup(fs); r = uv_loop_close(loop); - ASSERT(r == 0); + ASSERT_OK(r); free(pipe); free(fs); diff --git a/deps/uv/test/test-gettimeofday.c b/deps/uv/test/test-gettimeofday.c index 4ebc11f93ed321..7d9012815c4022 100644 --- a/deps/uv/test/test-gettimeofday.c +++ b/deps/uv/test/test-gettimeofday.c @@ -28,12 +28,12 @@ TEST_IMPL(gettimeofday) { tv.tv_sec = 0; r = uv_gettimeofday(&tv); - ASSERT(r == 0); - ASSERT(tv.tv_sec != 0); + ASSERT_OK(r); + ASSERT_NE(0, tv.tv_sec); /* Test invalid input. */ r = uv_gettimeofday(NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); return 0; } diff --git a/deps/uv/test/test-handle-fileno.c b/deps/uv/test/test-handle-fileno.c index 6c4c2b6601d4a3..be53152ce8459c 100644 --- a/deps/uv/test/test-handle-fileno.c +++ b/deps/uv/test/test-handle-fileno.c @@ -56,49 +56,49 @@ TEST_IMPL(handle_fileno) { uv_loop_t* loop; loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_idle_init(loop, &idle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((uv_handle_t*) &idle, &fd); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*) &idle, NULL); r = uv_tcp_init(loop, &tcp); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((uv_handle_t*) &tcp, &fd); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_tcp_bind(&tcp, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((uv_handle_t*) &tcp, &fd); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &tcp, NULL); r = uv_fileno((uv_handle_t*) &tcp, &fd); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_udp_init(loop, &udp); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((uv_handle_t*) &udp, &fd); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_udp_bind(&udp, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((uv_handle_t*) &udp, &fd); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &udp, NULL); r = uv_fileno((uv_handle_t*) &udp, &fd); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_pipe_init(loop, &pipe, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((uv_handle_t*) &pipe, &fd); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_pipe_bind(&pipe, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((uv_handle_t*) &pipe, &fd); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &pipe, NULL); r = uv_fileno((uv_handle_t*) &pipe, &fd); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); tty_fd = get_tty_fd(); if (tty_fd < 0) { @@ -106,14 +106,14 @@ TEST_IMPL(handle_fileno) { fflush(stderr); } else { r = uv_tty_init(loop, &tty, tty_fd, 0); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(uv_is_readable((uv_stream_t*) &tty)); ASSERT(!uv_is_writable((uv_stream_t*) &tty)); r = uv_fileno((uv_handle_t*) &tty, &fd); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &tty, NULL); r = uv_fileno((uv_handle_t*) &tty, &fd); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); ASSERT(!uv_is_readable((uv_stream_t*) &tty)); ASSERT(!uv_is_writable((uv_stream_t*) &tty)); } diff --git a/deps/uv/test/test-homedir.c b/deps/uv/test/test-homedir.c index 508351f72c0327..769d5c8179fc77 100644 --- a/deps/uv/test/test-homedir.c +++ b/deps/uv/test/test-homedir.c @@ -34,39 +34,39 @@ TEST_IMPL(homedir) { /* Test the normal case */ len = sizeof homedir; homedir[0] = '\0'; - ASSERT(strlen(homedir) == 0); + ASSERT_OK(strlen(homedir)); r = uv_os_homedir(homedir, &len); - ASSERT(r == 0); - ASSERT(strlen(homedir) == len); - ASSERT(len > 0); - ASSERT(homedir[len] == '\0'); + ASSERT_OK(r); + ASSERT_EQ(strlen(homedir), len); + ASSERT_GT(len, 0); + ASSERT_EQ(homedir[len], '\0'); #ifdef _WIN32 if (len == 3 && homedir[1] == ':') - ASSERT(homedir[2] == '\\'); + ASSERT_EQ(homedir[2], '\\'); else - ASSERT(homedir[len - 1] != '\\'); + ASSERT_NE(homedir[len - 1], '\\'); #else if (len == 1) - ASSERT(homedir[0] == '/'); + ASSERT_EQ(homedir[0], '/'); else - ASSERT(homedir[len - 1] != '/'); + ASSERT_NE(homedir[len - 1], '/'); #endif /* Test the case where the buffer is too small */ len = SMALLPATH; r = uv_os_homedir(homedir, &len); - ASSERT(r == UV_ENOBUFS); - ASSERT(len > SMALLPATH); + ASSERT_EQ(r, UV_ENOBUFS); + ASSERT_GT(len, SMALLPATH); /* Test invalid inputs */ r = uv_os_homedir(NULL, &len); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_os_homedir(homedir, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); len = 0; r = uv_os_homedir(homedir, &len); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); return 0; } diff --git a/deps/uv/test/test-hrtime.c b/deps/uv/test/test-hrtime.c index 854a482f23c189..c0b88c6757def7 100644 --- a/deps/uv/test/test-hrtime.c +++ b/deps/uv/test/test-hrtime.c @@ -45,7 +45,7 @@ TEST_IMPL(hrtime) { * that the difference between the two hrtime values has a reasonable * lower bound. */ - ASSERT(diff > (uint64_t) 25 * NANOSEC / MILLISEC); + ASSERT_UINT64_GT(diff, (uint64_t) 25 * NANOSEC / MILLISEC); --i; } return 0; @@ -57,8 +57,8 @@ TEST_IMPL(clock_gettime) { ASSERT_EQ(UV_EINVAL, uv_clock_gettime(1337, &t)); ASSERT_EQ(UV_EFAULT, uv_clock_gettime(1337, NULL)); - ASSERT_EQ(0, uv_clock_gettime(UV_CLOCK_MONOTONIC, &t)); - ASSERT_EQ(0, uv_clock_gettime(UV_CLOCK_REALTIME, &t)); + ASSERT_OK(uv_clock_gettime(UV_CLOCK_MONOTONIC, &t)); + ASSERT_OK(uv_clock_gettime(UV_CLOCK_REALTIME, &t)); ASSERT_GT(1682500000000ll, t.tv_sec); /* 2023-04-26T09:06:40.000Z */ return 0; diff --git a/deps/uv/test/test-idle.c b/deps/uv/test/test-idle.c index e3f4c2bcb659f9..069e3483580568 100644 --- a/deps/uv/test/test-idle.c +++ b/deps/uv/test/test-idle.c @@ -39,7 +39,7 @@ static void close_cb(uv_handle_t* handle) { static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer_handle); + ASSERT_PTR_EQ(handle, &timer_handle); uv_close((uv_handle_t*) &idle_handle, close_cb); uv_close((uv_handle_t*) &check_handle, close_cb); @@ -52,7 +52,7 @@ static void timer_cb(uv_timer_t* handle) { static void idle_cb(uv_idle_t* handle) { - ASSERT(handle == &idle_handle); + ASSERT_PTR_EQ(handle, &idle_handle); idle_cb_called++; fprintf(stderr, "idle_cb %d\n", idle_cb_called); @@ -61,7 +61,7 @@ static void idle_cb(uv_idle_t* handle) { static void check_cb(uv_check_t* handle) { - ASSERT(handle == &check_handle); + ASSERT_PTR_EQ(handle, &check_handle); check_cb_called++; fprintf(stderr, "check_cb %d\n", check_cb_called); @@ -73,26 +73,26 @@ TEST_IMPL(idle_starvation) { int r; r = uv_idle_init(uv_default_loop(), &idle_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_idle_start(&idle_handle, idle_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_check_init(uv_default_loop(), &check_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_check_start(&check_handle, check_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(uv_default_loop(), &timer_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer_handle, timer_cb, 50, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(idle_cb_called > 0); - ASSERT(timer_cb_called == 1); - ASSERT(close_cb_called == 3); + ASSERT_GT(idle_cb_called, 0); + ASSERT_EQ(1, timer_cb_called); + ASSERT_EQ(3, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -105,19 +105,19 @@ static void idle_stop(uv_idle_t* handle) { TEST_IMPL(idle_check) { - ASSERT_EQ(0, uv_idle_init(uv_default_loop(), &idle_handle)); - ASSERT_EQ(0, uv_idle_start(&idle_handle, idle_stop)); + ASSERT_OK(uv_idle_init(uv_default_loop(), &idle_handle)); + ASSERT_OK(uv_idle_start(&idle_handle, idle_stop)); - ASSERT_EQ(0, uv_check_init(uv_default_loop(), &check_handle)); - ASSERT_EQ(0, uv_check_start(&check_handle, check_cb)); + ASSERT_OK(uv_check_init(uv_default_loop(), &check_handle)); + ASSERT_OK(uv_check_start(&check_handle, check_cb)); ASSERT_EQ(1, uv_run(uv_default_loop(), UV_RUN_ONCE)); ASSERT_EQ(1, check_cb_called); - ASSERT_EQ(0, close_cb_called); + ASSERT_OK(close_cb_called); uv_close((uv_handle_t*) &idle_handle, close_cb); uv_close((uv_handle_t*) &check_handle, close_cb); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); diff --git a/deps/uv/test/test-idna.c b/deps/uv/test/test-idna.c index 9b7002819fa354..bcacfc8a3ad785 100644 --- a/deps/uv/test/test-idna.c +++ b/deps/uv/test/test-idna.c @@ -20,6 +20,7 @@ */ #include "task.h" +#define uv__malloc malloc #include "../src/idna.c" #include @@ -31,66 +32,66 @@ TEST_IMPL(utf8_decode1) { /* ASCII. */ p = b; snprintf(b, sizeof(b), "%c\x7F", 0x00); - ASSERT(0 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 1); - ASSERT(127 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 2); + ASSERT_OK(uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 1); + ASSERT_EQ(127, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 2); /* Two-byte sequences. */ p = b; snprintf(b, sizeof(b), "\xC2\x80\xDF\xBF"); - ASSERT(128 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 2); - ASSERT(0x7FF == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 4); + ASSERT_EQ(128, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 2); + ASSERT_EQ(0x7FF, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 4); /* Three-byte sequences. */ p = b; snprintf(b, sizeof(b), "\xE0\xA0\x80\xEF\xBF\xBF"); - ASSERT(0x800 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 3); - ASSERT(0xFFFF == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 6); + ASSERT_EQ(0x800, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 3); + ASSERT_EQ(0xFFFF, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 6); /* Four-byte sequences. */ p = b; snprintf(b, sizeof(b), "\xF0\x90\x80\x80\xF4\x8F\xBF\xBF"); - ASSERT(0x10000 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 4); - ASSERT(0x10FFFF == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 8); + ASSERT_EQ(0x10000, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 4); + ASSERT_EQ(0x10FFFF, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 8); /* Four-byte sequences > U+10FFFF; disallowed. */ p = b; snprintf(b, sizeof(b), "\xF4\x90\xC0\xC0\xF7\xBF\xBF\xBF"); - ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 4); - ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 8); + ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 4); + ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 8); /* Overlong; disallowed. */ p = b; snprintf(b, sizeof(b), "\xC0\x80\xC1\x80"); - ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 2); - ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 4); + ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 2); + ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 4); /* Surrogate pairs; disallowed. */ p = b; snprintf(b, sizeof(b), "\xED\xA0\x80\xED\xA3\xBF"); - ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 3); - ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + 6); + ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 3); + ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + 6); /* Simply illegal. */ p = b; snprintf(b, sizeof(b), "\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); for (i = 1; i <= 8; i++) { - ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b))); - ASSERT(p == b + i); + ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + sizeof(b))); + ASSERT_PTR_EQ(p, b + i); } return 0; @@ -122,7 +123,7 @@ TEST_IMPL(utf8_decode1_overrun) { do { \ char d[256] = {0}; \ static const char s[] = "" input ""; \ - ASSERT(err == uv__idna_toascii(s, s + sizeof(s) - 1, d, d + sizeof(d))); \ + ASSERT_EQ(err, uv__idna_toascii(s, s + sizeof(s) - 1, d, d + sizeof(d))); \ } while (0) #define T(input, expected) \ @@ -132,13 +133,13 @@ TEST_IMPL(utf8_decode1_overrun) { char d2[256] = {0}; \ static const char s[] = "" input ""; \ n = uv__idna_toascii(s, s + sizeof(s) - 1, d1, d1 + sizeof(d1)); \ - ASSERT(n == sizeof(expected)); \ - ASSERT(0 == memcmp(d1, expected, n)); \ + ASSERT_EQ(n, sizeof(expected)); \ + ASSERT_OK(memcmp(d1, expected, n)); \ /* Sanity check: encoding twice should not change the output. */ \ n = uv__idna_toascii(d1, d1 + strlen(d1), d2, d2 + sizeof(d2)); \ - ASSERT(n == sizeof(expected)); \ - ASSERT(0 == memcmp(d2, expected, n)); \ - ASSERT(0 == memcmp(d1, d2, sizeof(d2))); \ + ASSERT_EQ(n, sizeof(expected)); \ + ASSERT_OK(memcmp(d2, expected, n)); \ + ASSERT_OK(memcmp(d1, d2, sizeof(d2))); \ } while (0) TEST_IMPL(idna_toascii) { diff --git a/deps/uv/test/test-ip-name.c b/deps/uv/test/test-ip-name.c index 006095f5f9731b..cdc0c563427ca8 100644 --- a/deps/uv/test/test-ip-name.c +++ b/deps/uv/test/test-ip-name.c @@ -40,20 +40,20 @@ TEST_IMPL(ip_name) { struct sockaddr_in6* addr6 = &test_addr.addr6; /* test ip4_name */ - ASSERT_EQ(0, uv_ip4_addr("192.168.0.1", TEST_PORT, addr4)); - ASSERT_EQ(0, uv_ip4_name(addr4, dst, INET_ADDRSTRLEN)); - ASSERT_EQ(0, strcmp("192.168.0.1", dst)); + ASSERT_OK(uv_ip4_addr("192.168.0.1", TEST_PORT, addr4)); + ASSERT_OK(uv_ip4_name(addr4, dst, INET_ADDRSTRLEN)); + ASSERT_OK(strcmp("192.168.0.1", dst)); - ASSERT_EQ(0, uv_ip_name(addr, dst, INET_ADDRSTRLEN)); - ASSERT_EQ(0, strcmp("192.168.0.1", dst)); + ASSERT_OK(uv_ip_name(addr, dst, INET_ADDRSTRLEN)); + ASSERT_OK(strcmp("192.168.0.1", dst)); /* test ip6_name */ - ASSERT_EQ(0, uv_ip6_addr("fe80::2acf:daff:fedd:342a", TEST_PORT, addr6)); - ASSERT_EQ(0, uv_ip6_name(addr6, dst, INET6_ADDRSTRLEN)); - ASSERT_EQ(0, strcmp("fe80::2acf:daff:fedd:342a", dst)); + ASSERT_OK(uv_ip6_addr("fe80::2acf:daff:fedd:342a", TEST_PORT, addr6)); + ASSERT_OK(uv_ip6_name(addr6, dst, INET6_ADDRSTRLEN)); + ASSERT_OK(strcmp("fe80::2acf:daff:fedd:342a", dst)); - ASSERT_EQ(0, uv_ip_name(addr, dst, INET6_ADDRSTRLEN)); - ASSERT_EQ(0, strcmp("fe80::2acf:daff:fedd:342a", dst)); + ASSERT_OK(uv_ip_name(addr, dst, INET6_ADDRSTRLEN)); + ASSERT_OK(strcmp("fe80::2acf:daff:fedd:342a", dst)); /* test other sa_family */ addr->sa_family = AF_UNIX; diff --git a/deps/uv/test/test-ip4-addr.c b/deps/uv/test/test-ip4-addr.c index 722ffb390a99e4..4a16c832d33ee7 100644 --- a/deps/uv/test/test-ip4-addr.c +++ b/deps/uv/test/test-ip4-addr.c @@ -30,25 +30,25 @@ TEST_IMPL(ip4_addr) { struct sockaddr_in addr; char dst[16]; - ASSERT(0 == uv_inet_ntop(AF_INET, "\xFF\xFF\xFF\xFF", dst, sizeof(dst))); - ASSERT(0 == strcmp(dst, "255.255.255.255")); - ASSERT(UV_ENOSPC == uv_inet_ntop(AF_INET, "\xFF\xFF\xFF\xFF", - dst, sizeof(dst) - 1)); - - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_ip4_addr("255.255.255.255", TEST_PORT, &addr)); - ASSERT(UV_EINVAL == uv_ip4_addr("255.255.255*000", TEST_PORT, &addr)); - ASSERT(UV_EINVAL == uv_ip4_addr("255.255.255.256", TEST_PORT, &addr)); - ASSERT(UV_EINVAL == uv_ip4_addr("2555.0.0.0", TEST_PORT, &addr)); - ASSERT(UV_EINVAL == uv_ip4_addr("255", TEST_PORT, &addr)); + ASSERT_OK(uv_inet_ntop(AF_INET, "\xFF\xFF\xFF\xFF", dst, sizeof(dst))); + ASSERT_OK(strcmp(dst, "255.255.255.255")); + ASSERT_EQ(UV_ENOSPC, uv_inet_ntop(AF_INET, "\xFF\xFF\xFF\xFF", + dst, sizeof(dst) - 1)); + + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("255.255.255.255", TEST_PORT, &addr)); + ASSERT_EQ(UV_EINVAL, uv_ip4_addr("255.255.255*000", TEST_PORT, &addr)); + ASSERT_EQ(UV_EINVAL, uv_ip4_addr("255.255.255.256", TEST_PORT, &addr)); + ASSERT_EQ(UV_EINVAL, uv_ip4_addr("2555.0.0.0", TEST_PORT, &addr)); + ASSERT_EQ(UV_EINVAL, uv_ip4_addr("255", TEST_PORT, &addr)); #ifdef SIN6_LEN - ASSERT(addr.sin_len == sizeof(addr)); + ASSERT_EQ(addr.sin_len, sizeof(addr)); #endif /* for broken address family */ - ASSERT(UV_EAFNOSUPPORT == uv_inet_pton(42, "127.0.0.1", - &addr.sin_addr.s_addr)); + ASSERT_EQ(UV_EAFNOSUPPORT, uv_inet_pton(42, "127.0.0.1", + &addr.sin_addr.s_addr)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-ip6-addr.c b/deps/uv/test/test-ip6-addr.c index 8f0c18601ba815..632b7928994950 100644 --- a/deps/uv/test/test-ip6-addr.c +++ b/deps/uv/test/test-ip6-addr.c @@ -51,7 +51,7 @@ TEST_IMPL(ip6_addr_link_local) { int ix; int r; - ASSERT(0 == uv_interface_addresses(&addresses, &count)); + ASSERT_OK(uv_interface_addresses(&addresses, &count)); for (ix = 0; ix < count; ix++) { address = addresses + ix; @@ -59,10 +59,10 @@ TEST_IMPL(ip6_addr_link_local) { if (address->address.address6.sin6_family != AF_INET6) continue; - ASSERT(0 == uv_inet_ntop(AF_INET6, - &address->address.address6.sin6_addr, - string_address, - sizeof(string_address))); + ASSERT_OK(uv_inet_ntop(AF_INET6, + &address->address.address6.sin6_addr, + string_address, + sizeof(string_address))); /* Skip addresses that are not link-local. */ if (strncmp(string_address, "fe80::", 6) != 0) @@ -72,21 +72,23 @@ TEST_IMPL(ip6_addr_link_local) { device_name = address->name; scoped_addr_len = sizeof(scoped_addr); - ASSERT(0 == uv_if_indextoname(iface_index, scoped_addr, &scoped_addr_len)); + ASSERT_OK(uv_if_indextoname(iface_index, + scoped_addr, + &scoped_addr_len)); #ifndef _WIN32 /* This assert fails on Windows, as Windows semantics are different. */ - ASSERT(0 == strcmp(device_name, scoped_addr)); + ASSERT_OK(strcmp(device_name, scoped_addr)); #endif interface_id_len = sizeof(interface_id); r = uv_if_indextoiid(iface_index, interface_id, &interface_id_len); - ASSERT(0 == r); + ASSERT_OK(r); #ifdef _WIN32 /* On Windows, the interface identifier is the numeric string of the index. */ - ASSERT(strtoul(interface_id, NULL, 10) == iface_index); + ASSERT_EQ(strtoul(interface_id, NULL, 10), iface_index); #else /* On Unix/Linux, the interface identifier is the interface device name. */ - ASSERT(0 == strcmp(device_name, interface_id)); + ASSERT_OK(strcmp(device_name, interface_id)); #endif snprintf(scoped_addr, @@ -102,16 +104,18 @@ TEST_IMPL(ip6_addr_link_local) { device_name); fflush(stderr); - ASSERT(0 == uv_ip6_addr(scoped_addr, TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr(scoped_addr, TEST_PORT, &addr)); fprintf(stderr, "Got scope_id 0x%2x\n", (unsigned)addr.sin6_scope_id); fflush(stderr); - ASSERT(iface_index == addr.sin6_scope_id); + ASSERT_EQ(iface_index, addr.sin6_scope_id); } uv_free_interface_addresses(addresses, count); scoped_addr_len = sizeof(scoped_addr); - ASSERT(0 != uv_if_indextoname((unsigned int)-1, scoped_addr, &scoped_addr_len)); + ASSERT_NE(0, uv_if_indextoname((unsigned int)-1, + scoped_addr, + &scoped_addr_len)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -137,16 +141,16 @@ TEST_IMPL(ip6_addr_link_local) { X("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255.255") \ #define TEST_GOOD(ADDR) \ - ASSERT(0 == uv_inet_pton(AF_INET6, ADDR, &addr)); \ - ASSERT(0 == uv_inet_pton(AF_INET6, ADDR "%en1", &addr)); \ - ASSERT(0 == uv_inet_pton(AF_INET6, ADDR "%%%%", &addr)); \ - ASSERT(0 == uv_inet_pton(AF_INET6, ADDR "%en1:1.2.3.4", &addr)); \ + ASSERT_OK(uv_inet_pton(AF_INET6, ADDR, &addr)); \ + ASSERT_OK(uv_inet_pton(AF_INET6, ADDR "%en1", &addr)); \ + ASSERT_OK(uv_inet_pton(AF_INET6, ADDR "%%%%", &addr)); \ + ASSERT_OK(uv_inet_pton(AF_INET6, ADDR "%en1:1.2.3.4", &addr)); \ #define TEST_BAD(ADDR) \ - ASSERT(0 != uv_inet_pton(AF_INET6, ADDR, &addr)); \ - ASSERT(0 != uv_inet_pton(AF_INET6, ADDR "%en1", &addr)); \ - ASSERT(0 != uv_inet_pton(AF_INET6, ADDR "%%%%", &addr)); \ - ASSERT(0 != uv_inet_pton(AF_INET6, ADDR "%en1:1.2.3.4", &addr)); \ + ASSERT_NE(0, uv_inet_pton(AF_INET6, ADDR, &addr)); \ + ASSERT_NE(0, uv_inet_pton(AF_INET6, ADDR "%en1", &addr)); \ + ASSERT_NE(0, uv_inet_pton(AF_INET6, ADDR "%%%%", &addr)); \ + ASSERT_NE(0, uv_inet_pton(AF_INET6, ADDR "%en1:1.2.3.4", &addr)); \ TEST_IMPL(ip6_pton) { struct in6_addr addr; @@ -163,9 +167,9 @@ TEST_IMPL(ip6_pton) { TEST_IMPL(ip6_sin6_len) { struct sockaddr_in6 s; - ASSERT_EQ(0, uv_ip6_addr("::", 0, &s)); + ASSERT_OK(uv_ip6_addr("::", 0, &s)); #ifdef SIN6_LEN - ASSERT(s.sin6_len == sizeof(s)); + ASSERT_EQ(s.sin6_len, sizeof(s)); #endif return 0; } diff --git a/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c b/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c index f239d1fc01fb7e..0305500abfbcb3 100644 --- a/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c +++ b/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c @@ -49,7 +49,7 @@ static size_t bytes_read; static void write_cb(uv_write_t* req, int status) { struct write_info* write_info = container_of(req, struct write_info, write_req); - ASSERT(status == 0); + ASSERT_OK(status); bytes_written += BUFFERS_PER_WRITE * BUFFER_SIZE; free(write_info); } @@ -75,7 +75,7 @@ static void do_write(uv_stream_t* handle) { r = uv_write( &write_info->write_req, handle, bufs, BUFFERS_PER_WRITE, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void alloc_cb(uv_handle_t* handle, @@ -94,18 +94,18 @@ static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { ssize_t i; int r; - ASSERT(nread >= 0); + ASSERT_GE(nread, 0); bytes_read += nread; for (i = 0; i < nread; i++) - ASSERT(buf->base[i] == BUFFER_CONTENT); + ASSERT_EQ(buf->base[i], BUFFER_CONTENT); free(buf->base); if (bytes_read >= XFER_SIZE) { r = uv_read_stop(handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_shutdown(&shutdown_req, handle, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); } } @@ -121,13 +121,13 @@ static void do_writes_and_reads(uv_stream_t* handle) { } r = uv_read_start(handle, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(handle->loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(bytes_written == XFER_SIZE); - ASSERT(bytes_read == XFER_SIZE); + ASSERT_EQ(bytes_written, XFER_SIZE); + ASSERT_EQ(bytes_read, XFER_SIZE); } TEST_IMPL(ipc_heavy_traffic_deadlock_bug) { @@ -146,9 +146,9 @@ int ipc_helper_heavy_traffic_deadlock_bug(void) { int r; r = uv_pipe_init(uv_default_loop(), &pipe, 1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_open(&pipe, 0); - ASSERT(r == 0); + ASSERT_OK(r); notify_parent_process(); do_writes_and_reads((uv_stream_t*) &pipe); diff --git a/deps/uv/test/test-ipc-send-recv.c b/deps/uv/test/test-ipc-send-recv.c index 48eea7286b87d9..0cdd881be05d87 100644 --- a/deps/uv/test/test-ipc-send-recv.c +++ b/deps/uv/test/test-ipc-send-recv.c @@ -96,7 +96,7 @@ static void recv_cb(uv_stream_t* handle, free(buf->base); pipe = (uv_pipe_t*) handle; - ASSERT(pipe == &ctx.channel); + ASSERT_PTR_EQ(pipe, &ctx.channel); do { if (++recv_cb_count == 1) { @@ -112,13 +112,13 @@ static void recv_cb(uv_stream_t* handle, * acceptable value. */ if (nread == UV_EOF) { /* UV_EOF is only acceptable for the final recv_cb call */ - ASSERT(recv_cb_count == 2); + ASSERT_EQ(2, recv_cb_count); } else { - ASSERT(nread >= 0); - ASSERT(uv_pipe_pending_count(pipe) > 0); + ASSERT_GE(nread, 0); + ASSERT_GT(uv_pipe_pending_count(pipe), 0); pending = uv_pipe_pending_type(pipe); - ASSERT(pending == ctx.expected_type); + ASSERT_EQ(pending, ctx.expected_type); if (pending == UV_NAMED_PIPE) r = uv_pipe_init(ctx.channel.loop, &recv->pipe, 0); @@ -126,10 +126,10 @@ static void recv_cb(uv_stream_t* handle, r = uv_tcp_init(ctx.channel.loop, &recv->tcp); else abort(); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_accept(handle, &recv->stream); - ASSERT(r == 0); + ASSERT_OK(r); } } while (uv_pipe_pending_count(pipe) > 0); @@ -143,8 +143,8 @@ static void connect_cb(uv_connect_t* req, int status) { int r; uv_buf_t buf; - ASSERT(req == &ctx.connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &ctx.connect_req); + ASSERT_OK(status); buf = uv_buf_init(".", 1); r = uv_write2(&ctx.write_req, @@ -152,7 +152,7 @@ static void connect_cb(uv_connect_t* req, int status) { &buf, 1, &ctx.send.stream, NULL); - ASSERT(r == 0); + ASSERT_OK(r); /* Perform two writes to the same pipe to make sure that on Windows we are * not running into issue 505: @@ -163,10 +163,10 @@ static void connect_cb(uv_connect_t* req, int status) { &buf, 1, &ctx.send2.stream, NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*)&ctx.channel, alloc_cb, recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static int run_test(int inprocess) { @@ -176,12 +176,12 @@ static int run_test(int inprocess) { if (inprocess) { r = uv_thread_create(&tid, ipc_send_recv_helper_threadproc, (void *) 42); - ASSERT(r == 0); + ASSERT_OK(r); uv_sleep(1000); r = uv_pipe_init(uv_default_loop(), &ctx.channel, 1); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_connect(&ctx.connect_req, &ctx.channel, TEST_PIPENAME_3, connect_cb); } else { @@ -191,13 +191,13 @@ static int run_test(int inprocess) { } r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(recv_cb_count == 2); + ASSERT_EQ(2, recv_cb_count); if (inprocess) { r = uv_thread_join(&tid); - ASSERT(r == 0); + ASSERT_OK(r); } return 0; @@ -209,19 +209,19 @@ static int run_ipc_send_recv_pipe(int inprocess) { ctx.expected_type = UV_NAMED_PIPE; r = uv_pipe_init(uv_default_loop(), &ctx.send.pipe, 1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&ctx.send.pipe, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(uv_default_loop(), &ctx.send2.pipe, 1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&ctx.send2.pipe, TEST_PIPENAME_2); - ASSERT(r == 0); + ASSERT_OK(r); r = run_test(inprocess); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -245,24 +245,24 @@ static int run_ipc_send_recv_tcp(int inprocess) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); ctx.expected_type = UV_TCP; r = uv_tcp_init(uv_default_loop(), &ctx.send.tcp); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_init(uv_default_loop(), &ctx.send2.tcp); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&ctx.send.tcp, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&ctx.send2.tcp, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = run_test(inprocess); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -286,7 +286,7 @@ TEST_IMPL(ipc_send_recv_tcp_inprocess) { /* Everything here runs in a child process or second thread. */ static void write2_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); /* After two successful writes in the child process, allow the child * process to be closed. */ @@ -317,7 +317,7 @@ static void read_cb(uv_stream_t* handle, ASSERT_GE(nread, 0); pipe = (uv_pipe_t*) handle; - ASSERT_EQ(pipe, &ctx2.channel); + ASSERT_PTR_EQ(pipe, &ctx2.channel); while (uv_pipe_pending_count(pipe) > 0) { if (++read_cb_count == 2) { @@ -337,10 +337,10 @@ static void read_cb(uv_stream_t* handle, r = uv_tcp_init(ctx2.channel.loop, &recv->tcp); else abort(); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_accept(handle, &recv->stream); - ASSERT(r == 0); + ASSERT_OK(r); wrbuf = uv_buf_init(".", 1); r = uv_write2(write_req, @@ -349,27 +349,27 @@ static void read_cb(uv_stream_t* handle, 1, &recv->stream, write2_cb); - ASSERT(r == 0); + ASSERT_OK(r); } } static void send_recv_start(void) { int r; - ASSERT(1 == uv_is_readable((uv_stream_t*)&ctx2.channel)); - ASSERT(1 == uv_is_writable((uv_stream_t*)&ctx2.channel)); - ASSERT(0 == uv_is_closing((uv_handle_t*)&ctx2.channel)); + ASSERT_EQ(1, uv_is_readable((uv_stream_t*)&ctx2.channel)); + ASSERT_EQ(1, uv_is_writable((uv_stream_t*)&ctx2.channel)); + ASSERT_OK(uv_is_closing((uv_handle_t*)&ctx2.channel)); r = uv_read_start((uv_stream_t*)&ctx2.channel, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void listen_cb(uv_stream_t* handle, int status) { int r; - ASSERT(handle == (uv_stream_t*)&ctx2.listen); - ASSERT(status == 0); + ASSERT_PTR_EQ(handle, (uv_stream_t*)&ctx2.listen); + ASSERT_OK(status); r = uv_accept((uv_stream_t*)&ctx2.listen, (uv_stream_t*)&ctx2.channel); - ASSERT(r == 0); + ASSERT_OK(r); send_recv_start(); } @@ -382,27 +382,27 @@ int run_ipc_send_recv_helper(uv_loop_t* loop, int inprocess) { memset(&ctx2, 0, sizeof(ctx2)); r = uv_pipe_init(loop, &ctx2.listen, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(loop, &ctx2.channel, 1); - ASSERT(r == 0); + ASSERT_OK(r); if (inprocess) { r = uv_pipe_bind(&ctx2.listen, TEST_PIPENAME_3); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&ctx2.listen, SOMAXCONN, listen_cb); - ASSERT(r == 0); + ASSERT_OK(r); } else { r = uv_pipe_open(&ctx2.channel, 0); - ASSERT(r == 0); + ASSERT_OK(r); send_recv_start(); } notify_parent_process(); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); return 0; } @@ -414,7 +414,7 @@ int ipc_send_recv_helper(void) { int r; r = run_ipc_send_recv_helper(uv_default_loop(), 0); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -425,11 +425,11 @@ void ipc_send_recv_helper_threadproc(void* arg) { uv_loop_t loop; r = uv_loop_init(&loop); - ASSERT(r == 0); + ASSERT_OK(r); r = run_ipc_send_recv_helper(&loop, 1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_loop_close(&loop); - ASSERT(r == 0); + ASSERT_OK(r); } diff --git a/deps/uv/test/test-ipc.c b/deps/uv/test/test-ipc.c index 7ec6ec9ce3af5b..49975d9b4d747c 100644 --- a/deps/uv/test/test-ipc.c +++ b/deps/uv/test/test-ipc.c @@ -68,16 +68,16 @@ static void on_connection(uv_stream_t* server, int status) { if (!local_conn_accepted) { /* Accept the connection and close it. Also and close the server. */ - ASSERT_EQ(status, 0); + ASSERT_OK(status); ASSERT_PTR_EQ(&tcp_server, server); conn = malloc(sizeof(*conn)); ASSERT_NOT_NULL(conn); r = uv_tcp_init(server->loop, conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept(server, (uv_stream_t*)conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_close((uv_handle_t*)conn, close_server_conn_cb); uv_close((uv_handle_t*)server, NULL); @@ -91,8 +91,8 @@ static void exit_cb(uv_process_t* process, int term_signal) { printf("exit_cb\n"); exit_cb_called++; - ASSERT_EQ(exit_status, 0); - ASSERT_EQ(term_signal, 0); + ASSERT_OK(exit_status); + ASSERT_OK(term_signal); uv_close((uv_handle_t*)process, NULL); } @@ -126,14 +126,14 @@ static void make_many_connections(void) { ASSERT_NOT_NULL(conn); r = uv_tcp_init(uv_default_loop(), &conn->conn); - ASSERT_EQ(r, 0); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(r); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_connect(&conn->conn_req, (uv_tcp_t*) &conn->conn, (const struct sockaddr*) &addr, connect_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); conn->conn.data = conn; } @@ -179,13 +179,13 @@ static void on_read(uv_stream_t* handle, /* Accept the pending TCP server, and start listening on it. */ ASSERT_EQ(pending, UV_TCP); r = uv_tcp_init(uv_default_loop(), &tcp_server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, on_connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); tcp_server_listening = 1; @@ -194,13 +194,13 @@ static void on_read(uv_stream_t* handle, outbuf = uv_buf_init("foobar\n", 7); r = uv_write(&write_req, (uv_stream_t*)pipe, &outbuf, 1, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* Create a bunch of connections to get both servers to accept. */ make_many_connections(); } else if (memcmp("accepted_connection\n", buf->base, nread) == 0) { /* Remote server has accepted a connection. Close the channel. */ - ASSERT_EQ(0, uv_pipe_pending_count(pipe)); + ASSERT_OK(uv_pipe_pending_count(pipe)); ASSERT_EQ(pending, UV_UNKNOWN_HANDLE); remote_conn_accepted = 1; uv_close((uv_handle_t*)&channel, NULL); @@ -248,28 +248,28 @@ static void on_read_listen_after_bound_twice(uv_stream_t* handle, /* Accept the first TCP server, and start listening on it. */ ASSERT_EQ(pending, UV_TCP); r = uv_tcp_init(uv_default_loop(), &tcp_server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, on_connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } else if (read_cb_called == 2) { /* Accept the second TCP server, and start listening on it. */ ASSERT_EQ(pending, UV_TCP); r = uv_tcp_init(uv_default_loop(), &tcp_server2); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server2); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&tcp_server2, BACKLOG, on_connection); ASSERT_EQ(r, UV_EADDRINUSE); uv_close((uv_handle_t*)&tcp_server, NULL); uv_close((uv_handle_t*)&tcp_server2, NULL); - ASSERT_EQ(0, uv_pipe_pending_count(pipe)); + ASSERT_OK(uv_pipe_pending_count(pipe)); uv_close((uv_handle_t*)&channel, NULL); } @@ -288,12 +288,12 @@ void spawn_helper(uv_pipe_t* channel, uv_stdio_container_t stdio[3]; r = uv_pipe_init(uv_default_loop(), channel, 1); - ASSERT_EQ(r, 0); - ASSERT_NE(channel->ipc, 0); + ASSERT_OK(r); + ASSERT_NE(0, channel->ipc); exepath_size = sizeof(exepath); r = uv_exepath(exepath, &exepath_size); - ASSERT_EQ(r, 0); + ASSERT_OK(r); exepath[exepath_size] = '\0'; args[0] = exepath; @@ -315,12 +315,12 @@ void spawn_helper(uv_pipe_t* channel, stdio[2].data.fd = 2; r = uv_spawn(uv_default_loop(), process, &options); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } static void on_tcp_write(uv_write_t* req, int status) { - ASSERT_EQ(status, 0); + ASSERT_OK(status); ASSERT_PTR_EQ(req->handle, &tcp_connection); tcp_write_cb_called++; } @@ -385,10 +385,10 @@ static void on_read_connection(uv_stream_t* handle, /* Accept the pending TCP connection */ ASSERT_EQ(pending, UV_TCP); r = uv_tcp_init(uv_default_loop(), &tcp_connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept(handle, (uv_stream_t*)&tcp_connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* Make sure that the expected data is correctly multiplexed. */ ASSERT_MEM_EQ("hello\n", buf->base, nread); @@ -397,10 +397,10 @@ static void on_read_connection(uv_stream_t* handle, outbuf = uv_buf_init("world\n", 6); r = uv_write(&write_req, (uv_stream_t*)&tcp_connection, &outbuf, 1, on_tcp_write); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*)&tcp_connection, on_read_alloc, on_tcp_read); - ASSERT_EQ(r, 0); + ASSERT_OK(r); free(buf->base); } @@ -422,7 +422,7 @@ static int run_ipc_test(const char* helper, uv_read_cb read_cb) { uv_read_start((uv_stream_t*)&channel, on_alloc, read_cb); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -434,10 +434,10 @@ TEST_IMPL(ipc_listen_before_write) { RETURN_SKIP(NO_SEND_HANDLE_ON_PIPE); #endif int r = run_ipc_test("ipc_helper_listen_before_write", on_read); - ASSERT_EQ(local_conn_accepted, 1); - ASSERT_EQ(remote_conn_accepted, 1); - ASSERT_EQ(read_cb_called, 1); - ASSERT_EQ(exit_cb_called, 1); + ASSERT_EQ(1, local_conn_accepted); + ASSERT_EQ(1, remote_conn_accepted); + ASSERT_EQ(1, read_cb_called); + ASSERT_EQ(1, exit_cb_called); return r; } @@ -447,10 +447,10 @@ TEST_IMPL(ipc_listen_after_write) { RETURN_SKIP(NO_SEND_HANDLE_ON_PIPE); #endif int r = run_ipc_test("ipc_helper_listen_after_write", on_read); - ASSERT_EQ(local_conn_accepted, 1); - ASSERT_EQ(remote_conn_accepted, 1); - ASSERT_EQ(read_cb_called, 1); - ASSERT_EQ(exit_cb_called, 1); + ASSERT_EQ(1, local_conn_accepted); + ASSERT_EQ(1, remote_conn_accepted); + ASSERT_EQ(1, read_cb_called); + ASSERT_EQ(1, exit_cb_called); return r; } @@ -460,10 +460,10 @@ TEST_IMPL(ipc_tcp_connection) { RETURN_SKIP(NO_SEND_HANDLE_ON_PIPE); #endif int r = run_ipc_test("ipc_helper_tcp_connection", on_read_connection); - ASSERT_EQ(read_cb_called, 1); - ASSERT_EQ(tcp_write_cb_called, 1); - ASSERT_EQ(tcp_read_cb_called, 1); - ASSERT_EQ(exit_cb_called, 1); + ASSERT_EQ(1, read_cb_called); + ASSERT_EQ(1, tcp_write_cb_called); + ASSERT_EQ(1, tcp_read_cb_called); + ASSERT_EQ(1, exit_cb_called); return r; } @@ -474,20 +474,20 @@ TEST_IMPL(listen_with_simultaneous_accepts) { int r; struct sockaddr_in addr; - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_simultaneous_accepts(&server, 1); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server, SOMAXCONN, NULL); - ASSERT_EQ(r, 0); - ASSERT_EQ(server.reqs_pending, 32); + ASSERT_OK(r); + ASSERT_EQ(32, server.reqs_pending); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -499,20 +499,20 @@ TEST_IMPL(listen_no_simultaneous_accepts) { int r; struct sockaddr_in addr; - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_simultaneous_accepts(&server, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server, SOMAXCONN, NULL); - ASSERT_EQ(r, 0); - ASSERT_EQ(server.reqs_pending, 1); + ASSERT_OK(r); + ASSERT_EQ(1, server.reqs_pending); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -523,8 +523,8 @@ TEST_IMPL(ipc_listen_after_bind_twice) { RETURN_SKIP(NO_SEND_HANDLE_ON_PIPE); #endif int r = run_ipc_test("ipc_helper_bind_twice", on_read_listen_after_bound_twice); - ASSERT_EQ(read_cb_called, 2); - ASSERT_EQ(exit_cb_called, 1); + ASSERT_EQ(2, read_cb_called); + ASSERT_EQ(1, exit_cb_called); return r; } #endif @@ -532,7 +532,7 @@ TEST_IMPL(ipc_listen_after_bind_twice) { TEST_IMPL(ipc_send_zero) { int r; r = run_ipc_test("ipc_helper_send_zero", on_read_send_zero); - ASSERT_EQ(r, 0); + ASSERT_OK(r); return 0; } @@ -563,7 +563,7 @@ static void tcp_connection_write_cb(uv_write_t* req, int status) { static void send_zero_write_cb(uv_write_t* req, int status) { - ASSERT_EQ(status, 0); + ASSERT_OK(status); send_zero_write++; } @@ -591,7 +591,7 @@ static void on_tcp_child_process_read(uv_stream_t* tcp, /* Write to the socket */ outbuf = uv_buf_init("hello again\n", 12); r = uv_write(&conn.tcp_write_req, tcp, &outbuf, 1, tcp_connection_write_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); tcp_conn_read_cb_called++; } @@ -600,9 +600,9 @@ static void on_tcp_child_process_read(uv_stream_t* tcp, static void connect_child_process_cb(uv_connect_t* req, int status) { int r; - ASSERT_EQ(status, 0); + ASSERT_OK(status); r = uv_read_start(req->handle, on_read_alloc, on_tcp_child_process_read); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } @@ -615,21 +615,21 @@ static void ipc_on_connection(uv_stream_t* server, int status) { * Accept the connection and close it. Also let the other * side know. */ - ASSERT_EQ(status, 0); + ASSERT_OK(status); ASSERT_PTR_EQ(&tcp_server, server); r = uv_tcp_init(server->loop, &conn.conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept(server, (uv_stream_t*)&conn.conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_close((uv_handle_t*)&conn.conn, close_cb); buf = uv_buf_init("accepted_connection\n", 20); r = uv_write2(&conn_notify_req, (uv_stream_t*)&channel, &buf, 1, NULL, conn_notify_write_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); connection_accepted = 1; } @@ -646,28 +646,28 @@ static void ipc_on_connection_tcp_conn(uv_stream_t* server, int status) { uv_buf_t buf; uv_tcp_t* conn; - ASSERT_EQ(status, 0); + ASSERT_OK(status); ASSERT_PTR_EQ(&tcp_server, server); conn = malloc(sizeof(*conn)); ASSERT_NOT_NULL(conn); r = uv_tcp_init(server->loop, conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept(server, (uv_stream_t*)conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* Send the accepted connection to the other process */ buf = uv_buf_init("hello\n", 6); r = uv_write2(&conn_notify_req, (uv_stream_t*)&channel, &buf, 1, (uv_stream_t*)conn, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) conn, on_read_alloc, on_tcp_child_process_read); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_close((uv_handle_t*)conn, close_and_free_cb); } @@ -682,44 +682,44 @@ int ipc_helper(int listen_after_write) { int r; uv_buf_t buf; - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_pipe_init(uv_default_loop(), &channel, 1); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_pipe_open(&channel, 0); ASSERT_EQ(1, uv_is_readable((uv_stream_t*) &channel)); ASSERT_EQ(1, uv_is_writable((uv_stream_t*) &channel)); - ASSERT_EQ(0, uv_is_closing((uv_handle_t*) &channel)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &channel)); r = uv_tcp_init(uv_default_loop(), &tcp_server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); if (!listen_after_write) { r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } buf = uv_buf_init("hello\n", 6); r = uv_write2(&write_req, (uv_stream_t*)&channel, &buf, 1, (uv_stream_t*)&tcp_server, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); if (listen_after_write) { r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } notify_parent_process(); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(connection_accepted, 1); - ASSERT_EQ(close_cb_called, 3); + ASSERT_EQ(1, connection_accepted); + ASSERT_EQ(3, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -736,43 +736,43 @@ int ipc_helper_tcp_connection(void) { struct sockaddr_in addr; r = uv_pipe_init(uv_default_loop(), &channel, 1); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_pipe_open(&channel, 0); ASSERT_EQ(1, uv_is_readable((uv_stream_t*) &channel)); ASSERT_EQ(1, uv_is_writable((uv_stream_t*) &channel)); - ASSERT_EQ(0, uv_is_closing((uv_handle_t*) &channel)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &channel)); r = uv_tcp_init(uv_default_loop(), &tcp_server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection_tcp_conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* Make a connection to the server */ r = uv_tcp_init(uv_default_loop(), &conn.conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_connect(&conn.conn_req, (uv_tcp_t*) &conn.conn, (const struct sockaddr*) &addr, connect_child_process_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(tcp_conn_read_cb_called, 1); - ASSERT_EQ(tcp_conn_write_cb_called, 1); - ASSERT_EQ(close_cb_called, 4); + ASSERT_EQ(1, tcp_conn_read_cb_called); + ASSERT_EQ(1, tcp_conn_write_cb_called); + ASSERT_EQ(4, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -787,38 +787,38 @@ int ipc_helper_bind_twice(void) { int r; uv_buf_t buf; - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_pipe_init(uv_default_loop(), &channel, 1); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_pipe_open(&channel, 0); ASSERT_EQ(1, uv_is_readable((uv_stream_t*) &channel)); ASSERT_EQ(1, uv_is_writable((uv_stream_t*) &channel)); - ASSERT_EQ(0, uv_is_closing((uv_handle_t*) &channel)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &channel)); buf = uv_buf_init("hello\n", 6); r = uv_tcp_init(uv_default_loop(), &tcp_server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_init(uv_default_loop(), &tcp_server2); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcp_server2, (const struct sockaddr*) &addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_write2(&write_req, (uv_stream_t*)&channel, &buf, 1, (uv_stream_t*)&tcp_server, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_write2(&write_req2, (uv_stream_t*)&channel, &buf, 1, (uv_stream_t*)&tcp_server2, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -831,13 +831,13 @@ int ipc_helper_send_zero(void) { zero_buf = uv_buf_init(0, 0); r = uv_pipe_init(uv_default_loop(), &channel, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_pipe_open(&channel, 0); ASSERT_EQ(1, uv_is_readable((uv_stream_t*) &channel)); ASSERT_EQ(1, uv_is_writable((uv_stream_t*) &channel)); - ASSERT_EQ(0, uv_is_closing((uv_handle_t*) &channel)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &channel)); r = uv_write(&write_req, (uv_stream_t*)&channel, @@ -845,12 +845,12 @@ int ipc_helper_send_zero(void) { 1, send_zero_write_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(send_zero_write, 1); + ASSERT_EQ(1, send_zero_write); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h index 78ff9c2d162167..d112d07a29a8ec 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h @@ -127,6 +127,8 @@ TEST_DECLARE (tcp_bind_writable_flags) TEST_DECLARE (tcp_bind_or_listen_error_after_close) TEST_DECLARE (tcp_listen_without_bind) TEST_DECLARE (tcp_connect_error_fault) +TEST_DECLARE (tcp_connect6_error_fault) +TEST_DECLARE (tcp_connect6_link_local) TEST_DECLARE (tcp_connect_timeout) TEST_DECLARE (tcp_local_connect_timeout) TEST_DECLARE (tcp6_local_connect_timeout) @@ -321,6 +323,7 @@ TEST_DECLARE (spawn_detached) TEST_DECLARE (spawn_and_kill_with_std) TEST_DECLARE (spawn_and_ping) TEST_DECLARE (spawn_preserve_env) +TEST_DECLARE (spawn_same_stdout_stderr) TEST_DECLARE (spawn_setuid_fails) TEST_DECLARE (spawn_setgid_fails) TEST_DECLARE (spawn_stdout_to_file) @@ -501,6 +504,7 @@ TEST_DECLARE (listen_with_simultaneous_accepts) TEST_DECLARE (listen_no_simultaneous_accepts) TEST_DECLARE (fs_stat_root) TEST_DECLARE (spawn_with_an_odd_path) +TEST_DECLARE (spawn_no_path) TEST_DECLARE (ipc_listen_after_bind_twice) TEST_DECLARE (win32_signum_number) #else @@ -542,6 +546,7 @@ TEST_DECLARE (fork_socketpair) TEST_DECLARE (fork_socketpair_started) TEST_DECLARE (fork_signal_to_child) TEST_DECLARE (fork_signal_to_child_closed) +TEST_DECLARE (fork_close_signal_in_child) #ifndef __APPLE__ /* This is forbidden in a fork child: The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). */ @@ -724,6 +729,8 @@ TASK_LIST_START TEST_ENTRY (tcp_bind_or_listen_error_after_close) TEST_ENTRY (tcp_listen_without_bind) TEST_ENTRY (tcp_connect_error_fault) + TEST_ENTRY (tcp_connect6_error_fault) + TEST_ENTRY (tcp_connect6_link_local) TEST_ENTRY (tcp_connect_timeout) TEST_ENTRY (tcp_local_connect_timeout) TEST_ENTRY (tcp6_local_connect_timeout) @@ -977,6 +984,7 @@ TASK_LIST_START TEST_ENTRY (spawn_and_kill_with_std) TEST_ENTRY (spawn_and_ping) TEST_ENTRY (spawn_preserve_env) + TEST_ENTRY (spawn_same_stdout_stderr) TEST_ENTRY (spawn_setuid_fails) TEST_ENTRY (spawn_setgid_fails) TEST_ENTRY (spawn_stdout_to_file) @@ -1015,6 +1023,7 @@ TASK_LIST_START TEST_ENTRY (listen_no_simultaneous_accepts) TEST_ENTRY (fs_stat_root) TEST_ENTRY (spawn_with_an_odd_path) + TEST_ENTRY (spawn_no_path) TEST_ENTRY (ipc_listen_after_bind_twice) TEST_ENTRY (win32_signum_number) #else @@ -1055,6 +1064,7 @@ TASK_LIST_START TEST_ENTRY (fs_unlink_archive_readonly) #endif TEST_ENTRY (fs_chown) + TEST_ENTRY (fs_link) TEST_ENTRY (fs_utime) TEST_ENTRY (fs_utime_round) TEST_ENTRY (fs_futime) @@ -1175,6 +1185,7 @@ TASK_LIST_START TEST_ENTRY (fork_socketpair_started) TEST_ENTRY (fork_signal_to_child) TEST_ENTRY (fork_signal_to_child_closed) + TEST_ENTRY (fork_close_signal_in_child) #ifndef __APPLE__ TEST_ENTRY (fork_fs_events_child) TEST_ENTRY (fork_fs_events_child_dir) diff --git a/deps/uv/test/test-loop-alive.c b/deps/uv/test/test-loop-alive.c index 76a2b04cc9d1e7..279cfc3227098d 100644 --- a/deps/uv/test/test-loop-alive.c +++ b/deps/uv/test/test-loop-alive.c @@ -37,7 +37,7 @@ static void work_cb(uv_work_t* req) { static void after_work_cb(uv_work_t* req, int status) { ASSERT(req); - ASSERT(status == 0); + ASSERT_OK(status); } @@ -51,16 +51,16 @@ TEST_IMPL(loop_alive) { ASSERT(uv_loop_alive(uv_default_loop())); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(!uv_loop_alive(uv_default_loop())); /* loops with requests are alive */ r = uv_queue_work(uv_default_loop(), &work_req, work_cb, after_work_cb); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(uv_loop_alive(uv_default_loop())); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(!uv_loop_alive(uv_default_loop())); MAKE_VALGRIND_HAPPY(uv_default_loop()); diff --git a/deps/uv/test/test-loop-close.c b/deps/uv/test/test-loop-close.c index f5814796e8f3f0..cd1b76ce1b0665 100644 --- a/deps/uv/test/test-loop-close.c +++ b/deps/uv/test/test-loop-close.c @@ -35,23 +35,23 @@ TEST_IMPL(loop_close) { uv_loop_t loop; loop.data = &loop; - ASSERT(0 == uv_loop_init(&loop)); - ASSERT(loop.data == (void*) &loop); + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_PTR_EQ(loop.data, (void*) &loop); uv_timer_init(&loop, &timer_handle); uv_timer_start(&timer_handle, timer_cb, 100, 100); - ASSERT(UV_EBUSY == uv_loop_close(&loop)); + ASSERT_EQ(UV_EBUSY, uv_loop_close(&loop)); uv_run(&loop, UV_RUN_DEFAULT); uv_close((uv_handle_t*) &timer_handle, NULL); r = uv_run(&loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(loop.data == (void*) &loop); - ASSERT(0 == uv_loop_close(&loop)); - ASSERT(loop.data == (void*) &loop); + ASSERT_PTR_EQ(loop.data, (void*) &loop); + ASSERT_OK(uv_loop_close(&loop)); + ASSERT_PTR_EQ(loop.data, (void*) &loop); return 0; } @@ -67,11 +67,11 @@ static void loop_instant_close_after_work_cb(uv_work_t* req, int status) { TEST_IMPL(loop_instant_close) { static uv_loop_t loop; static uv_work_t req; - ASSERT(0 == uv_loop_init(&loop)); - ASSERT(0 == uv_queue_work(&loop, - &req, - loop_instant_close_work_cb, - loop_instant_close_after_work_cb)); + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_OK(uv_queue_work(&loop, + &req, + loop_instant_close_work_cb, + loop_instant_close_after_work_cb)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } diff --git a/deps/uv/test/test-loop-configure.c b/deps/uv/test/test-loop-configure.c index d057c1ed8a7bf8..1bc328431c9f0d 100644 --- a/deps/uv/test/test-loop-configure.c +++ b/deps/uv/test/test-loop-configure.c @@ -24,15 +24,15 @@ static void timer_cb(uv_timer_t* handle) { TEST_IMPL(loop_configure) { uv_timer_t timer_handle; uv_loop_t loop; - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); #ifdef _WIN32 - ASSERT(UV_ENOSYS == uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, 0)); + ASSERT_EQ(UV_ENOSYS, uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, 0)); #else - ASSERT(0 == uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, SIGPROF)); + ASSERT_OK(uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, SIGPROF)); #endif - ASSERT(0 == uv_timer_init(&loop, &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 10, 0)); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); - ASSERT(0 == uv_loop_close(&loop)); + ASSERT_OK(uv_timer_init(&loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 10, 0)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_loop_close(&loop)); return 0; } diff --git a/deps/uv/test/test-loop-handles.c b/deps/uv/test/test-loop-handles.c index 5d3df0245aa064..58368bf73ce471 100644 --- a/deps/uv/test/test-loop-handles.c +++ b/deps/uv/test/test-loop-handles.c @@ -108,7 +108,7 @@ static int idle_2_is_active = 0; static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer_handle); + ASSERT_PTR_EQ(handle, &timer_handle); } @@ -116,7 +116,7 @@ static void idle_2_close_cb(uv_handle_t* handle) { fprintf(stderr, "%s", "IDLE_2_CLOSE_CB\n"); fflush(stderr); - ASSERT(handle == (uv_handle_t*)&idle_2_handle); + ASSERT_PTR_EQ(handle, (uv_handle_t*)&idle_2_handle); ASSERT(idle_2_is_active); @@ -129,7 +129,7 @@ static void idle_2_cb(uv_idle_t* handle) { fprintf(stderr, "%s", "IDLE_2_CB\n"); fflush(stderr); - ASSERT(handle == &idle_2_handle); + ASSERT_PTR_EQ(handle, &idle_2_handle); idle_2_cb_called++; @@ -144,14 +144,14 @@ static void idle_1_cb(uv_idle_t* handle) { fflush(stderr); ASSERT_NOT_NULL(handle); - ASSERT(idles_1_active > 0); + ASSERT_GT(idles_1_active, 0); /* Init idle_2 and make it active */ if (!idle_2_is_active && !uv_is_closing((uv_handle_t*)&idle_2_handle)) { r = uv_idle_init(uv_default_loop(), &idle_2_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_idle_start(&idle_2_handle, idle_2_cb); - ASSERT(r == 0); + ASSERT_OK(r); idle_2_is_active = 1; idle_2_cb_started++; } @@ -160,7 +160,7 @@ static void idle_1_cb(uv_idle_t* handle) { if (idle_1_cb_called % 5 == 0) { r = uv_idle_stop((uv_idle_t*)handle); - ASSERT(r == 0); + ASSERT_OK(r); idles_1_active--; } } @@ -179,7 +179,7 @@ static void idle_1_close_cb(uv_handle_t* handle) { static void prepare_1_close_cb(uv_handle_t* handle) { fprintf(stderr, "%s", "PREPARE_1_CLOSE_CB"); fflush(stderr); - ASSERT(handle == (uv_handle_t*)&prepare_1_handle); + ASSERT_PTR_EQ(handle, (uv_handle_t*)&prepare_1_handle); prepare_1_close_cb_called++; } @@ -188,7 +188,7 @@ static void prepare_1_close_cb(uv_handle_t* handle) { static void check_close_cb(uv_handle_t* handle) { fprintf(stderr, "%s", "CHECK_CLOSE_CB\n"); fflush(stderr); - ASSERT(handle == (uv_handle_t*)&check_handle); + ASSERT_PTR_EQ(handle, (uv_handle_t*)&check_handle); check_close_cb_called++; } @@ -197,7 +197,7 @@ static void check_close_cb(uv_handle_t* handle) { static void prepare_2_close_cb(uv_handle_t* handle) { fprintf(stderr, "%s", "PREPARE_2_CLOSE_CB\n"); fflush(stderr); - ASSERT(handle == (uv_handle_t*)&prepare_2_handle); + ASSERT_PTR_EQ(handle, (uv_handle_t*)&prepare_2_handle); prepare_2_close_cb_called++; } @@ -208,13 +208,13 @@ static void check_cb(uv_check_t* handle) { fprintf(stderr, "%s", "CHECK_CB\n"); fflush(stderr); - ASSERT(handle == &check_handle); + ASSERT_PTR_EQ(handle, &check_handle); if (loop_iteration < ITERATIONS) { /* Make some idle watchers active */ for (i = 0; i < 1 + (loop_iteration % IDLE_COUNT); i++) { r = uv_idle_start(&idle_1_handles[i], idle_1_cb); - ASSERT(r == 0); + ASSERT_OK(r); idles_1_active++; } @@ -244,16 +244,16 @@ static void prepare_2_cb(uv_prepare_t* handle) { fprintf(stderr, "%s", "PREPARE_2_CB\n"); fflush(stderr); - ASSERT(handle == &prepare_2_handle); + ASSERT_PTR_EQ(handle, &prepare_2_handle); /* Prepare_2 gets started by prepare_1 when (loop_iteration % 2 == 0), and it * stops itself immediately. A started watcher is not queued until the next * round, so when this callback is made (loop_iteration % 2 == 0) cannot be * true. */ - ASSERT(loop_iteration % 2 != 0); + ASSERT_NE(0, loop_iteration % 2); r = uv_prepare_stop((uv_prepare_t*)handle); - ASSERT(r == 0); + ASSERT_OK(r); prepare_2_cb_called++; } @@ -264,11 +264,11 @@ static void prepare_1_cb(uv_prepare_t* handle) { fprintf(stderr, "%s", "PREPARE_1_CB\n"); fflush(stderr); - ASSERT(handle == &prepare_1_handle); + ASSERT_PTR_EQ(handle, &prepare_1_handle); if (loop_iteration % 2 == 0) { r = uv_prepare_start(&prepare_2_handle, prepare_2_cb); - ASSERT(r == 0); + ASSERT_OK(r); } prepare_1_cb_called++; @@ -283,23 +283,23 @@ TEST_IMPL(loop_handles) { int r; r = uv_prepare_init(uv_default_loop(), &prepare_1_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_prepare_start(&prepare_1_handle, prepare_1_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_check_init(uv_default_loop(), &check_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_check_start(&check_handle, check_cb); - ASSERT(r == 0); + ASSERT_OK(r); /* initialize only, prepare_2 is started by prepare_1_cb */ r = uv_prepare_init(uv_default_loop(), &prepare_2_handle); - ASSERT(r == 0); + ASSERT_OK(r); for (i = 0; i < IDLE_COUNT; i++) { /* initialize only, idle_1 handles are started by check_cb */ r = uv_idle_init(uv_default_loop(), &idle_1_handles[i]); - ASSERT(r == 0); + ASSERT_OK(r); } /* don't init or start idle_2, both is done by idle_1_cb */ @@ -307,30 +307,30 @@ TEST_IMPL(loop_handles) { /* The timer callback is there to keep the event loop polling unref it as it * is not supposed to keep the loop alive */ r = uv_timer_init(uv_default_loop(), &timer_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer_handle, timer_cb, TIMEOUT, TIMEOUT); - ASSERT(r == 0); + ASSERT_OK(r); uv_unref((uv_handle_t*)&timer_handle); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(loop_iteration == ITERATIONS); + ASSERT_EQ(loop_iteration, ITERATIONS); - ASSERT(prepare_1_cb_called == ITERATIONS); - ASSERT(prepare_1_close_cb_called == 1); + ASSERT_EQ(prepare_1_cb_called, ITERATIONS); + ASSERT_EQ(1, prepare_1_close_cb_called); - ASSERT(prepare_2_cb_called == ITERATIONS / 2); - ASSERT(prepare_2_close_cb_called == 1); + ASSERT_EQ(prepare_2_cb_called, ITERATIONS / 2); + ASSERT_EQ(1, prepare_2_close_cb_called); - ASSERT(check_cb_called == ITERATIONS); - ASSERT(check_close_cb_called == 1); + ASSERT_EQ(check_cb_called, ITERATIONS); + ASSERT_EQ(1, check_close_cb_called); /* idle_1_cb should be called a lot */ - ASSERT(idle_1_close_cb_called == IDLE_COUNT); + ASSERT_EQ(idle_1_close_cb_called, IDLE_COUNT); - ASSERT(idle_2_close_cb_called == idle_2_cb_started); - ASSERT(idle_2_is_active == 0); + ASSERT_EQ(idle_2_close_cb_called, idle_2_cb_started); + ASSERT_OK(idle_2_is_active); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-loop-stop.c b/deps/uv/test/test-loop-stop.c index 981d20d109930d..a00a5b81ade79e 100644 --- a/deps/uv/test/test-loop-stop.c +++ b/deps/uv/test/test-loop-stop.c @@ -30,7 +30,7 @@ static int num_ticks = 10; static void prepare_cb(uv_prepare_t* handle) { - ASSERT(handle == &prepare_handle); + ASSERT_PTR_EQ(handle, &prepare_handle); prepare_called++; if (prepare_called == num_ticks) uv_prepare_stop(handle); @@ -38,7 +38,7 @@ static void prepare_cb(uv_prepare_t* handle) { static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer_handle); + ASSERT_PTR_EQ(handle, &timer_handle); timer_called++; if (timer_called == 1) uv_stop(uv_default_loop()); @@ -55,17 +55,17 @@ TEST_IMPL(loop_stop) { uv_timer_start(&timer_handle, timer_cb, 100, 100); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r != 0); - ASSERT(timer_called == 1); + ASSERT(r); + ASSERT_EQ(1, timer_called); r = uv_run(uv_default_loop(), UV_RUN_NOWAIT); - ASSERT(r != 0); - ASSERT(prepare_called > 1); + ASSERT(r); + ASSERT_GT(prepare_called, 1); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(timer_called == 10); - ASSERT(prepare_called == 10); + ASSERT_OK(r); + ASSERT_EQ(10, timer_called); + ASSERT_EQ(10, prepare_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -76,7 +76,7 @@ TEST_IMPL(loop_stop_before_run) { ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); ASSERT_OK(uv_timer_start(&timer_handle, (uv_timer_cb) abort, 0, 0)); uv_stop(uv_default_loop()); - ASSERT_NE(uv_run(uv_default_loop(), UV_RUN_DEFAULT), 0); + ASSERT_NE(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-loop-time.c b/deps/uv/test/test-loop-time.c index 5d083064ae3133..01e44ffbdad18c 100644 --- a/deps/uv/test/test-loop-time.c +++ b/deps/uv/test/test-loop-time.c @@ -28,7 +28,7 @@ TEST_IMPL(loop_update_time) { start = uv_now(uv_default_loop()); while (uv_now(uv_default_loop()) - start < 1000) - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_NOWAIT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_NOWAIT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -46,23 +46,23 @@ TEST_IMPL(loop_backend_timeout) { /* The default loop has some internal watchers to initialize. */ loop->active_handles++; r = uv_run(loop, UV_RUN_NOWAIT); - ASSERT_EQ(r, 1); + ASSERT_EQ(1, r); loop->active_handles--; - ASSERT_EQ(uv_loop_alive(loop), 0); + ASSERT_OK(uv_loop_alive(loop)); r = uv_timer_init(loop, &timer); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(uv_loop_alive(loop), 0); - ASSERT_EQ(uv_backend_timeout(loop), 0); + ASSERT_OK(uv_loop_alive(loop)); + ASSERT_OK(uv_backend_timeout(loop)); r = uv_timer_start(&timer, cb, 1000, 0); /* 1 sec */ - ASSERT_EQ(r, 0); - ASSERT_EQ(uv_backend_timeout(loop), 1000); + ASSERT_OK(r); + ASSERT_EQ(1000, uv_backend_timeout(loop)); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); - ASSERT_EQ(uv_backend_timeout(loop), 0); + ASSERT_OK(r); + ASSERT_OK(uv_backend_timeout(loop)); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-metrics.c b/deps/uv/test/test-metrics.c index d532f4eff49ec1..c7c73aa53d79cc 100644 --- a/deps/uv/test/test-metrics.c +++ b/deps/uv/test/test-metrics.c @@ -59,11 +59,11 @@ TEST_IMPL(metrics_idle_time) { cntr = 0; timer.data = &cntr; - ASSERT_EQ(0, uv_loop_configure(uv_default_loop(), UV_METRICS_IDLE_TIME)); - ASSERT_EQ(0, uv_timer_init(uv_default_loop(), &timer)); - ASSERT_EQ(0, uv_timer_start(&timer, timer_spin_cb, timeout, 0)); + ASSERT_OK(uv_loop_configure(uv_default_loop(), UV_METRICS_IDLE_TIME)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_spin_cb, timeout, 0)); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); ASSERT_GT(cntr, 0); idle_time = uv_metrics_idle_time(uv_default_loop()); @@ -87,12 +87,12 @@ static void metrics_routine_cb(void* arg) { cntr = 0; timer.data = &cntr; - ASSERT_EQ(0, uv_loop_init(&loop)); - ASSERT_EQ(0, uv_loop_configure(&loop, UV_METRICS_IDLE_TIME)); - ASSERT_EQ(0, uv_timer_init(&loop, &timer)); - ASSERT_EQ(0, uv_timer_start(&timer, timer_spin_cb, timeout, 0)); + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_OK(uv_loop_configure(&loop, UV_METRICS_IDLE_TIME)); + ASSERT_OK(uv_timer_init(&loop, &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_spin_cb, timeout, 0)); - ASSERT_EQ(0, uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); ASSERT_GT(cntr, 0); idle_time = uv_metrics_idle_time(&loop); @@ -104,7 +104,7 @@ static void metrics_routine_cb(void* arg) { ASSERT_GE(idle_time, (timeout - 500) * UV_NS_TO_MS); close_loop(&loop); - ASSERT_EQ(0, uv_loop_close(&loop)); + ASSERT_OK(uv_loop_close(&loop)); } @@ -113,7 +113,7 @@ TEST_IMPL(metrics_idle_time_thread) { int i; for (i = 0; i < 5; i++) { - ASSERT_EQ(0, uv_thread_create(&threads[i], metrics_routine_cb, NULL)); + ASSERT_OK(uv_thread_create(&threads[i], metrics_routine_cb, NULL)); } for (i = 0; i < 5; i++) { @@ -136,16 +136,16 @@ TEST_IMPL(metrics_idle_time_zero) { cntr = 0; timer.data = &cntr; - ASSERT_EQ(0, uv_loop_configure(uv_default_loop(), UV_METRICS_IDLE_TIME)); - ASSERT_EQ(0, uv_timer_init(uv_default_loop(), &timer)); - ASSERT_EQ(0, uv_timer_start(&timer, timer_noop_cb, 0, 0)); + ASSERT_OK(uv_loop_configure(uv_default_loop(), UV_METRICS_IDLE_TIME)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_noop_cb, 0, 0)); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); ASSERT_GT(cntr, 0); - ASSERT_EQ(0, uv_metrics_idle_time(uv_default_loop())); + ASSERT_OK(uv_metrics_idle_time(uv_default_loop())); - ASSERT_EQ(0, uv_metrics_info(uv_default_loop(), &metrics)); + ASSERT_OK(uv_metrics_info(uv_default_loop(), &metrics)); ASSERT_UINT64_EQ(cntr, metrics.loop_count); MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -156,7 +156,7 @@ TEST_IMPL(metrics_idle_time_zero) { static void close_cb(uv_fs_t* req) { uv_metrics_t metrics; - ASSERT_EQ(0, uv_metrics_info(uv_default_loop(), &metrics)); + ASSERT_OK(uv_metrics_info(uv_default_loop(), &metrics)); ASSERT_UINT64_EQ(3, metrics.loop_count); ASSERT_UINT64_GT(metrics.events, last_events_count); @@ -168,7 +168,7 @@ static void close_cb(uv_fs_t* req) { static void write_cb(uv_fs_t* req) { uv_metrics_t metrics; - ASSERT_EQ(0, uv_metrics_info(uv_default_loop(), &metrics)); + ASSERT_OK(uv_metrics_info(uv_default_loop(), &metrics)); ASSERT_UINT64_EQ(2, metrics.loop_count); ASSERT_UINT64_GT(metrics.events, last_events_count); ASSERT_EQ(req->result, sizeof(test_buf)); @@ -176,17 +176,17 @@ static void write_cb(uv_fs_t* req) { uv_fs_req_cleanup(req); last_events_count = metrics.events; - ASSERT_EQ(0, uv_fs_close(uv_default_loop(), - &fs_reqs.close_req, - fs_reqs.open_req.result, - close_cb)); + ASSERT_OK(uv_fs_close(uv_default_loop(), + &fs_reqs.close_req, + fs_reqs.open_req.result, + close_cb)); } static void create_cb(uv_fs_t* req) { uv_metrics_t metrics; - ASSERT_EQ(0, uv_metrics_info(uv_default_loop(), &metrics)); + ASSERT_OK(uv_metrics_info(uv_default_loop(), &metrics)); /* Event count here is still 0 so not going to check. */ ASSERT_UINT64_EQ(1, metrics.loop_count); ASSERT_GE(req->result, 0); @@ -195,13 +195,13 @@ static void create_cb(uv_fs_t* req) { last_events_count = metrics.events; uv_buf_t iov = uv_buf_init(test_buf, sizeof(test_buf)); - ASSERT_EQ(0, uv_fs_write(uv_default_loop(), - &fs_reqs.write_req, - req->result, - &iov, - 1, - 0, - write_cb)); + ASSERT_OK(uv_fs_write(uv_default_loop(), + &fs_reqs.write_req, + req->result, + &iov, + 1, + 0, + write_cb)); } @@ -210,15 +210,15 @@ static void prepare_cb(uv_prepare_t* handle) { uv_prepare_stop(handle); - ASSERT_EQ(0, uv_metrics_info(uv_default_loop(), &metrics)); + ASSERT_OK(uv_metrics_info(uv_default_loop(), &metrics)); ASSERT_UINT64_EQ(0, metrics.loop_count); ASSERT_UINT64_EQ(0, metrics.events); - ASSERT_EQ(0, uv_fs_open(uv_default_loop(), - &fs_reqs.open_req, - "test_file", - O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR, - create_cb)); + ASSERT_OK(uv_fs_open(uv_default_loop(), + &fs_reqs.open_req, + "test_file", + O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR, + create_cb)); } @@ -229,10 +229,10 @@ TEST_IMPL(metrics_info_check) { uv_fs_unlink(NULL, &unlink_req, "test_file", NULL); uv_fs_req_cleanup(&unlink_req); - ASSERT_EQ(0, uv_prepare_init(uv_default_loop(), &prepare)); - ASSERT_EQ(0, uv_prepare_start(&prepare, prepare_cb)); + ASSERT_OK(uv_prepare_init(uv_default_loop(), &prepare)); + ASSERT_OK(uv_prepare_start(&prepare, prepare_cb)); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); uv_fs_unlink(NULL, &unlink_req, "test_file", NULL); uv_fs_req_cleanup(&unlink_req); diff --git a/deps/uv/test/test-multiple-listen.c b/deps/uv/test/test-multiple-listen.c index bbaa9bc1ef1265..47f35f6c05873c 100644 --- a/deps/uv/test/test-multiple-listen.c +++ b/deps/uv/test/test-multiple-listen.c @@ -38,7 +38,7 @@ static void close_cb(uv_handle_t* handle) { static void connection_cb(uv_stream_t* tcp, int status) { - ASSERT(status == 0); + ASSERT_OK(status); uv_close((uv_handle_t*)&server, close_cb); connection_cb_called++; } @@ -48,25 +48,25 @@ static void start_server(void) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void connect_cb(uv_connect_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); free(req); uv_close((uv_handle_t*)&client, close_cb); connect_cb_called++; @@ -78,17 +78,17 @@ static void client_connect(void) { uv_connect_t* connect_req = malloc(sizeof *connect_req); int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); ASSERT_NOT_NULL(connect_req); r = uv_tcp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(connect_req, &client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -100,9 +100,9 @@ TEST_IMPL(multiple_listen) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connection_cb_called == 1); - ASSERT(connect_cb_called == 1); - ASSERT(close_cb_called == 2); + ASSERT_EQ(1, connection_cb_called); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-mutexes.c b/deps/uv/test/test-mutexes.c index 975222ca1229d7..ca3377324b2eab 100644 --- a/deps/uv/test/test-mutexes.c +++ b/deps/uv/test/test-mutexes.c @@ -40,7 +40,7 @@ TEST_IMPL(thread_mutex) { int r; r = uv_mutex_init(&mutex); - ASSERT(r == 0); + ASSERT_OK(r); uv_mutex_lock(&mutex); uv_mutex_unlock(&mutex); @@ -55,11 +55,11 @@ TEST_IMPL(thread_mutex_recursive) { int r; r = uv_mutex_init_recursive(&mutex); - ASSERT(r == 0); + ASSERT_OK(r); uv_mutex_lock(&mutex); uv_mutex_lock(&mutex); - ASSERT(0 == uv_mutex_trylock(&mutex)); + ASSERT_OK(uv_mutex_trylock(&mutex)); uv_mutex_unlock(&mutex); uv_mutex_unlock(&mutex); @@ -75,7 +75,7 @@ TEST_IMPL(thread_rwlock) { int r; r = uv_rwlock_init(&rwlock); - ASSERT(r == 0); + ASSERT_OK(r); uv_rwlock_rdlock(&rwlock); uv_rwlock_rdunlock(&rwlock); @@ -101,7 +101,7 @@ static void synchronize(void) { synchronize_nowait(); /* Wait for the other thread. Guard against spurious wakeups. */ for (current = step; current == step; uv_cond_wait(&condvar, &mutex)); - ASSERT(step == current + 1); + ASSERT_EQ(step, current + 1); } @@ -111,23 +111,23 @@ static void thread_rwlock_trylock_peer(void* unused) { uv_mutex_lock(&mutex); /* Write lock held by other thread. */ - ASSERT(UV_EBUSY == uv_rwlock_tryrdlock(&rwlock)); - ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + ASSERT_EQ(UV_EBUSY, uv_rwlock_tryrdlock(&rwlock)); + ASSERT_EQ(UV_EBUSY, uv_rwlock_trywrlock(&rwlock)); synchronize(); /* Read lock held by other thread. */ - ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + ASSERT_OK(uv_rwlock_tryrdlock(&rwlock)); uv_rwlock_rdunlock(&rwlock); - ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + ASSERT_EQ(UV_EBUSY, uv_rwlock_trywrlock(&rwlock)); synchronize(); /* Acquire write lock. */ - ASSERT(0 == uv_rwlock_trywrlock(&rwlock)); + ASSERT_OK(uv_rwlock_trywrlock(&rwlock)); synchronize(); /* Release write lock and acquire read lock. */ uv_rwlock_wrunlock(&rwlock); - ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + ASSERT_OK(uv_rwlock_tryrdlock(&rwlock)); synchronize(); uv_rwlock_rdunlock(&rwlock); @@ -139,22 +139,22 @@ static void thread_rwlock_trylock_peer(void* unused) { TEST_IMPL(thread_rwlock_trylock) { uv_thread_t thread; - ASSERT(0 == uv_cond_init(&condvar)); - ASSERT(0 == uv_mutex_init(&mutex)); - ASSERT(0 == uv_rwlock_init(&rwlock)); + ASSERT_OK(uv_cond_init(&condvar)); + ASSERT_OK(uv_mutex_init(&mutex)); + ASSERT_OK(uv_rwlock_init(&rwlock)); uv_mutex_lock(&mutex); - ASSERT(0 == uv_thread_create(&thread, thread_rwlock_trylock_peer, NULL)); + ASSERT_OK(uv_thread_create(&thread, thread_rwlock_trylock_peer, NULL)); /* Hold write lock. */ - ASSERT(0 == uv_rwlock_trywrlock(&rwlock)); + ASSERT_OK(uv_rwlock_trywrlock(&rwlock)); synchronize(); /* Releases the mutex to the other thread. */ /* Release write lock and acquire read lock. Pthreads doesn't support * the notion of upgrading or downgrading rwlocks, so neither do we. */ uv_rwlock_wrunlock(&rwlock); - ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + ASSERT_OK(uv_rwlock_tryrdlock(&rwlock)); synchronize(); /* Release read lock. */ @@ -162,17 +162,17 @@ TEST_IMPL(thread_rwlock_trylock) { synchronize(); /* Write lock held by other thread. */ - ASSERT(UV_EBUSY == uv_rwlock_tryrdlock(&rwlock)); - ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + ASSERT_EQ(UV_EBUSY, uv_rwlock_tryrdlock(&rwlock)); + ASSERT_EQ(UV_EBUSY, uv_rwlock_trywrlock(&rwlock)); synchronize(); /* Read lock held by other thread. */ - ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + ASSERT_OK(uv_rwlock_tryrdlock(&rwlock)); uv_rwlock_rdunlock(&rwlock); - ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + ASSERT_EQ(UV_EBUSY, uv_rwlock_trywrlock(&rwlock)); synchronize(); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); uv_rwlock_destroy(&rwlock); uv_mutex_unlock(&mutex); uv_mutex_destroy(&mutex); diff --git a/deps/uv/test/test-not-readable-nor-writable-on-read-error.c b/deps/uv/test/test-not-readable-nor-writable-on-read-error.c index 823a4e91e29096..2c45a2da2e88e3 100644 --- a/deps/uv/test/test-not-readable-nor-writable-on-read-error.c +++ b/deps/uv/test/test-not-readable-nor-writable-on-read-error.c @@ -35,7 +35,7 @@ static int close_cb_called; static void write_cb(uv_write_t* req, int status) { write_cb_called++; - ASSERT(status == 0); + ASSERT_OK(status); } static void alloc_cb(uv_handle_t* handle, @@ -54,8 +54,8 @@ static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { read_cb_called++; ASSERT((nread < 0) && (nread != UV_EOF)); - ASSERT(0 == uv_is_writable(handle)); - ASSERT(0 == uv_is_readable(handle)); + ASSERT_OK(uv_is_writable(handle)); + ASSERT_OK(uv_is_readable(handle)); uv_close((uv_handle_t*) handle, close_cb); } @@ -65,10 +65,10 @@ static void connect_cb(uv_connect_t* req, int status) { uv_buf_t reset_me; connect_cb_called++; - ASSERT(status == 0); + ASSERT_OK(status); r = uv_read_start((uv_stream_t*) &tcp_client, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); reset_me = uv_buf_init(reset_me_cmd, sizeof(reset_me_cmd)); @@ -78,26 +78,26 @@ static void connect_cb(uv_connect_t* req, int status) { 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } TEST_IMPL(not_readable_nor_writable_on_read_error) { struct sockaddr_in sa; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &sa)); - ASSERT(0 == uv_loop_init(&loop)); - ASSERT(0 == uv_tcp_init(&loop, &tcp_client)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &sa)); + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_OK(uv_tcp_init(&loop, &tcp_client)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &tcp_client, - (const struct sockaddr*) &sa, - connect_cb)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &tcp_client, + (const struct sockaddr*) &sa, + connect_cb)); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); - ASSERT(connect_cb_called == 1); - ASSERT(read_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, read_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; diff --git a/deps/uv/test/test-not-writable-after-shutdown.c b/deps/uv/test/test-not-writable-after-shutdown.c index 84e09177bd3651..066f8bbafebebe 100644 --- a/deps/uv/test/test-not-writable-after-shutdown.c +++ b/deps/uv/test/test-not-writable-after-shutdown.c @@ -34,12 +34,12 @@ static void shutdown_cb(uv_shutdown_t* req, int status) { static void connect_cb(uv_connect_t* req, int status) { int r; - ASSERT(status == 0); + ASSERT_OK(status); r = uv_shutdown(&shutdown_req, req->handle, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_is_writable(req->handle)); + ASSERT_OK(uv_is_writable(req->handle)); } TEST_IMPL(not_writable_after_shutdown) { @@ -49,20 +49,20 @@ TEST_IMPL(not_writable_after_shutdown) { uv_tcp_t socket; uv_connect_t connect_req; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); r = uv_tcp_init(loop, &socket); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &socket, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-osx-select.c b/deps/uv/test/test-osx-select.c index 00ae540b405a6c..44e2c6d8dd2e30 100644 --- a/deps/uv/test/test-osx-select.c +++ b/deps/uv/test/test-osx-select.c @@ -62,7 +62,7 @@ TEST_IMPL(osx_select) { } r = uv_tty_init(uv_default_loop(), &tty, fd, 1); - ASSERT(r == 0); + ASSERT_OK(r); uv_read_start((uv_stream_t*) &tty, alloc_cb, read_cb); @@ -72,12 +72,12 @@ TEST_IMPL(osx_select) { "feel pretty happy\n"; for (i = 0, len = strlen(str); i < len; i++) { r = ioctl(fd, TIOCSTI, str + i); - ASSERT(r == 0); + ASSERT_OK(r); } uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(read_count == 3); + ASSERT_EQ(3, read_count); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -97,13 +97,13 @@ TEST_IMPL(osx_select_many_fds) { TEST_FILE_LIMIT(ARRAY_SIZE(tcps) + 100); r = uv_ip4_addr("127.0.0.1", 0, &addr); - ASSERT(r == 0); + ASSERT_OK(r); for (i = 0; i < ARRAY_SIZE(tcps); i++) { r = uv_tcp_init(uv_default_loop(), &tcps[i]); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcps[i], (const struct sockaddr *) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_unref((uv_handle_t*) &tcps[i]); } @@ -115,10 +115,10 @@ TEST_IMPL(osx_select_many_fds) { } r = uv_tty_init(uv_default_loop(), &tty, fd, 1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &tty, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); /* Emulate user-input */ str = "got some input\n" @@ -126,12 +126,12 @@ TEST_IMPL(osx_select_many_fds) { "feel pretty happy\n"; for (i = 0, len = strlen(str); i < len; i++) { r = ioctl(fd, TIOCSTI, str + i); - ASSERT(r == 0); + ASSERT_OK(r); } uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(read_count == 3); + ASSERT_EQ(3, read_count); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-ping-pong.c b/deps/uv/test/test-ping-pong.c index f54f2ad22e59d9..cd9fbf62bba4ae 100644 --- a/deps/uv/test/test-ping-pong.c +++ b/deps/uv/test/test-ping-pong.c @@ -83,7 +83,7 @@ static void pinger_on_close(uv_handle_t* handle) { static void pinger_after_write(uv_write_t* req, int status) { - ASSERT_EQ(status, 0); + ASSERT_OK(status); free(req->data); free(req); } @@ -112,7 +112,7 @@ static void pinger_write_ping(pinger_t* pinger) { req = malloc(sizeof(*req)); ASSERT_NOT_NULL(req); req->data = NULL; - ASSERT_EQ(0, uv_write(req, stream, bufs, nbufs, pinger_after_write)); + ASSERT_OK(uv_write(req, stream, bufs, nbufs, pinger_after_write)); puts("PING"); } @@ -188,7 +188,7 @@ static void ponger_read_cb(uv_stream_t* stream, req = malloc(sizeof(*req)); ASSERT_NOT_NULL(req); req->data = buf->base; - ASSERT_EQ(0, uv_write(req, stream, &writebuf, 1, pinger_after_write)); + ASSERT_OK(uv_write(req, stream, &writebuf, 1, pinger_after_write)); } @@ -197,17 +197,17 @@ static void pinger_on_connect(uv_connect_t* req, int status) { pinger_on_connect_count++; - ASSERT_EQ(status, 0); + ASSERT_OK(status); ASSERT_EQ(1, uv_is_readable(req->handle)); ASSERT_EQ(1, uv_is_writable(req->handle)); - ASSERT_EQ(0, uv_is_closing((uv_handle_t *) req->handle)); + ASSERT_OK(uv_is_closing((uv_handle_t *) req->handle)); pinger_write_ping(pinger); - ASSERT_EQ(0, uv_read_start((uv_stream_t*) req->handle, - alloc_cb, - pinger_read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) req->handle, + alloc_cb, + pinger_read_cb)); } @@ -218,7 +218,7 @@ static void tcp_pinger_v6_new(int vectored_writes) { pinger_t* pinger; - ASSERT_EQ(0, uv_ip6_addr("::1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip6_addr("::1", TEST_PORT, &server_addr)); pinger = malloc(sizeof(*pinger)); ASSERT_NOT_NULL(pinger); pinger->vectored_writes = vectored_writes; @@ -229,7 +229,7 @@ static void tcp_pinger_v6_new(int vectored_writes) { /* Try to connect to the server and do NUM_PINGS ping-pongs. */ r = uv_tcp_init(uv_default_loop(), &pinger->stream.tcp); pinger->stream.tcp.data = pinger; - ASSERT_EQ(0, r); + ASSERT_OK(r); /* We are never doing multiple reads/connects at a time anyway, so these * handles can be pre-initialized. */ @@ -237,10 +237,10 @@ static void tcp_pinger_v6_new(int vectored_writes) { &pinger->stream.tcp, (const struct sockaddr*) &server_addr, pinger_on_connect); - ASSERT_EQ(0, r); + ASSERT_OK(r); /* Synchronous connect callbacks are not allowed. */ - ASSERT_EQ(pinger_on_connect_count, 0); + ASSERT_OK(pinger_on_connect_count); } @@ -249,7 +249,7 @@ static void tcp_pinger_new(int vectored_writes) { struct sockaddr_in server_addr; pinger_t* pinger; - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); pinger = malloc(sizeof(*pinger)); ASSERT_NOT_NULL(pinger); pinger->vectored_writes = vectored_writes; @@ -260,7 +260,7 @@ static void tcp_pinger_new(int vectored_writes) { /* Try to connect to the server and do NUM_PINGS ping-pongs. */ r = uv_tcp_init(uv_default_loop(), &pinger->stream.tcp); pinger->stream.tcp.data = pinger; - ASSERT_EQ(0, r); + ASSERT_OK(r); /* We are never doing multiple reads/connects at a time anyway, so these * handles can be pre-initialized. */ @@ -268,10 +268,10 @@ static void tcp_pinger_new(int vectored_writes) { &pinger->stream.tcp, (const struct sockaddr*) &server_addr, pinger_on_connect); - ASSERT_EQ(0, r); + ASSERT_OK(r); /* Synchronous connect callbacks are not allowed. */ - ASSERT_EQ(pinger_on_connect_count, 0); + ASSERT_OK(pinger_on_connect_count); } @@ -289,7 +289,7 @@ static void pipe_pinger_new(int vectored_writes) { /* Try to connect to the server and do NUM_PINGS ping-pongs. */ r = uv_pipe_init(uv_default_loop(), &pinger->stream.pipe, 0); pinger->stream.pipe.data = pinger; - ASSERT_EQ(0, r); + ASSERT_OK(r); /* We are never doing multiple reads/connects at a time anyway, so these * handles can be pre-initialized. */ @@ -297,7 +297,7 @@ static void pipe_pinger_new(int vectored_writes) { pinger_on_connect); /* Synchronous connect callbacks are not allowed. */ - ASSERT_EQ(pinger_on_connect_count, 0); + ASSERT_OK(pinger_on_connect_count); } @@ -315,31 +315,31 @@ static void socketpair_pinger_new(int vectored_writes) { /* Try to make a socketpair and do NUM_PINGS ping-pongs. */ (void)uv_default_loop(); /* ensure WSAStartup has been performed */ - ASSERT_EQ(0, uv_socketpair(SOCK_STREAM, 0, fds, UV_NONBLOCK_PIPE, UV_NONBLOCK_PIPE)); + ASSERT_OK(uv_socketpair(SOCK_STREAM, 0, fds, UV_NONBLOCK_PIPE, UV_NONBLOCK_PIPE)); #ifndef _WIN32 /* On Windows, this is actually a UV_TCP, but libuv doesn't detect that. */ ASSERT_EQ(uv_guess_handle((uv_file) fds[0]), UV_NAMED_PIPE); ASSERT_EQ(uv_guess_handle((uv_file) fds[1]), UV_NAMED_PIPE); #endif - ASSERT_EQ(0, uv_tcp_init(uv_default_loop(), &pinger->stream.tcp)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &pinger->stream.tcp)); pinger->stream.pipe.data = pinger; - ASSERT_EQ(0, uv_tcp_open(&pinger->stream.tcp, fds[1])); + ASSERT_OK(uv_tcp_open(&pinger->stream.tcp, fds[1])); ponger = malloc(sizeof(*ponger)); ASSERT_NOT_NULL(ponger); ponger->data = NULL; - ASSERT_EQ(0, uv_tcp_init(uv_default_loop(), ponger)); - ASSERT_EQ(0, uv_tcp_open(ponger, fds[0])); + ASSERT_OK(uv_tcp_init(uv_default_loop(), ponger)); + ASSERT_OK(uv_tcp_open(ponger, fds[0])); pinger_write_ping(pinger); - ASSERT_EQ(0, uv_read_start((uv_stream_t*) &pinger->stream.tcp, - alloc_cb, - pinger_read_cb)); - ASSERT_EQ(0, uv_read_start((uv_stream_t*) ponger, - alloc_cb, - ponger_read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) &pinger->stream.tcp, + alloc_cb, + pinger_read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) ponger, + alloc_cb, + ponger_read_cb)); } @@ -349,14 +349,14 @@ static void pipe2_pinger_new(int vectored_writes) { uv_pipe_t* ponger; /* Try to make a pipe and do NUM_PINGS pings. */ - ASSERT_EQ(0, uv_pipe(fds, UV_NONBLOCK_PIPE, UV_NONBLOCK_PIPE)); + ASSERT_OK(uv_pipe(fds, UV_NONBLOCK_PIPE, UV_NONBLOCK_PIPE)); ASSERT_EQ(uv_guess_handle(fds[0]), UV_NAMED_PIPE); ASSERT_EQ(uv_guess_handle(fds[1]), UV_NAMED_PIPE); ponger = malloc(sizeof(*ponger)); ASSERT_NOT_NULL(ponger); - ASSERT_EQ(0, uv_pipe_init(uv_default_loop(), ponger, 0)); - ASSERT_EQ(0, uv_pipe_open(ponger, fds[0])); + ASSERT_OK(uv_pipe_init(uv_default_loop(), ponger, 0)); + ASSERT_OK(uv_pipe_open(ponger, fds[0])); pinger = malloc(sizeof(*pinger)); ASSERT_NOT_NULL(pinger); @@ -364,19 +364,19 @@ static void pipe2_pinger_new(int vectored_writes) { pinger->state = 0; pinger->pongs = 0; pinger->pong = PING; - ASSERT_EQ(0, uv_pipe_init(uv_default_loop(), &pinger->stream.pipe, 0)); - ASSERT_EQ(0, uv_pipe_open(&pinger->stream.pipe, fds[1])); + ASSERT_OK(uv_pipe_init(uv_default_loop(), &pinger->stream.pipe, 0)); + ASSERT_OK(uv_pipe_open(&pinger->stream.pipe, fds[1])); pinger->stream.pipe.data = pinger; /* record for close_cb */ ponger->data = pinger; /* record for read_cb */ pinger_write_ping(pinger); - ASSERT_EQ(0, uv_read_start((uv_stream_t*) ponger, alloc_cb, pinger_read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) ponger, alloc_cb, pinger_read_cb)); } static int run_ping_pong_test(void) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(completed_pingers, 1); + ASSERT_EQ(1, completed_pingers); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-pipe-bind-error.c b/deps/uv/test/test-pipe-bind-error.c index f8626302a1d899..381a0084dec2cc 100644 --- a/deps/uv/test/test-pipe-bind-error.c +++ b/deps/uv/test/test-pipe-bind-error.c @@ -46,26 +46,26 @@ TEST_IMPL(pipe_bind_error_addrinuse) { int r; r = uv_pipe_init(uv_default_loop(), &server1, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&server1, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(uv_default_loop(), &server2, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&server2, TEST_PIPENAME); - ASSERT(r == UV_EADDRINUSE); + ASSERT_EQ(r, UV_EADDRINUSE); r = uv_listen((uv_stream_t*)&server1, SOMAXCONN, NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server2, SOMAXCONN, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server1, close_cb); uv_close((uv_handle_t*)&server2, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -77,16 +77,16 @@ TEST_IMPL(pipe_bind_error_addrnotavail) { int r; r = uv_pipe_init(uv_default_loop(), &server, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&server, BAD_PIPENAME); - ASSERT(r == UV_EACCES); + ASSERT_EQ(r, UV_EACCES); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -98,17 +98,17 @@ TEST_IMPL(pipe_bind_error_inval) { int r; r = uv_pipe_init(uv_default_loop(), &server, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&server, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&server, TEST_PIPENAME_2); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -123,16 +123,16 @@ TEST_IMPL(pipe_listen_without_bind) { int r; r = uv_pipe_init(uv_default_loop(), &server, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server, SOMAXCONN, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -141,14 +141,14 @@ TEST_IMPL(pipe_listen_without_bind) { TEST_IMPL(pipe_bind_or_listen_error_after_close) { uv_pipe_t server; - ASSERT_EQ(uv_pipe_init(uv_default_loop(), &server, 0), 0); + ASSERT_OK(uv_pipe_init(uv_default_loop(), &server, 0)); uv_close((uv_handle_t*) &server, NULL); ASSERT_EQ(uv_pipe_bind(&server, TEST_PIPENAME), UV_EINVAL); ASSERT_EQ(uv_listen((uv_stream_t*) &server, SOMAXCONN, NULL), UV_EINVAL); - ASSERT_EQ(uv_run(uv_default_loop(), UV_RUN_DEFAULT), 0); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-pipe-close-stdout-read-stdin.c b/deps/uv/test/test-pipe-close-stdout-read-stdin.c index a9295f0aa59f62..51bbf0f54e23d5 100644 --- a/deps/uv/test/test-pipe-close-stdout-read-stdin.c +++ b/deps/uv/test/test-pipe-close-stdout-read-stdin.c @@ -61,7 +61,7 @@ TEST_IMPL(pipe_close_stdout_read_stdin) { uv_pipe_t stdin_pipe; r = pipe(fd); - ASSERT(r == 0); + ASSERT_OK(r); #if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) pid = -1; @@ -80,24 +80,24 @@ TEST_IMPL(pipe_close_stdout_read_stdin) { ASSERT(-1 <= r && r <= 1); close(0); r = dup(fd[0]); - ASSERT(r != -1); + ASSERT_NE(r, -1); /* Create a stream that reads from the pipe. */ r = uv_pipe_init(uv_default_loop(), (uv_pipe_t *)&stdin_pipe, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_open((uv_pipe_t *)&stdin_pipe, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t *)&stdin_pipe, alloc_buffer, read_stdin); - ASSERT(r == 0); + ASSERT_OK(r); /* * Because the other end of the pipe was closed, there should * be no event left to process after one run of the event loop. * Otherwise, it means that events were not processed correctly. */ - ASSERT(uv_run(uv_default_loop(), UV_RUN_NOWAIT) == 0); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_NOWAIT)); } else { /* * Close both ends of the pipe so that the child diff --git a/deps/uv/test/test-pipe-connect-error.c b/deps/uv/test/test-pipe-connect-error.c index 140e7d32dafc44..ee6e0776f3371e 100644 --- a/deps/uv/test/test-pipe-connect-error.c +++ b/deps/uv/test/test-pipe-connect-error.c @@ -64,13 +64,13 @@ TEST_IMPL(pipe_connect_bad_name) { int r; r = uv_pipe_init(uv_default_loop(), &client, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_pipe_connect(&req, &client, BAD_PIPENAME, connect_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(close_cb_called, 1); - ASSERT_EQ(connect_cb_called, 1); + ASSERT_EQ(1, close_cb_called); + ASSERT_EQ(1, connect_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -84,13 +84,13 @@ TEST_IMPL(pipe_connect_to_file) { int r; r = uv_pipe_init(uv_default_loop(), &client, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_pipe_connect(&req, &client, path, connect_cb_file); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(close_cb_called, 1); - ASSERT_EQ(connect_cb_called, 1); + ASSERT_EQ(1, close_cb_called); + ASSERT_EQ(1, connect_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-pipe-connect-multiple.c b/deps/uv/test/test-pipe-connect-multiple.c index b8f417e81caff0..69a09ec6cddad9 100644 --- a/deps/uv/test/test-pipe-connect-multiple.c +++ b/deps/uv/test/test-pipe-connect-multiple.c @@ -44,14 +44,14 @@ static uv_pipe_t connections[NUM_CLIENTS]; static void connection_cb(uv_stream_t* server, int status) { int r; uv_pipe_t* conn; - ASSERT(status == 0); + ASSERT_OK(status); conn = &connections[connection_cb_called]; r = uv_pipe_init(server->loop, conn, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_accept(server, (uv_stream_t*)conn); - ASSERT(r == 0); + ASSERT_OK(r); if (++connection_cb_called == NUM_CLIENTS && connect_cb_called == NUM_CLIENTS) { @@ -61,7 +61,7 @@ static void connection_cb(uv_stream_t* server, int status) { static void connect_cb(uv_connect_t* connect_req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); if (++connect_cb_called == NUM_CLIENTS && connection_cb_called == NUM_CLIENTS) { uv_stop(connect_req->handle->loop); @@ -80,17 +80,17 @@ TEST_IMPL(pipe_connect_multiple) { loop = uv_default_loop(); r = uv_pipe_init(loop, &server_handle, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&server_handle, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server_handle, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); for (i = 0; i < NUM_CLIENTS; i++) { r = uv_pipe_init(loop, &clients[i].pipe_handle, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_connect(&clients[i].conn_req, &clients[i].pipe_handle, TEST_PIPENAME, @@ -99,8 +99,8 @@ TEST_IMPL(pipe_connect_multiple) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(connection_cb_called == NUM_CLIENTS); - ASSERT(connect_cb_called == NUM_CLIENTS); + ASSERT_EQ(connection_cb_called, NUM_CLIENTS); + ASSERT_EQ(connect_cb_called, NUM_CLIENTS); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -110,14 +110,14 @@ TEST_IMPL(pipe_connect_multiple) { static void connection_cb2(uv_stream_t* server, int status) { int r; uv_pipe_t* conn; - ASSERT_EQ(status, 0); + ASSERT_OK(status); conn = &connections[connection_cb_called]; r = uv_pipe_init(server->loop, conn, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_accept(server, (uv_stream_t*)conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_close((uv_handle_t*)conn, NULL); if (++connection_cb_called == NUM_CLIENTS && @@ -146,17 +146,17 @@ TEST_IMPL(pipe_connect_close_multiple) { loop = uv_default_loop(); r = uv_pipe_init(loop, &server_handle, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_pipe_bind(&server_handle, TEST_PIPENAME); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server_handle, 128, connection_cb2); - ASSERT_EQ(r, 0); + ASSERT_OK(r); for (i = 0; i < NUM_CLIENTS; i++) { r = uv_pipe_init(loop, &clients[i].pipe_handle, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_pipe_connect(&clients[i].conn_req, &clients[i].pipe_handle, TEST_PIPENAME, diff --git a/deps/uv/test/test-pipe-connect-prepare.c b/deps/uv/test/test-pipe-connect-prepare.c index f7a79404048c15..93d15a473f3ff8 100644 --- a/deps/uv/test/test-pipe-connect-prepare.c +++ b/deps/uv/test/test-pipe-connect-prepare.c @@ -48,7 +48,7 @@ static void close_cb(uv_handle_t* handle) { static void connect_cb(uv_connect_t* connect_req, int status) { - ASSERT(status == UV_ENOENT); + ASSERT_EQ(status, UV_ENOENT); connect_cb_called++; uv_close((uv_handle_t*)&prepare_handle, close_cb); uv_close((uv_handle_t*)&pipe_handle, close_cb); @@ -56,7 +56,7 @@ static void connect_cb(uv_connect_t* connect_req, int status) { static void prepare_cb(uv_prepare_t* handle) { - ASSERT(handle == &prepare_handle); + ASSERT_PTR_EQ(handle, &prepare_handle); uv_pipe_connect(&conn_req, &pipe_handle, BAD_PIPENAME, connect_cb); } @@ -65,18 +65,18 @@ TEST_IMPL(pipe_connect_on_prepare) { int r; r = uv_pipe_init(uv_default_loop(), &pipe_handle, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_prepare_init(uv_default_loop(), &prepare_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_prepare_start(&prepare_handle, prepare_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 2); - ASSERT(connect_cb_called == 1); + ASSERT_EQ(2, close_cb_called); + ASSERT_EQ(1, connect_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-pipe-getsockname.c b/deps/uv/test/test-pipe-getsockname.c index d749933d44f6f0..eb09d88fd2b3a5 100644 --- a/deps/uv/test/test-pipe-getsockname.c +++ b/deps/uv/test/test-pipe-getsockname.c @@ -40,8 +40,8 @@ static int pipe_client_connect_cb_called = 0; static void pipe_close_cb(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*) &pipe_client || - handle == (uv_handle_t*) &pipe_server); + ASSERT_NE(handle == (uv_handle_t*) &pipe_client || + handle == (uv_handle_t*) &pipe_server, 0); pipe_close_cb_called++; } @@ -51,12 +51,12 @@ static void pipe_client_connect_cb(uv_connect_t* req, int status) { size_t len; int r; - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); len = sizeof buf; r = uv_pipe_getpeername(&pipe_client, buf, &len); - ASSERT(r == 0); + ASSERT_OK(r); if (*buf == '\0') { /* Linux abstract socket. */ const char expected[] = "\0" TEST_PIPENAME; @@ -82,7 +82,7 @@ static void pipe_server_connection_cb(uv_stream_t* handle, int status) { /* This function *may* be called, depending on whether accept or the * connection callback is called first. */ - ASSERT(status == 0); + ASSERT_OK(status); } @@ -99,44 +99,44 @@ TEST_IMPL(pipe_getsockname) { ASSERT_NOT_NULL(loop); r = uv_pipe_init(loop, &pipe_server, 0); - ASSERT(r == 0); + ASSERT_OK(r); len = sizeof buf; r = uv_pipe_getsockname(&pipe_server, buf, &len); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); len = sizeof buf; r = uv_pipe_getpeername(&pipe_server, buf, &len); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_pipe_bind(&pipe_server, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); len = sizeof buf; r = uv_pipe_getsockname(&pipe_server, buf, &len); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(buf[len - 1] != 0); - ASSERT(buf[len] == '\0'); - ASSERT(memcmp(buf, TEST_PIPENAME, len) == 0); + ASSERT_NE(0, buf[len - 1]); + ASSERT_EQ(buf[len], '\0'); + ASSERT_OK(memcmp(buf, TEST_PIPENAME, len)); len = sizeof buf; r = uv_pipe_getpeername(&pipe_server, buf, &len); - ASSERT(r == UV_ENOTCONN); + ASSERT_EQ(r, UV_ENOTCONN); r = uv_listen((uv_stream_t*) &pipe_server, 0, pipe_server_connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(loop, &pipe_client, 0); - ASSERT(r == 0); + ASSERT_OK(r); len = sizeof buf; r = uv_pipe_getsockname(&pipe_client, buf, &len); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); len = sizeof buf; r = uv_pipe_getpeername(&pipe_client, buf, &len); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); uv_pipe_connect(&connect_req, &pipe_client, TEST_PIPENAME, pipe_client_connect_cb); @@ -146,15 +146,15 @@ TEST_IMPL(pipe_getsockname) { len = sizeof buf; r = uv_pipe_getpeername(&pipe_client, buf, &len); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(buf[len - 1] != 0); - ASSERT(memcmp(buf, TEST_PIPENAME, len) == 0); + ASSERT_NE(0, buf[len - 1]); + ASSERT_OK(memcmp(buf, TEST_PIPENAME, len)); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(pipe_client_connect_cb_called == 1); - ASSERT(pipe_close_cb_called == 2); + ASSERT_OK(r); + ASSERT_EQ(1, pipe_client_connect_cb_called); + ASSERT_EQ(2, pipe_close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -218,50 +218,50 @@ TEST_IMPL(pipe_getsockname_blocking) { int r; r = CreatePipe(&readh, &writeh, NULL, 65536); - ASSERT(r != 0); + ASSERT(r); r = uv_pipe_init(uv_default_loop(), &pipe_client, 0); - ASSERT(r == 0); + ASSERT_OK(r); readfd = _open_osfhandle((intptr_t)readh, _O_RDONLY); - ASSERT(r != -1); + ASSERT_NE(r, -1); r = uv_pipe_open(&pipe_client, readfd); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &pipe_client, (uv_alloc_cb) abort, (uv_read_cb) abort); - ASSERT(r == 0); + ASSERT_OK(r); Sleep(100); r = uv_read_stop((uv_stream_t*)&pipe_client); - ASSERT(r == 0); + ASSERT_OK(r); len1 = sizeof buf1; r = uv_pipe_getsockname(&pipe_client, buf1, &len1); - ASSERT(r == 0); - ASSERT(len1 == 0); /* It's an annonymous pipe. */ + ASSERT_OK(r); + ASSERT_OK(len1); /* It's an annonymous pipe. */ r = uv_read_start((uv_stream_t*)&pipe_client, (uv_alloc_cb) abort, (uv_read_cb) abort); - ASSERT(r == 0); + ASSERT_OK(r); Sleep(100); len2 = sizeof buf2; r = uv_pipe_getsockname(&pipe_client, buf2, &len2); - ASSERT(r == 0); - ASSERT(len2 == 0); /* It's an annonymous pipe. */ + ASSERT_OK(r); + ASSERT_OK(len2); /* It's an annonymous pipe. */ r = uv_read_stop((uv_stream_t*)&pipe_client); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(len1 == len2); - ASSERT(memcmp(buf1, buf2, len1) == 0); + ASSERT_EQ(len1, len2); + ASSERT_OK(memcmp(buf1, buf2, len1)); pipe_close_cb_called = 0; uv_close((uv_handle_t*)&pipe_client, pipe_close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(pipe_close_cb_called == 1); + ASSERT_EQ(1, pipe_close_cb_called); CloseHandle(writeh); #endif diff --git a/deps/uv/test/test-pipe-pending-instances.c b/deps/uv/test/test-pipe-pending-instances.c index 9b1bfbc9aaccc4..570ecd69b734f7 100644 --- a/deps/uv/test/test-pipe-pending-instances.c +++ b/deps/uv/test/test-pipe-pending-instances.c @@ -37,22 +37,22 @@ TEST_IMPL(pipe_pending_instances) { loop = uv_default_loop(); r = uv_pipe_init(loop, &pipe_handle, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_pending_instances(&pipe_handle, 8); r = uv_pipe_bind(&pipe_handle, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_pending_instances(&pipe_handle, 16); r = uv_listen((uv_stream_t*)&pipe_handle, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*)&pipe_handle, NULL); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-pipe-sendmsg.c b/deps/uv/test/test-pipe-sendmsg.c index 7758b65b05cff9..3958b05378ca2c 100644 --- a/deps/uv/test/test-pipe-sendmsg.c +++ b/deps/uv/test/test-pipe-sendmsg.c @@ -45,12 +45,12 @@ static void set_nonblocking(uv_os_sock_t sock) { #ifdef _WIN32 unsigned long on = 1; r = ioctlsocket(sock, FIONBIO, &on); - ASSERT(r == 0); + ASSERT_OK(r); #else int flags = fcntl(sock, F_GETFL, 0); - ASSERT(flags >= 0); + ASSERT_GE(flags, 0); r = fcntl(sock, F_SETFL, flags | O_NONBLOCK); - ASSERT(r >= 0); + ASSERT_GE(r, 0); #endif } @@ -79,22 +79,22 @@ static void read_cb(uv_stream_t* handle, unsigned int i; p = (uv_pipe_t*) handle; - ASSERT(nread >= 0); + ASSERT_GE(nread, 0); while (uv_pipe_pending_count(p) != 0) { pending = uv_pipe_pending_type(p); - ASSERT(pending == UV_NAMED_PIPE); + ASSERT_EQ(pending, UV_NAMED_PIPE); - ASSERT(incoming_count < ARRAY_SIZE(incoming)); + ASSERT_LT(incoming_count, ARRAY_SIZE(incoming)); inc = &incoming[incoming_count++]; - ASSERT(0 == uv_pipe_init(p->loop, inc, 0)); - ASSERT(0 == uv_accept(handle, (uv_stream_t*) inc)); + ASSERT_OK(uv_pipe_init(p->loop, inc, 0)); + ASSERT_OK(uv_accept(handle, (uv_stream_t*) inc)); } if (incoming_count != ARRAY_SIZE(incoming)) return; - ASSERT(0 == uv_read_stop((uv_stream_t*) p)); + ASSERT_OK(uv_read_stop((uv_stream_t*) p)); uv_close((uv_handle_t*) p, close_cb); for (i = 0; i < ARRAY_SIZE(incoming); i++) uv_close((uv_handle_t*) &incoming[i], close_cb); @@ -115,12 +115,12 @@ TEST_IMPL(pipe_sendmsg) { unsigned int i; uv_buf_t buf; - ASSERT(0 == socketpair(AF_UNIX, SOCK_STREAM, 0, fds)); + ASSERT_OK(socketpair(AF_UNIX, SOCK_STREAM, 0, fds)); for (i = 0; i < ARRAY_SIZE(send_fds); i += 2) - ASSERT(0 == socketpair(AF_UNIX, SOCK_STREAM, 0, send_fds + i)); - ASSERT(i == ARRAY_SIZE(send_fds)); - ASSERT(0 == uv_pipe_init(uv_default_loop(), &p, 1)); - ASSERT(0 == uv_pipe_open(&p, fds[1])); + ASSERT_OK(socketpair(AF_UNIX, SOCK_STREAM, 0, send_fds + i)); + ASSERT_EQ(i, ARRAY_SIZE(send_fds)); + ASSERT_OK(uv_pipe_init(uv_default_loop(), &p, 1)); + ASSERT_OK(uv_pipe_open(&p, fds[1])); buf = uv_buf_init("X", 1); memset(&msg, 0, sizeof(msg)); @@ -130,7 +130,7 @@ TEST_IMPL(pipe_sendmsg) { msg.msg_control = (void*) scratch; msg.msg_controllen = CMSG_LEN(sizeof(send_fds)); - ASSERT(sizeof(scratch) >= msg.msg_controllen); + ASSERT_GE(sizeof(scratch), msg.msg_controllen); cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_level = SOL_SOCKET; @@ -146,16 +146,16 @@ TEST_IMPL(pipe_sendmsg) { } set_nonblocking(fds[1]); - ASSERT(0 == uv_read_start((uv_stream_t*) &p, alloc_cb, read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) &p, alloc_cb, read_cb)); do r = sendmsg(fds[0], &msg, 0); while (r == -1 && errno == EINTR); - ASSERT(r == 1); + ASSERT_EQ(1, r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(ARRAY_SIZE(incoming) == incoming_count); - ASSERT(ARRAY_SIZE(incoming) + 1 == close_called); + ASSERT_EQ(ARRAY_SIZE(incoming), incoming_count); + ASSERT_EQ(ARRAY_SIZE(incoming) + 1, close_called); close(fds[0]); MAKE_VALGRIND_HAPPY(uv_default_loop()); diff --git a/deps/uv/test/test-pipe-server-close.c b/deps/uv/test/test-pipe-server-close.c index dc20661916d889..ad7d792acc3865 100644 --- a/deps/uv/test/test-pipe-server-close.c +++ b/deps/uv/test/test-pipe-server-close.c @@ -35,15 +35,15 @@ static int pipe_client_connect_cb_called = 0; static void pipe_close_cb(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*) &pipe_client || - handle == (uv_handle_t*) &pipe_server); + ASSERT_NE(handle == (uv_handle_t*) &pipe_client || + handle == (uv_handle_t*) &pipe_server, 0); pipe_close_cb_called++; } static void pipe_client_connect_cb(uv_connect_t* req, int status) { - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); pipe_client_connect_cb_called++; @@ -56,7 +56,7 @@ static void pipe_server_connection_cb(uv_stream_t* handle, int status) { /* This function *may* be called, depending on whether accept or the * connection callback is called first. */ - ASSERT(status == 0); + ASSERT_OK(status); } @@ -71,23 +71,23 @@ TEST_IMPL(pipe_server_close) { ASSERT_NOT_NULL(loop); r = uv_pipe_init(loop, &pipe_server, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&pipe_server, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*) &pipe_server, 0, pipe_server_connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(loop, &pipe_client, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_connect(&connect_req, &pipe_client, TEST_PIPENAME, pipe_client_connect_cb); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(pipe_client_connect_cb_called == 1); - ASSERT(pipe_close_cb_called == 2); + ASSERT_OK(r); + ASSERT_EQ(1, pipe_client_connect_cb_called); + ASSERT_EQ(2, pipe_close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-pipe-set-fchmod.c b/deps/uv/test/test-pipe-set-fchmod.c index 402970e3da9922..9563e4fdd50f54 100644 --- a/deps/uv/test/test-pipe-set-fchmod.c +++ b/deps/uv/test/test-pipe-set-fchmod.c @@ -35,10 +35,10 @@ TEST_IMPL(pipe_set_chmod) { loop = uv_default_loop(); r = uv_pipe_init(loop, &pipe_handle, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_bind(&pipe_handle, TEST_PIPENAME); - ASSERT(r == 0); + ASSERT_OK(r); /* No easy way to test if this works, we will only make sure that the call is * successful. */ @@ -47,17 +47,17 @@ TEST_IMPL(pipe_set_chmod) { MAKE_VALGRIND_HAPPY(loop); RETURN_SKIP("Insufficient privileges to alter pipe fmode"); } - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 memset(&stat_buf, 0, sizeof(stat_buf)); - ASSERT_EQ(0, stat(TEST_PIPENAME, &stat_buf)); + ASSERT_OK(stat(TEST_PIPENAME, &stat_buf)); ASSERT(stat_buf.st_mode & S_IRUSR); ASSERT(stat_buf.st_mode & S_IRGRP); ASSERT(stat_buf.st_mode & S_IROTH); #endif r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE); - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 stat(TEST_PIPENAME, &stat_buf); ASSERT(stat_buf.st_mode & S_IWUSR); @@ -66,7 +66,7 @@ TEST_IMPL(pipe_set_chmod) { #endif r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE | UV_READABLE); - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 stat(TEST_PIPENAME, &stat_buf); ASSERT(stat_buf.st_mode & S_IRUSR); @@ -78,14 +78,14 @@ TEST_IMPL(pipe_set_chmod) { #endif r = uv_pipe_chmod(NULL, UV_WRITABLE | UV_READABLE); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_pipe_chmod(&pipe_handle, 12345678); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&pipe_handle, NULL); r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE | UV_READABLE); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-pipe-set-non-blocking.c b/deps/uv/test/test-pipe-set-non-blocking.c index 1b90bca3d2ab90..bf1c284189ffce 100644 --- a/deps/uv/test/test-pipe-set-non-blocking.c +++ b/deps/uv/test/test-pipe-set-non-blocking.c @@ -46,13 +46,13 @@ static void thread_main(void* arg) { uv_fs_req_cleanup(&req); } while (n > 0 || (n == -1 && uv_errno == UV_EINTR)); - ASSERT(n == 0); + ASSERT_OK(n); } #ifdef _WIN32 static void write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); req->handle = NULL; /* signal completion of write_cb */ } #endif @@ -77,15 +77,15 @@ TEST_IMPL(pipe_set_non_blocking) { uv_write_t write_req; #endif - ASSERT(0 == uv_pipe_init(uv_default_loop(), &pipe_handle, 0)); - ASSERT(0 == uv_pipe(fd, 0, 0)); - ASSERT(0 == uv_pipe_open(&pipe_handle, fd[1])); - ASSERT(0 == uv_stream_set_blocking((uv_stream_t*) &pipe_handle, 1)); + ASSERT_OK(uv_pipe_init(uv_default_loop(), &pipe_handle, 0)); + ASSERT_OK(uv_pipe(fd, 0, 0)); + ASSERT_OK(uv_pipe_open(&pipe_handle, fd[1])); + ASSERT_OK(uv_stream_set_blocking((uv_stream_t*) &pipe_handle, 1)); fd[1] = -1; /* fd[1] is owned by pipe_handle now. */ ctx.fd = fd[0]; - ASSERT(0 == uv_barrier_init(&ctx.barrier, 2)); - ASSERT(0 == uv_thread_create(&thread, thread_main, &ctx)); + ASSERT_OK(uv_barrier_init(&ctx.barrier, 2)); + ASSERT_OK(uv_thread_create(&thread, thread_main, &ctx)); uv_barrier_wait(&ctx.barrier); buf.len = sizeof(data); @@ -99,25 +99,29 @@ TEST_IMPL(pipe_set_non_blocking) { */ n = uv_try_write((uv_stream_t*) &pipe_handle, &buf, 1); #ifdef _WIN32 - ASSERT(n == UV_EAGAIN); /* E_NOTIMPL */ - ASSERT(0 == uv_write(&write_req, (uv_stream_t*) &pipe_handle, &buf, 1, write_cb)); + ASSERT_EQ(n, UV_EAGAIN); /* E_NOTIMPL */ + ASSERT_OK(uv_write(&write_req, + (uv_stream_t*) &pipe_handle, + &buf, + 1, + write_cb)); ASSERT_NOT_NULL(write_req.handle); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); ASSERT_NULL(write_req.handle); /* check for signaled completion of write_cb */ n = buf.len; #endif - ASSERT(n == sizeof(data)); + ASSERT_EQ(n, sizeof(data)); nwritten += n; } uv_close((uv_handle_t*) &pipe_handle, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); #ifdef _WIN32 - ASSERT(0 == _close(fd[0])); /* fd[1] is closed by uv_close(). */ + ASSERT_OK(_close(fd[0])); /* fd[1] is closed by uv_close(). */ #else - ASSERT(0 == close(fd[0])); /* fd[1] is closed by uv_close(). */ + ASSERT_OK(close(fd[0])); /* fd[1] is closed by uv_close(). */ #endif fd[0] = -1; uv_barrier_destroy(&ctx.barrier); diff --git a/deps/uv/test/test-platform-output.c b/deps/uv/test/test-platform-output.c index 5839f52dfe5885..f18e097f913607 100644 --- a/deps/uv/test/test-platform-output.c +++ b/deps/uv/test/test-platform-output.c @@ -44,37 +44,37 @@ TEST_IMPL(platform_output) { int err; err = uv_get_process_title(buffer, sizeof(buffer)); - ASSERT(err == 0); + ASSERT_OK(err); printf("uv_get_process_title: %s\n", buffer); size = sizeof(buffer); err = uv_cwd(buffer, &size); - ASSERT(err == 0); + ASSERT_OK(err); printf("uv_cwd: %s\n", buffer); err = uv_resident_set_memory(&rss); #if defined(__MSYS__) - ASSERT(err == UV_ENOSYS); + ASSERT_EQ(err, UV_ENOSYS); #else - ASSERT(err == 0); + ASSERT_OK(err); printf("uv_resident_set_memory: %llu\n", (unsigned long long) rss); #endif err = uv_uptime(&uptime); #if defined(__PASE__) - ASSERT(err == UV_ENOSYS); + ASSERT_EQ(err, UV_ENOSYS); #else - ASSERT(err == 0); - ASSERT(uptime > 0); + ASSERT_OK(err); + ASSERT_GT(uptime, 0); printf("uv_uptime: %f\n", uptime); #endif err = uv_getrusage(&rusage); - ASSERT(err == 0); - ASSERT(rusage.ru_utime.tv_sec >= 0); - ASSERT(rusage.ru_utime.tv_usec >= 0); - ASSERT(rusage.ru_stime.tv_sec >= 0); - ASSERT(rusage.ru_stime.tv_usec >= 0); + ASSERT_OK(err); + ASSERT_GE(rusage.ru_utime.tv_sec, 0); + ASSERT_GE(rusage.ru_utime.tv_usec, 0); + ASSERT_GE(rusage.ru_stime.tv_sec, 0); + ASSERT_GE(rusage.ru_stime.tv_usec, 0); printf("uv_getrusage:\n"); printf(" user: %llu sec %llu microsec\n", (unsigned long long) rusage.ru_utime.tv_sec, @@ -92,9 +92,9 @@ TEST_IMPL(platform_output) { err = uv_cpu_info(&cpus, &count); #if defined(__CYGWIN__) || defined(__MSYS__) - ASSERT(err == UV_ENOSYS); + ASSERT_EQ(err, UV_ENOSYS); #else - ASSERT(err == 0); + ASSERT_OK(err); printf("uv_cpu_info:\n"); for (i = 0; i < count; i++) { @@ -113,7 +113,7 @@ TEST_IMPL(platform_output) { uv_free_cpu_info(cpus, count); err = uv_interface_addresses(&interfaces, &count); - ASSERT(err == 0); + ASSERT_OK(err); printf("uv_interface_addresses:\n"); for (i = 0; i < count; i++) { @@ -149,7 +149,7 @@ TEST_IMPL(platform_output) { uv_free_interface_addresses(interfaces, count); err = uv_os_get_passwd(&pwd); - ASSERT_EQ(err, 0); + ASSERT_OK(err); err = uv_os_get_group(&grp, pwd.gid); #if defined(_WIN32) @@ -159,7 +159,7 @@ TEST_IMPL(platform_output) { (void) member; grp.groupname = "ENOTSUP"; #else - ASSERT_EQ(err, 0); + ASSERT_OK(err); ASSERT_EQ(pwd.gid, grp.gid); #endif @@ -183,14 +183,14 @@ TEST_IMPL(platform_output) { #endif pid = uv_os_getpid(); - ASSERT(pid > 0); + ASSERT_GT(pid, 0); printf("uv_os_getpid: %d\n", (int) pid); ppid = uv_os_getppid(); - ASSERT(ppid > 0); + ASSERT_GT(ppid, 0); printf("uv_os_getppid: %d\n", (int) ppid); err = uv_os_uname(&uname); - ASSERT(err == 0); + ASSERT_OK(err); printf("uv_os_uname:\n"); printf(" sysname: %s\n", uname.sysname); printf(" release: %s\n", uname.release); diff --git a/deps/uv/test/test-poll-close-doesnt-corrupt-stack.c b/deps/uv/test/test-poll-close-doesnt-corrupt-stack.c index a19f42769b5788..0acb452a78bcad 100644 --- a/deps/uv/test/test-poll-close-doesnt-corrupt-stack.c +++ b/deps/uv/test/test-poll-close-doesnt-corrupt-stack.c @@ -59,12 +59,12 @@ static void NO_INLINE close_socket_and_verify_stack(void) { data[i] = MARKER; r = closesocket(sock); - ASSERT(r == 0); + ASSERT_OK(r); uv_sleep(VERIFY_AFTER); for (i = 0; i < ARRAY_SIZE(data); i++) - ASSERT(data[i] == MARKER); + ASSERT_EQ(data[i], MARKER); } #endif @@ -79,34 +79,34 @@ TEST_IMPL(poll_close_doesnt_corrupt_stack) { struct sockaddr_in addr; r = WSAStartup(MAKEWORD(2, 2), &wsa_data); - ASSERT(r == 0); + ASSERT_OK(r); sock = socket(AF_INET, SOCK_STREAM, 0); - ASSERT(sock != INVALID_SOCKET); + ASSERT_NE(sock, INVALID_SOCKET); on = 1; r = ioctlsocket(sock, FIONBIO, &on); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_ip4_addr("127.0.0.1", TEST_PORT, &addr); - ASSERT(r == 0); + ASSERT_OK(r); r = connect(sock, (const struct sockaddr*) &addr, sizeof addr); - ASSERT(r != 0); - ASSERT(WSAGetLastError() == WSAEWOULDBLOCK); + ASSERT(r); + ASSERT_EQ(WSAGetLastError(), WSAEWOULDBLOCK); r = uv_poll_init_socket(uv_default_loop(), &handle, sock); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_poll_start(&handle, UV_READABLE | UV_WRITABLE, poll_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &handle, close_cb); close_socket_and_verify_stack(); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-poll-close.c b/deps/uv/test/test-poll-close.c index b4ad4c7834674b..5843bf4516d282 100644 --- a/deps/uv/test/test-poll-close.c +++ b/deps/uv/test/test-poll-close.c @@ -50,7 +50,7 @@ TEST_IMPL(poll_close) { { struct WSAData wsa_data; int r = WSAStartup(MAKEWORD(2, 2), &wsa_data); - ASSERT(r == 0); + ASSERT_OK(r); } #endif @@ -66,7 +66,7 @@ TEST_IMPL(poll_close) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == NUM_SOCKETS); + ASSERT_EQ(close_cb_called, NUM_SOCKETS); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-poll-closesocket.c b/deps/uv/test/test-poll-closesocket.c index a81d0b09ff8d0d..01f8f7410189f4 100644 --- a/deps/uv/test/test-poll-closesocket.c +++ b/deps/uv/test/test-poll-closesocket.c @@ -39,11 +39,11 @@ static void close_cb(uv_handle_t* h) { static void poll_cb(uv_poll_t* h, int status, int events) { int r; - ASSERT(status == 0); - ASSERT(h == &handle); + ASSERT_OK(status); + ASSERT_PTR_EQ(h, &handle); r = uv_poll_start(&handle, UV_READABLE, poll_cb); - ASSERT(r == 0); + ASSERT_OK(r); closesocket(sock); uv_close((uv_handle_t*) &handle, close_cb); @@ -62,29 +62,29 @@ TEST_IMPL(poll_closesocket) { struct sockaddr_in addr; r = WSAStartup(MAKEWORD(2, 2), &wsa_data); - ASSERT(r == 0); + ASSERT_OK(r); sock = socket(AF_INET, SOCK_STREAM, 0); - ASSERT(sock != INVALID_SOCKET); + ASSERT_NE(sock, INVALID_SOCKET); on = 1; r = ioctlsocket(sock, FIONBIO, &on); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_ip4_addr("127.0.0.1", TEST_PORT, &addr); - ASSERT(r == 0); + ASSERT_OK(r); r = connect(sock, (const struct sockaddr*) &addr, sizeof addr); - ASSERT(r != 0); - ASSERT(WSAGetLastError() == WSAEWOULDBLOCK); + ASSERT(r); + ASSERT_EQ(WSAGetLastError(), WSAEWOULDBLOCK); r = uv_poll_init_socket(uv_default_loop(), &handle, sock); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_poll_start(&handle, UV_WRITABLE, poll_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-poll-multiple-handles.c b/deps/uv/test/test-poll-multiple-handles.c index 1aad1ef21065b7..d9c4924dbfe385 100644 --- a/deps/uv/test/test-poll-multiple-handles.c +++ b/deps/uv/test/test-poll-multiple-handles.c @@ -40,7 +40,7 @@ static void close_cb(uv_handle_t* handle) { static void poll_cb(uv_poll_t* handle, int status, int events) { /* Not a bound socket, linux immediately reports UV_READABLE, other OS do not */ - ASSERT(events == UV_READABLE); + ASSERT_EQ(events, UV_READABLE); } TEST_IMPL(poll_multiple_handles) { @@ -51,20 +51,24 @@ TEST_IMPL(poll_multiple_handles) { { struct WSAData wsa_data; int r = WSAStartup(MAKEWORD(2, 2), &wsa_data); - ASSERT(r == 0); + ASSERT_OK(r); } #endif sock = socket(AF_INET, SOCK_STREAM, 0); #ifdef _WIN32 - ASSERT(sock != INVALID_SOCKET); + ASSERT_NE(sock, INVALID_SOCKET); #else - ASSERT(sock != -1); + ASSERT_NE(sock, -1); #endif - ASSERT(0 == uv_poll_init_socket(uv_default_loop(), &first_poll_handle, sock)); - ASSERT(0 == uv_poll_init_socket(uv_default_loop(), &second_poll_handle, sock)); + ASSERT_OK(uv_poll_init_socket(uv_default_loop(), + &first_poll_handle, + sock)); + ASSERT_OK(uv_poll_init_socket(uv_default_loop(), + &second_poll_handle, + sock)); - ASSERT(0 == uv_poll_start(&first_poll_handle, UV_READABLE, poll_cb)); + ASSERT_OK(uv_poll_start(&first_poll_handle, UV_READABLE, poll_cb)); /* We may not start polling while another polling handle is active * on that fd. @@ -73,26 +77,27 @@ TEST_IMPL(poll_multiple_handles) { /* We do not track handles in an O(1) lookupable way on Windows, * so not checking that here. */ - ASSERT(uv_poll_start(&second_poll_handle, UV_READABLE, poll_cb) == UV_EEXIST); + ASSERT_EQ(uv_poll_start(&second_poll_handle, UV_READABLE, poll_cb), + UV_EEXIST); #endif /* After stopping the other polling handle, we now should be able to poll */ - ASSERT(0 == uv_poll_stop(&first_poll_handle)); - ASSERT(0 == uv_poll_start(&second_poll_handle, UV_READABLE, poll_cb)); + ASSERT_OK(uv_poll_stop(&first_poll_handle)); + ASSERT_OK(uv_poll_start(&second_poll_handle, UV_READABLE, poll_cb)); /* Closing an already stopped polling handle is safe in any case */ uv_close((uv_handle_t*) &first_poll_handle, close_cb); uv_unref((uv_handle_t*) &second_poll_handle); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(close_cb_called == 1); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, close_cb_called); uv_ref((uv_handle_t*) &second_poll_handle); ASSERT(uv_is_active((uv_handle_t*) &second_poll_handle)); uv_close((uv_handle_t*) &second_poll_handle, close_cb); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(close_cb_called == 2); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-poll-oob.c b/deps/uv/test/test-poll-oob.c index b1ff41f5b8ad9f..b40c93c3708776 100644 --- a/deps/uv/test/test-poll-oob.c +++ b/deps/uv/test/test-poll-oob.c @@ -70,7 +70,7 @@ static void poll_cb(uv_poll_t* handle, int status, int events) { int n; int fd; - ASSERT(0 == uv_fileno((uv_handle_t*)handle, &fd)); + ASSERT_OK(uv_fileno((uv_handle_t*)handle, &fd)); memset(buffer, 0, 5); if (events & UV_PRIORITIZED) { @@ -79,10 +79,10 @@ static void poll_cb(uv_poll_t* handle, int status, int events) { while (n == -1 && errno == EINTR); ASSERT(n >= 0 || errno != EINVAL); cli_pr_check = 1; - ASSERT(0 == uv_poll_stop(&poll_req[0])); - ASSERT(0 == uv_poll_start(&poll_req[0], - UV_READABLE | UV_WRITABLE, - poll_cb)); + ASSERT_OK(uv_poll_stop(&poll_req[0])); + ASSERT_OK(uv_poll_start(&poll_req[0], + UV_READABLE | UV_WRITABLE, + poll_cb)); } if (events & UV_READABLE) { if (fd == client_fd) { @@ -91,21 +91,21 @@ static void poll_cb(uv_poll_t* handle, int status, int events) { while (n == -1 && errno == EINTR); ASSERT(n >= 0 || errno != EINVAL); if (cli_rd_check == 1) { - ASSERT(strncmp(buffer, "world", n) == 0); - ASSERT(5 == n); + ASSERT_OK(strncmp(buffer, "world", n)); + ASSERT_EQ(5, n); cli_rd_check = 2; } if (cli_rd_check == 0) { - ASSERT(n == 4); - ASSERT(strncmp(buffer, "hello", n) == 0); + ASSERT_EQ(4, n); + ASSERT_OK(strncmp(buffer, "hello", n)); cli_rd_check = 1; do { do n = recv(server_fd, &buffer, 5, 0); while (n == -1 && errno == EINTR); if (n > 0) { - ASSERT(n == 5); - ASSERT(strncmp(buffer, "world", n) == 0); + ASSERT_EQ(5, n); + ASSERT_OK(strncmp(buffer, "world", n)); cli_rd_check = 2; } } while (n > 0); @@ -118,8 +118,8 @@ static void poll_cb(uv_poll_t* handle, int status, int events) { n = recv(server_fd, &buffer, 3, 0); while (n == -1 && errno == EINTR); ASSERT(n >= 0 || errno != EINVAL); - ASSERT(3 == n); - ASSERT(strncmp(buffer, "foo", n) == 0); + ASSERT_EQ(3, n); + ASSERT_OK(strncmp(buffer, "foo", n)); srv_rd_check = 1; uv_poll_stop(&poll_req[1]); } @@ -128,35 +128,39 @@ static void poll_cb(uv_poll_t* handle, int status, int events) { do { n = send(client_fd, "foo", 3, 0); } while (n < 0 && errno == EINTR); - ASSERT(3 == n); + ASSERT_EQ(3, n); } } static void connection_cb(uv_stream_t* handle, int status) { int r; - ASSERT(0 == status); - ASSERT(0 == uv_accept(handle, (uv_stream_t*) &peer_handle)); - ASSERT(0 == uv_fileno((uv_handle_t*) &peer_handle, &server_fd)); - ASSERT(0 == uv_poll_init_socket(uv_default_loop(), &poll_req[0], client_fd)); - ASSERT(0 == uv_poll_init_socket(uv_default_loop(), &poll_req[1], server_fd)); - ASSERT(0 == uv_poll_start(&poll_req[0], - UV_PRIORITIZED | UV_READABLE | UV_WRITABLE, - poll_cb)); - ASSERT(0 == uv_poll_start(&poll_req[1], - UV_READABLE, - poll_cb)); + ASSERT_OK(status); + ASSERT_OK(uv_accept(handle, (uv_stream_t*) &peer_handle)); + ASSERT_OK(uv_fileno((uv_handle_t*) &peer_handle, &server_fd)); + ASSERT_OK(uv_poll_init_socket(uv_default_loop(), + &poll_req[0], + client_fd)); + ASSERT_OK(uv_poll_init_socket(uv_default_loop(), + &poll_req[1], + server_fd)); + ASSERT_OK(uv_poll_start(&poll_req[0], + UV_PRIORITIZED | UV_READABLE | UV_WRITABLE, + poll_cb)); + ASSERT_OK(uv_poll_start(&poll_req[1], + UV_READABLE, + poll_cb)); do { r = send(server_fd, "hello", 5, MSG_OOB); } while (r < 0 && errno == EINTR); - ASSERT(5 == r); + ASSERT_EQ(5, r); do { r = send(server_fd, "world", 5, 0); } while (r < 0 && errno == EINTR); - ASSERT(5 == r); + ASSERT_EQ(5, r); - ASSERT(0 == uv_idle_start(&idle, idle_cb)); + ASSERT_OK(uv_idle_start(&idle, idle_cb)); } @@ -165,39 +169,39 @@ TEST_IMPL(poll_oob) { int r = 0; uv_loop_t* loop; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); - ASSERT(0 == uv_tcp_init(loop, &server_handle)); - ASSERT(0 == uv_tcp_init(loop, &client_handle)); - ASSERT(0 == uv_tcp_init(loop, &peer_handle)); - ASSERT(0 == uv_idle_init(loop, &idle)); - ASSERT(0 == uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); + ASSERT_OK(uv_tcp_init(loop, &server_handle)); + ASSERT_OK(uv_tcp_init(loop, &client_handle)); + ASSERT_OK(uv_tcp_init(loop, &peer_handle)); + ASSERT_OK(uv_idle_init(loop, &idle)); + ASSERT_OK(uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); /* Ensure two separate packets */ - ASSERT(0 == uv_tcp_nodelay(&client_handle, 1)); + ASSERT_OK(uv_tcp_nodelay(&client_handle, 1)); client_fd = socket(PF_INET, SOCK_STREAM, 0); - ASSERT(client_fd >= 0); + ASSERT_GE(client_fd, 0); do { errno = 0; r = connect(client_fd, (const struct sockaddr*)&addr, sizeof(addr)); } while (r == -1 && errno == EINTR); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(ticks == kMaxTicks); + ASSERT_EQ(ticks, kMaxTicks); /* Did client receive the POLLPRI message */ - ASSERT(cli_pr_check == 1); + ASSERT_EQ(1, cli_pr_check); /* Did client receive the POLLIN message */ - ASSERT(cli_rd_check == 2); + ASSERT_EQ(2, cli_rd_check); /* Could we write with POLLOUT and did the server receive our POLLOUT message * through POLLIN. */ - ASSERT(srv_rd_check == 1); + ASSERT_EQ(1, srv_rd_check); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-poll.c b/deps/uv/test/test-poll.c index a0f28324e2f2ca..f5a30e9a6b2499 100644 --- a/deps/uv/test/test-poll.c +++ b/deps/uv/test/test-poll.c @@ -106,9 +106,9 @@ static uv_os_sock_t create_bound_socket (struct sockaddr_in bind_addr) { sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); #ifdef _WIN32 - ASSERT(sock != INVALID_SOCKET); + ASSERT_NE(sock, INVALID_SOCKET); #else - ASSERT(sock >= 0); + ASSERT_GE(sock, 0); #endif #ifndef _WIN32 @@ -116,12 +116,12 @@ static uv_os_sock_t create_bound_socket (struct sockaddr_in bind_addr) { /* Allow reuse of the port. */ int yes = 1; r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); - ASSERT(r == 0); + ASSERT_OK(r); } #endif r = bind(sock, (const struct sockaddr*) &bind_addr, sizeof bind_addr); - ASSERT(r == 0); + ASSERT_OK(r); return sock; } @@ -163,12 +163,12 @@ static connection_context_t* create_connection_context( r = uv_poll_init_socket(uv_default_loop(), &context->poll_handle, sock); context->open_handles++; context->poll_handle.data = context; - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(uv_default_loop(), &context->timer_handle); context->open_handles++; context->timer_handle.data = context; - ASSERT(r == 0); + ASSERT_OK(r); return context; } @@ -179,15 +179,15 @@ static void connection_close_cb(uv_handle_t* handle) { if (--context->open_handles == 0) { if (test_mode == DUPLEX || context->is_server_connection) { - ASSERT(context->read == TRANSFER_BYTES); + ASSERT_EQ(context->read, TRANSFER_BYTES); } else { - ASSERT(context->read == 0); + ASSERT_OK(context->read); } if (test_mode == DUPLEX || !context->is_server_connection) { - ASSERT(context->sent == TRANSFER_BYTES); + ASSERT_EQ(context->sent, TRANSFER_BYTES); } else { - ASSERT(context->sent == 0); + ASSERT_OK(context->sent); } closed_connections++; @@ -208,7 +208,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { unsigned int new_events; int r; - ASSERT(status == 0); + ASSERT_OK(status); ASSERT(events & context->events); ASSERT(!(events & ~context->events)); @@ -226,7 +226,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { do r = recv(context->sock, buffer, sizeof buffer, 0); while (r == -1 && errno == EINTR); - ASSERT(r >= 0); + ASSERT_GE(r, 0); if (r > 0) { context->read += r; @@ -306,7 +306,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { static char buffer[103]; int send_bytes = MIN(TRANSFER_BYTES - context->sent, sizeof buffer); - ASSERT(send_bytes > 0); + ASSERT_GT(send_bytes, 0); do r = send(context->sock, buffer, send_bytes, 0); @@ -318,7 +318,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { break; } - ASSERT(r > 0); + ASSERT_GT(r, 0); context->sent += r; valid_writable_wakeups++; break; @@ -330,7 +330,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { static char buffer[1234]; int send_bytes = MIN(TRANSFER_BYTES - context->sent, sizeof buffer); - ASSERT(send_bytes > 0); + ASSERT_GT(send_bytes, 0); do r = send(context->sock, buffer, send_bytes, 0); @@ -342,18 +342,18 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { break; } - ASSERT(r > 0); + ASSERT_GT(r, 0); valid_writable_wakeups++; context->sent += r; while (context->sent < TRANSFER_BYTES) { send_bytes = MIN(TRANSFER_BYTES - context->sent, sizeof buffer); - ASSERT(send_bytes > 0); + ASSERT_GT(send_bytes, 0); do r = send(context->sock, buffer, send_bytes, 0); while (r == -1 && errno == EINTR); - ASSERT(r != 0); + ASSERT(r); if (r < 0) { ASSERT(got_eagain()); @@ -403,7 +403,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { #else r = shutdown(context->sock, SHUT_WR); #endif - ASSERT(r == 0); + ASSERT_OK(r); context->sent_fin = 1; new_events &= ~UV_WRITABLE; } @@ -432,9 +432,9 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { /* Assert that uv_is_active works correctly for poll handles. */ if (context->events != 0) { - ASSERT(1 == uv_is_active((uv_handle_t*) handle)); + ASSERT_EQ(1, uv_is_active((uv_handle_t*) handle)); } else { - ASSERT(0 == uv_is_active((uv_handle_t*) handle)); + ASSERT_OK(uv_is_active((uv_handle_t*) handle)); } } @@ -444,7 +444,7 @@ static void delay_timer_cb(uv_timer_t* timer) { int r; /* Timer should auto stop. */ - ASSERT(0 == uv_is_active((uv_handle_t*) timer)); + ASSERT_OK(uv_is_active((uv_handle_t*) timer)); /* Add the requested events to the poll mask. */ ASSERT(context->delayed_events != 0); @@ -454,7 +454,7 @@ static void delay_timer_cb(uv_timer_t* timer) { r = uv_poll_start(&context->poll_handle, context->events, connection_poll_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -471,7 +471,7 @@ static server_context_t* create_server_context( r = uv_poll_init_socket(uv_default_loop(), &context->poll_handle, sock); context->poll_handle.data = context; - ASSERT(r == 0); + ASSERT_OK(r); return context; } @@ -500,9 +500,9 @@ static void server_poll_cb(uv_poll_t* handle, int status, int events) { addr_len = sizeof addr; sock = accept(server_context->sock, (struct sockaddr*) &addr, &addr_len); #ifdef _WIN32 - ASSERT(sock != INVALID_SOCKET); + ASSERT_NE(sock, INVALID_SOCKET); #else - ASSERT(sock >= 0); + ASSERT_GE(sock, 0); #endif connection_context = create_connection_context(sock, 1); @@ -510,7 +510,7 @@ static void server_poll_cb(uv_poll_t* handle, int status, int events) { r = uv_poll_start(&connection_context->poll_handle, UV_READABLE | UV_WRITABLE | UV_DISCONNECT, connection_poll_cb); - ASSERT(r == 0); + ASSERT_OK(r); if (++server_context->connections == NUM_CLIENTS) { close_socket(server_context->sock); @@ -525,15 +525,15 @@ static void start_server(void) { uv_os_sock_t sock; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); sock = create_bound_socket(addr); context = create_server_context(sock); r = listen(sock, 100); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_poll_start(&context->poll_handle, UV_READABLE, server_poll_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -544,8 +544,8 @@ static void start_client(void) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); - ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", 0, &addr)); sock = create_bound_socket(addr); context = create_connection_context(sock, 0); @@ -554,7 +554,7 @@ static void start_client(void) { r = uv_poll_start(&context->poll_handle, UV_READABLE | UV_WRITABLE | UV_DISCONNECT, connection_poll_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = connect(sock, (struct sockaddr*) &server_addr, sizeof server_addr); ASSERT(r == 0 || got_eagain()); @@ -568,7 +568,7 @@ static void start_poll_test(void) { { struct WSAData wsa_data; int r = WSAStartup(MAKEWORD(2, 2), &wsa_data); - ASSERT(r == 0); + ASSERT_OK(r); } #endif @@ -578,16 +578,16 @@ static void start_poll_test(void) { start_client(); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); /* Assert that at most five percent of the writable wakeups was spurious. */ - ASSERT(spurious_writable_wakeups == 0 || - (valid_writable_wakeups + spurious_writable_wakeups) / - spurious_writable_wakeups > 20); + ASSERT_NE(spurious_writable_wakeups == 0 || + (valid_writable_wakeups + spurious_writable_wakeups) / + spurious_writable_wakeups > 20, 0); - ASSERT(closed_connections == NUM_CLIENTS * 2); + ASSERT_EQ(closed_connections, NUM_CLIENTS * 2); #if !defined(__sun) && !defined(_AIX) && !defined(__MVS__) - ASSERT(disconnects == NUM_CLIENTS * 2); + ASSERT_EQ(disconnects, NUM_CLIENTS * 2); #endif MAKE_VALGRIND_HAPPY(uv_default_loop()); } @@ -642,9 +642,9 @@ TEST_IMPL(poll_bad_fdtype) { #else fd = open(".", O_RDONLY); #endif - ASSERT(fd != -1); - ASSERT(0 != uv_poll_init(uv_default_loop(), &poll_handle, fd)); - ASSERT(0 == close(fd)); + ASSERT_NE(fd, -1); + ASSERT_NE(0, uv_poll_init(uv_default_loop(), &poll_handle, fd)); + ASSERT_OK(close(fd)); #endif MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -658,15 +658,15 @@ TEST_IMPL(poll_nested_epoll) { int fd; fd = epoll_create(1); - ASSERT(fd != -1); + ASSERT_NE(fd, -1); - ASSERT(0 == uv_poll_init(uv_default_loop(), &poll_handle, fd)); - ASSERT(0 == uv_poll_start(&poll_handle, UV_READABLE, (uv_poll_cb) abort)); - ASSERT(0 != uv_run(uv_default_loop(), UV_RUN_NOWAIT)); + ASSERT_OK(uv_poll_init(uv_default_loop(), &poll_handle, fd)); + ASSERT_OK(uv_poll_start(&poll_handle, UV_READABLE, (uv_poll_cb) abort)); + ASSERT_NE(0, uv_run(uv_default_loop(), UV_RUN_NOWAIT)); uv_close((uv_handle_t*) &poll_handle, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == close(fd)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(close(fd)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -680,15 +680,15 @@ TEST_IMPL(poll_nested_kqueue) { int fd; fd = kqueue(); - ASSERT(fd != -1); + ASSERT_NE(fd, -1); - ASSERT(0 == uv_poll_init(uv_default_loop(), &poll_handle, fd)); - ASSERT(0 == uv_poll_start(&poll_handle, UV_READABLE, (uv_poll_cb) abort)); - ASSERT(0 != uv_run(uv_default_loop(), UV_RUN_NOWAIT)); + ASSERT_OK(uv_poll_init(uv_default_loop(), &poll_handle, fd)); + ASSERT_OK(uv_poll_start(&poll_handle, UV_READABLE, (uv_poll_cb) abort)); + ASSERT_NE(0, uv_run(uv_default_loop(), UV_RUN_NOWAIT)); uv_close((uv_handle_t*) &poll_handle, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == close(fd)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(close(fd)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-process-priority.c b/deps/uv/test/test-process-priority.c index b3d0a85bdd70ec..941e4b36391032 100644 --- a/deps/uv/test/test-process-priority.c +++ b/deps/uv/test/test-process-priority.c @@ -35,7 +35,7 @@ TEST_IMPL(process_priority) { /* Verify that passing a NULL pointer returns UV_EINVAL. */ r = uv_os_getpriority(0, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Verify that all valid values work. */ for (i = UV_PRIORITY_HIGHEST; i <= UV_PRIORITY_LOW; i++) { @@ -46,38 +46,38 @@ TEST_IMPL(process_priority) { if (r == UV_EACCES) continue; - ASSERT(r == 0); - ASSERT(uv_os_getpriority(0, &priority) == 0); + ASSERT_OK(r); + ASSERT_OK(uv_os_getpriority(0, &priority)); /* Verify that the priority values match on Unix, and are range mapped on Windows. */ #ifndef _WIN32 - ASSERT(priority == i); + ASSERT_EQ(priority, i); #else /* On Windows, only elevated users can set UV_PRIORITY_HIGHEST. Other users will silently be set to UV_PRIORITY_HIGH. */ if (i < UV_PRIORITY_HIGH) ASSERT(priority == UV_PRIORITY_HIGHEST || priority == UV_PRIORITY_HIGH); else if (i < UV_PRIORITY_ABOVE_NORMAL) - ASSERT(priority == UV_PRIORITY_HIGH); + ASSERT_EQ(priority, UV_PRIORITY_HIGH); else if (i < UV_PRIORITY_NORMAL) - ASSERT(priority == UV_PRIORITY_ABOVE_NORMAL); + ASSERT_EQ(priority, UV_PRIORITY_ABOVE_NORMAL); else if (i < UV_PRIORITY_BELOW_NORMAL) - ASSERT(priority == UV_PRIORITY_NORMAL); + ASSERT_EQ(priority, UV_PRIORITY_NORMAL); else if (i < UV_PRIORITY_LOW) - ASSERT(priority == UV_PRIORITY_BELOW_NORMAL); + ASSERT_EQ(priority, UV_PRIORITY_BELOW_NORMAL); else - ASSERT(priority == UV_PRIORITY_LOW); + ASSERT_EQ(priority, UV_PRIORITY_LOW); #endif /* Verify that the current PID and 0 are equivalent. */ - ASSERT(uv_os_getpriority(uv_os_getpid(), &r) == 0); - ASSERT(priority == r); + ASSERT_OK(uv_os_getpriority(uv_os_getpid(), &r)); + ASSERT_EQ(priority, r); } /* Verify that invalid priorities return UV_EINVAL. */ - ASSERT(uv_os_setpriority(0, UV_PRIORITY_HIGHEST - 1) == UV_EINVAL); - ASSERT(uv_os_setpriority(0, UV_PRIORITY_LOW + 1) == UV_EINVAL); + ASSERT_EQ(uv_os_setpriority(0, UV_PRIORITY_HIGHEST - 1), UV_EINVAL); + ASSERT_EQ(uv_os_setpriority(0, UV_PRIORITY_LOW + 1), UV_EINVAL); return 0; } diff --git a/deps/uv/test/test-process-title-threadsafe.c b/deps/uv/test/test-process-title-threadsafe.c index 927643cc8c90c9..05baaf44a453ad 100644 --- a/deps/uv/test/test-process-title-threadsafe.c +++ b/deps/uv/test/test-process-title-threadsafe.c @@ -46,7 +46,7 @@ static void getter_thread_body(void* arg) { getter_sem = arg; while (UV_EAGAIN == uv_sem_trywait(getter_sem)) { - ASSERT(0 == uv_get_process_title(buffer, sizeof(buffer))); + ASSERT_OK(uv_get_process_title(buffer, sizeof(buffer))); /* The maximum size of the process title on some platforms depends on * the total size of the argv vector. It's therefore possible to read @@ -70,10 +70,10 @@ static void setter_thread_body(void* arg) { int i; for (i = 0; i < NUM_ITERATIONS; i++) { - ASSERT(0 == uv_set_process_title(titles[0])); - ASSERT(0 == uv_set_process_title(titles[1])); - ASSERT(0 == uv_set_process_title(titles[2])); - ASSERT(0 == uv_set_process_title(titles[3])); + ASSERT_OK(uv_set_process_title(titles[0])); + ASSERT_OK(uv_set_process_title(titles[1])); + ASSERT_OK(uv_set_process_title(titles[2])); + ASSERT_OK(uv_set_process_title(titles[3])); } } @@ -89,20 +89,19 @@ TEST_IMPL(process_title_threadsafe) { RETURN_SKIP("uv_(get|set)_process_title is not implemented."); #endif - ASSERT(0 == uv_set_process_title(titles[0])); + ASSERT_OK(uv_set_process_title(titles[0])); - ASSERT_EQ(0, uv_sem_init(&getter_sem, 0)); - ASSERT_EQ(0, - uv_thread_create(&getter_thread, getter_thread_body, &getter_sem)); + ASSERT_OK(uv_sem_init(&getter_sem, 0)); + ASSERT_OK(uv_thread_create(&getter_thread, getter_thread_body, &getter_sem)); for (i = 0; i < (int) ARRAY_SIZE(setter_threads); i++) - ASSERT(0 == uv_thread_create(&setter_threads[i], setter_thread_body, NULL)); + ASSERT_OK(uv_thread_create(&setter_threads[i], setter_thread_body, NULL)); for (i = 0; i < (int) ARRAY_SIZE(setter_threads); i++) - ASSERT(0 == uv_thread_join(&setter_threads[i])); + ASSERT_OK(uv_thread_join(&setter_threads[i])); uv_sem_post(&getter_sem); - ASSERT_EQ(0, uv_thread_join(&getter_thread)); + ASSERT_OK(uv_thread_join(&getter_thread)); uv_sem_destroy(&getter_sem); return 0; diff --git a/deps/uv/test/test-process-title.c b/deps/uv/test/test-process-title.c index c5cff9723da4d3..7178cf87da4b52 100644 --- a/deps/uv/test/test-process-title.c +++ b/deps/uv/test/test-process-title.c @@ -29,15 +29,15 @@ static void set_title(const char* title) { int err; err = uv_get_process_title(buffer, sizeof(buffer)); - ASSERT(err == 0); + ASSERT_OK(err); err = uv_set_process_title(title); - ASSERT(err == 0); + ASSERT_OK(err); err = uv_get_process_title(buffer, sizeof(buffer)); - ASSERT(err == 0); + ASSERT_OK(err); - ASSERT(strcmp(buffer, title) == 0); + ASSERT_OK(strcmp(buffer, title)); } @@ -47,15 +47,15 @@ static void uv_get_process_title_edge_cases(void) { /* Test a NULL buffer */ r = uv_get_process_title(NULL, 100); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Test size of zero */ r = uv_get_process_title(buffer, 0); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Test for insufficient buffer size */ r = uv_get_process_title(buffer, 1); - ASSERT(r == UV_ENOBUFS); + ASSERT_EQ(r, UV_ENOBUFS); } @@ -77,8 +77,8 @@ TEST_IMPL(process_title) { static void exit_cb(uv_process_t* process, int64_t status, int signo) { - ASSERT(status == 0); - ASSERT(signo == 0); + ASSERT_OK(status); + ASSERT_OK(signo); uv_close((uv_handle_t*) process, NULL); } @@ -97,7 +97,7 @@ TEST_IMPL(process_title_big_argv) { #endif exepath_size = sizeof(exepath) - 1; - ASSERT(0 == uv_exepath(exepath, &exepath_size)); + ASSERT_OK(uv_exepath(exepath, &exepath_size)); exepath[exepath_size] = '\0'; memset(jumbo, 'x', sizeof(jumbo) - 1); @@ -117,8 +117,8 @@ TEST_IMPL(process_title_big_argv) { options.args = args; options.exit_cb = exit_cb; - ASSERT(0 == uv_spawn(uv_default_loop(), &process, &options)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -131,5 +131,5 @@ void process_title_big_argv(void) { /* Return value deliberately ignored. */ uv_get_process_title(buf, sizeof(buf)); - ASSERT(0 != strcmp(buf, "fail")); + ASSERT_NE(0, strcmp(buf, "fail")); } diff --git a/deps/uv/test/test-queue-foreach-delete.c b/deps/uv/test/test-queue-foreach-delete.c index 4fe8aecee5f781..b3a2d19c4088c9 100644 --- a/deps/uv/test/test-queue-foreach-delete.c +++ b/deps/uv/test/test-queue-foreach-delete.c @@ -71,7 +71,7 @@ static const unsigned first_handle_number_fs_event = 0; static unsigned name##_cb_calls[3]; \ \ static void name##2_cb(__VA_ARGS__) { \ - ASSERT(handle == &(name)[2]); \ + ASSERT_PTR_EQ(handle, &(name)[2]); \ if (first_handle_number_##name == 2) { \ uv_close((uv_handle_t*)&(name)[2], NULL); \ uv_close((uv_handle_t*)&(name)[1], NULL); \ @@ -80,12 +80,12 @@ static const unsigned first_handle_number_fs_event = 0; } \ \ static void name##1_cb(__VA_ARGS__) { \ - ASSERT(handle == &(name)[1]); \ + ASSERT_PTR_EQ(handle, &(name)[1]); \ ASSERT(0 && "Shouldn't be called" && (&name[0])); \ } \ \ static void name##0_cb(__VA_ARGS__) { \ - ASSERT(handle == &(name)[0]); \ + ASSERT_PTR_EQ(handle, &(name)[0]); \ if (first_handle_number_##name == 0) { \ uv_close((uv_handle_t*)&(name)[0], NULL); \ uv_close((uv_handle_t*)&(name)[1], NULL); \ @@ -105,18 +105,18 @@ static const unsigned first_handle_number_fs_event = 0; for (i = 0; i < ARRAY_SIZE(name); i++) { \ int r; \ r = uv_##name##_init((loop), &(name)[i]); \ - ASSERT(r == 0); \ + ASSERT_OK(r); \ \ r = uv_##name##_start(&(name)[i], name##_cbs[i]); \ - ASSERT(r == 0); \ + ASSERT_OK(r); \ } \ } while (0) #define END_ASSERTS(name) \ do { \ - ASSERT(name##_cb_calls[0] == 1); \ - ASSERT(name##_cb_calls[1] == 0); \ - ASSERT(name##_cb_calls[2] == 1); \ + ASSERT_EQ(1, name##_cb_calls[0]); \ + ASSERT_OK(name##_cb_calls[1]); \ + ASSERT_EQ(1, name##_cb_calls[2]); \ } while (0) DEFINE_GLOBALS_AND_CBS(idle, uv_idle_t* handle) @@ -140,13 +140,13 @@ static void init_and_start_fs_events(uv_loop_t* loop) { for (i = 0; i < ARRAY_SIZE(fs_event); i++) { int r; r = uv_fs_event_init(loop, &fs_event[i]); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fs_event_start(&fs_event[i], (uv_fs_event_cb)fs_event_cbs[i], watched_dir, 0); - ASSERT(r == 0); + ASSERT_OK(r); } } @@ -156,10 +156,10 @@ static void helper_timer_cb(uv_timer_t* thandle) { /* fire all fs_events */ r = uv_fs_utime(thandle->loop, &fs_req, watched_dir, 0, 0, NULL); - ASSERT(r == 0); - ASSERT(fs_req.result == 0); - ASSERT(fs_req.fs_type == UV_FS_UTIME); - ASSERT(strcmp(fs_req.path, watched_dir) == 0); + ASSERT_OK(r); + ASSERT_OK(fs_req.result); + ASSERT_EQ(fs_req.fs_type, UV_FS_UTIME); + ASSERT_OK(strcmp(fs_req.path, watched_dir)); uv_fs_req_cleanup(&fs_req); helper_timer_cb_calls++; @@ -182,21 +182,21 @@ TEST_IMPL(queue_foreach_delete) { /* helper timer to trigger async and fs_event callbacks */ r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, helper_timer_cb, 0, 0); - ASSERT(r == 0); + ASSERT_OK(r); #endif r = uv_run(loop, UV_RUN_NOWAIT); - ASSERT(r == 1); + ASSERT_EQ(1, r); END_ASSERTS(idle); END_ASSERTS(prepare); END_ASSERTS(check); #ifdef __linux__ - ASSERT(helper_timer_cb_calls == 1); + ASSERT_EQ(1, helper_timer_cb_calls); #endif MAKE_VALGRIND_HAPPY(loop); diff --git a/deps/uv/test/test-random.c b/deps/uv/test/test-random.c index 3ff3fa8b364824..d82d05782c098e 100644 --- a/deps/uv/test/test-random.c +++ b/deps/uv/test/test-random.c @@ -33,16 +33,16 @@ static void random_cb(uv_random_t* req, int status, void* buf, size_t buflen) { memset(zero, 0, sizeof(zero)); - ASSERT(0 == status); - ASSERT(buf == (void*) scratch); + ASSERT_OK(status); + ASSERT_PTR_EQ(buf, (void*) scratch); if (random_cb_called == 0) { - ASSERT(buflen == 0); - ASSERT(0 == memcmp(scratch, zero, sizeof(zero))); + ASSERT_OK(buflen); + ASSERT_OK(memcmp(scratch, zero, sizeof(zero))); } else { - ASSERT(buflen == sizeof(scratch)); + ASSERT_EQ(buflen, sizeof(scratch)); /* Buy a lottery ticket if you manage to trip this assertion. */ - ASSERT(0 != memcmp(scratch, zero, sizeof(zero))); + ASSERT_NE(0, memcmp(scratch, zero, sizeof(zero))); } random_cb_called++; @@ -54,21 +54,21 @@ TEST_IMPL(random_async) { uv_loop_t* loop; loop = uv_default_loop(); - ASSERT(UV_EINVAL == uv_random(loop, &req, scratch, sizeof(scratch), -1, - random_cb)); - ASSERT(UV_E2BIG == uv_random(loop, &req, scratch, -1, -1, random_cb)); + ASSERT_EQ(UV_EINVAL, uv_random(loop, &req, scratch, sizeof(scratch), -1, + random_cb)); + ASSERT_EQ(UV_E2BIG, uv_random(loop, &req, scratch, -1, -1, random_cb)); - ASSERT(0 == uv_random(loop, &req, scratch, 0, 0, random_cb)); - ASSERT(0 == random_cb_called); + ASSERT_OK(uv_random(loop, &req, scratch, 0, 0, random_cb)); + ASSERT_OK(random_cb_called); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == random_cb_called); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, random_cb_called); - ASSERT(0 == uv_random(loop, &req, scratch, sizeof(scratch), 0, random_cb)); - ASSERT(1 == random_cb_called); + ASSERT_OK(uv_random(loop, &req, scratch, sizeof(scratch), 0, random_cb)); + ASSERT_EQ(1, random_cb_called); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(2 == random_cb_called); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(2, random_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -79,15 +79,15 @@ TEST_IMPL(random_sync) { char zero[256]; char buf[256]; - ASSERT(UV_EINVAL == uv_random(NULL, NULL, buf, sizeof(buf), -1, NULL)); - ASSERT(UV_E2BIG == uv_random(NULL, NULL, buf, -1, -1, NULL)); + ASSERT_EQ(UV_EINVAL, uv_random(NULL, NULL, buf, sizeof(buf), -1, NULL)); + ASSERT_EQ(UV_E2BIG, uv_random(NULL, NULL, buf, -1, -1, NULL)); memset(buf, 0, sizeof(buf)); - ASSERT(0 == uv_random(NULL, NULL, buf, sizeof(buf), 0, NULL)); + ASSERT_OK(uv_random(NULL, NULL, buf, sizeof(buf), 0, NULL)); /* Buy a lottery ticket if you manage to trip this assertion. */ memset(zero, 0, sizeof(zero)); - ASSERT(0 != memcmp(buf, zero, sizeof(zero))); + ASSERT_NE(0, memcmp(buf, zero, sizeof(zero))); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-readable-on-eof.c b/deps/uv/test/test-readable-on-eof.c index 1162f8db1d06a4..2137ac5947f919 100644 --- a/deps/uv/test/test-readable-on-eof.c +++ b/deps/uv/test/test-readable-on-eof.c @@ -35,7 +35,7 @@ static int close_cb_called; static void write_cb(uv_write_t* req, int status) { write_cb_called++; - ASSERT_EQ(status, 0); + ASSERT_OK(status); } static void alloc_cb(uv_handle_t* handle, @@ -54,16 +54,16 @@ static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { int r; ASSERT_EQ(nread, UV_EOF); - ASSERT_EQ(uv_is_readable(handle), 1); - ASSERT_EQ(uv_is_writable(handle), 1); + ASSERT_EQ(1, uv_is_readable(handle)); + ASSERT_EQ(1, uv_is_writable(handle)); if (++read_cb_called == 3) { uv_close((uv_handle_t*) handle, close_cb); - ASSERT_EQ(uv_is_readable(handle), 0); - ASSERT_EQ(uv_is_writable(handle), 0); + ASSERT_OK(uv_is_readable(handle)); + ASSERT_OK(uv_is_writable(handle)); } else { r = uv_read_start((uv_stream_t*) &tcp_client, alloc_cb, read_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } } @@ -72,7 +72,7 @@ static void connect_cb(uv_connect_t* req, int status) { uv_buf_t close_me; connect_cb_called++; - ASSERT_EQ(status, 0); + ASSERT_OK(status); read_cb((uv_stream_t*) &tcp_client, UV_EOF, NULL); @@ -84,27 +84,26 @@ static void connect_cb(uv_connect_t* req, int status) { 1, write_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } TEST_IMPL(readable_on_eof) { struct sockaddr_in sa; - ASSERT_EQ(uv_ip4_addr("127.0.0.1", TEST_PORT, &sa), 0); - ASSERT_EQ(uv_loop_init(&loop), 0); - ASSERT_EQ(uv_tcp_init(&loop, &tcp_client), 0); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &sa)); + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_OK(uv_tcp_init(&loop, &tcp_client)); - ASSERT_EQ(uv_tcp_connect(&connect_req, + ASSERT_OK(uv_tcp_connect(&connect_req, &tcp_client, (const struct sockaddr*) &sa, - connect_cb), - 0); + connect_cb)); - ASSERT_EQ(uv_run(&loop, UV_RUN_DEFAULT), 0); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); - ASSERT_EQ(connect_cb_called, 1); - ASSERT_EQ(read_cb_called, 3); - ASSERT_EQ(write_cb_called, 1); - ASSERT_EQ(close_cb_called, 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(3, read_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; diff --git a/deps/uv/test/test-ref.c b/deps/uv/test/test-ref.c index 7a9a0b9315b697..dbe94f7168b18d 100644 --- a/deps/uv/test/test-ref.c +++ b/deps/uv/test/test-ref.c @@ -47,9 +47,9 @@ static void close_cb(uv_handle_t* handle) { static void do_close(void* handle) { close_cb_called = 0; uv_close((uv_handle_t*)handle, close_cb); - ASSERT(close_cb_called == 0); + ASSERT_OK(close_cb_called); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); } @@ -69,13 +69,13 @@ static void req_cb(uv_handle_t* req, int status) { static void shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(req == &shutdown_req); + ASSERT_PTR_EQ(req, &shutdown_req); shutdown_cb_called++; } static void write_cb(uv_write_t* req, int status) { - ASSERT(req == &write_req); + ASSERT_PTR_EQ(req, &write_req); uv_shutdown(&shutdown_req, req->handle, shutdown_cb); write_cb_called++; } @@ -83,8 +83,8 @@ static void write_cb(uv_write_t* req, int status) { static void connect_and_write(uv_connect_t* req, int status) { uv_buf_t buf = uv_buf_init(buffer, sizeof buffer); - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); uv_write(&write_req, req->handle, &buf, 1, write_cb); connect_cb_called++; } @@ -92,8 +92,8 @@ static void connect_and_write(uv_connect_t* req, int status) { static void connect_and_shutdown(uv_connect_t* req, int status) { - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); uv_shutdown(&shutdown_req, req->handle, shutdown_cb); connect_cb_called++; } @@ -250,7 +250,7 @@ TEST_IMPL(tcp_ref2b) { uv_unref((uv_handle_t*)&h); uv_close((uv_handle_t*)&h, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } @@ -259,7 +259,7 @@ TEST_IMPL(tcp_ref2b) { TEST_IMPL(tcp_ref3) { struct sockaddr_in addr; uv_tcp_t h; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); uv_tcp_init(uv_default_loop(), &h); uv_tcp_connect(&connect_req, &h, @@ -267,8 +267,8 @@ TEST_IMPL(tcp_ref3) { connect_and_shutdown); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_called == 1); - ASSERT(shutdown_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, shutdown_cb_called); do_close(&h); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -278,7 +278,7 @@ TEST_IMPL(tcp_ref3) { TEST_IMPL(tcp_ref4) { struct sockaddr_in addr; uv_tcp_t h; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); uv_tcp_init(uv_default_loop(), &h); uv_tcp_connect(&connect_req, &h, @@ -286,9 +286,9 @@ TEST_IMPL(tcp_ref4) { connect_and_write); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(shutdown_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, shutdown_cb_called); do_close(&h); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -309,7 +309,7 @@ TEST_IMPL(udp_ref) { TEST_IMPL(udp_ref2) { struct sockaddr_in addr; uv_udp_t h; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); uv_udp_init(uv_default_loop(), &h); uv_udp_bind(&h, (const struct sockaddr*) &addr, 0); uv_udp_recv_start(&h, (uv_alloc_cb)fail_cb, (uv_udp_recv_cb)fail_cb); @@ -327,7 +327,7 @@ TEST_IMPL(udp_ref3) { uv_udp_send_t req; uv_udp_t h; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); uv_udp_init(uv_default_loop(), &h); uv_udp_send(&req, &h, @@ -337,7 +337,7 @@ TEST_IMPL(udp_ref3) { (uv_udp_send_cb) req_cb); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(req_cb_called == 1); + ASSERT_EQ(1, req_cb_called); do_close(&h); MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -374,8 +374,8 @@ TEST_IMPL(pipe_ref3) { uv_pipe_connect(&connect_req, &h, TEST_PIPENAME, connect_and_shutdown); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_called == 1); - ASSERT(shutdown_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, shutdown_cb_called); do_close(&h); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -388,9 +388,9 @@ TEST_IMPL(pipe_ref4) { uv_pipe_connect(&connect_req, &h, TEST_PIPENAME, connect_and_write); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(shutdown_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, shutdown_cb_called); do_close(&h); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -410,7 +410,7 @@ TEST_IMPL(process_ref) { exepath_size = sizeof(exepath); r = uv_exepath(exepath, &exepath_size); - ASSERT(r == 0); + ASSERT_OK(r); argv[0] = exepath; options.file = exepath; @@ -418,13 +418,13 @@ TEST_IMPL(process_ref) { options.exit_cb = NULL; r = uv_spawn(uv_default_loop(), &h, &options); - ASSERT(r == 0); + ASSERT_OK(r); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop(), UV_RUN_DEFAULT); r = uv_process_kill(&h, /* SIGTERM */ 15); - ASSERT(r == 0); + ASSERT_OK(r); do_close(&h); @@ -437,9 +437,9 @@ TEST_IMPL(has_ref) { uv_idle_t h; uv_idle_init(uv_default_loop(), &h); uv_ref((uv_handle_t*)&h); - ASSERT(uv_has_ref((uv_handle_t*)&h) == 1); + ASSERT_EQ(1, uv_has_ref((uv_handle_t*)&h)); uv_unref((uv_handle_t*)&h); - ASSERT(uv_has_ref((uv_handle_t*)&h) == 0); + ASSERT_OK(uv_has_ref((uv_handle_t*)&h)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } diff --git a/deps/uv/test/test-run-nowait.c b/deps/uv/test/test-run-nowait.c index 704105376faeac..89f5f55b18ac47 100644 --- a/deps/uv/test/test-run-nowait.c +++ b/deps/uv/test/test-run-nowait.c @@ -27,7 +27,7 @@ static int timer_called = 0; static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer_handle); + ASSERT_PTR_EQ(handle, &timer_handle); timer_called = 1; } @@ -38,8 +38,8 @@ TEST_IMPL(run_nowait) { uv_timer_start(&timer_handle, timer_cb, 100, 100); r = uv_run(uv_default_loop(), UV_RUN_NOWAIT); - ASSERT(r != 0); - ASSERT(timer_called == 0); + ASSERT(r); + ASSERT_OK(timer_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-run-once.c b/deps/uv/test/test-run-once.c index ee332fa1a057d7..0ae0082c637b31 100644 --- a/deps/uv/test/test-run-once.c +++ b/deps/uv/test/test-run-once.c @@ -29,7 +29,7 @@ static int idle_counter; static void idle_cb(uv_idle_t* handle) { - ASSERT(handle == &idle_handle); + ASSERT_PTR_EQ(handle, &idle_handle); if (++idle_counter == NUM_TICKS) uv_idle_stop(handle); @@ -41,7 +41,7 @@ TEST_IMPL(run_once) { uv_idle_start(&idle_handle, idle_cb); while (uv_run(uv_default_loop(), UV_RUN_ONCE)); - ASSERT(idle_counter == NUM_TICKS); + ASSERT_EQ(idle_counter, NUM_TICKS); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-semaphore.c b/deps/uv/test/test-semaphore.c index ac03bb08f17ec7..ad54808d623a9f 100644 --- a/deps/uv/test/test-semaphore.c +++ b/deps/uv/test/test-semaphore.c @@ -40,7 +40,7 @@ static void worker(void* arg) { uv_sleep(c->delay); uv_mutex_lock(&c->mutex); - ASSERT(c->posted == 0); + ASSERT_OK(c->posted); uv_sem_post(&c->sem); c->posted = 1; uv_mutex_unlock(&c->mutex); @@ -53,17 +53,17 @@ TEST_IMPL(semaphore_1) { memset(&wc, 0, sizeof(wc)); - ASSERT(0 == uv_sem_init(&wc.sem, 0)); - ASSERT(0 == uv_mutex_init(&wc.mutex)); - ASSERT(0 == uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_sem_init(&wc.sem, 0)); + ASSERT_OK(uv_mutex_init(&wc.mutex)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); uv_sleep(100); uv_mutex_lock(&wc.mutex); - ASSERT(wc.posted == 1); + ASSERT_EQ(1, wc.posted); uv_sem_wait(&wc.sem); /* should not block */ uv_mutex_unlock(&wc.mutex); /* ergo, it should be ok to unlock after wait */ - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); uv_mutex_destroy(&wc.mutex); uv_sem_destroy(&wc.sem); @@ -78,13 +78,13 @@ TEST_IMPL(semaphore_2) { memset(&wc, 0, sizeof(wc)); wc.delay = 100; - ASSERT(0 == uv_sem_init(&wc.sem, 0)); - ASSERT(0 == uv_mutex_init(&wc.mutex)); - ASSERT(0 == uv_thread_create(&thread, worker, &wc)); + ASSERT_OK(uv_sem_init(&wc.sem, 0)); + ASSERT_OK(uv_mutex_init(&wc.mutex)); + ASSERT_OK(uv_thread_create(&thread, worker, &wc)); uv_sem_wait(&wc.sem); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_join(&thread)); uv_mutex_destroy(&wc.mutex); uv_sem_destroy(&wc.sem); @@ -95,15 +95,15 @@ TEST_IMPL(semaphore_2) { TEST_IMPL(semaphore_3) { uv_sem_t sem; - ASSERT(0 == uv_sem_init(&sem, 3)); + ASSERT_OK(uv_sem_init(&sem, 3)); uv_sem_wait(&sem); /* should not block */ uv_sem_wait(&sem); /* should not block */ - ASSERT(0 == uv_sem_trywait(&sem)); - ASSERT(UV_EAGAIN == uv_sem_trywait(&sem)); + ASSERT_OK(uv_sem_trywait(&sem)); + ASSERT_EQ(UV_EAGAIN, uv_sem_trywait(&sem)); uv_sem_post(&sem); - ASSERT(0 == uv_sem_trywait(&sem)); - ASSERT(UV_EAGAIN == uv_sem_trywait(&sem)); + ASSERT_OK(uv_sem_trywait(&sem)); + ASSERT_EQ(UV_EAGAIN, uv_sem_trywait(&sem)); uv_sem_destroy(&sem); diff --git a/deps/uv/test/test-shutdown-close.c b/deps/uv/test/test-shutdown-close.c index cb478b5fdd2939..306404afb45c74 100644 --- a/deps/uv/test/test-shutdown-close.c +++ b/deps/uv/test/test-shutdown-close.c @@ -37,7 +37,7 @@ static int close_cb_called = 0; static void shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(req == &shutdown_req); + ASSERT_PTR_EQ(req, &shutdown_req); ASSERT(status == 0 || status == UV_ECANCELED); shutdown_cb_called++; } @@ -51,14 +51,14 @@ static void close_cb(uv_handle_t* handle) { static void connect_cb(uv_connect_t* req, int status) { int r; - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); r = uv_shutdown(&shutdown_req, req->handle, shutdown_cb); - ASSERT(r == 0); - ASSERT(0 == uv_is_closing((uv_handle_t*) req->handle)); + ASSERT_OK(r); + ASSERT_OK(uv_is_closing((uv_handle_t*) req->handle)); uv_close((uv_handle_t*) req->handle, close_cb); - ASSERT(1 == uv_is_closing((uv_handle_t*) req->handle)); + ASSERT_EQ(1, uv_is_closing((uv_handle_t*) req->handle)); connect_cb_called++; } @@ -69,20 +69,20 @@ TEST_IMPL(shutdown_close_tcp) { uv_tcp_t h; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &h); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &h, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(connect_cb_called == 1); - ASSERT(shutdown_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -94,14 +94,14 @@ TEST_IMPL(shutdown_close_pipe) { int r; r = uv_pipe_init(uv_default_loop(), &h, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_connect(&connect_req, &h, TEST_PIPENAME, connect_cb); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(connect_cb_called == 1); - ASSERT(shutdown_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-shutdown-eof.c b/deps/uv/test/test-shutdown-eof.c index 9c0b85652aef12..6669c29769be35 100644 --- a/deps/uv/test/test-shutdown-eof.c +++ b/deps/uv/test/test-shutdown-eof.c @@ -46,7 +46,7 @@ static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { - ASSERT((uv_tcp_t*)t == &tcp); + ASSERT_PTR_EQ((uv_tcp_t*)t, &tcp); if (nread == 0) { free(buf->base); @@ -54,14 +54,14 @@ static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { } if (!got_q) { - ASSERT(nread == 1); + ASSERT_EQ(1, nread); ASSERT(!got_eof); - ASSERT(buf->base[0] == 'Q'); + ASSERT_EQ(buf->base[0], 'Q'); free(buf->base); got_q = 1; puts("got Q"); } else { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); if (buf->base) { free(buf->base); } @@ -72,24 +72,24 @@ static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { static void shutdown_cb(uv_shutdown_t *req, int status) { - ASSERT(req == &shutdown_req); + ASSERT_PTR_EQ(req, &shutdown_req); - ASSERT(called_connect_cb == 1); + ASSERT_EQ(1, called_connect_cb); ASSERT(!got_eof); - ASSERT(called_tcp_close_cb == 0); - ASSERT(called_timer_close_cb == 0); - ASSERT(called_timer_cb == 0); + ASSERT_OK(called_tcp_close_cb); + ASSERT_OK(called_timer_close_cb); + ASSERT_OK(called_timer_cb); called_shutdown_cb++; } static void connect_cb(uv_connect_t *req, int status) { - ASSERT(status == 0); - ASSERT(req == &connect_req); + ASSERT_OK(status); + ASSERT_PTR_EQ(req, &connect_req); /* Start reading from our connection so we can receive the EOF. */ - ASSERT_EQ(0, uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); /* Check error handling. */ ASSERT_EQ(UV_EALREADY, uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); @@ -107,37 +107,37 @@ static void connect_cb(uv_connect_t *req, int status) { uv_shutdown(&shutdown_req, (uv_stream_t*) &tcp, shutdown_cb); called_connect_cb++; - ASSERT(called_shutdown_cb == 0); + ASSERT_OK(called_shutdown_cb); } static void tcp_close_cb(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*) &tcp); + ASSERT_PTR_EQ(handle, (uv_handle_t*) &tcp); - ASSERT(called_connect_cb == 1); + ASSERT_EQ(1, called_connect_cb); ASSERT(got_q); ASSERT(got_eof); - ASSERT(called_timer_cb == 1); + ASSERT_EQ(1, called_timer_cb); called_tcp_close_cb++; } static void timer_close_cb(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*) &timer); + ASSERT_PTR_EQ(handle, (uv_handle_t*) &timer); called_timer_close_cb++; } static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer); + ASSERT_PTR_EQ(handle, &timer); uv_close((uv_handle_t*) handle, timer_close_cb); /* * The most important assert of the test: we have not received * tcp_close_cb yet. */ - ASSERT(called_tcp_close_cb == 0); + ASSERT_OK(called_tcp_close_cb); uv_close((uv_handle_t*) &tcp, tcp_close_cb); called_timer_cb++; @@ -158,11 +158,11 @@ TEST_IMPL(shutdown_eof) { qbuf.len = 1; r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); + ASSERT_OK(r); uv_timer_start(&timer, timer_cb, 100, 0); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); r = uv_tcp_init(uv_default_loop(), &tcp); ASSERT(!r); @@ -174,13 +174,13 @@ TEST_IMPL(shutdown_eof) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(called_connect_cb == 1); - ASSERT(called_shutdown_cb == 1); + ASSERT_EQ(1, called_connect_cb); + ASSERT_EQ(1, called_shutdown_cb); ASSERT(got_eof); ASSERT(got_q); - ASSERT(called_tcp_close_cb == 1); - ASSERT(called_timer_close_cb == 1); - ASSERT(called_timer_cb == 1); + ASSERT_EQ(1, called_tcp_close_cb); + ASSERT_EQ(1, called_timer_close_cb); + ASSERT_EQ(1, called_timer_cb); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-shutdown-simultaneous.c b/deps/uv/test/test-shutdown-simultaneous.c index 14cc443730d565..0dd8e353c860f9 100644 --- a/deps/uv/test/test-shutdown-simultaneous.c +++ b/deps/uv/test/test-shutdown-simultaneous.c @@ -44,8 +44,8 @@ static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { static void shutdown_cb(uv_shutdown_t *req, int status) { ASSERT_PTR_EQ(req, &shutdown_req); - ASSERT_EQ(called_connect_cb, 1); - ASSERT_EQ(called_tcp_close_cb, 0); + ASSERT_EQ(1, called_connect_cb); + ASSERT_OK(called_tcp_close_cb); } @@ -58,8 +58,8 @@ static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { } if (!got_q) { - ASSERT_EQ(nread, 4); - ASSERT_EQ(got_eof, 0); + ASSERT_EQ(4, nread); + ASSERT_OK(got_eof); ASSERT_MEM_EQ(buf->base, "QQSS", 4); free(buf->base); got_q = 1; @@ -79,11 +79,11 @@ static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { static void connect_cb(uv_connect_t *req, int status) { - ASSERT_EQ(status, 0); + ASSERT_OK(status); ASSERT_PTR_EQ(req, &connect_req); /* Start reading from our connection so we can receive the EOF. */ - ASSERT_EQ(0, uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); /* Check error handling. */ ASSERT_EQ(UV_EALREADY, uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); @@ -98,7 +98,7 @@ static void connect_cb(uv_connect_t *req, int status) { ASSERT_EQ(qbuf.len, uv_try_write((uv_stream_t*) &tcp, &qbuf, 1)); called_connect_cb++; - ASSERT_EQ(called_shutdown_cb, 0); + ASSERT_OK(called_shutdown_cb); } @@ -113,22 +113,22 @@ TEST_IMPL(shutdown_simultaneous) { qbuf.base = "QQSS"; qbuf.len = 4; - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); r = uv_tcp_init(uv_default_loop(), &tcp); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &tcp, (const struct sockaddr*) &server_addr, connect_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(called_connect_cb, 1); - ASSERT_EQ(called_shutdown_cb, 1); - ASSERT_EQ(got_eof, 1); - ASSERT_EQ(got_q, 1); + ASSERT_EQ(1, called_connect_cb); + ASSERT_EQ(1, called_shutdown_cb); + ASSERT_EQ(1, got_eof); + ASSERT_EQ(1, got_q); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-shutdown-twice.c b/deps/uv/test/test-shutdown-twice.c index d936a70cb7d7bb..c21a98340bd910 100644 --- a/deps/uv/test/test-shutdown-twice.c +++ b/deps/uv/test/test-shutdown-twice.c @@ -37,8 +37,8 @@ static void close_cb(uv_handle_t* handle) { } static void shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(req == &req1); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &req1); + ASSERT_OK(status); shutdown_cb_called++; uv_close((uv_handle_t*) req->handle, close_cb); } @@ -46,12 +46,12 @@ static void shutdown_cb(uv_shutdown_t* req, int status) { static void connect_cb(uv_connect_t* req, int status) { int r; - ASSERT(status == 0); + ASSERT_OK(status); r = uv_shutdown(&req1, req->handle, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_shutdown(&req2, req->handle, shutdown_cb); - ASSERT(r != 0); + ASSERT(r); } @@ -63,22 +63,22 @@ TEST_IMPL(shutdown_twice) { uv_connect_t connect_req; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); r = uv_tcp_init(loop, &h); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &h, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(shutdown_cb_called == 1); + ASSERT_EQ(1, shutdown_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-signal-multiple-loops.c b/deps/uv/test/test-signal-multiple-loops.c index de511fc06804ef..e68eabf6fc2857 100644 --- a/deps/uv/test/test-signal-multiple-loops.c +++ b/deps/uv/test/test-signal-multiple-loops.c @@ -66,14 +66,14 @@ static void increment_counter(int* counter) { static void signal1_cb(uv_signal_t* handle, int signum) { - ASSERT(signum == SIGUSR1); + ASSERT_EQ(signum, SIGUSR1); increment_counter(&signal1_cb_counter); uv_signal_stop(handle); } static void signal2_cb(uv_signal_t* handle, int signum) { - ASSERT(signum == SIGUSR2); + ASSERT_EQ(signum, SIGUSR2); increment_counter(&signal2_cb_counter); uv_signal_stop(handle); } @@ -89,25 +89,25 @@ static void signal_handling_worker(void* context) { action = (enum signal_action) (uintptr_t) context; - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); /* Setup the signal watchers and start them. */ if (action == ONLY_SIGUSR1 || action == SIGUSR1_AND_SIGUSR2) { r = uv_signal_init(&loop, &signal1a); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_signal_start(&signal1a, signal1_cb, SIGUSR1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_signal_init(&loop, &signal1b); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_signal_start(&signal1b, signal1_cb, SIGUSR1); - ASSERT(r == 0); + ASSERT_OK(r); } if (action == ONLY_SIGUSR2 || action == SIGUSR1_AND_SIGUSR2) { r = uv_signal_init(&loop, &signal2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_signal_start(&signal2, signal2_cb, SIGUSR2); - ASSERT(r == 0); + ASSERT_OK(r); } /* Signal watchers are now set up. */ @@ -117,26 +117,26 @@ static void signal_handling_worker(void* context) { * will return when all signal watchers caught a signal. */ r = uv_run(&loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); /* Restart the signal watchers. */ if (action == ONLY_SIGUSR1 || action == SIGUSR1_AND_SIGUSR2) { r = uv_signal_start(&signal1a, signal1_cb, SIGUSR1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_signal_start(&signal1b, signal1_cb, SIGUSR1); - ASSERT(r == 0); + ASSERT_OK(r); } if (action == ONLY_SIGUSR2 || action == SIGUSR1_AND_SIGUSR2) { r = uv_signal_start(&signal2, signal2_cb, SIGUSR2); - ASSERT(r == 0); + ASSERT_OK(r); } /* Wait for signals once more. */ uv_sem_post(&sem); r = uv_run(&loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); /* Close the watchers. */ if (action == ONLY_SIGUSR1 || action == SIGUSR1_AND_SIGUSR2) { @@ -150,7 +150,7 @@ static void signal_handling_worker(void* context) { /* Wait for the signal watchers to close. */ r = uv_run(&loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); uv_loop_close(&loop); } @@ -173,18 +173,18 @@ static void loop_creating_worker(void* context) { loop = malloc(sizeof(*loop)); ASSERT_NOT_NULL(loop); - ASSERT(0 == uv_loop_init(loop)); + ASSERT_OK(uv_loop_init(loop)); r = uv_signal_init(loop, &signal); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_signal_start(&signal, signal_unexpected_cb, SIGTERM); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &signal, NULL); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); uv_loop_close(loop); free(loop); @@ -229,17 +229,17 @@ TEST_IMPL(signal_multiple_loops) { int r; r = uv_sem_init(&sem, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_mutex_init(&lock); - ASSERT(r == 0); + ASSERT_OK(r); /* Create a couple of threads that create a destroy loops continuously. */ for (i = 0; i < NUM_LOOP_CREATING_THREADS; i++) { r = uv_thread_create(&loop_creating_threads[i], loop_creating_worker, NULL); - ASSERT(r == 0); + ASSERT_OK(r); } /* Create a couple of threads that actually handle signals. */ @@ -253,7 +253,7 @@ TEST_IMPL(signal_multiple_loops) { r = uv_thread_create(&signal_handling_threads[i], signal_handling_worker, (void*) (uintptr_t) action); - ASSERT(r == 0); + ASSERT_OK(r); } /* Wait until all threads have started and set up their signal watchers. */ @@ -261,9 +261,9 @@ TEST_IMPL(signal_multiple_loops) { uv_sem_wait(&sem); r = kill(getpid(), SIGUSR1); - ASSERT(r == 0); + ASSERT_OK(r); r = kill(getpid(), SIGUSR2); - ASSERT(r == 0); + ASSERT_OK(r); /* Wait for all threads to handle these signals. */ for (i = 0; i < NUM_SIGNAL_HANDLING_THREADS; i++) @@ -277,14 +277,14 @@ TEST_IMPL(signal_multiple_loops) { pthread_sigmask(SIG_SETMASK, &sigset, NULL); r = kill(getpid(), SIGUSR1); - ASSERT(r == 0); + ASSERT_OK(r); r = kill(getpid(), SIGUSR2); - ASSERT(r == 0); + ASSERT_OK(r); /* Wait for all signal handling threads to exit. */ for (i = 0; i < NUM_SIGNAL_HANDLING_THREADS; i++) { r = uv_thread_join(&signal_handling_threads[i]); - ASSERT(r == 0); + ASSERT_OK(r); } /* Tell all loop creating threads to stop. */ @@ -295,7 +295,7 @@ TEST_IMPL(signal_multiple_loops) { /* Wait for all loop creating threads to exit. */ for (i = 0; i < NUM_LOOP_CREATING_THREADS; i++) { r = uv_thread_join(&loop_creating_threads[i]); - ASSERT(r == 0); + ASSERT_OK(r); } uv_sem_destroy(&sem); @@ -306,13 +306,13 @@ TEST_IMPL(signal_multiple_loops) { /* The division by three reflects the fact that we spawn three different * thread groups of (NUM_SIGNAL_HANDLING_THREADS / 3) threads each. */ - ASSERT(signal1_cb_counter == 8 * (NUM_SIGNAL_HANDLING_THREADS / 3)); - ASSERT(signal2_cb_counter == 4 * (NUM_SIGNAL_HANDLING_THREADS / 3)); + ASSERT_EQ(signal1_cb_counter, 8 * (NUM_SIGNAL_HANDLING_THREADS / 3)); + ASSERT_EQ(signal2_cb_counter, 4 * (NUM_SIGNAL_HANDLING_THREADS / 3)); /* We don't know exactly how much loops will be created and destroyed, but at * least there should be 1 for every loop creating thread. */ - ASSERT(loop_creation_counter >= NUM_LOOP_CREATING_THREADS); + ASSERT_GE(loop_creation_counter, NUM_LOOP_CREATING_THREADS); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-signal-pending-on-close.c b/deps/uv/test/test-signal-pending-on-close.c index e0b9bc300b159e..42a4296704bab5 100644 --- a/deps/uv/test/test-signal-pending-on-close.c +++ b/deps/uv/test/test-signal-pending-on-close.c @@ -35,7 +35,7 @@ static int close_cb_called; static void stop_loop_cb(uv_signal_t* signal, int signum) { - ASSERT(signum == SIGPIPE); + ASSERT_EQ(signum, SIGPIPE); uv_stop(signal->loop); } @@ -50,7 +50,7 @@ static void close_cb(uv_handle_t *handle) { static void write_cb(uv_write_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == UV_EPIPE); + ASSERT_EQ(status, UV_EPIPE); free(buf); uv_close((uv_handle_t *) &pipe_hdl, close_cb); uv_close((uv_handle_t *) &signal_hdl, close_cb); @@ -62,17 +62,17 @@ TEST_IMPL(signal_pending_on_close) { uv_buf_t buffer; int r; - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); - ASSERT(0 == uv_signal_init(&loop, &signal_hdl)); + ASSERT_OK(uv_signal_init(&loop, &signal_hdl)); - ASSERT(0 == uv_signal_start(&signal_hdl, signal_cb, SIGPIPE)); + ASSERT_OK(uv_signal_start(&signal_hdl, signal_cb, SIGPIPE)); - ASSERT(0 == pipe(pipefds)); + ASSERT_OK(pipe(pipefds)); - ASSERT(0 == uv_pipe_init(&loop, &pipe_hdl, 0)); + ASSERT_OK(uv_pipe_init(&loop, &pipe_hdl, 0)); - ASSERT(0 == uv_pipe_open(&pipe_hdl, pipefds[1])); + ASSERT_OK(uv_pipe_open(&pipe_hdl, pipefds[1])); /* Write data large enough so it needs loop iteration */ buf = malloc(1<<24); @@ -81,14 +81,14 @@ TEST_IMPL(signal_pending_on_close) { buffer = uv_buf_init(buf, 1<<24); r = uv_write(&write_req, (uv_stream_t *) &pipe_hdl, &buffer, 1, write_cb); - ASSERT(0 == r); + ASSERT_OK(r); /* cause a SIGPIPE on write in next iteration */ close(pipefds[0]); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); - ASSERT(2 == close_cb_called); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; @@ -96,18 +96,18 @@ TEST_IMPL(signal_pending_on_close) { TEST_IMPL(signal_close_loop_alive) { - ASSERT(0 == uv_loop_init(&loop)); - ASSERT(0 == uv_signal_init(&loop, &signal_hdl)); - ASSERT(0 == uv_signal_start(&signal_hdl, stop_loop_cb, SIGPIPE)); + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_OK(uv_signal_init(&loop, &signal_hdl)); + ASSERT_OK(uv_signal_start(&signal_hdl, stop_loop_cb, SIGPIPE)); uv_unref((uv_handle_t*) &signal_hdl); - ASSERT(0 == uv_kill(uv_os_getpid(), SIGPIPE)); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_kill(uv_os_getpid(), SIGPIPE)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); uv_close((uv_handle_t*) &signal_hdl, close_cb); - ASSERT(1 == uv_loop_alive(&loop)); + ASSERT_EQ(1, uv_loop_alive(&loop)); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); - ASSERT(1 == close_cb_called); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(&loop); return 0; diff --git a/deps/uv/test/test-signal.c b/deps/uv/test/test-signal.c index f8222d14b4e71f..b1e24bb01a10e2 100644 --- a/deps/uv/test/test-signal.c +++ b/deps/uv/test/test-signal.c @@ -31,12 +31,12 @@ TEST_IMPL(kill_invalid_signum) { pid = uv_os_getpid(); - ASSERT(uv_kill(pid, -1) == UV_EINVAL); + ASSERT_EQ(uv_kill(pid, -1), UV_EINVAL); #ifdef _WIN32 /* NSIG is not available on all platforms. */ - ASSERT(uv_kill(pid, NSIG) == UV_EINVAL); + ASSERT_EQ(uv_kill(pid, NSIG), UV_EINVAL); #endif - ASSERT(uv_kill(pid, 4096) == UV_EINVAL); + ASSERT_EQ(uv_kill(pid, 4096), UV_EINVAL); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -55,20 +55,20 @@ TEST_IMPL(win32_signum_number) { loop = uv_default_loop(); uv_signal_init(loop, &signal); - ASSERT(uv_signal_start(&signal, signum_test_cb, 0) == UV_EINVAL); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGINT) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGBREAK) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGHUP) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGWINCH) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGILL) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGABRT_COMPAT) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGFPE) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGSEGV) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGTERM) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, SIGABRT) == 0); - ASSERT(uv_signal_start(&signal, signum_test_cb, -1) == UV_EINVAL); - ASSERT(uv_signal_start(&signal, signum_test_cb, NSIG) == UV_EINVAL); - ASSERT(uv_signal_start(&signal, signum_test_cb, 1024) == UV_EINVAL); + ASSERT_EQ(uv_signal_start(&signal, signum_test_cb, 0), UV_EINVAL); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGINT)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGBREAK)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGHUP)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGWINCH)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGILL)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGABRT_COMPAT)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGFPE)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGSEGV)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGTERM)); + ASSERT_OK(uv_signal_start(&signal, signum_test_cb, SIGABRT)); + ASSERT_EQ(uv_signal_start(&signal, signum_test_cb, -1), UV_EINVAL); + ASSERT_EQ(uv_signal_start(&signal, signum_test_cb, NSIG), UV_EINVAL); + ASSERT_EQ(uv_signal_start(&signal, signum_test_cb, 1024), UV_EINVAL); MAKE_VALGRIND_HAPPY(loop); return 0; } @@ -100,7 +100,7 @@ struct signal_ctx { static void signal_cb(uv_signal_t* handle, int signum) { struct signal_ctx* ctx = container_of(handle, struct signal_ctx, handle); - ASSERT(signum == ctx->signum); + ASSERT_EQ(signum, ctx->signum); if (++ctx->ncalls == NSIGNALS) { if (ctx->stop_or_close == STOP) uv_signal_stop(handle); @@ -113,8 +113,8 @@ static void signal_cb(uv_signal_t* handle, int signum) { static void signal_cb_one_shot(uv_signal_t* handle, int signum) { struct signal_ctx* ctx = container_of(handle, struct signal_ctx, handle); - ASSERT(signum == ctx->signum); - ASSERT(++ctx->ncalls == 1); + ASSERT_EQ(signum, ctx->signum); + ASSERT_EQ(1, ++ctx->ncalls); if (ctx->stop_or_close == CLOSE) uv_close((uv_handle_t*)handle, NULL); } @@ -138,18 +138,18 @@ static void start_watcher(uv_loop_t* loop, ctx->signum = signum; ctx->stop_or_close = CLOSE; ctx->one_shot = one_shot; - ASSERT(0 == uv_signal_init(loop, &ctx->handle)); + ASSERT_OK(uv_signal_init(loop, &ctx->handle)); if (one_shot) - ASSERT(0 == uv_signal_start_oneshot(&ctx->handle, signal_cb_one_shot, signum)); + ASSERT_OK(uv_signal_start_oneshot(&ctx->handle, signal_cb_one_shot, signum)); else - ASSERT(0 == uv_signal_start(&ctx->handle, signal_cb, signum)); + ASSERT_OK(uv_signal_start(&ctx->handle, signal_cb, signum)); } static void start_timer(uv_loop_t* loop, int signum, struct timer_ctx* ctx) { ctx->ncalls = 0; ctx->signum = signum; - ASSERT(0 == uv_timer_init(loop, &ctx->handle)); - ASSERT(0 == uv_timer_start(&ctx->handle, timer_cb, 5, 5)); + ASSERT_OK(uv_timer_init(loop, &ctx->handle)); + ASSERT_OK(uv_timer_start(&ctx->handle, timer_cb, 5, 5)); } @@ -162,23 +162,23 @@ TEST_IMPL(we_get_signal) { start_timer(loop, SIGCHLD, &tc); start_watcher(loop, SIGCHLD, &sc, 0); sc.stop_or_close = STOP; /* stop, don't close the signal handle */ - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc.ncalls == NSIGNALS); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(sc.ncalls, NSIGNALS); start_timer(loop, SIGCHLD, &tc); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc.ncalls == NSIGNALS); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(sc.ncalls, NSIGNALS); sc.ncalls = 0; sc.stop_or_close = CLOSE; /* now close it when it's done */ uv_signal_start(&sc.handle, signal_cb, SIGCHLD); start_timer(loop, SIGCHLD, &tc); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc.ncalls == NSIGNALS); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(sc.ncalls, NSIGNALS); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -198,13 +198,13 @@ TEST_IMPL(we_get_signals) { start_watcher(loop, SIGUSR2, sc + 3, 0); start_timer(loop, SIGUSR1, tc + 0); start_timer(loop, SIGUSR2, tc + 1); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); for (i = 0; i < ARRAY_SIZE(sc); i++) - ASSERT(sc[i].ncalls == NSIGNALS); + ASSERT_EQ(sc[i].ncalls, NSIGNALS); for (i = 0; i < ARRAY_SIZE(tc); i++) - ASSERT(tc[i].ncalls == NSIGNALS); + ASSERT_EQ(tc[i].ncalls, NSIGNALS); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -219,21 +219,21 @@ TEST_IMPL(we_get_signal_one_shot) { start_timer(loop, SIGCHLD, &tc); start_watcher(loop, SIGCHLD, &sc, 1); sc.stop_or_close = NOOP; - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc.ncalls == 1); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(1, sc.ncalls); start_timer(loop, SIGCHLD, &tc); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(sc.ncalls == 1); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, sc.ncalls); sc.ncalls = 0; sc.stop_or_close = CLOSE; /* now close it when it's done */ uv_signal_start_oneshot(&sc.handle, signal_cb_one_shot, SIGCHLD); start_timer(loop, SIGCHLD, &tc); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc.ncalls == 1); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(1, sc.ncalls); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -252,10 +252,10 @@ TEST_IMPL(we_get_signals_mixed) { start_watcher(loop, SIGCHLD, sc + 1, 1); sc[0].stop_or_close = CLOSE; sc[1].stop_or_close = CLOSE; - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc[0].ncalls == 1); - ASSERT(sc[1].ncalls == 1); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(1, sc[0].ncalls); + ASSERT_EQ(1, sc[1].ncalls); /* 2 one-shot, 1 normal then remove normal */ start_timer(loop, SIGCHLD, &tc); @@ -265,11 +265,11 @@ TEST_IMPL(we_get_signals_mixed) { sc[1].stop_or_close = CLOSE; start_watcher(loop, SIGCHLD, sc + 2, 0); uv_close((uv_handle_t*)&(sc[2]).handle, NULL); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc[0].ncalls == 1); - ASSERT(sc[1].ncalls == 1); - ASSERT(sc[2].ncalls == 0); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(1, sc[0].ncalls); + ASSERT_EQ(1, sc[1].ncalls); + ASSERT_OK(sc[2].ncalls); /* 2 normal, 1 one-shot then remove one-shot */ start_timer(loop, SIGCHLD, &tc); @@ -279,11 +279,11 @@ TEST_IMPL(we_get_signals_mixed) { sc[1].stop_or_close = CLOSE; start_watcher(loop, SIGCHLD, sc + 2, 1); uv_close((uv_handle_t*)&(sc[2]).handle, NULL); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc[0].ncalls == NSIGNALS); - ASSERT(sc[1].ncalls == NSIGNALS); - ASSERT(sc[2].ncalls == 0); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_EQ(sc[0].ncalls, NSIGNALS); + ASSERT_EQ(sc[1].ncalls, NSIGNALS); + ASSERT_OK(sc[2].ncalls); /* 2 normal, 2 one-shot then remove 2 normal */ start_timer(loop, SIGCHLD, &tc); @@ -295,12 +295,12 @@ TEST_IMPL(we_get_signals_mixed) { sc[3].stop_or_close = CLOSE; uv_close((uv_handle_t*)&(sc[0]).handle, NULL); uv_close((uv_handle_t*)&(sc[1]).handle, NULL); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc[0].ncalls == 0); - ASSERT(sc[1].ncalls == 0); - ASSERT(sc[2].ncalls == 1); - ASSERT(sc[2].ncalls == 1); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_OK(sc[0].ncalls); + ASSERT_OK(sc[1].ncalls); + ASSERT_EQ(1, sc[2].ncalls); + ASSERT_EQ(1, sc[2].ncalls); /* 1 normal, 1 one-shot, 2 normal then remove 1st normal, 2nd normal */ start_timer(loop, SIGCHLD, &tc); @@ -311,12 +311,12 @@ TEST_IMPL(we_get_signals_mixed) { sc[3].stop_or_close = CLOSE; uv_close((uv_handle_t*)&(sc[0]).handle, NULL); uv_close((uv_handle_t*)&(sc[2]).handle, NULL); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(tc.ncalls == NSIGNALS); - ASSERT(sc[0].ncalls == 0); - ASSERT(sc[1].ncalls == 1); - ASSERT(sc[2].ncalls == 0); - ASSERT(sc[3].ncalls == NSIGNALS); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(tc.ncalls, NSIGNALS); + ASSERT_OK(sc[0].ncalls); + ASSERT_EQ(1, sc[1].ncalls); + ASSERT_OK(sc[2].ncalls); + ASSERT_EQ(sc[3].ncalls, NSIGNALS); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-socket-buffer-size.c b/deps/uv/test/test-socket-buffer-size.c index 5f072cb02be252..64904e93d5060f 100644 --- a/deps/uv/test/test-socket-buffer-size.c +++ b/deps/uv/test/test-socket-buffer-size.c @@ -40,14 +40,14 @@ static void check_buffer_size(uv_handle_t* handle) { int value; value = 0; - ASSERT(0 == uv_recv_buffer_size(handle, &value)); - ASSERT(value > 0); + ASSERT_OK(uv_recv_buffer_size(handle, &value)); + ASSERT_GT(value, 0); value = 10000; - ASSERT(0 == uv_recv_buffer_size(handle, &value)); + ASSERT_OK(uv_recv_buffer_size(handle, &value)); value = 0; - ASSERT(0 == uv_recv_buffer_size(handle, &value)); + ASSERT_OK(uv_recv_buffer_size(handle, &value)); /* linux sets double the value */ ASSERT(value == 10000 || value == 20000); } @@ -56,21 +56,21 @@ static void check_buffer_size(uv_handle_t* handle) { TEST_IMPL(socket_buffer_size) { struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &tcp)); - ASSERT(0 == uv_tcp_bind(&tcp, (struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &tcp)); + ASSERT_OK(uv_tcp_bind(&tcp, (struct sockaddr*) &addr, 0)); check_buffer_size((uv_handle_t*) &tcp); uv_close((uv_handle_t*) &tcp, close_cb); - ASSERT(0 == uv_udp_init(uv_default_loop(), &udp)); - ASSERT(0 == uv_udp_bind(&udp, (struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_udp_init(uv_default_loop(), &udp)); + ASSERT_OK(uv_udp_bind(&udp, (struct sockaddr*) &addr, 0)); check_buffer_size((uv_handle_t*) &udp); uv_close((uv_handle_t*) &udp, close_cb); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-spawn.c b/deps/uv/test/test-spawn.c index 5e84dcdbb11de7..bbb7cb498bacf2 100644 --- a/deps/uv/test/test-spawn.c +++ b/deps/uv/test/test-spawn.c @@ -65,8 +65,8 @@ static void exit_cb(uv_process_t* process, int term_signal) { printf("exit_cb\n"); exit_cb_called++; - ASSERT(exit_status == 1); - ASSERT(term_signal == 0); + ASSERT_EQ(1, exit_status); + ASSERT_OK(term_signal); uv_close((uv_handle_t*) process, close_cb); } @@ -86,9 +86,9 @@ static void kill_cb(uv_process_t* process, printf("exit_cb\n"); exit_cb_called++; #ifdef _WIN32 - ASSERT(exit_status == 1); + ASSERT_EQ(1, exit_status); #else - ASSERT(exit_status == 0); + ASSERT_OK(exit_status); #endif #if defined(__APPLE__) || defined(__MVS__) /* @@ -108,7 +108,7 @@ static void kill_cb(uv_process_t* process, * This process should be dead. */ err = uv_kill(process->pid, 0); - ASSERT(err == UV_ESRCH); + ASSERT_EQ(err, UV_ESRCH); } static void detach_failure_cb(uv_process_t* process, @@ -130,7 +130,7 @@ static void on_read(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { if (nread > 0) { output_used += nread; } else if (nread < 0) { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); uv_close((uv_handle_t*) tcp, close_cb); } } @@ -143,20 +143,20 @@ static void on_read_once(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { static void write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); uv_close((uv_handle_t*) req->handle, close_cb); } static void write_null_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); } static void init_process_options(char* test, uv_exit_cb exit_cb) { /* Note spawn_helper1 defined in test/run-tests.c */ int r = uv_exepath(exepath, &exepath_size); - ASSERT(r == 0); + ASSERT_OK(r); exepath[exepath_size] = '\0'; args[0] = exepath; args[1] = test; @@ -189,9 +189,9 @@ TEST_IMPL(spawn_fails) { r = uv_spawn(uv_default_loop(), &process, &options); ASSERT(r == UV_ENOENT || r == UV_EACCES); - ASSERT(0 == uv_is_active((uv_handle_t*) &process)); + ASSERT_OK(uv_is_active((uv_handle_t*) &process)); uv_close((uv_handle_t*) &process, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -209,19 +209,19 @@ TEST_IMPL(spawn_fails_check_for_waitpid_cleanup) { r = uv_spawn(uv_default_loop(), &process, &options); ASSERT(r == UV_ENOENT || r == UV_EACCES); - ASSERT(0 == uv_is_active((uv_handle_t*) &process)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_is_active((uv_handle_t*) &process)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); /* verify the child is successfully cleaned up within libuv */ do err = waitpid(process.pid, &status, 0); while (err == -1 && errno == EINTR); - ASSERT(err == -1); - ASSERT(errno == ECHILD); + ASSERT_EQ(err, -1); + ASSERT_EQ(errno, ECHILD); uv_close((uv_handle_t*) &process, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -247,11 +247,11 @@ TEST_IMPL(spawn_empty_env) { options.env = env; env[0] = NULL; - ASSERT(0 == uv_spawn(uv_default_loop(), &process, &options)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -264,13 +264,13 @@ TEST_IMPL(spawn_exit_code) { init_process_options("spawn_helper1", exit_cb); r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -292,18 +292,18 @@ TEST_IMPL(spawn_stdout) { options.stdio_count = 2; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 2); /* Once for process once for the pipe. */ + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(2, close_cb_called); /* Once for process once for the pipe. */ printf("output is: %s", output); - ASSERT(strcmp("hello world\n", output) == 0); + ASSERT_OK(strcmp("hello world\n", output)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -324,7 +324,7 @@ TEST_IMPL(spawn_stdout_to_file) { r = uv_fs_open(NULL, &fs_req, "stdout_file", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ASSERT(r != -1); + ASSERT_NE(r, -1); uv_fs_req_cleanup(&fs_req); file = r; @@ -336,25 +336,25 @@ TEST_IMPL(spawn_stdout_to_file) { options.stdio_count = 2; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); buf = uv_buf_init(output, sizeof(output)); r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); - ASSERT(r == 12); + ASSERT_EQ(12, r); uv_fs_req_cleanup(&fs_req); r = uv_fs_close(NULL, &fs_req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&fs_req); printf("output is: %s", output); - ASSERT(strcmp("hello world\n", output) == 0); + ASSERT_OK(strcmp("hello world\n", output)); /* Cleanup. */ unlink("stdout_file"); @@ -378,7 +378,7 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file) { r = uv_fs_open(NULL, &fs_req, "stdout_file", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ASSERT(r != -1); + ASSERT_NE(r, -1); uv_fs_req_cleanup(&fs_req); file = r; @@ -392,25 +392,25 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file) { options.stdio_count = 3; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); buf = uv_buf_init(output, sizeof(output)); r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); - ASSERT(r == 27); + ASSERT_EQ(27, r); uv_fs_req_cleanup(&fs_req); r = uv_fs_close(NULL, &fs_req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&fs_req); printf("output is: %s", output); - ASSERT(strcmp("hello world\nhello errworld\n", output) == 0); + ASSERT_OK(strcmp("hello world\nhello errworld\n", output)); /* Cleanup. */ unlink("stdout_file"); @@ -440,10 +440,10 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file2) { O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ASSERT(r != -1); + ASSERT_NE(r, -1); uv_fs_req_cleanup(&fs_req); file = dup2(r, STDERR_FILENO); - ASSERT(file != -1); + ASSERT_NE(file, -1); options.stdio = stdio; options.stdio[0].flags = UV_IGNORE; @@ -454,25 +454,25 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file2) { options.stdio_count = 3; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); buf = uv_buf_init(output, sizeof(output)); r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); - ASSERT(r == 27); + ASSERT_EQ(27, r); uv_fs_req_cleanup(&fs_req); r = uv_fs_close(NULL, &fs_req, file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&fs_req); printf("output is: %s", output); - ASSERT(strcmp("hello world\nhello errworld\n", output) == 0); + ASSERT_OK(strcmp("hello world\nhello errworld\n", output)); /* Cleanup. */ unlink("stdout_file"); @@ -507,18 +507,18 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file_swap) { O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ASSERT(r != -1); + ASSERT_NE(r, -1); uv_fs_req_cleanup(&fs_req); stdout_file = dup2(r, STDOUT_FILENO); - ASSERT(stdout_file != -1); + ASSERT_NE(stdout_file, -1); /* open 'stderr_file' and replace STDERR_FILENO with it */ r = uv_fs_open(NULL, &fs_req, "stderr_file", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ASSERT(r != -1); + ASSERT_NE(r, -1); uv_fs_req_cleanup(&fs_req); stderr_file = dup2(r, STDERR_FILENO); - ASSERT(stderr_file != -1); + ASSERT_NE(stderr_file, -1); /* now we're going to swap them: the child process' stdout will be our * stderr_file and vice versa */ @@ -531,39 +531,39 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file_swap) { options.stdio_count = 3; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); buf = uv_buf_init(output, sizeof(output)); /* check the content of stdout_file */ r = uv_fs_read(NULL, &fs_req, stdout_file, &buf, 1, 0, NULL); - ASSERT(r >= 15); + ASSERT_GE(r, 15); uv_fs_req_cleanup(&fs_req); r = uv_fs_close(NULL, &fs_req, stdout_file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&fs_req); printf("output is: %s", output); - ASSERT(strncmp("hello errworld\n", output, 15) == 0); + ASSERT_OK(strncmp("hello errworld\n", output, 15)); /* check the content of stderr_file */ r = uv_fs_read(NULL, &fs_req, stderr_file, &buf, 1, 0, NULL); - ASSERT(r >= 12); + ASSERT_GE(r, 12); uv_fs_req_cleanup(&fs_req); r = uv_fs_close(NULL, &fs_req, stderr_file, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_fs_req_cleanup(&fs_req); printf("output is: %s", output); - ASSERT(strncmp("hello world\n", output, 12) == 0); + ASSERT_OK(strncmp("hello world\n", output, 12)); /* Cleanup. */ unlink("stdout_file"); @@ -598,22 +598,22 @@ TEST_IMPL(spawn_stdin) { options.stdio_count = 2; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); buf.base = buffer; buf.len = sizeof(buffer); r = uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 3); /* Once for process twice for the pipe. */ - ASSERT(strcmp(buffer, output) == 0); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(3, close_cb_called); /* Once for process twice for the pipe. */ + ASSERT_OK(strcmp(buffer, output)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -637,18 +637,18 @@ TEST_IMPL(spawn_stdio_greater_than_3) { options.stdio_count = 4; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &pipe, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 2); /* Once for process once for the pipe. */ + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(2, close_cb_called); /* Once for process once for the pipe. */ printf("output from stdio[3] is: %s", output); - ASSERT(strcmp("fourth stdio!\n", output) == 0); + ASSERT_OK(strcmp("fourth stdio!\n", output)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -661,7 +661,7 @@ int spawn_tcp_server_helper(void) { int r; r = uv_tcp_init(uv_default_loop(), &tcp); - ASSERT(r == 0); + ASSERT_OK(r); #ifdef _WIN32 handle = _get_osfhandle(3); @@ -669,13 +669,13 @@ int spawn_tcp_server_helper(void) { handle = 3; #endif r = uv_tcp_open(&tcp, handle); - ASSERT(r == 0); + ASSERT_OK(r); /* Make sure that we can listen on a socket that was * passed down from the parent process */ r = uv_listen((uv_stream_t*) &tcp, SOMAXCONN, NULL); - ASSERT(r == 0); + ASSERT_OK(r); return 1; } @@ -692,21 +692,21 @@ TEST_IMPL(spawn_tcp_server) { init_process_options("spawn_tcp_server_helper", exit_cb); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); fd = -1; r = uv_tcp_init_ex(uv_default_loop(), &tcp_server, AF_INET); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); #ifdef _WIN32 r = uv_fileno((uv_handle_t*) &tcp_server, &handle); fd = _open_osfhandle((intptr_t) handle, 0); #else r = uv_fileno((uv_handle_t*) &tcp_server, &fd); #endif - ASSERT(r == 0); - ASSERT(fd > 0); + ASSERT_OK(r); + ASSERT_GT(fd, 0); options.stdio = stdio; options.stdio[0].flags = UV_INHERIT_FD; @@ -720,13 +720,13 @@ TEST_IMPL(spawn_tcp_server) { options.stdio_count = 4; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -742,13 +742,13 @@ TEST_IMPL(spawn_ignored_stdio) { options.stdio_count = 0; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -761,19 +761,19 @@ TEST_IMPL(spawn_and_kill) { init_process_options("spawn_helper4", kill_cb); r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb, 500, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 2); /* Once for process and once for timer. */ + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(2, close_cb_called); /* Once for process and once for timer. */ MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -795,25 +795,25 @@ TEST_IMPL(spawn_preserve_env) { options.stdio_count = 2; r = putenv("ENV_TEST=testval"); - ASSERT(r == 0); + ASSERT_OK(r); /* Explicitly set options.env to NULL to test for env clobbering. */ options.env = NULL; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 2); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(2, close_cb_called); printf("output is: %s", output); - ASSERT(strcmp("testval", output) == 0); + ASSERT_OK(strcmp("testval", output)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -828,22 +828,22 @@ TEST_IMPL(spawn_detached) { options.flags |= UV_PROCESS_DETACHED; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); uv_unref((uv_handle_t*) &process); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 0); + ASSERT_OK(exit_cb_called); - ASSERT(process.pid == uv_process_get_pid(&process)); + ASSERT_EQ(process.pid, uv_process_get_pid(&process)); r = uv_kill(process.pid, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_kill(process.pid, SIGTERM); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -861,13 +861,13 @@ TEST_IMPL(spawn_and_kill_with_std) { init_process_options("spawn_helper4", kill_cb); r = uv_pipe_init(uv_default_loop(), &in, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(uv_default_loop(), &out, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(uv_default_loop(), &err, 0); - ASSERT(r == 0); + ASSERT_OK(r); options.stdio = stdio; options.stdio[0].flags = UV_CREATE_PIPE | UV_READABLE_PIPE; @@ -879,29 +879,29 @@ TEST_IMPL(spawn_and_kill_with_std) { options.stdio_count = 3; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); buf = uv_buf_init(message, sizeof message); r = uv_write(&write, (uv_stream_t*) &in, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &err, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb, 500, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 5); /* process x 1, timer x 1, stdio x 3. */ + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(5, close_cb_called); /* process x 1, timer x 1, stdio x 3. */ MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -928,27 +928,27 @@ TEST_IMPL(spawn_and_ping) { options.stdio_count = 2; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); /* Sending signum == 0 should check if the * child process is still alive, not kill it. */ r = uv_process_kill(&process, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 0); + ASSERT_OK(exit_cb_called); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(strcmp(output, "TEST") == 0); + ASSERT_EQ(1, exit_cb_called); + ASSERT_OK(strcmp(output, "TEST")); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -975,27 +975,27 @@ TEST_IMPL(spawn_same_stdout_stderr) { options.stdio_count = 2; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); /* Sending signum == 0 should check if the * child process is still alive, not kill it. */ r = uv_process_kill(&process, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 0); + ASSERT_OK(exit_cb_called); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(strcmp(output, "TEST") == 0); + ASSERT_EQ(1, exit_cb_called); + ASSERT_OK(strcmp(output, "TEST")); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1019,15 +1019,15 @@ TEST_IMPL(spawn_closed_process_io) { close(0); /* Close process stdin. */ - ASSERT(0 == uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); buf = uv_buf_init(buffer, sizeof(buffer)); - ASSERT(0 == uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb)); + ASSERT_OK(uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 2); /* process, child stdin */ + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(2, close_cb_called); /* process, child stdin */ MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1049,39 +1049,39 @@ TEST_IMPL(kill) { sigset_t set; sigemptyset(&set); sigaddset(&set, SIGTERM); - ASSERT(0 == pthread_sigmask(SIG_BLOCK, &set, NULL)); + ASSERT_OK(pthread_sigmask(SIG_BLOCK, &set, NULL)); } - ASSERT(SIG_ERR != signal(SIGTERM, SIG_IGN)); + ASSERT_NE(SIG_ERR, signal(SIGTERM, SIG_IGN)); #endif r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 { sigset_t set; sigemptyset(&set); sigaddset(&set, SIGTERM); - ASSERT(0 == pthread_sigmask(SIG_UNBLOCK, &set, NULL)); + ASSERT_OK(pthread_sigmask(SIG_UNBLOCK, &set, NULL)); } - ASSERT(SIG_ERR != signal(SIGTERM, SIG_DFL)); + ASSERT_NE(SIG_ERR, signal(SIGTERM, SIG_DFL)); #endif /* Sending signum == 0 should check if the * child process is still alive, not kill it. */ r = uv_kill(process.pid, 0); - ASSERT(r == 0); + ASSERT_OK(r); /* Kill the process. */ r = uv_kill(process.pid, SIGTERM); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1119,21 +1119,21 @@ TEST_IMPL(spawn_detect_pipe_name_collisions_on_windows) { 65536, 0, NULL); - ASSERT(pipe_handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(pipe_handle, INVALID_HANDLE_VALUE); r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 2); /* Once for process once for the pipe. */ + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(2, close_cb_called); /* Once for process once for the pipe. */ printf("output is: %s", output); - ASSERT(strcmp("hello world\n", output) == 0); + ASSERT_OK(strcmp("hello world\n", output)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1197,7 +1197,7 @@ TEST_IMPL(argument_escaping) { cracked = CommandLineToArgvW(command_line, &num_args); for (i = 0; i < num_args; ++i) { wprintf(L"%d: %s\t%s\n", i, test_str[i], cracked[i]); - ASSERT(wcscmp(test_str[i], cracked[i]) == 0); + ASSERT_OK(wcscmp(test_str[i], cracked[i])); } LocalFree(cracked); @@ -1207,19 +1207,19 @@ TEST_IMPL(argument_escaping) { free(test_output); result = make_program_args(verbatim, 1, &verbatim_output); - ASSERT(result == 0); + ASSERT_OK(result); result = make_program_args(verbatim, 0, &non_verbatim_output); - ASSERT(result == 0); + ASSERT_OK(result); wprintf(L" verbatim_output: %s\n", verbatim_output); wprintf(L"non_verbatim_output: %s\n", non_verbatim_output); - ASSERT(wcscmp(verbatim_output, - L"cmd.exe /c c:\\path\\to\\node.exe --eval " - L"\"require('c:\\\\path\\\\to\\\\test.js')\"") == 0); - ASSERT(wcscmp(non_verbatim_output, - L"cmd.exe /c \"c:\\path\\to\\node.exe --eval " - L"\\\"require('c:\\\\path\\\\to\\\\test.js')\\\"\"") == 0); + ASSERT_OK(wcscmp(verbatim_output, + L"cmd.exe /c c:\\path\\to\\node.exe --eval " + L"\"require('c:\\\\path\\\\to\\\\test.js')\"")); + ASSERT_OK(wcscmp(non_verbatim_output, + L"cmd.exe /c \"c:\\path\\to\\node.exe --eval " + L"\\\"require('c:\\\\path\\\\to\\\\test.js')\\\"\"")); free(verbatim_output); free(non_verbatim_output); @@ -1303,7 +1303,7 @@ TEST_IMPL(environment_creation) { } result = make_program_env(environment, &env); - ASSERT(result == 0); + ASSERT_OK(result); for (str = env, prev = NULL; *str; prev = str, str += wcslen(str) + 1) { int found = 0; @@ -1327,7 +1327,7 @@ TEST_IMPL(environment_creation) { } if (prev) { /* verify sort order */ #if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) - ASSERT(CompareStringOrdinal(prev, -1, str, -1, TRUE) == 1); + ASSERT_EQ(1, CompareStringOrdinal(prev, -1, str, -1, TRUE)); #endif } ASSERT(found); /* verify that we expected this variable */ @@ -1359,9 +1359,37 @@ TEST_IMPL(spawn_with_an_odd_path) { options.file = options.args[0] = "program-that-had-better-not-exist"; r = uv_spawn(uv_default_loop(), &process, &options); ASSERT(r == UV_ENOENT || r == UV_EACCES); - ASSERT(0 == uv_is_active((uv_handle_t*) &process)); + ASSERT_OK(uv_is_active((uv_handle_t*) &process)); uv_close((uv_handle_t*) &process, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + + MAKE_VALGRIND_HAPPY(uv_default_loop()); + return 0; +} + + +TEST_IMPL(spawn_no_path) { + char* env[1]; + WCHAR* old_path = NULL; + DWORD old_path_len; + + if ((old_path_len = GetEnvironmentVariableW(L"PATH", NULL, 0)) > 0) { + old_path = malloc(old_path_len * sizeof(WCHAR)); + GetEnvironmentVariableW(L"PATH", old_path, old_path_len); + SetEnvironmentVariableW(L"PATH", NULL); + } + + init_process_options("spawn_helper1", exit_cb); + options.env = env; + env[0] = NULL; + + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); + + SetEnvironmentVariableW(L"PATH", old_path); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1398,13 +1426,13 @@ TEST_IMPL(spawn_setuid_setgid) { if (r == UV_EACCES) RETURN_SKIP("user 'nobody' cannot access the test runner"); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1424,8 +1452,8 @@ TEST_IMPL(spawn_setuid_fails) { struct passwd* pw; pw = getpwnam("nobody"); ASSERT_NOT_NULL(pw); - ASSERT(0 == setgid(pw->pw_gid)); - ASSERT(0 == setuid(pw->pw_uid)); + ASSERT_OK(setgid(pw->pw_gid)); + ASSERT_OK(setuid(pw->pw_uid)); } #endif /* !__PASE__ */ @@ -1449,15 +1477,15 @@ TEST_IMPL(spawn_setuid_fails) { r = uv_spawn(uv_default_loop(), &process, &options); #if defined(__CYGWIN__) - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); #else - ASSERT(r == UV_EPERM); + ASSERT_EQ(r, UV_EPERM); #endif r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); + ASSERT_OK(close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1475,8 +1503,8 @@ TEST_IMPL(spawn_setgid_fails) { struct passwd* pw; pw = getpwnam("nobody"); ASSERT_NOT_NULL(pw); - ASSERT(0 == setgid(pw->pw_gid)); - ASSERT(0 == setuid(pw->pw_uid)); + ASSERT_OK(setgid(pw->pw_gid)); + ASSERT_OK(setuid(pw->pw_uid)); } #endif /* !__PASE__ */ @@ -1494,15 +1522,15 @@ TEST_IMPL(spawn_setgid_fails) { r = uv_spawn(uv_default_loop(), &process, &options); #if defined(__CYGWIN__) || defined(__MVS__) - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); #else - ASSERT(r == UV_EPERM); + ASSERT_EQ(r, UV_EPERM); #endif r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); + ASSERT_OK(close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1528,12 +1556,12 @@ TEST_IMPL(spawn_setuid_fails) { options.uid = (uv_uid_t) -42424242; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == UV_ENOTSUP); + ASSERT_EQ(r, UV_ENOTSUP); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); + ASSERT_OK(close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1549,12 +1577,12 @@ TEST_IMPL(spawn_setgid_fails) { options.gid = (uv_gid_t) -42424242; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == UV_ENOTSUP); + ASSERT_EQ(r, UV_ENOTSUP); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); + ASSERT_OK(close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1564,12 +1592,12 @@ TEST_IMPL(spawn_setgid_fails) { TEST_IMPL(spawn_auto_unref) { init_process_options("spawn_helper1", NULL); - ASSERT(0 == uv_spawn(uv_default_loop(), &process, &options)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == uv_is_closing((uv_handle_t*) &process)); + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_is_closing((uv_handle_t*) &process)); uv_close((uv_handle_t*) &process, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(1 == uv_is_closing((uv_handle_t*) &process)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, uv_is_closing((uv_handle_t*) &process)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } @@ -1594,13 +1622,13 @@ TEST_IMPL(spawn_fs_open) { #endif r = uv_fs_open(NULL, &fs_req, dev_null, O_RDWR, 0, NULL); - ASSERT(r != -1); + ASSERT_NE(r, -1); fd = uv_get_osfhandle((uv_file) fs_req.result); uv_fs_req_cleanup(&fs_req); init_process_options("spawn_helper8", exit_cb); - ASSERT(0 == uv_pipe_init(uv_default_loop(), &in, 0)); + ASSERT_OK(uv_pipe_init(uv_default_loop(), &in, 0)); options.stdio = stdio; options.stdio[0].flags = UV_CREATE_PIPE | UV_READABLE_PIPE; @@ -1609,29 +1637,35 @@ TEST_IMPL(spawn_fs_open) { /* make an inheritable copy */ #ifdef _WIN32 - ASSERT(0 != DuplicateHandle(GetCurrentProcess(), fd, GetCurrentProcess(), &dup_fd, - 0, /* inherit */ TRUE, DUPLICATE_SAME_ACCESS)); + ASSERT_NE(0, DuplicateHandle(GetCurrentProcess(), fd, GetCurrentProcess(), &dup_fd, + 0, /* inherit */ TRUE, DUPLICATE_SAME_ACCESS)); kernelbase_module = GetModuleHandleA("kernelbase.dll"); pCompareObjectHandles = (sCompareObjectHandles) GetProcAddress(kernelbase_module, "CompareObjectHandles"); - ASSERT(pCompareObjectHandles == NULL || pCompareObjectHandles(fd, dup_fd)); + ASSERT_NE(pCompareObjectHandles == NULL || + pCompareObjectHandles(fd, dup_fd), + 0); #else dup_fd = dup(fd); #endif - ASSERT(0 == uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); buf = uv_buf_init((char*) &fd, sizeof(fd)); - ASSERT(0 == uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_null_cb)); + ASSERT_OK(uv_write(&write_req, + (uv_stream_t*) &in, + &buf, + 1, + write_null_cb)); buf = uv_buf_init((char*) &dup_fd, sizeof(fd)); - ASSERT(0 == uv_write(&write_req2, (uv_stream_t*) &in, &buf, 1, write_cb)); + ASSERT_OK(uv_write(&write_req2, (uv_stream_t*) &in, &buf, 1, write_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == uv_fs_close(NULL, &fs_req, r, NULL)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_fs_close(NULL, &fs_req, r, NULL)); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 2); /* One for `in`, one for process */ + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(2, close_cb_called); /* One for `in`, one for process */ MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1647,9 +1681,9 @@ TEST_IMPL(closed_fd_events) { bufs[0] = uv_buf_init("", 1); /* create a pipe and share it with a child process */ - ASSERT(0 == uv_pipe(fd, 0, 0)); - ASSERT(fd[0] > 2); - ASSERT(fd[1] > 2); + ASSERT_OK(uv_pipe(fd, 0, 0)); + ASSERT_GT(fd[0], 2); + ASSERT_GT(fd[1], 2); /* spawn_helper4 blocks indefinitely. */ init_process_options("spawn_helper4", exit_cb); @@ -1660,49 +1694,51 @@ TEST_IMPL(closed_fd_events) { options.stdio[1].flags = UV_IGNORE; options.stdio[2].flags = UV_IGNORE; - ASSERT(0 == uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); uv_unref((uv_handle_t*) &process); /* read from the pipe with uv */ - ASSERT(0 == uv_pipe_init(uv_default_loop(), &pipe_handle, 0)); - ASSERT(0 == uv_pipe_open(&pipe_handle, fd[0])); + ASSERT_OK(uv_pipe_init(uv_default_loop(), &pipe_handle, 0)); + ASSERT_OK(uv_pipe_open(&pipe_handle, fd[0])); /* uv_pipe_open() takes ownership of the file descriptor. */ fd[0] = -1; - ASSERT(0 == uv_read_start((uv_stream_t*) &pipe_handle, on_alloc, on_read_once)); + ASSERT_OK(uv_read_start((uv_stream_t*) &pipe_handle, + on_alloc, + on_read_once)); - ASSERT(1 == uv_fs_write(NULL, &req, fd[1], bufs, 1, -1, NULL)); - ASSERT(req.result == 1); + ASSERT_EQ(1, uv_fs_write(NULL, &req, fd[1], bufs, 1, -1, NULL)); + ASSERT_EQ(1, req.result); uv_fs_req_cleanup(&req); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); /* should have received just one byte */ - ASSERT(output_used == 1); + ASSERT_EQ(1, output_used); /* close the pipe and see if we still get events */ uv_close((uv_handle_t*) &pipe_handle, close_cb); - ASSERT(1 == uv_fs_write(NULL, &req, fd[1], bufs, 1, -1, NULL)); - ASSERT(req.result == 1); + ASSERT_EQ(1, uv_fs_write(NULL, &req, fd[1], bufs, 1, -1, NULL)); + ASSERT_EQ(1, req.result); uv_fs_req_cleanup(&req); - ASSERT(0 == uv_timer_init(uv_default_loop(), &timer)); - ASSERT(0 == uv_timer_start(&timer, timer_counter_cb, 10, 0)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_counter_cb, 10, 0)); /* see if any spurious events interrupt the timer */ if (1 == uv_run(uv_default_loop(), UV_RUN_ONCE)) /* have to run again to really trigger the timer */ - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); - ASSERT(timer_counter == 1); + ASSERT_EQ(1, timer_counter); /* cleanup */ - ASSERT(0 == uv_process_kill(&process, SIGTERM)); + ASSERT_OK(uv_process_kill(&process, SIGTERM)); #ifdef _WIN32 - ASSERT(0 == _close(fd[1])); + ASSERT_OK(_close(fd[1])); #else - ASSERT(0 == close(fd[1])); + ASSERT_OK(close(fd[1])); #endif MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -1767,13 +1803,13 @@ TEST_IMPL(spawn_reads_child_path) { options.env = env; r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1799,27 +1835,27 @@ TEST_IMPL(spawn_inherit_streams) { init_process_options("spawn_helper9", exit_cb); loop = uv_default_loop(); - ASSERT(uv_pipe_init(loop, &pipe_stdin_child, 0) == 0); - ASSERT(uv_pipe_init(loop, &pipe_stdout_child, 0) == 0); - ASSERT(uv_pipe_init(loop, &pipe_stdin_parent, 0) == 0); - ASSERT(uv_pipe_init(loop, &pipe_stdout_parent, 0) == 0); - - ASSERT(uv_pipe(fds_stdin, 0, 0) == 0); - ASSERT(uv_pipe(fds_stdout, 0, 0) == 0); - - ASSERT(uv_pipe_open(&pipe_stdin_child, fds_stdin[0]) == 0); - ASSERT(uv_pipe_open(&pipe_stdout_child, fds_stdout[1]) == 0); - ASSERT(uv_pipe_open(&pipe_stdin_parent, fds_stdin[1]) == 0); - ASSERT(uv_pipe_open(&pipe_stdout_parent, fds_stdout[0]) == 0); + ASSERT_OK(uv_pipe_init(loop, &pipe_stdin_child, 0)); + ASSERT_OK(uv_pipe_init(loop, &pipe_stdout_child, 0)); + ASSERT_OK(uv_pipe_init(loop, &pipe_stdin_parent, 0)); + ASSERT_OK(uv_pipe_init(loop, &pipe_stdout_parent, 0)); + + ASSERT_OK(uv_pipe(fds_stdin, 0, 0)); + ASSERT_OK(uv_pipe(fds_stdout, 0, 0)); + + ASSERT_OK(uv_pipe_open(&pipe_stdin_child, fds_stdin[0])); + ASSERT_OK(uv_pipe_open(&pipe_stdout_child, fds_stdout[1])); + ASSERT_OK(uv_pipe_open(&pipe_stdin_parent, fds_stdin[1])); + ASSERT_OK(uv_pipe_open(&pipe_stdout_parent, fds_stdout[0])); ASSERT(uv_is_readable((uv_stream_t*) &pipe_stdin_child)); ASSERT(uv_is_writable((uv_stream_t*) &pipe_stdout_child)); ASSERT(uv_is_writable((uv_stream_t*) &pipe_stdin_parent)); ASSERT(uv_is_readable((uv_stream_t*) &pipe_stdout_parent)); /* Some systems (SVR4) open a bidirectional pipe, most don't. */ bidir = uv_is_writable((uv_stream_t*) &pipe_stdin_child); - ASSERT(uv_is_readable((uv_stream_t*) &pipe_stdout_child) == bidir); - ASSERT(uv_is_readable((uv_stream_t*) &pipe_stdin_parent) == bidir); - ASSERT(uv_is_writable((uv_stream_t*) &pipe_stdout_parent) == bidir); + ASSERT_EQ(uv_is_readable((uv_stream_t*) &pipe_stdout_child), bidir); + ASSERT_EQ(uv_is_readable((uv_stream_t*) &pipe_stdin_parent), bidir); + ASSERT_EQ(uv_is_writable((uv_stream_t*) &pipe_stdout_parent), bidir); child_stdio[0].flags = UV_INHERIT_STREAM; child_stdio[0].data.stream = (uv_stream_t *) &pipe_stdin_child; @@ -1830,7 +1866,7 @@ TEST_IMPL(spawn_inherit_streams) { options.stdio = child_stdio; options.stdio_count = 2; - ASSERT(uv_spawn(loop, &child_req, &options) == 0); + ASSERT_OK(uv_spawn(loop, &child_req, &options)); uv_close((uv_handle_t*) &pipe_stdin_child, NULL); uv_close((uv_handle_t*) &pipe_stdout_child, NULL); @@ -1845,19 +1881,19 @@ TEST_IMPL(spawn_inherit_streams) { &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &pipe_stdout_parent, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 3); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(3, close_cb_called); r = memcmp(ubuf, output, sizeof ubuf); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -1898,7 +1934,7 @@ TEST_IMPL(spawn_exercise_sigchld_issue) { init_process_options("spawn_helper1", exit_cb); r = uv_spawn(uv_default_loop(), &process, &options); - ASSERT_EQ(r, 0); + ASSERT_OK(r); // This test exercises a bug in the darwin kernel that causes SIGCHLD not to // be delivered sometimes. Calling posix_spawn many times increases the @@ -1917,10 +1953,10 @@ TEST_IMPL(spawn_exercise_sigchld_issue) { } r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(exit_cb_called, 1); - ASSERT_EQ(close_cb_called, 101); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(101, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -1939,14 +1975,14 @@ void spawn_stdin_stdout(void) { if (r == 0) { return; } - ASSERT(r > 0); + ASSERT_GT(r, 0); c = r; pbuf = buf; while (c) { do { w = write(1, pbuf, (size_t)c); } while (w == -1 && errno == EINTR); - ASSERT(w >= 0); + ASSERT_GE(w, 0); pbuf = pbuf + w; c = c - w; } @@ -1958,14 +1994,14 @@ void spawn_stdin_stdout(void) { char* pbuf; HANDLE h_stdin = GetStdHandle(STD_INPUT_HANDLE); HANDLE h_stdout = GetStdHandle(STD_OUTPUT_HANDLE); - ASSERT(h_stdin != INVALID_HANDLE_VALUE); - ASSERT(h_stdout != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(h_stdin, INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(h_stdout, INVALID_HANDLE_VALUE); for (;;) { DWORD n_read; DWORD n_written; DWORD to_write; if (!ReadFile(h_stdin, buf, sizeof buf, &n_read, NULL)) { - ASSERT(GetLastError() == ERROR_BROKEN_PIPE); + ASSERT_EQ(GetLastError(), ERROR_BROKEN_PIPE); return; } to_write = n_read; @@ -1985,7 +2021,7 @@ TEST_IMPL(spawn_relative_path) { init_process_options("spawn_helper1", exit_cb); exepath_size = sizeof(exepath) - 2; - ASSERT_EQ(0, uv_exepath(exepath, &exepath_size)); + ASSERT_OK(uv_exepath(exepath, &exepath_size)); exepath[exepath_size] = '\0'; /* Poor man's basename(3). */ @@ -2003,8 +2039,8 @@ TEST_IMPL(spawn_relative_path) { options.cwd = exepath; options.file = options.args[0] = sep + 1; - ASSERT_EQ(0, uv_spawn(uv_default_loop(), &process, &options)); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_spawn(uv_default_loop(), &process, &options)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); ASSERT_EQ(1, exit_cb_called); ASSERT_EQ(1, close_cb_called); diff --git a/deps/uv/test/test-stdio-over-pipes.c b/deps/uv/test/test-stdio-over-pipes.c index 1b7f17297cabb2..c41040ee2fdc78 100644 --- a/deps/uv/test/test-stdio-over-pipes.c +++ b/deps/uv/test/test-stdio-over-pipes.c @@ -52,8 +52,8 @@ static void exit_cb(uv_process_t* process, int term_signal) { printf("exit_cb\n"); exit_cb_called++; - ASSERT(exit_status == 0); - ASSERT(term_signal == 0); + ASSERT_OK(exit_status); + ASSERT_OK(term_signal); uv_close((uv_handle_t*)process, close_cb); uv_close((uv_handle_t*)&in, close_cb); uv_close((uv_handle_t*)&out, close_cb); @@ -62,7 +62,7 @@ static void exit_cb(uv_process_t* process, static void init_process_options(char* test, uv_exit_cb exit_cb) { int r = uv_exepath(exepath, &exepath_size); - ASSERT(r == 0); + ASSERT_OK(r); exepath[exepath_size] = '\0'; args[0] = exepath; args[1] = test; @@ -104,11 +104,11 @@ static void on_read(uv_stream_t* pipe, ssize_t nread, const uv_buf_t* rdbuf) { if (nread > 0) { output_used += nread; if (output_used % 12 == 0) { - ASSERT(memcmp("hello world\n", output, 12) == 0); + ASSERT_OK(memcmp("hello world\n", output, 12)); wrbuf = uv_buf_init(output, 12); req = malloc(sizeof(*req)); r = uv_write(req, (uv_stream_t*) &in, &wrbuf, 1, after_write); - ASSERT(r == 0); + ASSERT_OK(r); } } @@ -140,20 +140,20 @@ static void test_stdio_over_pipes(int overlapped) { options.stdio_count = 3; r = uv_spawn(loop, &process, &options); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(on_read_cb_called > 1); - ASSERT(after_write_cb_called == 2); - ASSERT(exit_cb_called == 1); - ASSERT(close_cb_called == 3); - ASSERT(memcmp("hello world\nhello world\n", output, 24) == 0); - ASSERT(output_used == 24); + ASSERT_GT(on_read_cb_called, 1); + ASSERT_EQ(2, after_write_cb_called); + ASSERT_EQ(1, exit_cb_called); + ASSERT_EQ(3, close_cb_called); + ASSERT_OK(memcmp("hello world\nhello world\n", output, 24)); + ASSERT_EQ(24, output_used); MAKE_VALGRIND_HAPPY(loop); } @@ -179,8 +179,8 @@ static uv_pipe_t stdin_pipe2; static uv_pipe_t stdout_pipe2; static void on_pipe_read(uv_stream_t* pipe, ssize_t nread, const uv_buf_t* buf) { - ASSERT(nread > 0); - ASSERT(memcmp("hello world\n", buf->base, nread) == 0); + ASSERT_GT(nread, 0); + ASSERT_OK(memcmp("hello world\n", buf->base, nread)); on_pipe_read_called++; free(buf->base); @@ -190,7 +190,7 @@ static void on_pipe_read(uv_stream_t* pipe, ssize_t nread, const uv_buf_t* buf) static void after_pipe_write(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); after_write_called++; } @@ -222,17 +222,17 @@ int stdio_over_pipes_helper(void) { int r; uv_loop_t* loop = uv_default_loop(); - ASSERT(UV_NAMED_PIPE == uv_guess_handle(0)); - ASSERT(UV_NAMED_PIPE == uv_guess_handle(1)); + ASSERT_EQ(UV_NAMED_PIPE, uv_guess_handle(0)); + ASSERT_EQ(UV_NAMED_PIPE, uv_guess_handle(1)); r = uv_pipe_init(loop, &stdin_pipe1, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(loop, &stdout_pipe1, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(loop, &stdin_pipe2, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_pipe_init(loop, &stdout_pipe2, 0); - ASSERT(r == 0); + ASSERT_OK(r); uv_pipe_open(&stdin_pipe1, 0); uv_pipe_open(&stdout_pipe1, 1); @@ -256,15 +256,15 @@ int stdio_over_pipes_helper(void) { &buf[i], 1, after_pipe_write); - ASSERT(r == 0); + ASSERT_OK(r); } notify_parent_process(); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(after_write_called == 7 * (j + 1)); - ASSERT(on_pipe_read_called == j); - ASSERT(close_cb_called == 0); + ASSERT_EQ(after_write_called, 7 * (j + 1)); + ASSERT_EQ(on_pipe_read_called, j); + ASSERT_OK(close_cb_called); uv_ref((uv_handle_t*) &stdout_pipe1); uv_ref((uv_handle_t*) &stdin_pipe1); @@ -274,13 +274,13 @@ int stdio_over_pipes_helper(void) { r = uv_read_start((uv_stream_t*) (j == 0 ? &stdin_pipe1 : &stdin_pipe2), on_read_alloc, on_pipe_read); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(after_write_called == 7 * (j + 1)); - ASSERT(on_pipe_read_called == j + 1); - ASSERT(close_cb_called == 0); + ASSERT_EQ(after_write_called, 7 * (j + 1)); + ASSERT_EQ(on_pipe_read_called, j + 1); + ASSERT_OK(close_cb_called); } uv_close((uv_handle_t*)&stdin_pipe1, close_cb); @@ -290,9 +290,9 @@ int stdio_over_pipes_helper(void) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(after_write_called == 14); - ASSERT(on_pipe_read_called == 2); - ASSERT(close_cb_called == 4); + ASSERT_EQ(14, after_write_called); + ASSERT_EQ(2, on_pipe_read_called); + ASSERT_EQ(4, close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-strscpy.c b/deps/uv/test/test-strscpy.c index 4e7db6ffec8ef2..b4699cff056137 100644 --- a/deps/uv/test/test-strscpy.c +++ b/deps/uv/test/test-strscpy.c @@ -29,25 +29,25 @@ TEST_IMPL(strscpy) { char d[4]; - ASSERT(0 == uv__strscpy(d, "", 0)); - ASSERT(0 == uv__strscpy(d, "x", 0)); + ASSERT_OK(uv__strscpy(d, "", 0)); + ASSERT_OK(uv__strscpy(d, "x", 0)); memset(d, 0, sizeof(d)); - ASSERT(1 == uv__strscpy(d, "x", sizeof(d))); - ASSERT(0 == memcmp(d, "x\0\0", sizeof(d))); + ASSERT_EQ(1, uv__strscpy(d, "x", sizeof(d))); + ASSERT_OK(memcmp(d, "x\0\0", sizeof(d))); memset(d, 0, sizeof(d)); - ASSERT(2 == uv__strscpy(d, "xy", sizeof(d))); - ASSERT(0 == memcmp(d, "xy\0", sizeof(d))); + ASSERT_EQ(2, uv__strscpy(d, "xy", sizeof(d))); + ASSERT_OK(memcmp(d, "xy\0", sizeof(d))); - ASSERT(3 == uv__strscpy(d, "xyz", sizeof(d))); - ASSERT(0 == memcmp(d, "xyz", sizeof(d))); + ASSERT_EQ(3, uv__strscpy(d, "xyz", sizeof(d))); + ASSERT_OK(memcmp(d, "xyz", sizeof(d))); - ASSERT(UV_E2BIG == uv__strscpy(d, "xyzz", sizeof(d))); - ASSERT(0 == memcmp(d, "xyz", sizeof(d))); + ASSERT_EQ(UV_E2BIG, uv__strscpy(d, "xyzz", sizeof(d))); + ASSERT_OK(memcmp(d, "xyz", sizeof(d))); - ASSERT(UV_E2BIG == uv__strscpy(d, "xyzzy", sizeof(d))); - ASSERT(0 == memcmp(d, "xyz", sizeof(d))); + ASSERT_EQ(UV_E2BIG, uv__strscpy(d, "xyzzy", sizeof(d))); + ASSERT_OK(memcmp(d, "xyz", sizeof(d))); return 0; } diff --git a/deps/uv/test/test-strtok.c b/deps/uv/test/test-strtok.c index 6c3d835914c388..f4e6cdf8b75a2b 100644 --- a/deps/uv/test/test-strtok.c +++ b/deps/uv/test/test-strtok.c @@ -56,7 +56,7 @@ const char* tokens[] = { }; #define ASSERT_STRCMP(x, y) \ - ASSERT((x != NULL && y != NULL && strcmp(x, y) == 0) || (x == y && x == NULL)) + ASSERT_NE((x != NULL && y != NULL && strcmp(x, y) == 0) || (x == y && x == NULL), 0) TEST_IMPL(strtok) { struct strtok_test_case tests[] = { @@ -74,13 +74,13 @@ TEST_IMPL(strtok) { char current_test[2048]; for (i = 0, j = 0; i < tests_len; i += 1) { - ASSERT(j < tokens_len); + ASSERT_LT(j, tokens_len); snprintf(current_test, sizeof(current_test), "%s", tests[i].str); tok_r = uv__strtok(current_test, tests[i].sep, &itr); ASSERT_STRCMP(tok_r, tokens[j]); j++; while (tok_r) { - ASSERT(j < tokens_len); + ASSERT_LT(j, tokens_len); tok_r = uv__strtok(NULL, tests[i].sep, &itr); ASSERT_STRCMP(tok_r, tokens[j]); j++; diff --git a/deps/uv/test/test-tcp-alloc-cb-fail.c b/deps/uv/test/test-tcp-alloc-cb-fail.c index a1b5e84d3b13dd..ff1cfcb844a70e 100644 --- a/deps/uv/test/test-tcp-alloc-cb-fail.c +++ b/deps/uv/test/test-tcp-alloc-cb-fail.c @@ -42,7 +42,7 @@ static void close_cb(uv_handle_t* handle) { } static void write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); } static void conn_alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { @@ -52,9 +52,9 @@ static void conn_alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { static void conn_read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - ASSERT(nread == UV_ENOBUFS); + ASSERT_EQ(nread, UV_ENOBUFS); ASSERT_NULL(buf->base); - ASSERT(buf->len == 0); + ASSERT_OK(buf->len); uv_close((uv_handle_t*) &incoming, close_cb); uv_close((uv_handle_t*) &client, close_cb); @@ -65,23 +65,23 @@ static void connect_cb(uv_connect_t* req, int status) { int r; uv_buf_t buf; - ASSERT(status == 0); + ASSERT_OK(status); connect_cb_called++; buf = uv_buf_init(hello, sizeof(hello)); r = uv_write(&write_req, req->handle, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void connection_cb(uv_stream_t* tcp, int status) { - ASSERT(status == 0); + ASSERT_OK(status); - ASSERT(0 == uv_tcp_init(tcp->loop, &incoming)); - ASSERT(0 == uv_accept(tcp, (uv_stream_t*) &incoming)); - ASSERT(0 == uv_read_start((uv_stream_t*) &incoming, - conn_alloc_cb, - conn_read_cb)); + ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); + ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); + ASSERT_OK(uv_read_start((uv_stream_t*) &incoming, + conn_alloc_cb, + conn_read_cb)); connection_cb_called++; } @@ -90,11 +90,11 @@ static void connection_cb(uv_stream_t* tcp, int status) { static void start_server(void) { struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &server)); - ASSERT(0 == uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server, 128, connection_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &server)); + ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb)); } @@ -104,19 +104,19 @@ TEST_IMPL(tcp_alloc_cb_fail) { start_server(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &client)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &client, - (struct sockaddr*) &addr, - connect_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client, + (struct sockaddr*) &addr, + connect_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(connect_cb_called == 1); - ASSERT(connection_cb_called == 1); - ASSERT(close_cb_called == 3); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, connection_cb_called); + ASSERT_EQ(3, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-bind-error.c b/deps/uv/test/test-tcp-bind-error.c index edb44c21459261..89e4e33993ffad 100644 --- a/deps/uv/test/test-tcp-bind-error.c +++ b/deps/uv/test/test-tcp-bind-error.c @@ -36,7 +36,7 @@ static void close_cb(uv_handle_t* handle) { static void connect_cb(uv_connect_t* req, int status) { - ASSERT(status == UV_EADDRINUSE); + ASSERT_EQ(status, UV_EADDRINUSE); uv_close((uv_handle_t*) req->handle, close_cb); connect_cb_called++; } @@ -53,24 +53,24 @@ TEST_IMPL(tcp_bind_error_addrinuse_connect) { * (greatest common denominator across platforms) but the connect callback * should receive an UV_EADDRINUSE error. */ - ASSERT(0 == uv_tcp_init(uv_default_loop(), &conn)); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_bind(&conn, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &conn)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_tcp_bind(&conn, (const struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT + 1, &addr)); - ASSERT(0 == uv_tcp_connect(&req, - &conn, - (const struct sockaddr*) &addr, - connect_cb)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT + 1, &addr)); + ASSERT_OK(uv_tcp_connect(&req, + &conn, + (const struct sockaddr*) &addr, + connect_cb)); addrlen = sizeof(addr); - ASSERT(UV_EADDRINUSE == uv_tcp_getsockname(&conn, - (struct sockaddr*) &addr, - &addrlen)); + ASSERT_EQ(UV_EADDRINUSE, uv_tcp_getsockname(&conn, + (struct sockaddr*) &addr, + &addrlen)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(connect_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -82,28 +82,28 @@ TEST_IMPL(tcp_bind_error_addrinuse_listen) { uv_tcp_t server1, server2; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server1, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_init(uv_default_loop(), &server2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server2, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server1, 128, NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server2, 128, NULL); - ASSERT(r == UV_EADDRINUSE); + ASSERT_EQ(r, UV_EADDRINUSE); uv_close((uv_handle_t*)&server1, close_cb); uv_close((uv_handle_t*)&server2, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -115,10 +115,10 @@ TEST_IMPL(tcp_bind_error_addrnotavail_1) { uv_tcp_t server; int r; - ASSERT(0 == uv_ip4_addr("127.255.255.255", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.255.255.255", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); /* It seems that Linux is broken here - bind succeeds. */ r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); @@ -128,7 +128,7 @@ TEST_IMPL(tcp_bind_error_addrnotavail_1) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -140,18 +140,18 @@ TEST_IMPL(tcp_bind_error_addrnotavail_2) { uv_tcp_t server; int r; - ASSERT(0 == uv_ip4_addr("4.4.4.4", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("4.4.4.4", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == UV_EADDRNOTAVAIL); + ASSERT_EQ(r, UV_EADDRNOTAVAIL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -168,15 +168,15 @@ TEST_IMPL(tcp_bind_error_fault) { garbage_addr = (struct sockaddr_in*) &garbage; r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) garbage_addr, 0); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -190,21 +190,21 @@ TEST_IMPL(tcp_bind_error_inval) { uv_tcp_t server; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr1)); - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT_2, &addr2)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr1)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT_2, &addr2)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr1, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr2, 0); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -216,12 +216,12 @@ TEST_IMPL(tcp_bind_localhost_ok) { uv_tcp_t server; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -233,12 +233,12 @@ TEST_IMPL(tcp_bind_invalid_flags) { uv_tcp_t server; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, UV_TCP_IPV6ONLY); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -250,9 +250,9 @@ TEST_IMPL(tcp_listen_without_bind) { uv_tcp_t server; r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server, 128, NULL); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -267,32 +267,32 @@ TEST_IMPL(tcp_bind_writable_flags) { uv_shutdown_t shutdown_req; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server, 128, NULL); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_is_writable((uv_stream_t*) &server)); - ASSERT(0 == uv_is_readable((uv_stream_t*) &server)); + ASSERT_OK(uv_is_writable((uv_stream_t*) &server)); + ASSERT_OK(uv_is_readable((uv_stream_t*) &server)); buf = uv_buf_init("PING", 4); r = uv_write(&write_req, (uv_stream_t*) &server, &buf, 1, NULL); - ASSERT(r == UV_EPIPE); + ASSERT_EQ(r, UV_EPIPE); r = uv_shutdown(&shutdown_req, (uv_stream_t*) &server, NULL); - ASSERT(r == UV_ENOTCONN); + ASSERT_EQ(r, UV_ENOTCONN); r = uv_read_start((uv_stream_t*) &server, (uv_alloc_cb) abort, (uv_read_cb) abort); - ASSERT(r == UV_ENOTCONN); + ASSERT_EQ(r, UV_ENOTCONN); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -307,11 +307,11 @@ TEST_IMPL(tcp_bind_or_listen_error_after_close) { addr.sin_port = htons(9999); addr.sin_family = AF_INET; - ASSERT_EQ(uv_tcp_init(uv_default_loop(), &tcp), 0); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &tcp)); uv_close((uv_handle_t*) &tcp, NULL); ASSERT_EQ(uv_tcp_bind(&tcp, (struct sockaddr*) &addr, 0), UV_EINVAL); ASSERT_EQ(uv_listen((uv_stream_t*) &tcp, 5, NULL), UV_EINVAL); - ASSERT_EQ(uv_run(uv_default_loop(), UV_RUN_DEFAULT), 0); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } diff --git a/deps/uv/test/test-tcp-bind6-error.c b/deps/uv/test/test-tcp-bind6-error.c index 656ebe34e297da..f44d3b7ee9ade4 100644 --- a/deps/uv/test/test-tcp-bind6-error.c +++ b/deps/uv/test/test-tcp-bind6-error.c @@ -42,29 +42,29 @@ TEST_IMPL(tcp_bind6_error_addrinuse) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server1, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_init(uv_default_loop(), &server2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server2, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server1, 128, NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&server2, 128, NULL); - ASSERT(r == UV_EADDRINUSE); + ASSERT_EQ(r, UV_EADDRINUSE); uv_close((uv_handle_t*)&server1, close_cb); uv_close((uv_handle_t*)&server2, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -79,18 +79,18 @@ TEST_IMPL(tcp_bind6_error_addrnotavail) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip6_addr("4:4:4:4:4:4:4:4", TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr("4:4:4:4:4:4:4:4", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == UV_EADDRNOTAVAIL); + ASSERT_EQ(r, UV_EADDRNOTAVAIL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -110,15 +110,15 @@ TEST_IMPL(tcp_bind6_error_fault) { garbage_addr = (struct sockaddr_in6*) &garbage; r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) garbage_addr, 0); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -135,21 +135,21 @@ TEST_IMPL(tcp_bind6_error_inval) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr1)); - ASSERT(0 == uv_ip6_addr("::", TEST_PORT_2, &addr2)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT, &addr1)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT_2, &addr2)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr1, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr2, 0); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -164,12 +164,12 @@ TEST_IMPL(tcp_bind6_localhost_ok) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr("::1", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-close-accept.c b/deps/uv/test/test-tcp-close-accept.c index b255cfbd9f362e..4988dd132750c1 100644 --- a/deps/uv/test/test-tcp-close-accept.c +++ b/deps/uv/test/test-tcp-close-accept.c @@ -47,7 +47,7 @@ static void close_cb(uv_handle_t* handle) { } static void write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); write_cb_called++; } @@ -57,7 +57,7 @@ static void connect_cb(uv_connect_t* req, int status) { uv_stream_t* outgoing; if (req == &tcp_check_req) { - ASSERT(status != 0); + ASSERT(status); /* * Time to finish the test: close both the check and pending incoming @@ -68,14 +68,14 @@ static void connect_cb(uv_connect_t* req, int status) { return; } - ASSERT(status == 0); - ASSERT(connect_reqs <= req); - ASSERT(req <= connect_reqs + ARRAY_SIZE(connect_reqs)); + ASSERT_OK(status); + ASSERT_LE(connect_reqs, req); + ASSERT_LE(req, connect_reqs + ARRAY_SIZE(connect_reqs)); i = req - connect_reqs; buf = uv_buf_init("x", 1); outgoing = (uv_stream_t*) &tcp_outgoing[i]; - ASSERT(0 == uv_write(&write_reqs[i], outgoing, &buf, 1, write_cb)); + ASSERT_OK(uv_write(&write_reqs[i], outgoing, &buf, 1, write_cb)); } static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { @@ -89,9 +89,9 @@ static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { unsigned int i; pending_incoming = (uv_tcp_t*) stream - &tcp_incoming[0]; - ASSERT(pending_incoming < got_connections); - ASSERT(0 == uv_read_stop(stream)); - ASSERT(1 == nread); + ASSERT_LT(pending_incoming, got_connections); + ASSERT_OK(uv_read_stop(stream)); + ASSERT_EQ(1, nread); loop = stream->loop; read_cb_called++; @@ -106,19 +106,19 @@ static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { uv_close((uv_handle_t*) &tcp_server, close_cb); /* Create new fd that should be one of the closed incomings */ - ASSERT(0 == uv_tcp_init(loop, &tcp_check)); - ASSERT(0 == uv_tcp_connect(&tcp_check_req, - &tcp_check, - (const struct sockaddr*) &addr, - connect_cb)); - ASSERT(0 == uv_read_start((uv_stream_t*) &tcp_check, alloc_cb, read_cb)); + ASSERT_OK(uv_tcp_init(loop, &tcp_check)); + ASSERT_OK(uv_tcp_connect(&tcp_check_req, + &tcp_check, + (const struct sockaddr*) &addr, + connect_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) &tcp_check, alloc_cb, read_cb)); } static void connection_cb(uv_stream_t* server, int status) { unsigned int i; uv_tcp_t* incoming; - ASSERT(server == (uv_stream_t*) &tcp_server); + ASSERT_PTR_EQ(server, (uv_stream_t*) &tcp_server); /* Ignore tcp_check connection */ if (got_connections == ARRAY_SIZE(tcp_incoming)) @@ -126,8 +126,8 @@ static void connection_cb(uv_stream_t* server, int status) { /* Accept everyone */ incoming = &tcp_incoming[got_connections++]; - ASSERT(0 == uv_tcp_init(server->loop, incoming)); - ASSERT(0 == uv_accept(server, (uv_stream_t*) incoming)); + ASSERT_OK(uv_tcp_init(server->loop, incoming)); + ASSERT_OK(uv_accept(server, (uv_stream_t*) incoming)); if (got_connections != ARRAY_SIZE(tcp_incoming)) return; @@ -135,7 +135,7 @@ static void connection_cb(uv_stream_t* server, int status) { /* Once all clients are accepted - start reading */ for (i = 0; i < ARRAY_SIZE(tcp_incoming); i++) { incoming = &tcp_incoming[i]; - ASSERT(0 == uv_read_start((uv_stream_t*) incoming, alloc_cb, read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) incoming, alloc_cb, read_cb)); } } @@ -162,30 +162,30 @@ TEST_IMPL(tcp_close_accept) { */ loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(loop, &tcp_server)); - ASSERT(0 == uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &tcp_server, - ARRAY_SIZE(tcp_outgoing), - connection_cb)); + ASSERT_OK(uv_tcp_init(loop, &tcp_server)); + ASSERT_OK(uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &tcp_server, + ARRAY_SIZE(tcp_outgoing), + connection_cb)); for (i = 0; i < ARRAY_SIZE(tcp_outgoing); i++) { client = tcp_outgoing + i; - ASSERT(0 == uv_tcp_init(loop, client)); - ASSERT(0 == uv_tcp_connect(&connect_reqs[i], - client, - (const struct sockaddr*) &addr, - connect_cb)); + ASSERT_OK(uv_tcp_init(loop, client)); + ASSERT_OK(uv_tcp_connect(&connect_reqs[i], + client, + (const struct sockaddr*) &addr, + connect_cb)); } uv_run(loop, UV_RUN_DEFAULT); - ASSERT(ARRAY_SIZE(tcp_outgoing) == got_connections); - ASSERT((ARRAY_SIZE(tcp_outgoing) + 2) == close_cb_called); - ASSERT(ARRAY_SIZE(tcp_outgoing) == write_cb_called); - ASSERT(1 == read_cb_called); + ASSERT_EQ(ARRAY_SIZE(tcp_outgoing), got_connections); + ASSERT_EQ((ARRAY_SIZE(tcp_outgoing) + 2), close_cb_called); + ASSERT_EQ(ARRAY_SIZE(tcp_outgoing), write_cb_called); + ASSERT_EQ(1, read_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-close-after-read-timeout.c b/deps/uv/test/test-tcp-close-after-read-timeout.c index 098e405a87529c..1b81630157d03e 100644 --- a/deps/uv/test/test-tcp-close-after-read-timeout.c +++ b/deps/uv/test/test-tcp-close-after-read-timeout.c @@ -48,10 +48,10 @@ static void on_client_connect(uv_connect_t* conn_req, int status) { int r; r = uv_read_start((uv_stream_t*) &client, on_client_alloc, on_client_read); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_timer_start(&timer, on_client_timeout, 1000, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } @@ -72,8 +72,8 @@ static void on_client_read(uv_stream_t* stream, ssize_t nread, static void on_client_timeout(uv_timer_t* handle) { - ASSERT_EQ(handle, &timer); - ASSERT_EQ(read_cb_called, 0); + ASSERT_PTR_EQ(handle, &timer); + ASSERT_OK(read_cb_called); uv_read_stop((uv_stream_t*) &client); uv_close((uv_handle_t*) &client, on_close); uv_close((uv_handle_t*) &timer, on_close); @@ -101,20 +101,20 @@ static void on_connection_read(uv_stream_t* stream, static void on_connection(uv_stream_t* server, int status) { int r; - ASSERT_EQ(status, 0); - ASSERT_EQ(uv_accept(server, (uv_stream_t*) &connection), 0); + ASSERT_OK(status); + ASSERT_OK(uv_accept(server, (uv_stream_t*) &connection)); r = uv_read_start((uv_stream_t*) &connection, on_connection_alloc, on_connection_read); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } static void on_close(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*) &client || - handle == (uv_handle_t*) &connection || - handle == (uv_handle_t*) &timer); + ASSERT_NE(handle == (uv_handle_t*) &client || + handle == (uv_handle_t*) &connection || + handle == (uv_handle_t*) &timer, 0); on_close_called++; } @@ -123,16 +123,16 @@ static void start_server(uv_loop_t* loop, uv_tcp_t* handle) { struct sockaddr_in addr; int r; - ASSERT_EQ(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr), 0); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(loop, handle); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_bind(handle, (const struct sockaddr*) &addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*) handle, 128, on_connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_unref((uv_handle_t*) handle); } @@ -147,7 +147,7 @@ TEST_IMPL(tcp_close_after_read_timeout) { uv_loop_t* loop; int r; - ASSERT_EQ(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr), 0); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); @@ -155,28 +155,28 @@ TEST_IMPL(tcp_close_after_read_timeout) { start_server(loop, &tcp_server); r = uv_tcp_init(loop, &client); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &client, (const struct sockaddr*) &addr, on_client_connect); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_init(loop, &connection); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_timer_init(loop, &timer); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(read_cb_called, 0); - ASSERT_EQ(on_close_called, 0); + ASSERT_OK(read_cb_called); + ASSERT_OK(on_close_called); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(read_cb_called, 1); - ASSERT_EQ(on_close_called, 3); + ASSERT_EQ(1, read_cb_called); + ASSERT_EQ(3, on_close_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-close-reset.c b/deps/uv/test/test-tcp-close-reset.c index 7415646996cd9f..74941789420f19 100644 --- a/deps/uv/test/test-tcp-close-reset.c +++ b/deps/uv/test/test-tcp-close-reset.c @@ -62,7 +62,7 @@ static void do_write(uv_tcp_t* handle) { buf = uv_buf_init("PING", 4); for (i = 0; i < ARRAY_SIZE(write_reqs); i++) { r = uv_write(&write_reqs[i], (uv_stream_t*) handle, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } } @@ -72,21 +72,25 @@ static void do_close(uv_tcp_t* handle) { int r; if (shutdown_before_close == 1) { - ASSERT(0 == uv_shutdown(&shutdown_req, (uv_stream_t*) handle, shutdown_cb)); - ASSERT(UV_EINVAL == uv_tcp_close_reset(handle, close_cb)); + ASSERT_OK(uv_shutdown(&shutdown_req, + (uv_stream_t*) handle, + shutdown_cb)); + ASSERT_EQ(UV_EINVAL, uv_tcp_close_reset(handle, close_cb)); } else if (shutdown_before_close == 2) { r = uv_fileno((const uv_handle_t*) handle, &fd); - ASSERT_EQ(r, 0); - ASSERT_NE(fd, INVALID_FD); + ASSERT_OK(r); #ifdef _WIN32 - ASSERT_EQ(0, shutdown(fd, SD_BOTH)); + ASSERT_PTR_NE(fd, INVALID_FD); + ASSERT_OK(shutdown((SOCKET)fd, SD_BOTH)); #else - ASSERT_EQ(0, shutdown(fd, SHUT_RDWR)); + ASSERT_NE(fd, INVALID_FD); + ASSERT_OK(shutdown(fd, SHUT_RDWR)); #endif - ASSERT_EQ(0, uv_tcp_close_reset(handle, close_cb)); + ASSERT_OK(uv_tcp_close_reset(handle, close_cb)); } else { - ASSERT(0 == uv_tcp_close_reset(handle, close_cb)); - ASSERT(UV_ENOTCONN == uv_shutdown(&shutdown_req, (uv_stream_t*) handle, shutdown_cb)); + ASSERT_OK(uv_tcp_close_reset(handle, close_cb)); + ASSERT_EQ(UV_ENOTCONN, uv_shutdown(&shutdown_req, (uv_stream_t*) handle, + shutdown_cb)); } uv_close((uv_handle_t*) &tcp_server, NULL); @@ -99,14 +103,14 @@ static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { } static void read_cb2(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - ASSERT((uv_tcp_t*)stream == &tcp_client); + ASSERT_PTR_EQ((uv_tcp_t*)stream, &tcp_client); if (nread == UV_EOF) uv_close((uv_handle_t*) stream, NULL); } static void connect_cb(uv_connect_t* conn_req, int status) { - ASSERT(conn_req == &connect_req); + ASSERT_PTR_EQ(conn_req, &connect_req); uv_read_start((uv_stream_t*) &tcp_client, alloc_cb, read_cb2); do_write(&tcp_client); if (client_close) @@ -116,33 +120,33 @@ static void connect_cb(uv_connect_t* conn_req, int status) { static void write_cb(uv_write_t* req, int status) { /* write callbacks should run before the close callback */ - ASSERT(close_cb_called == 0); - ASSERT(req->handle == (uv_stream_t*)&tcp_client); + ASSERT_OK(close_cb_called); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*)&tcp_client); write_cb_called++; } static void close_cb(uv_handle_t* handle) { if (client_close) - ASSERT(handle == (uv_handle_t*) &tcp_client); + ASSERT_PTR_EQ(handle, (uv_handle_t*) &tcp_client); else - ASSERT(handle == (uv_handle_t*) &tcp_accepted); + ASSERT_PTR_EQ(handle, (uv_handle_t*) &tcp_accepted); close_cb_called++; } static void shutdown_cb(uv_shutdown_t* req, int status) { if (client_close) - ASSERT(req->handle == (uv_stream_t*) &tcp_client); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*) &tcp_client); else - ASSERT(req->handle == (uv_stream_t*) &tcp_accepted); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*) &tcp_accepted); shutdown_cb_called++; } static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - ASSERT((uv_tcp_t*)stream == &tcp_accepted); + ASSERT_PTR_EQ((uv_tcp_t*)stream, &tcp_accepted); if (nread < 0) { uv_close((uv_handle_t*) stream, NULL); } else { @@ -154,10 +158,10 @@ static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { static void connection_cb(uv_stream_t* server, int status) { - ASSERT(status == 0); + ASSERT_OK(status); - ASSERT(0 == uv_tcp_init(loop, &tcp_accepted)); - ASSERT(0 == uv_accept(server, (uv_stream_t*) &tcp_accepted)); + ASSERT_OK(uv_tcp_init(loop, &tcp_accepted)); + ASSERT_OK(uv_accept(server, (uv_stream_t*) &tcp_accepted)); uv_read_start((uv_stream_t*) &tcp_accepted, alloc_cb, read_cb); } @@ -167,16 +171,16 @@ static void start_server(uv_loop_t* loop, uv_tcp_t* handle) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(loop, handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(handle, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)handle, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -184,16 +188,16 @@ static void do_connect(uv_loop_t* loop, uv_tcp_t* tcp_client) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(loop, tcp_client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, tcp_client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -212,16 +216,16 @@ TEST_IMPL(tcp_close_reset_client) { do_connect(loop, &tcp_client); - ASSERT(write_cb_called == 0); - ASSERT(close_cb_called == 0); - ASSERT(shutdown_cb_called == 0); + ASSERT_OK(write_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_OK(shutdown_cb_called); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(write_cb_called == 4); - ASSERT(close_cb_called == 1); - ASSERT(shutdown_cb_called == 0); + ASSERT_EQ(4, write_cb_called); + ASSERT_EQ(1, close_cb_called); + ASSERT_OK(shutdown_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -239,16 +243,16 @@ TEST_IMPL(tcp_close_reset_client_after_shutdown) { do_connect(loop, &tcp_client); - ASSERT(write_cb_called == 0); - ASSERT(close_cb_called == 0); - ASSERT(shutdown_cb_called == 0); + ASSERT_OK(write_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_OK(shutdown_cb_called); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(write_cb_called == 4); - ASSERT(close_cb_called == 0); - ASSERT(shutdown_cb_called == 1); + ASSERT_EQ(4, write_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_EQ(1, shutdown_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -266,16 +270,16 @@ TEST_IMPL(tcp_close_reset_accepted) { do_connect(loop, &tcp_client); - ASSERT(write_cb_called == 0); - ASSERT(close_cb_called == 0); - ASSERT(shutdown_cb_called == 0); + ASSERT_OK(write_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_OK(shutdown_cb_called); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(write_cb_called == 4); - ASSERT(close_cb_called == 1); - ASSERT(shutdown_cb_called == 0); + ASSERT_EQ(4, write_cb_called); + ASSERT_EQ(1, close_cb_called); + ASSERT_OK(shutdown_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -293,16 +297,16 @@ TEST_IMPL(tcp_close_reset_accepted_after_shutdown) { do_connect(loop, &tcp_client); - ASSERT(write_cb_called == 0); - ASSERT(close_cb_called == 0); - ASSERT(shutdown_cb_called == 0); + ASSERT_OK(write_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_OK(shutdown_cb_called); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(write_cb_called == 4); - ASSERT(close_cb_called == 0); - ASSERT(shutdown_cb_called == 1); + ASSERT_EQ(4, write_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_EQ(1, shutdown_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -320,16 +324,16 @@ TEST_IMPL(tcp_close_reset_accepted_after_socket_shutdown) { do_connect(loop, &tcp_client); - ASSERT_EQ(write_cb_called, 0); - ASSERT_EQ(close_cb_called, 0); - ASSERT_EQ(shutdown_cb_called, 0); + ASSERT_OK(write_cb_called); + ASSERT_OK(close_cb_called); + ASSERT_OK(shutdown_cb_called); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); - ASSERT_EQ(write_cb_called, 4); - ASSERT_EQ(close_cb_called, 1); - ASSERT_EQ(shutdown_cb_called, 0); + ASSERT_EQ(4, write_cb_called); + ASSERT_EQ(1, close_cb_called); + ASSERT_OK(shutdown_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-close-while-connecting.c b/deps/uv/test/test-tcp-close-while-connecting.c index 490413891bbc0c..ba5e46901a4302 100644 --- a/deps/uv/test/test-tcp-close-while-connecting.c +++ b/deps/uv/test/test-tcp-close-while-connecting.c @@ -69,24 +69,24 @@ TEST_IMPL(tcp_close_while_connecting) { int r; loop = uv_default_loop(); - ASSERT(0 == uv_ip4_addr("1.2.3.4", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(loop, &tcp_handle)); + ASSERT_OK(uv_ip4_addr("1.2.3.4", TEST_PORT, &addr)); + ASSERT_OK(uv_tcp_init(loop, &tcp_handle)); r = uv_tcp_connect(&connect_req, &tcp_handle, (const struct sockaddr*) &addr, connect_cb); if (r == UV_ENETUNREACH) RETURN_SKIP("Network unreachable."); - ASSERT(r == 0); - ASSERT(0 == uv_timer_init(loop, &timer1_handle)); - ASSERT(0 == uv_timer_start(&timer1_handle, timer1_cb, 1, 0)); - ASSERT(0 == uv_timer_init(loop, &timer2_handle)); - ASSERT(0 == uv_timer_start(&timer2_handle, timer2_cb, 86400 * 1000, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - - ASSERT(connect_cb_called == 1); - ASSERT(timer1_cb_called == 1); - ASSERT(close_cb_called == 2); + ASSERT_OK(r); + ASSERT_OK(uv_timer_init(loop, &timer1_handle)); + ASSERT_OK(uv_timer_start(&timer1_handle, timer1_cb, 1, 0)); + ASSERT_OK(uv_timer_init(loop, &timer2_handle)); + ASSERT_OK(uv_timer_start(&timer2_handle, timer2_cb, 86400 * 1000, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, timer1_cb_called); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(loop); diff --git a/deps/uv/test/test-tcp-close.c b/deps/uv/test/test-tcp-close.c index 6879bae20f89ad..ed19da6f783b3e 100644 --- a/deps/uv/test/test-tcp-close.c +++ b/deps/uv/test/test-tcp-close.c @@ -49,7 +49,7 @@ static void connect_cb(uv_connect_t* conn_req, int status) { ASSERT_NOT_NULL(req); r = uv_write(req, (uv_stream_t*)&tcp_handle, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } uv_close((uv_handle_t*)&tcp_handle, close_cb); @@ -58,21 +58,21 @@ static void connect_cb(uv_connect_t* conn_req, int status) { static void write_cb(uv_write_t* req, int status) { /* write callbacks should run before the close callback */ - ASSERT(close_cb_called == 0); - ASSERT(req->handle == (uv_stream_t*)&tcp_handle); + ASSERT_OK(close_cb_called); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*)&tcp_handle); write_cb_called++; free(req); } static void close_cb(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*)&tcp_handle); + ASSERT_PTR_EQ(handle, (uv_handle_t*)&tcp_handle); close_cb_called++; } static void connection_cb(uv_stream_t* server, int status) { - ASSERT(status == 0); + ASSERT_OK(status); } @@ -80,16 +80,16 @@ static void start_server(uv_loop_t* loop, uv_tcp_t* handle) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(loop, handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(handle, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)handle, 128, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_unref((uv_handle_t*)handle); } @@ -104,7 +104,7 @@ TEST_IMPL(tcp_close) { uv_loop_t* loop; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); @@ -112,24 +112,24 @@ TEST_IMPL(tcp_close) { start_server(loop, &tcp_server); r = uv_tcp_init(loop, &tcp_handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &tcp_handle, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(write_cb_called == 0); - ASSERT(close_cb_called == 0); + ASSERT_OK(write_cb_called); + ASSERT_OK(close_cb_called); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); printf("%d of %d write reqs seen\n", write_cb_called, NUM_WRITE_REQS); - ASSERT(write_cb_called == NUM_WRITE_REQS); - ASSERT(close_cb_called == 1); + ASSERT_EQ(write_cb_called, NUM_WRITE_REQS); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-connect-error-after-write.c b/deps/uv/test/test-tcp-connect-error-after-write.c index 1800b4d6ed06d3..7321259628d5e6 100644 --- a/deps/uv/test/test-tcp-connect-error-after-write.c +++ b/deps/uv/test/test-tcp-connect-error-after-write.c @@ -37,14 +37,14 @@ static void close_cb(uv_handle_t* handle) { static void connect_cb(uv_connect_t* req, int status) { - ASSERT(status < 0); + ASSERT_LT(status, 0); connect_cb_called++; uv_close((uv_handle_t*)req->handle, close_cb); } static void write_cb(uv_write_t* req, int status) { - ASSERT(status < 0); + ASSERT_LT(status, 0); write_cb_called++; } @@ -67,30 +67,30 @@ TEST_IMPL(tcp_connect_error_after_write) { uv_buf_t buf; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); buf = uv_buf_init("TEST", 4); r = uv_tcp_init(uv_default_loop(), &conn); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_write(&write_req, (uv_stream_t*)&conn, &buf, 1, write_cb); - ASSERT(r == UV_EBADF); + ASSERT_EQ(r, UV_EBADF); r = uv_tcp_connect(&connect_req, &conn, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_write(&write_req, (uv_stream_t*)&conn, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-connect-error.c b/deps/uv/test/test-tcp-connect-error.c index 9384ebce57c450..ee0f9ee5ce6220 100644 --- a/deps/uv/test/test-tcp-connect-error.c +++ b/deps/uv/test/test-tcp-connect-error.c @@ -54,19 +54,19 @@ TEST_IMPL(tcp_connect_error_fault) { garbage_addr = (const struct sockaddr_in*) &garbage; r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&req, &server, (const struct sockaddr*) garbage_addr, connect_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_called == 0); - ASSERT(close_cb_called == 1); + ASSERT_OK(connect_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-connect-timeout.c b/deps/uv/test/test-tcp-connect-timeout.c index 4cd83e1d38b58c..4eb834e1afac80 100644 --- a/deps/uv/test/test-tcp-connect-timeout.c +++ b/deps/uv/test/test-tcp-connect-timeout.c @@ -38,14 +38,14 @@ static void close_cb(uv_handle_t* handle); static void connect_cb(uv_connect_t* req, int status) { - ASSERT(req == &connect_req); - ASSERT(status == UV_ECANCELED); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_EQ(status, UV_ECANCELED); connect_cb_called++; } static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer); + ASSERT_PTR_EQ(handle, &timer); uv_close((uv_handle_t*)&conn, close_cb); uv_close((uv_handle_t*)&timer, close_cb); } @@ -64,16 +64,16 @@ TEST_IMPL(tcp_connect_timeout) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("8.8.8.8", 9999, &addr)); + ASSERT_OK(uv_ip4_addr("8.8.8.8", 9999, &addr)); r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb, 50, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_init(uv_default_loop(), &conn); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &conn, @@ -81,10 +81,10 @@ TEST_IMPL(tcp_connect_timeout) { connect_cb); if (r == UV_ENETUNREACH) RETURN_SKIP("Network unreachable."); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -105,7 +105,7 @@ static int is_supported_system(void) { int min_semver[3] = {10, 0, 16299}; int cnt; uv_utsname_t uname; - ASSERT_EQ(uv_os_uname(&uname), 0); + ASSERT_OK(uv_os_uname(&uname)); if (strcmp(uname.sysname, "Windows_NT") == 0) { cnt = sscanf(uname.release, "%d.%d.%d", &semver[0], &semver[1], &semver[2]); if (cnt != 3) { @@ -130,17 +130,17 @@ TEST_IMPL(tcp_local_connect_timeout) { if (!is_supported_system()) { RETURN_SKIP("Unsupported system"); } - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_timer_init(uv_default_loop(), &timer); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* Give it 1s to timeout. */ r = uv_timer_start(&timer, timer_cb, 1000, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_init(uv_default_loop(), &conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &conn, @@ -148,10 +148,10 @@ TEST_IMPL(tcp_local_connect_timeout) { connect_local_cb); if (r == UV_ENETUNREACH) RETURN_SKIP("Network unreachable."); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -168,17 +168,17 @@ TEST_IMPL(tcp6_local_connect_timeout) { RETURN_SKIP("IPv6 not supported"); } - ASSERT_EQ(0, uv_ip6_addr("::1", 9999, &addr)); + ASSERT_OK(uv_ip6_addr("::1", 9999, &addr)); r = uv_timer_init(uv_default_loop(), &timer); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* Give it 1s to timeout. */ r = uv_timer_start(&timer, timer_cb, 1000, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_init(uv_default_loop(), &conn); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &conn, @@ -186,10 +186,10 @@ TEST_IMPL(tcp6_local_connect_timeout) { connect_local_cb); if (r == UV_ENETUNREACH) RETURN_SKIP("Network unreachable."); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(r, 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-connect6-error.c b/deps/uv/test/test-tcp-connect6-error.c index 8646dd56496eb0..1e6d7c78da999d 100644 --- a/deps/uv/test/test-tcp-connect6-error.c +++ b/deps/uv/test/test-tcp-connect6-error.c @@ -49,22 +49,63 @@ TEST_IMPL(tcp_connect6_error_fault) { int r; uv_connect_t req; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + garbage_addr = (const struct sockaddr_in6*) &garbage; r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&req, &server, (const struct sockaddr*) garbage_addr, connect_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_close((uv_handle_t*)&server, close_cb); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_called == 0); - ASSERT(close_cb_called == 1); + ASSERT_OK(connect_cb_called); + ASSERT_EQ(1, close_cb_called); + + MAKE_VALGRIND_HAPPY(uv_default_loop()); + return 0; +} + + +TEST_IMPL(tcp_connect6_link_local) { + struct sockaddr_in6 addr; + uv_connect_t req; + uv_tcp_t server; + + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + +#if defined(__QEMU__) + /* qemu's sockaddr_in6 translation is broken pre-qemu 8.0.0 + * when host endianness != guest endiannes. + * Fixed in https://github.com/qemu/qemu/commit/44cf6731d6b. + */ + RETURN_SKIP("Test does not currently work in QEMU"); +#endif /* defined(__QEMU__) */ + + ASSERT_OK(uv_ip6_addr("fe80::0bad:babe", 1337, &addr)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &server)); + + /* We're making two shaky assumptions here: + * 1. There is a network interface that routes IPv6 link-local traffic, and + * 2. There is no firewall rule that blackholes or otherwise hard-kills the + * connection attempt to the address above, i.e., we don't expect the + * connect() system call to fail synchronously. + */ + ASSERT_OK(uv_tcp_connect(&req, + &server, + (struct sockaddr*) &addr, + connect_cb)); + + uv_close((uv_handle_t*) &server, NULL); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-create-socket-early.c b/deps/uv/test/test-tcp-create-socket-early.c index c84882dad216ef..e8c1aaab2765a8 100644 --- a/deps/uv/test/test-tcp-create-socket-early.c +++ b/deps/uv/test/test-tcp-create-socket-early.c @@ -32,7 +32,7 @@ static void on_connect(uv_connect_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); uv_close((uv_handle_t*) req->handle, NULL); } @@ -41,16 +41,16 @@ static void on_connection(uv_stream_t* server, int status) { uv_tcp_t* handle; int r; - ASSERT(status == 0); + ASSERT_OK(status); handle = malloc(sizeof(*handle)); ASSERT_NOT_NULL(handle); r = uv_tcp_init_ex(server->loop, handle, AF_INET); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_accept(server, (uv_stream_t*)handle); - ASSERT(r == UV_EBUSY); + ASSERT_EQ(r, UV_EBUSY); uv_close((uv_handle_t*) server, NULL); uv_close((uv_handle_t*) handle, (uv_close_cb)free); @@ -61,16 +61,16 @@ static void tcp_listener(uv_loop_t* loop, uv_tcp_t* server) { struct sockaddr_in addr; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_tcp_init(loop, server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*) server, 128, on_connection); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -78,16 +78,16 @@ static void tcp_connector(uv_loop_t* loop, uv_tcp_t* client, uv_connect_t* req) struct sockaddr_in server_addr; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); r = uv_tcp_init(loop, client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(req, client, (const struct sockaddr*) &server_addr, on_connect); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -98,32 +98,34 @@ TEST_IMPL(tcp_create_early) { uv_os_fd_t fd; int r, namelen; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init_ex(uv_default_loop(), &client, AF_INET); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((const uv_handle_t*) &client, &fd); - ASSERT(r == 0); - ASSERT(fd != INVALID_FD); + ASSERT_OK(r); /* Windows returns WSAEINVAL if the socket is not bound */ #ifndef _WIN32 + ASSERT_NE(fd, INVALID_FD); namelen = sizeof sockname; r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); - ASSERT(r == 0); - ASSERT(sockname.sin_family == AF_INET); + ASSERT_OK(r); + ASSERT_EQ(sockname.sin_family, AF_INET); +#else + ASSERT_PTR_NE(fd, INVALID_FD); #endif r = uv_tcp_bind(&client, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); namelen = sizeof sockname; r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); - ASSERT(r == 0); - ASSERT(memcmp(&addr.sin_addr, - &sockname.sin_addr, - sizeof(addr.sin_addr)) == 0); + ASSERT_OK(r); + ASSERT_OK(memcmp(&addr.sin_addr, + &sockname.sin_addr, + sizeof(addr.sin_addr))); uv_close((uv_handle_t*) &client, NULL); uv_run(uv_default_loop(), UV_RUN_DEFAULT); @@ -142,32 +144,34 @@ TEST_IMPL(tcp_create_early_bad_bind) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init_ex(uv_default_loop(), &client, AF_INET6); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((const uv_handle_t*) &client, &fd); - ASSERT(r == 0); - ASSERT(fd != INVALID_FD); + ASSERT_OK(r); /* Windows returns WSAEINVAL if the socket is not bound */ #ifndef _WIN32 + ASSERT_NE(fd, INVALID_FD); { int namelen; struct sockaddr_in6 sockname; namelen = sizeof sockname; r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); - ASSERT(r == 0); - ASSERT(sockname.sin6_family == AF_INET6); + ASSERT_OK(r); + ASSERT_EQ(sockname.sin6_family, AF_INET6); } +#else + ASSERT_PTR_NE(fd, INVALID_FD); #endif r = uv_tcp_bind(&client, (const struct sockaddr*) &addr, 0); #if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MSYS__) - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); #else - ASSERT(r == UV_EFAULT); + ASSERT_EQ(r, UV_EFAULT); #endif uv_close((uv_handle_t*) &client, NULL); @@ -183,10 +187,10 @@ TEST_IMPL(tcp_create_early_bad_domain) { int r; r = uv_tcp_init_ex(uv_default_loop(), &client, 47); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_tcp_init_ex(uv_default_loop(), &client, 1024); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(uv_default_loop(), UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-tcp-flags.c b/deps/uv/test/test-tcp-flags.c index 6856429aa1dc75..30178d706d9418 100644 --- a/deps/uv/test/test-tcp-flags.c +++ b/deps/uv/test/test-tcp-flags.c @@ -34,18 +34,18 @@ TEST_IMPL(tcp_flags) { loop = uv_default_loop(); r = uv_tcp_init(loop, &handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_nodelay(&handle, 1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_keepalive(&handle, 1, 60); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*)&handle, NULL); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-oob.c b/deps/uv/test/test-tcp-oob.c index 989454ed8787f9..7962fa93448a20 100644 --- a/deps/uv/test/test-tcp-oob.c +++ b/deps/uv/test/test-tcp-oob.c @@ -61,22 +61,22 @@ static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { #endif uv_os_fd_t fd; - ASSERT(nread >= 0); - ASSERT(0 == uv_fileno((uv_handle_t*)handle, &fd)); - ASSERT(0 == uv_idle_start(&idle, idle_cb)); + ASSERT_GE(nread, 0); + ASSERT_OK(uv_fileno((uv_handle_t*)handle, &fd)); + ASSERT_OK(uv_idle_start(&idle, idle_cb)); #ifdef __MVS__ /* Need to flush out the OOB data. Otherwise, this callback will get * triggered on every poll with nread = 0. */ - ASSERT(-1 != recv(fd, lbuf, sizeof(lbuf), MSG_OOB)); + ASSERT_NE(-1, recv(fd, lbuf, sizeof(lbuf), MSG_OOB)); #endif } static void connect_cb(uv_connect_t* req, int status) { - ASSERT(req->handle == (uv_stream_t*) &client_handle); - ASSERT(0 == status); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*) &client_handle); + ASSERT_OK(status); } @@ -84,14 +84,14 @@ static void connection_cb(uv_stream_t* handle, int status) { int r; uv_os_fd_t fd; - ASSERT(0 == status); - ASSERT(0 == uv_accept(handle, (uv_stream_t*) &peer_handle)); - ASSERT(0 == uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); + ASSERT_OK(status); + ASSERT_OK(uv_accept(handle, (uv_stream_t*) &peer_handle)); + ASSERT_OK(uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); /* Send some OOB data */ - ASSERT(0 == uv_fileno((uv_handle_t*) &client_handle, &fd)); + ASSERT_OK(uv_fileno((uv_handle_t*) &client_handle, &fd)); - ASSERT(0 == uv_stream_set_blocking((uv_stream_t*) &client_handle, 1)); + ASSERT_OK(uv_stream_set_blocking((uv_stream_t*) &client_handle, 1)); /* The problem triggers only on a second message, it seem that xnu is not * triggering `kevent()` for the first one @@ -99,14 +99,14 @@ static void connection_cb(uv_stream_t* handle, int status) { do { r = send(fd, "hello", 5, MSG_OOB); } while (r < 0 && errno == EINTR); - ASSERT(5 == r); + ASSERT_EQ(5, r); do { r = send(fd, "hello", 5, MSG_OOB); } while (r < 0 && errno == EINTR); - ASSERT(5 == r); + ASSERT_EQ(5, r); - ASSERT(0 == uv_stream_set_blocking((uv_stream_t*) &client_handle, 0)); + ASSERT_OK(uv_stream_set_blocking((uv_stream_t*) &client_handle, 0)); } @@ -114,26 +114,26 @@ TEST_IMPL(tcp_oob) { struct sockaddr_in addr; uv_loop_t* loop; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); - ASSERT(0 == uv_tcp_init(loop, &server_handle)); - ASSERT(0 == uv_tcp_init(loop, &client_handle)); - ASSERT(0 == uv_tcp_init(loop, &peer_handle)); - ASSERT(0 == uv_idle_init(loop, &idle)); - ASSERT(0 == uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); + ASSERT_OK(uv_tcp_init(loop, &server_handle)); + ASSERT_OK(uv_tcp_init(loop, &client_handle)); + ASSERT_OK(uv_tcp_init(loop, &peer_handle)); + ASSERT_OK(uv_idle_init(loop, &idle)); + ASSERT_OK(uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); /* Ensure two separate packets */ - ASSERT(0 == uv_tcp_nodelay(&client_handle, 1)); + ASSERT_OK(uv_tcp_nodelay(&client_handle, 1)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &client_handle, - (const struct sockaddr*) &addr, - connect_cb)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client_handle, + (const struct sockaddr*) &addr, + connect_cb)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(ticks == kMaxTicks); + ASSERT_EQ(ticks, kMaxTicks); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-open.c b/deps/uv/test/test-tcp-open.c index b5c5621a793679..3fbcf2a5f23c83 100644 --- a/deps/uv/test/test-tcp-open.c +++ b/deps/uv/test/test-tcp-open.c @@ -46,7 +46,7 @@ static void startup(void) { #ifdef _WIN32 struct WSAData wsa_data; int r = WSAStartup(MAKEWORD(2, 2), &wsa_data); - ASSERT(r == 0); + ASSERT_OK(r); #endif } @@ -56,9 +56,9 @@ static uv_os_sock_t create_tcp_socket(void) { sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); #ifdef _WIN32 - ASSERT(sock != INVALID_SOCKET); + ASSERT_NE(sock, INVALID_SOCKET); #else - ASSERT(sock >= 0); + ASSERT_GE(sock, 0); #endif #ifndef _WIN32 @@ -66,7 +66,7 @@ static uv_os_sock_t create_tcp_socket(void) { /* Allow reuse of the port. */ int yes = 1; int r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); - ASSERT(r == 0); + ASSERT_OK(r); } #endif @@ -81,7 +81,7 @@ static void close_socket(uv_os_sock_t sock) { #else r = close(sock); #endif - ASSERT(r == 0); + ASSERT_OK(r); } @@ -89,7 +89,7 @@ static void alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { static char slab[65536]; - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -102,8 +102,8 @@ static void close_cb(uv_handle_t* handle) { static void shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(req == &shutdown_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &shutdown_req); + ASSERT_OK(status); /* Now we wait for the EOF */ shutdown_cb_called++; @@ -114,11 +114,11 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { ASSERT_NOT_NULL(tcp); if (nread >= 0) { - ASSERT(nread == 4); - ASSERT(memcmp("PING", buf->base, nread) == 0); + ASSERT_EQ(4, nread); + ASSERT_OK(memcmp("PING", buf->base, nread)); } else { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); uv_close((uv_handle_t*)tcp, close_cb); } } @@ -130,9 +130,9 @@ static void read1_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { if (nread >= 0) { for (i = 0; i < nread; ++i) - ASSERT(buf->base[i] == 'P'); + ASSERT_EQ(buf->base[i], 'P'); } else { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); printf("GOT EOF\n"); uv_close((uv_handle_t*)tcp, close_cb); } @@ -166,7 +166,7 @@ static void write1_cb(uv_write_t* req, int status) { buf = uv_buf_init("P", 1); r = uv_write(&write_req, req->handle, &buf, 1, write1_cb); - ASSERT(r == 0); + ASSERT_OK(r); write_cb_called++; } @@ -177,7 +177,7 @@ static void timer_cb(uv_timer_t* handle) { /* Shutdown on drain. */ r = uv_shutdown(&shutdown_req, (uv_stream_t*) &client, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); shutdown_requested++; } @@ -187,22 +187,22 @@ static void connect_cb(uv_connect_t* req, int status) { uv_stream_t* stream; int r; - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); stream = req->handle; connect_cb_called++; r = uv_write(&write_req, stream, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); /* Shutdown on drain. */ r = uv_shutdown(&shutdown_req, stream, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); /* Start reading */ r = uv_read_start(stream, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -211,25 +211,25 @@ static void connect1_cb(uv_connect_t* req, int status) { uv_stream_t* stream; int r; - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); stream = req->handle; connect_cb_called++; r = uv_timer_init(uv_default_loop(), &tm); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&tm, timer_cb, 2000, 0); - ASSERT(r == 0); + ASSERT_OK(r); buf = uv_buf_init("P", 1); r = uv_write(&write_req, stream, &buf, 1, write1_cb); - ASSERT(r == 0); + ASSERT_OK(r); /* Start reading */ r = uv_read_start(stream, alloc_cb, read1_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -239,30 +239,30 @@ TEST_IMPL(tcp_open) { int r; uv_tcp_t client2; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); startup(); sock = create_tcp_socket(); r = uv_tcp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_open(&client, sock); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 { r = uv_tcp_init(uv_default_loop(), &client2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_open(&client2, sock); - ASSERT(r == UV_EEXIST); + ASSERT_EQ(r, UV_EEXIST); uv_close((uv_handle_t*) &client2, NULL); } @@ -272,10 +272,10 @@ TEST_IMPL(tcp_open) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(shutdown_cb_called == 1); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -292,13 +292,13 @@ TEST_IMPL(tcp_open_twice) { sock2 = create_tcp_socket(); r = uv_tcp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_open(&client, sock1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_open(&client, sock2); - ASSERT(r == UV_EBUSY); + ASSERT_EQ(r, UV_EBUSY); close_socket(sock2); uv_close((uv_handle_t*) &client, NULL); @@ -317,15 +317,15 @@ TEST_IMPL(tcp_open_bound) { startup(); sock = create_tcp_socket(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &server)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &server)); - ASSERT(0 == bind(sock, (struct sockaddr*) &addr, sizeof(addr))); + ASSERT_OK(bind(sock, (struct sockaddr*) &addr, sizeof(addr))); - ASSERT(0 == uv_tcp_open(&server, sock)); + ASSERT_OK(uv_tcp_open(&server, sock)); - ASSERT(0 == uv_listen((uv_stream_t*) &server, 128, NULL)); + ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, NULL)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -338,28 +338,34 @@ TEST_IMPL(tcp_open_connected) { uv_os_sock_t sock; uv_buf_t buf = uv_buf_init("PING", 4); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); startup(); sock = create_tcp_socket(); - ASSERT(0 == connect(sock, (struct sockaddr*) &addr, sizeof(addr))); + ASSERT_OK(connect(sock, (struct sockaddr*) &addr, sizeof(addr))); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); - ASSERT(0 == uv_tcp_open(&client, sock)); + ASSERT_OK(uv_tcp_open(&client, sock)); - ASSERT(0 == uv_write(&write_req, (uv_stream_t*) &client, &buf, 1, write_cb)); + ASSERT_OK(uv_write(&write_req, + (uv_stream_t*) &client, + &buf, + 1, + write_cb)); - ASSERT(0 == uv_shutdown(&shutdown_req, (uv_stream_t*) &client, shutdown_cb)); + ASSERT_OK(uv_shutdown(&shutdown_req, + (uv_stream_t*) &client, + shutdown_cb)); - ASSERT(0 == uv_read_start((uv_stream_t*) &client, alloc_cb, read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) &client, alloc_cb, read_cb)); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(shutdown_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -371,30 +377,30 @@ TEST_IMPL(tcp_write_ready) { uv_os_sock_t sock; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); startup(); sock = create_tcp_socket(); r = uv_tcp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_open(&client, sock); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &client, (const struct sockaddr*) &addr, connect1_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(shutdown_cb_called == 1); - ASSERT(shutdown_requested == 1); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called > 0); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, shutdown_requested); + ASSERT_EQ(1, connect_cb_called); + ASSERT_GT(write_cb_called, 0); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-read-stop-start.c b/deps/uv/test/test-tcp-read-stop-start.c index 9be12bb75b0b34..68d6f7c2ab5855 100644 --- a/deps/uv/test/test-tcp-read-stop-start.c +++ b/deps/uv/test/test-tcp-read-stop-start.c @@ -33,14 +33,14 @@ static uv_connect_t connect_req; static void on_read2(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf); static void on_write_close_immediately(uv_write_t* req, int status) { - ASSERT(0 == status); + ASSERT_OK(status); uv_close((uv_handle_t*)req->handle, NULL); /* Close immediately */ free(req); } static void on_write(uv_write_t* req, int status) { - ASSERT(0 == status); + ASSERT_OK(status); free(req); } @@ -50,7 +50,7 @@ static void do_write(uv_stream_t* stream, uv_write_cb cb) { uv_buf_t buf; buf.base = "1234578"; buf.len = 8; - ASSERT(0 == uv_write(req, stream, &buf, 1, cb)); + ASSERT_OK(uv_write(req, stream, &buf, 1, cb)); } static void on_alloc(uv_handle_t* handle, @@ -62,22 +62,22 @@ static void on_alloc(uv_handle_t* handle, } static void on_read1(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - ASSERT(nread >= 0); + ASSERT_GE(nread, 0); /* Do write on a half open connection to force WSAECONNABORTED (on Windows) * in the subsequent uv_read_start() */ do_write(stream, on_write); - ASSERT(0 == uv_read_stop(stream)); + ASSERT_OK(uv_read_stop(stream)); - ASSERT(0 == uv_read_start(stream, on_alloc, on_read2)); + ASSERT_OK(uv_read_start(stream, on_alloc, on_read2)); read_cb_called++; } static void on_read2(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - ASSERT(nread < 0); + ASSERT_LT(nread, 0); uv_close((uv_handle_t*)stream, NULL); uv_close((uv_handle_t*)&server, NULL); @@ -86,17 +86,17 @@ static void on_read2(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { } static void on_connection(uv_stream_t* server, int status) { - ASSERT(0 == status); + ASSERT_OK(status); - ASSERT(0 == uv_tcp_init(server->loop, &connection)); + ASSERT_OK(uv_tcp_init(server->loop, &connection)); - ASSERT(0 == uv_accept(server, (uv_stream_t* )&connection)); + ASSERT_OK(uv_accept(server, (uv_stream_t* )&connection)); - ASSERT(0 == uv_read_start((uv_stream_t*)&connection, on_alloc, on_read1)); + ASSERT_OK(uv_read_start((uv_stream_t*)&connection, on_alloc, on_read1)); } static void on_connect(uv_connect_t* req, int status) { - ASSERT(0 == status); + ASSERT_OK(status); do_write((uv_stream_t*)&client, on_write_close_immediately); } @@ -107,29 +107,29 @@ TEST_IMPL(tcp_read_stop_start) { { /* Server */ struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(loop, &server)); + ASSERT_OK(uv_tcp_init(loop, &server)); - ASSERT(0 == uv_tcp_bind(&server, (struct sockaddr*) & addr, 0)); + ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) & addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*)&server, 10, on_connection)); + ASSERT_OK(uv_listen((uv_stream_t*)&server, 10, on_connection)); } { /* Client */ struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(loop, &client)); + ASSERT_OK(uv_tcp_init(loop, &client)); - ASSERT(0 == uv_tcp_connect(&connect_req, &client, - (const struct sockaddr*) & addr, on_connect)); + ASSERT_OK(uv_tcp_connect(&connect_req, &client, + (const struct sockaddr*) & addr, on_connect)); } - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(read_cb_called >= 2); + ASSERT_GE(read_cb_called, 2); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-read-stop.c b/deps/uv/test/test-tcp-read-stop.c index 1754876d4f1263..114c5ec135a82e 100644 --- a/deps/uv/test/test-tcp-read-stop.c +++ b/deps/uv/test/test-tcp-read-stop.c @@ -40,21 +40,21 @@ static void write_cb(uv_write_t* req, int status) { static void timer_cb(uv_timer_t* handle) { uv_buf_t buf = uv_buf_init("PING", 4); - ASSERT(0 == uv_write(&write_req, - (uv_stream_t*) &tcp_handle, - &buf, - 1, - write_cb)); - ASSERT(0 == uv_read_stop((uv_stream_t*) &tcp_handle)); + ASSERT_OK(uv_write(&write_req, + (uv_stream_t*) &tcp_handle, + &buf, + 1, + write_cb)); + ASSERT_OK(uv_read_stop((uv_stream_t*) &tcp_handle)); } static void connect_cb(uv_connect_t* req, int status) { - ASSERT(0 == status); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 50, 0)); - ASSERT(0 == uv_read_start((uv_stream_t*) &tcp_handle, - (uv_alloc_cb) fail_cb, - (uv_read_cb) fail_cb)); + ASSERT_OK(status); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 50, 0)); + ASSERT_OK(uv_read_start((uv_stream_t*) &tcp_handle, + (uv_alloc_cb) fail_cb, + (uv_read_cb) fail_cb)); } @@ -62,14 +62,14 @@ TEST_IMPL(tcp_read_stop) { uv_connect_t connect_req; struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &tcp_handle)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &tcp_handle, - (const struct sockaddr*) &addr, - connect_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &tcp_handle)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &tcp_handle, + (const struct sockaddr*) &addr, + connect_cb)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-rst.c b/deps/uv/test/test-tcp-rst.c index b5d216ce7e8e51..7729f03e607d6a 100644 --- a/deps/uv/test/test-tcp-rst.c +++ b/deps/uv/test/test-tcp-rst.c @@ -31,7 +31,7 @@ static int called_close_cb; static void close_cb(uv_handle_t* handle) { - ASSERT(handle == (uv_handle_t*) &tcp); + ASSERT_PTR_EQ(handle, (uv_handle_t*) &tcp); called_close_cb++; } @@ -48,7 +48,7 @@ static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { ASSERT_EQ(nread, UV_ECONNRESET); int fd; - ASSERT_EQ(0, uv_fileno((uv_handle_t*) t, &fd)); + ASSERT_OK(uv_fileno((uv_handle_t*) t, &fd)); uv_handle_type type = uv_guess_handle(fd); ASSERT_EQ(type, UV_TCP); @@ -58,11 +58,11 @@ static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { static void connect_cb(uv_connect_t *req, int status) { - ASSERT_EQ(status, 0); + ASSERT_OK(status); ASSERT_PTR_EQ(req, &connect_req); /* Start reading from the connection so we receive the RST in uv__read. */ - ASSERT_EQ(0, uv_read_start((uv_stream_t*) &tcp, alloc_cb, read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) &tcp, alloc_cb, read_cb)); /* Write 'QSH' to receive RST from the echo server. */ ASSERT_EQ(qbuf.len, uv_try_write((uv_stream_t*) &tcp, &qbuf, 1)); @@ -86,21 +86,21 @@ TEST_IMPL(tcp_rst) { qbuf.base = "QSH"; qbuf.len = 3; - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); r = uv_tcp_init(uv_default_loop(), &tcp); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &tcp, (const struct sockaddr*) &server_addr, connect_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(called_alloc_cb, 1); - ASSERT_EQ(called_connect_cb, 1); - ASSERT_EQ(called_close_cb, 1); + ASSERT_EQ(1, called_alloc_cb); + ASSERT_EQ(1, called_connect_cb); + ASSERT_EQ(1, called_close_cb); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-shutdown-after-write.c b/deps/uv/test/test-tcp-shutdown-after-write.c index d2401e8fdb36f6..cd8c24dd66b089 100644 --- a/deps/uv/test/test-tcp-shutdown-after-write.c +++ b/deps/uv/test/test-tcp-shutdown-after-write.c @@ -66,10 +66,10 @@ static void timer_cb(uv_timer_t* handle) { buf = uv_buf_init("TEST", 4); r = uv_write(&write_req, (uv_stream_t*)&conn, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_shutdown(&shutdown_req, (uv_stream_t*)&conn, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -80,22 +80,22 @@ static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { static void connect_cb(uv_connect_t* req, int status) { int r; - ASSERT(status == 0); + ASSERT_OK(status); connect_cb_called++; r = uv_read_start((uv_stream_t*)&conn, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); } static void write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); write_cb_called++; } static void shutdown_cb(uv_shutdown_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); shutdown_cb_called++; uv_close((uv_handle_t*)&conn, close_cb); } @@ -106,32 +106,32 @@ TEST_IMPL(tcp_shutdown_after_write) { uv_loop_t* loop; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb, 125, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_init(loop, &conn); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &conn, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(shutdown_cb_called == 1); - ASSERT(conn_close_cb_called == 1); - ASSERT(timer_close_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, conn_close_cb_called); + ASSERT_EQ(1, timer_close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-try-write-error.c b/deps/uv/test/test-tcp-try-write-error.c index 97deccaa0dd7eb..80a23ed73793d6 100644 --- a/deps/uv/test/test-tcp-try-write-error.c +++ b/deps/uv/test/test-tcp-try-write-error.c @@ -49,21 +49,21 @@ static void incoming_close_cb(uv_handle_t* handle) { r = uv_try_write((uv_stream_t*) &client, &buf, 1); fprintf(stderr, "uv_try_write error: %d %s\n", r, uv_strerror(r)); ASSERT(r == UV_EPIPE || r == UV_ECONNABORTED || r == UV_ECONNRESET); - ASSERT(client.write_queue_size == 0); + ASSERT_OK(client.write_queue_size); } static void connect_cb(uv_connect_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); connect_cb_called++; } static void connection_cb(uv_stream_t* tcp, int status) { - ASSERT(status == 0); + ASSERT_OK(status); - ASSERT(0 == uv_tcp_init(tcp->loop, &incoming)); - ASSERT(0 == uv_accept(tcp, (uv_stream_t*) &incoming)); + ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); + ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); connection_cb_called++; uv_close((uv_handle_t*) &incoming, incoming_close_cb); @@ -74,11 +74,11 @@ static void connection_cb(uv_stream_t* tcp, int status) { static void start_server(void) { struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &server)); - ASSERT(0 == uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server, 128, connection_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &server)); + ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb)); } @@ -88,21 +88,21 @@ TEST_IMPL(tcp_try_write_error) { start_server(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &client)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &client, - (struct sockaddr*) &addr, - connect_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client, + (struct sockaddr*) &addr, + connect_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); uv_close((uv_handle_t*) &client, close_cb); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(connect_cb_called == 1); - ASSERT(close_cb_called == 3); - ASSERT(connection_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(3, close_cb_called); + ASSERT_EQ(1, connection_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-try-write.c b/deps/uv/test/test-tcp-try-write.c index 6458857a85c879..afb20ec7df66ae 100644 --- a/deps/uv/test/test-tcp-try-write.c +++ b/deps/uv/test/test-tcp-try-write.c @@ -46,7 +46,7 @@ static void close_cb(uv_handle_t* handle) { static void connect_cb(uv_connect_t* req, int status) { int r; uv_buf_t buf; - ASSERT(status == 0); + ASSERT_OK(status); connect_cb_called++; do { @@ -87,24 +87,24 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { static void connection_cb(uv_stream_t* tcp, int status) { - ASSERT(status == 0); + ASSERT_OK(status); - ASSERT(0 == uv_tcp_init(tcp->loop, &incoming)); - ASSERT(0 == uv_accept(tcp, (uv_stream_t*) &incoming)); + ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); + ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); connection_cb_called++; - ASSERT(0 == uv_read_start((uv_stream_t*) &incoming, alloc_cb, read_cb)); + ASSERT_OK(uv_read_start((uv_stream_t*) &incoming, alloc_cb, read_cb)); } static void start_server(void) { struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &server)); - ASSERT(0 == uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server, 128, connection_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &server)); + ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb)); } @@ -114,21 +114,21 @@ TEST_IMPL(tcp_try_write) { start_server(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &client)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &client, - (struct sockaddr*) &addr, - connect_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client, + (struct sockaddr*) &addr, + connect_cb)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(connect_cb_called == 1); - ASSERT(close_cb_called == 3); - ASSERT(connection_cb_called == 1); - ASSERT(bytes_read == bytes_written); - ASSERT(bytes_written > 0); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(3, close_cb_called); + ASSERT_EQ(1, connection_cb_called); + ASSERT_EQ(bytes_read, bytes_written); + ASSERT_GT(bytes_written, 0); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-unexpected-read.c b/deps/uv/test/test-tcp-unexpected-read.c index e11f77473f4030..aef7a2f75d2242 100644 --- a/deps/uv/test/test-tcp-unexpected-read.c +++ b/deps/uv/test/test-tcp-unexpected-read.c @@ -60,14 +60,14 @@ static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { static void connect_cb(uv_connect_t* req, int status) { - ASSERT(req->handle == (uv_stream_t*) &client_handle); - ASSERT(0 == status); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*) &client_handle); + ASSERT_OK(status); } static void write_cb(uv_write_t* req, int status) { - ASSERT(req->handle == (uv_stream_t*) &peer_handle); - ASSERT(0 == status); + ASSERT_PTR_EQ(req->handle, (uv_stream_t*) &peer_handle); + ASSERT_OK(status); } @@ -76,11 +76,11 @@ static void connection_cb(uv_stream_t* handle, int status) { buf = uv_buf_init("PING", 4); - ASSERT(0 == status); - ASSERT(0 == uv_accept(handle, (uv_stream_t*) &peer_handle)); - ASSERT(0 == uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); - ASSERT(0 == uv_write(&write_req, (uv_stream_t*) &peer_handle, - &buf, 1, write_cb)); + ASSERT_OK(status); + ASSERT_OK(uv_accept(handle, (uv_stream_t*) &peer_handle)); + ASSERT_OK(uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); + ASSERT_OK(uv_write(&write_req, (uv_stream_t*) &peer_handle, + &buf, 1, write_cb)); } @@ -88,29 +88,29 @@ TEST_IMPL(tcp_unexpected_read) { struct sockaddr_in addr; uv_loop_t* loop; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); - ASSERT(0 == uv_timer_init(loop, &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 1000, 0)); - ASSERT(0 == uv_check_init(loop, &check_handle)); - ASSERT(0 == uv_check_start(&check_handle, check_cb)); - ASSERT(0 == uv_tcp_init(loop, &server_handle)); - ASSERT(0 == uv_tcp_init(loop, &client_handle)); - ASSERT(0 == uv_tcp_init(loop, &peer_handle)); - ASSERT(0 == uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &client_handle, - (const struct sockaddr*) &addr, - connect_cb)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_timer_init(loop, &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 1000, 0)); + ASSERT_OK(uv_check_init(loop, &check_handle)); + ASSERT_OK(uv_check_start(&check_handle, check_cb)); + ASSERT_OK(uv_tcp_init(loop, &server_handle)); + ASSERT_OK(uv_tcp_init(loop, &client_handle)); + ASSERT_OK(uv_tcp_init(loop, &peer_handle)); + ASSERT_OK(uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client_handle, + (const struct sockaddr*) &addr, + connect_cb)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); /* This is somewhat inexact but the idea is that the event loop should not * start busy looping when the server sends a message and the client isn't * reading. */ - ASSERT(ticks <= 20); + ASSERT_LE(ticks, 20); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-write-after-connect.c b/deps/uv/test/test-tcp-write-after-connect.c index 4a786995ff1002..63845bc45258a2 100644 --- a/deps/uv/test/test-tcp-write-after-connect.c +++ b/deps/uv/test/test-tcp-write-after-connect.c @@ -32,13 +32,13 @@ uv_buf_t buf = { "HELLO", 4 }; static void write_cb(uv_write_t *req, int status) { - ASSERT(status == UV_ECANCELED); + ASSERT_EQ(status, UV_ECANCELED); uv_close((uv_handle_t*) req->handle, NULL); } static void connect_cb(uv_connect_t *req, int status) { - ASSERT(status == UV_ECONNREFUSED); + ASSERT_EQ(status, UV_ECONNREFUSED); } @@ -49,20 +49,20 @@ TEST_IMPL(tcp_write_after_connect) { #endif struct sockaddr_in sa; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &sa)); - ASSERT(0 == uv_loop_init(&loop)); - ASSERT(0 == uv_tcp_init(&loop, &tcp_client)); - - ASSERT(0 == uv_tcp_connect(&connection_request, - &tcp_client, - (const struct sockaddr *) - &sa, - connect_cb)); - - ASSERT(0 == uv_write(&write_request, - (uv_stream_t *)&tcp_client, - &buf, 1, - write_cb)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &sa)); + ASSERT_OK(uv_loop_init(&loop)); + ASSERT_OK(uv_tcp_init(&loop, &tcp_client)); + + ASSERT_OK(uv_tcp_connect(&connection_request, + &tcp_client, + (const struct sockaddr *) + &sa, + connect_cb)); + + ASSERT_OK(uv_write(&write_request, + (uv_stream_t *)&tcp_client, + &buf, 1, + write_cb)); uv_run(&loop, UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-tcp-write-fail.c b/deps/uv/test/test-tcp-write-fail.c index 2912e7c5068586..530329a3ac63c8 100644 --- a/deps/uv/test/test-tcp-write-fail.c +++ b/deps/uv/test/test-tcp-write-fail.c @@ -41,13 +41,13 @@ static void close_socket(uv_tcp_t* sock) { int r; r = uv_fileno((uv_handle_t*)sock, &fd); - ASSERT(r == 0); + ASSERT_OK(r); #ifdef _WIN32 r = closesocket((uv_os_sock_t)fd); #else r = close(fd); #endif - ASSERT(r == 0); + ASSERT_OK(r); } @@ -60,7 +60,7 @@ static void close_cb(uv_handle_t* handle) { static void write_cb(uv_write_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status != 0); + ASSERT(status); fprintf(stderr, "uv_write error: %s\n", uv_strerror(status)); write_cb_called++; @@ -73,8 +73,8 @@ static void connect_cb(uv_connect_t* req, int status) { uv_stream_t* stream; int r; - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); stream = req->handle; connect_cb_called++; @@ -84,7 +84,7 @@ static void connect_cb(uv_connect_t* req, int status) { buf = uv_buf_init("hello\n", 6); r = uv_write(&write_req, stream, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -93,22 +93,22 @@ TEST_IMPL(tcp_write_fail) { uv_tcp_t client; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, write_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-write-in-a-row.c b/deps/uv/test/test-tcp-write-in-a-row.c index 99f4dee125e1a8..89304eb5a34999 100644 --- a/deps/uv/test/test-tcp-write-in-a-row.c +++ b/deps/uv/test/test-tcp-write-in-a-row.c @@ -45,7 +45,7 @@ static void close_cb(uv_handle_t* handle) { static void write_cb(uv_write_t* w, int status) { /* the small write should finish immediately after the big write */ - ASSERT_EQ(0, uv_stream_get_write_queue_size((uv_stream_t*) &client)); + ASSERT_OK(uv_stream_get_write_queue_size((uv_stream_t*) &client)); write_cb_called++; @@ -62,13 +62,13 @@ static void connect_cb(uv_connect_t* _, int status) { uv_buf_t buf; size_t write_queue_size0, write_queue_size1; - ASSERT_EQ(0, status); + ASSERT_OK(status); connect_cb_called++; /* fire a big write */ buf = uv_buf_init(data, sizeof(data)); r = uv_write(&small_write, (uv_stream_t*) &client, &buf, 1, write_cb); - ASSERT_EQ(0, r); + ASSERT_OK(r); /* check that the write process gets stuck */ write_queue_size0 = uv_stream_get_write_queue_size((uv_stream_t*) &client); @@ -77,7 +77,7 @@ static void connect_cb(uv_connect_t* _, int status) { /* fire a small write, which should be queued */ buf = uv_buf_init("A", 1); r = uv_write(&big_write, (uv_stream_t*) &client, &buf, 1, write_cb); - ASSERT_EQ(0, r); + ASSERT_OK(r); write_queue_size1 = uv_stream_get_write_queue_size((uv_stream_t*) &client); ASSERT_EQ(write_queue_size1, write_queue_size0 + 1); @@ -93,22 +93,22 @@ static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) { static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) {} static void connection_cb(uv_stream_t* tcp, int status) { - ASSERT_EQ(0, status); + ASSERT_OK(status); connection_cb_called++; - ASSERT_EQ(0, uv_tcp_init(tcp->loop, &incoming)); - ASSERT_EQ(0, uv_accept(tcp, (uv_stream_t*) &incoming)); - ASSERT_EQ(0, uv_read_start((uv_stream_t*) &incoming, alloc_cb, read_cb)); + ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); + ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); + ASSERT_OK(uv_read_start((uv_stream_t*) &incoming, alloc_cb, read_cb)); } static void start_server(void) { struct sockaddr_in addr; - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - ASSERT_EQ(0, uv_tcp_init(uv_default_loop(), &server)); - ASSERT_EQ(0, uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); - ASSERT_EQ(0, uv_listen((uv_stream_t*) &server, 128, connection_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &server)); + ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb)); } TEST_IMPL(tcp_write_in_a_row) { @@ -121,15 +121,15 @@ TEST_IMPL(tcp_write_in_a_row) { start_server(); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT_EQ(0, uv_tcp_init(uv_default_loop(), &client)); - ASSERT_EQ(0, uv_tcp_connect(&connect_req, - &client, - (struct sockaddr*) &addr, - connect_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client, + (struct sockaddr*) &addr, + connect_cb)); - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); ASSERT_EQ(1, connect_cb_called); ASSERT_EQ(3, close_cb_called); diff --git a/deps/uv/test/test-tcp-write-queue-order.c b/deps/uv/test/test-tcp-write-queue-order.c index 7562c41d3de208..e838c88a6a2b55 100644 --- a/deps/uv/test/test-tcp-write-queue-order.c +++ b/deps/uv/test/test-tcp-write-queue-order.c @@ -67,7 +67,7 @@ static void connect_cb(uv_connect_t* req, int status) { int i; uv_buf_t buf; - ASSERT(status == 0); + ASSERT_OK(status); connect_cb_called++; buf = uv_buf_init(base, sizeof(base)); @@ -78,19 +78,19 @@ static void connect_cb(uv_connect_t* req, int status) { &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } } static void connection_cb(uv_stream_t* tcp, int status) { - ASSERT(status == 0); + ASSERT_OK(status); - ASSERT(0 == uv_tcp_init(tcp->loop, &incoming)); - ASSERT(0 == uv_accept(tcp, (uv_stream_t*) &incoming)); + ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); + ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); - ASSERT(0 == uv_timer_init(uv_default_loop(), &timer)); - ASSERT(0 == uv_timer_start(&timer, timer_cb, 1000, 0)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); + ASSERT_OK(uv_timer_start(&timer, timer_cb, 1000, 0)); connection_cb_called++; } @@ -99,11 +99,11 @@ static void connection_cb(uv_stream_t* tcp, int status) { static void start_server(void) { struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - ASSERT(0 == uv_tcp_init(uv_default_loop(), &server)); - ASSERT(0 == uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); - ASSERT(0 == uv_listen((uv_stream_t*) &server, 128, connection_cb)); + ASSERT_OK(uv_tcp_init(uv_default_loop(), &server)); + ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb)); } @@ -114,25 +114,25 @@ TEST_IMPL(tcp_write_queue_order) { start_server(); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - - ASSERT(0 == uv_tcp_init(uv_default_loop(), &client)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &client, - (struct sockaddr*) &addr, - connect_cb)); - ASSERT(0 == uv_send_buffer_size((uv_handle_t*) &client, &buffer_size)); - - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - - ASSERT(connect_cb_called == 1); - ASSERT(connection_cb_called == 1); - ASSERT(write_callbacks > 0); - ASSERT(write_cancelled_callbacks > 0); - ASSERT(write_callbacks + - write_error_callbacks + - write_cancelled_callbacks == REQ_COUNT); - ASSERT(close_cb_called == 3); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + + ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_tcp_connect(&connect_req, + &client, + (struct sockaddr*) &addr, + connect_cb)); + ASSERT_OK(uv_send_buffer_size((uv_handle_t*) &client, &buffer_size)); + + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(1, connection_cb_called); + ASSERT_GT(write_callbacks, 0); + ASSERT_GT(write_cancelled_callbacks, 0); + ASSERT_EQ(write_callbacks + + write_error_callbacks + + write_cancelled_callbacks, REQ_COUNT); + ASSERT_EQ(3, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tcp-write-to-half-open-connection.c b/deps/uv/test/test-tcp-write-to-half-open-connection.c index 8978211d2b7663..2b2f5644e17969 100644 --- a/deps/uv/test/test-tcp-write-to-half-open-connection.c +++ b/deps/uv/test/test-tcp-write-to-half-open-connection.c @@ -45,23 +45,23 @@ static void connection_cb(uv_stream_t* server, int status) { int r; uv_buf_t buf; - ASSERT(server == (uv_stream_t*)&tcp_server); - ASSERT(status == 0); + ASSERT_PTR_EQ(server, (uv_stream_t*)&tcp_server); + ASSERT_OK(status); r = uv_tcp_init(server->loop, &tcp_peer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_accept(server, (uv_stream_t*)&tcp_peer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*)&tcp_peer, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); buf.base = "hello\n"; buf.len = 6; r = uv_write(&write_req, (uv_stream_t*)&tcp_peer, &buf, 1, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -88,8 +88,8 @@ static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { static void connect_cb(uv_connect_t* req, int status) { - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); /* Close the client. */ uv_close((uv_handle_t*)&tcp_client, NULL); @@ -97,7 +97,7 @@ static void connect_cb(uv_connect_t* req, int status) { static void write_cb(uv_write_t* req, int status) { - ASSERT(status == 0); + ASSERT_OK(status); write_cb_called++; } @@ -107,34 +107,34 @@ TEST_IMPL(tcp_write_to_half_open_connection) { uv_loop_t* loop; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); loop = uv_default_loop(); ASSERT_NOT_NULL(loop); r = uv_tcp_init(loop, &tcp_server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_listen((uv_stream_t*)&tcp_server, 1, connection_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_init(loop, &tcp_client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &tcp_client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(write_cb_called > 0); - ASSERT(read_cb_called > 0); + ASSERT_GT(write_cb_called, 0); + ASSERT_GT(read_cb_called, 0); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-tcp-writealot.c b/deps/uv/test/test-tcp-writealot.c index 3c6c149e92c590..ebafb1796327d3 100644 --- a/deps/uv/test/test-tcp-writealot.c +++ b/deps/uv/test/test-tcp-writealot.c @@ -65,19 +65,19 @@ static void close_cb(uv_handle_t* handle) { static void shutdown_cb(uv_shutdown_t* req, int status) { uv_tcp_t* tcp; - ASSERT(req == &shutdown_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &shutdown_req); + ASSERT_OK(status); tcp = (uv_tcp_t*)(req->handle); /* The write buffer should be empty by now. */ - ASSERT(tcp->write_queue_size == 0); + ASSERT_OK(tcp->write_queue_size); /* Now we wait for the EOF */ shutdown_cb_called++; /* We should have had all the writes called already. */ - ASSERT(write_cb_called == WRITES); + ASSERT_EQ(write_cb_called, WRITES); } @@ -88,7 +88,7 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { bytes_received_done += nread; } else { - ASSERT(nread == UV_EOF); + ASSERT_EQ(nread, UV_EOF); printf("GOT EOF\n"); uv_close((uv_handle_t*)tcp, close_cb); } @@ -115,8 +115,8 @@ static void connect_cb(uv_connect_t* req, int status) { uv_stream_t* stream; int i, j, r; - ASSERT(req == &connect_req); - ASSERT(status == 0); + ASSERT_PTR_EQ(req, &connect_req); + ASSERT_OK(status); stream = req->handle; connect_cb_called++; @@ -131,16 +131,16 @@ static void connect_cb(uv_connect_t* req, int status) { } r = uv_write(write_req, stream, send_bufs, CHUNKS_PER_WRITE, write_cb); - ASSERT(r == 0); + ASSERT_OK(r); } /* Shutdown on drain. */ r = uv_shutdown(&shutdown_req, stream, shutdown_cb); - ASSERT(r == 0); + ASSERT_OK(r); /* Start reading */ r = uv_read_start(stream, alloc_cb, read_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -153,29 +153,29 @@ TEST_IMPL(tcp_writealot) { RETURN_SKIP("Test is too slow to run under ThreadSanitizer"); #endif - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); send_buffer = calloc(1, TOTAL_BYTES); ASSERT_NOT_NULL(send_buffer); r = uv_tcp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tcp_connect(&connect_req, &client, (const struct sockaddr*) &addr, connect_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(shutdown_cb_called == 1); - ASSERT(connect_cb_called == 1); - ASSERT(write_cb_called == WRITES); - ASSERT(close_cb_called == 1); - ASSERT(bytes_sent == TOTAL_BYTES); - ASSERT(bytes_sent_done == TOTAL_BYTES); - ASSERT(bytes_received_done == TOTAL_BYTES); + ASSERT_EQ(1, shutdown_cb_called); + ASSERT_EQ(1, connect_cb_called); + ASSERT_EQ(write_cb_called, WRITES); + ASSERT_EQ(1, close_cb_called); + ASSERT_EQ(bytes_sent, TOTAL_BYTES); + ASSERT_EQ(bytes_sent_done, TOTAL_BYTES); + ASSERT_EQ(bytes_received_done, TOTAL_BYTES); free(send_buffer); diff --git a/deps/uv/test/test-thread-affinity.c b/deps/uv/test/test-thread-affinity.c index 2c9b696ec7a5d2..d21487d9937756 100644 --- a/deps/uv/test/test-thread-affinity.c +++ b/deps/uv/test/test-thread-affinity.c @@ -1,4 +1,22 @@ /* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. */ #include "uv.h" @@ -16,12 +34,12 @@ static void check_affinity(void* arg) { cpumask = (char*)arg; cpumasksize = uv_cpumask_size(); - ASSERT(cpumasksize > 0); + ASSERT_GT(cpumasksize, 0); tid = uv_thread_self(); r = uv_thread_setaffinity(&tid, cpumask, NULL, cpumasksize); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_thread_setaffinity(&tid, cpumask + cpumasksize, cpumask, cpumasksize); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -45,13 +63,13 @@ TEST_IMPL(thread_affinity) { threads[0] = uv_thread_self(); #endif cpumasksize = uv_cpumask_size(); - ASSERT(cpumasksize > 0); + ASSERT_GT(cpumasksize, 0); cpumask = calloc(4 * cpumasksize, 1); ASSERT(cpumask); r = uv_thread_getaffinity(&threads[0], cpumask, cpumasksize); - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(cpumask[0] && "test must be run with cpu 0 affinity"); ncpus = 0; while (cpumask[++ncpus]) { } @@ -82,24 +100,24 @@ TEST_IMPL(thread_affinity) { } #endif - ASSERT(0 == uv_thread_create(threads + 1, - check_affinity, - &cpumask[t1first])); - ASSERT(0 == uv_thread_create(threads + 2, - check_affinity, - &cpumask[t2first])); - ASSERT(0 == uv_thread_join(threads + 1)); - ASSERT(0 == uv_thread_join(threads + 2)); + ASSERT_OK(uv_thread_create(threads + 1, + check_affinity, + &cpumask[t1first])); + ASSERT_OK(uv_thread_create(threads + 2, + check_affinity, + &cpumask[t2first])); + ASSERT_OK(uv_thread_join(threads + 1)); + ASSERT_OK(uv_thread_join(threads + 2)); ASSERT(cpumask[t1first + 0] == (ncpus == 1)); ASSERT(cpumask[t1first + 1] == (ncpus >= 2)); - ASSERT(cpumask[t1first + 2] == 0); + ASSERT_OK(cpumask[t1first + 2]); ASSERT(cpumask[t1first + 3] == (ncpus >= 4)); - ASSERT(cpumask[t2first + 0] == 1); - ASSERT(cpumask[t2first + 1] == 0); + ASSERT_EQ(1, cpumask[t2first + 0]); + ASSERT_OK(cpumask[t2first + 1]); ASSERT(cpumask[t2first + 2] == (ncpus >= 3)); - ASSERT(cpumask[t2first + 3] == 0); + ASSERT_OK(cpumask[t2first + 3]); c = uv_thread_getcpu(); ASSERT_GE(c, 0); @@ -107,16 +125,16 @@ TEST_IMPL(thread_affinity) { memset(cpumask, 0, cpumasksize); cpumask[c] = 1; r = uv_thread_setaffinity(&threads[0], cpumask, NULL, cpumasksize); - ASSERT_EQ(r, 0); + ASSERT_OK(r); memset(cpumask, 0, cpumasksize); r = uv_thread_getaffinity(&threads[0], cpumask, cpumasksize); - ASSERT_EQ(r, 0); + ASSERT_OK(r); for (i = 0; i < cpumasksize; i++) { if (i == c) ASSERT_EQ(1, cpumask[i]); else - ASSERT_EQ(0, cpumask[i]); + ASSERT_OK(cpumask[i]); } free(cpumask); @@ -129,7 +147,7 @@ TEST_IMPL(thread_affinity) { TEST_IMPL(thread_affinity) { int cpumasksize; cpumasksize = uv_cpumask_size(); - ASSERT(cpumasksize == UV_ENOTSUP); + ASSERT_EQ(cpumasksize, UV_ENOTSUP); return 0; } diff --git a/deps/uv/test/test-thread-equal.c b/deps/uv/test/test-thread-equal.c index f7bde71b3d900e..3b2ba8df4434b5 100644 --- a/deps/uv/test/test-thread-equal.c +++ b/deps/uv/test/test-thread-equal.c @@ -31,7 +31,7 @@ static void check_thread(void* arg) { #ifdef _WIN32 ASSERT_NOT_NULL(self_id); #endif - ASSERT(uv_thread_equal(&main_thread_id, &self_id) == 0); + ASSERT_OK(uv_thread_equal(&main_thread_id, &self_id)); *thread_id = uv_thread_self(); } @@ -41,11 +41,11 @@ TEST_IMPL(thread_equal) { #ifdef _WIN32 ASSERT_NOT_NULL(main_thread_id); #endif - ASSERT(0 != uv_thread_equal(&main_thread_id, &main_thread_id)); - ASSERT(0 == uv_thread_create(threads + 0, check_thread, subthreads + 0)); - ASSERT(0 == uv_thread_create(threads + 1, check_thread, subthreads + 1)); - ASSERT(0 == uv_thread_join(threads + 0)); - ASSERT(0 == uv_thread_join(threads + 1)); - ASSERT(0 == uv_thread_equal(subthreads + 0, subthreads + 1)); + ASSERT_NE(0, uv_thread_equal(&main_thread_id, &main_thread_id)); + ASSERT_OK(uv_thread_create(threads + 0, check_thread, subthreads + 0)); + ASSERT_OK(uv_thread_create(threads + 1, check_thread, subthreads + 1)); + ASSERT_OK(uv_thread_join(threads + 0)); + ASSERT_OK(uv_thread_join(threads + 1)); + ASSERT_OK(uv_thread_equal(subthreads + 0, subthreads + 1)); return 0; } diff --git a/deps/uv/test/test-thread.c b/deps/uv/test/test-thread.c index 82f80833ab1690..d0094e304435bb 100644 --- a/deps/uv/test/test-thread.c +++ b/deps/uv/test/test-thread.c @@ -71,7 +71,7 @@ static void getaddrinfo_do(struct getaddrinfo_req* req) { "localhost", NULL, NULL); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -80,7 +80,7 @@ static void getaddrinfo_cb(uv_getaddrinfo_t* handle, struct addrinfo* res) { struct getaddrinfo_req* req; - ASSERT(status == 0); + ASSERT_OK(status); req = container_of(handle, struct getaddrinfo_req, handle); uv_freeaddrinfo(res); @@ -94,7 +94,7 @@ static void fs_do(struct fs_req* req) { int r; r = uv_fs_stat(req->loop, &req->handle, ".", fs_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -115,7 +115,7 @@ static void do_work(void* arg) { size_t i; struct test_thread* thread = arg; - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); for (i = 0; i < ARRAY_SIZE(getaddrinfo_reqs); i++) { struct getaddrinfo_req* req = getaddrinfo_reqs + i; @@ -131,14 +131,14 @@ static void do_work(void* arg) { fs_do(req); } - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); - ASSERT(0 == uv_loop_close(&loop)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_loop_close(&loop)); thread->thread_called = 1; } static void thread_entry(void* arg) { - ASSERT(arg == (void *) 42); + ASSERT_PTR_EQ(arg, (void *) 42); thread_called++; } @@ -148,12 +148,12 @@ TEST_IMPL(thread_create) { int r; r = uv_thread_create(&tid, thread_entry, (void *) 42); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_thread_join(&tid); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(thread_called == 1); + ASSERT_EQ(1, thread_called); return 0; } @@ -176,13 +176,13 @@ TEST_IMPL(threadpool_multiple_event_loops) { for (i = 0; i < ARRAY_SIZE(threads); i++) { r = uv_thread_create(&threads[i].thread_id, do_work, &threads[i]); - ASSERT(r == 0); + ASSERT_OK(r); } for (i = 0; i < ARRAY_SIZE(threads); i++) { r = uv_thread_join(&threads[i].thread_id); - ASSERT(r == 0); - ASSERT(threads[i].thread_called == 1); + ASSERT_OK(r); + ASSERT_EQ(1, threads[i].thread_called); } return 0; @@ -192,7 +192,7 @@ TEST_IMPL(threadpool_multiple_event_loops) { static void tls_thread(void* arg) { ASSERT_NULL(uv_key_get(&tls_key)); uv_key_set(&tls_key, arg); - ASSERT(arg == uv_key_get(&tls_key)); + ASSERT_PTR_EQ(arg, uv_key_get(&tls_key)); uv_key_set(&tls_key, NULL); ASSERT_NULL(uv_key_get(&tls_key)); } @@ -201,14 +201,14 @@ static void tls_thread(void* arg) { TEST_IMPL(thread_local_storage) { char name[] = "main"; uv_thread_t threads[2]; - ASSERT(0 == uv_key_create(&tls_key)); + ASSERT_OK(uv_key_create(&tls_key)); ASSERT_NULL(uv_key_get(&tls_key)); uv_key_set(&tls_key, name); - ASSERT(name == uv_key_get(&tls_key)); - ASSERT(0 == uv_thread_create(threads + 0, tls_thread, threads + 0)); - ASSERT(0 == uv_thread_create(threads + 1, tls_thread, threads + 1)); - ASSERT(0 == uv_thread_join(threads + 0)); - ASSERT(0 == uv_thread_join(threads + 1)); + ASSERT_PTR_EQ(name, uv_key_get(&tls_key)); + ASSERT_OK(uv_thread_create(threads + 0, tls_thread, threads + 0)); + ASSERT_OK(uv_thread_create(threads + 1, tls_thread, threads + 1)); + ASSERT_OK(uv_thread_join(threads + 0)); + ASSERT_OK(uv_thread_join(threads + 1)); uv_key_delete(&tls_key); return 0; } @@ -222,30 +222,30 @@ static void thread_check_stack(void* arg) { * on MacOS. */ if (expected == 0) expected = 512 * 1024; - ASSERT(pthread_get_stacksize_np(pthread_self()) >= expected); + ASSERT_GE(pthread_get_stacksize_np(pthread_self()), expected); #elif defined(__linux__) && defined(__GLIBC__) size_t expected; struct rlimit lim; size_t stack_size; pthread_attr_t attr; - ASSERT(0 == getrlimit(RLIMIT_STACK, &lim)); + ASSERT_OK(getrlimit(RLIMIT_STACK, &lim)); if (lim.rlim_cur == RLIM_INFINITY) lim.rlim_cur = 2 << 20; /* glibc default. */ - ASSERT(0 == pthread_getattr_np(pthread_self(), &attr)); - ASSERT(0 == pthread_attr_getstacksize(&attr, &stack_size)); + ASSERT_OK(pthread_getattr_np(pthread_self(), &attr)); + ASSERT_OK(pthread_attr_getstacksize(&attr, &stack_size)); expected = arg == NULL ? 0 : ((uv_thread_options_t*)arg)->stack_size; if (expected == 0) expected = (size_t)lim.rlim_cur; - ASSERT(stack_size >= expected); - ASSERT(0 == pthread_attr_destroy(&attr)); + ASSERT_GE(stack_size, expected); + ASSERT_OK(pthread_attr_destroy(&attr)); #endif } TEST_IMPL(thread_stack_size) { uv_thread_t thread; - ASSERT(0 == uv_thread_create(&thread, thread_check_stack, NULL)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create(&thread, thread_check_stack, NULL)); + ASSERT_OK(uv_thread_join(&thread)); return 0; } @@ -255,42 +255,42 @@ TEST_IMPL(thread_stack_size_explicit) { options.flags = UV_THREAD_HAS_STACK_SIZE; options.stack_size = 1024 * 1024; - ASSERT(0 == uv_thread_create_ex(&thread, &options, - thread_check_stack, &options)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT_OK(uv_thread_join(&thread)); options.stack_size = 8 * 1024 * 1024; /* larger than most default os sizes */ - ASSERT(0 == uv_thread_create_ex(&thread, &options, - thread_check_stack, &options)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT_OK(uv_thread_join(&thread)); options.stack_size = 0; - ASSERT(0 == uv_thread_create_ex(&thread, &options, - thread_check_stack, &options)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT_OK(uv_thread_join(&thread)); options.stack_size = 42; - ASSERT(0 == uv_thread_create_ex(&thread, &options, - thread_check_stack, &options)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT_OK(uv_thread_join(&thread)); #ifdef PTHREAD_STACK_MIN options.stack_size = PTHREAD_STACK_MIN - 42; /* unaligned size */ - ASSERT(0 == uv_thread_create_ex(&thread, &options, - thread_check_stack, &options)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT_OK(uv_thread_join(&thread)); options.stack_size = PTHREAD_STACK_MIN / 2 - 42; /* unaligned size */ - ASSERT(0 == uv_thread_create_ex(&thread, &options, - thread_check_stack, &options)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT_OK(uv_thread_join(&thread)); #endif /* unaligned size, should be larger than PTHREAD_STACK_MIN */ options.stack_size = 1234567; - ASSERT(0 == uv_thread_create_ex(&thread, &options, - thread_check_stack, &options)); - ASSERT(0 == uv_thread_join(&thread)); + ASSERT_OK(uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT_OK(uv_thread_join(&thread)); return 0; } diff --git a/deps/uv/test/test-threadpool-cancel.c b/deps/uv/test/test-threadpool-cancel.c index fed0b07a3ca960..b758ac4f6b66ec 100644 --- a/deps/uv/test/test-threadpool-cancel.c +++ b/deps/uv/test/test-threadpool-cancel.c @@ -73,8 +73,8 @@ static void saturate_threadpool(void) { loop = uv_default_loop(); for (i = 0; i < ARRAY_SIZE(pause_reqs); i += 1) { - ASSERT(0 == uv_sem_init(pause_sems + i, 0)); - ASSERT(0 == uv_queue_work(loop, pause_reqs + i, work_cb, done_cb)); + ASSERT_OK(uv_sem_init(pause_sems + i, 0)); + ASSERT_OK(uv_queue_work(loop, pause_reqs + i, work_cb, done_cb)); } } @@ -119,7 +119,8 @@ static int known_broken(uv_req_t* req) { static void fs_cb(uv_fs_t* req) { - ASSERT(known_broken((uv_req_t*) req) || req->result == UV_ECANCELED); + ASSERT_NE(known_broken((uv_req_t*) req) || \ + req->result == UV_ECANCELED, 0); uv_fs_req_cleanup(req); fs_cb_called++; } @@ -128,7 +129,7 @@ static void fs_cb(uv_fs_t* req) { static void getaddrinfo_cb(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { - ASSERT(status == UV_EAI_CANCELED); + ASSERT_EQ(status, UV_EAI_CANCELED); ASSERT_NULL(res); uv_freeaddrinfo(res); /* Should not crash. */ } @@ -138,7 +139,7 @@ static void getnameinfo_cb(uv_getnameinfo_t* handle, int status, const char* hostname, const char* service) { - ASSERT(status == UV_EAI_CANCELED); + ASSERT_EQ(status, UV_EAI_CANCELED); ASSERT_NULL(hostname); ASSERT_NULL(service); } @@ -150,7 +151,7 @@ static void work2_cb(uv_work_t* req) { static void done2_cb(uv_work_t* req, int status) { - ASSERT(status == UV_ECANCELED); + ASSERT_EQ(status, UV_ECANCELED); done2_cb_called++; } @@ -174,7 +175,7 @@ static void timer_cb(uv_timer_t* handle) { static void nop_done_cb(uv_work_t* req, int status) { - ASSERT(status == UV_ECANCELED); + ASSERT_EQ(status, UV_ECANCELED); done_cb_called++; } @@ -184,9 +185,9 @@ static void nop_random_cb(uv_random_t* req, int status, void* buf, size_t len) { ri = container_of(req, struct random_info, random_req); - ASSERT(status == UV_ECANCELED); - ASSERT(buf == (void*) ri->buf); - ASSERT(len == sizeof(ri->buf)); + ASSERT_EQ(status, UV_ECANCELED); + ASSERT_PTR_EQ(buf, (void*) ri->buf); + ASSERT_EQ(len, sizeof(ri->buf)); done_cb_called++; } @@ -204,21 +205,21 @@ TEST_IMPL(threadpool_cancel_getaddrinfo) { saturate_threadpool(); r = uv_getaddrinfo(loop, reqs + 0, getaddrinfo_cb, "fail", NULL, NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getaddrinfo(loop, reqs + 1, getaddrinfo_cb, NULL, "fail", NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getaddrinfo(loop, reqs + 2, getaddrinfo_cb, "fail", "fail", NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getaddrinfo(loop, reqs + 3, getaddrinfo_cb, "fail", NULL, &hints); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_timer_init(loop, &ci.timer_handle)); - ASSERT(0 == uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == timer_cb_called); + ASSERT_OK(uv_timer_init(loop, &ci.timer_handle)); + ASSERT_OK(uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, timer_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -233,28 +234,28 @@ TEST_IMPL(threadpool_cancel_getnameinfo) { int r; r = uv_ip4_addr("127.0.0.1", 80, &addr4); - ASSERT(r == 0); + ASSERT_OK(r); INIT_CANCEL_INFO(&ci, reqs); loop = uv_default_loop(); saturate_threadpool(); r = uv_getnameinfo(loop, reqs + 0, getnameinfo_cb, (const struct sockaddr*)&addr4, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getnameinfo(loop, reqs + 1, getnameinfo_cb, (const struct sockaddr*)&addr4, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getnameinfo(loop, reqs + 2, getnameinfo_cb, (const struct sockaddr*)&addr4, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_getnameinfo(loop, reqs + 3, getnameinfo_cb, (const struct sockaddr*)&addr4, 0); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_timer_init(loop, &ci.timer_handle)); - ASSERT(0 == uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == timer_cb_called); + ASSERT_OK(uv_timer_init(loop, &ci.timer_handle)); + ASSERT_OK(uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, timer_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -267,17 +268,17 @@ TEST_IMPL(threadpool_cancel_random) { saturate_threadpool(); loop = uv_default_loop(); - ASSERT(0 == uv_random(loop, - &req.random_req, - &req.buf, - sizeof(req.buf), - 0, - nop_random_cb)); - ASSERT(0 == uv_cancel((uv_req_t*) &req)); - ASSERT(0 == done_cb_called); + ASSERT_OK(uv_random(loop, + &req.random_req, + &req.buf, + sizeof(req.buf), + 0, + nop_random_cb)); + ASSERT_OK(uv_cancel((uv_req_t*) &req)); + ASSERT_OK(done_cb_called); unblock_threadpool(); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == done_cb_called); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, done_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -295,13 +296,13 @@ TEST_IMPL(threadpool_cancel_work) { saturate_threadpool(); for (i = 0; i < ARRAY_SIZE(reqs); i++) - ASSERT(0 == uv_queue_work(loop, reqs + i, work2_cb, done2_cb)); + ASSERT_OK(uv_queue_work(loop, reqs + i, work2_cb, done2_cb)); - ASSERT(0 == uv_timer_init(loop, &ci.timer_handle)); - ASSERT(0 == uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == timer_cb_called); - ASSERT(ARRAY_SIZE(reqs) == done2_cb_called); + ASSERT_OK(uv_timer_init(loop, &ci.timer_handle)); + ASSERT_OK(uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, timer_cb_called); + ASSERT_EQ(ARRAY_SIZE(reqs), done2_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -322,39 +323,39 @@ TEST_IMPL(threadpool_cancel_fs) { /* Needs to match ARRAY_SIZE(fs_reqs). */ n = 0; - ASSERT(0 == uv_fs_chmod(loop, reqs + n++, "/", 0, fs_cb)); - ASSERT(0 == uv_fs_chown(loop, reqs + n++, "/", 0, 0, fs_cb)); - ASSERT(0 == uv_fs_close(loop, reqs + n++, 0, fs_cb)); - ASSERT(0 == uv_fs_fchmod(loop, reqs + n++, 0, 0, fs_cb)); - ASSERT(0 == uv_fs_fchown(loop, reqs + n++, 0, 0, 0, fs_cb)); - ASSERT(0 == uv_fs_fdatasync(loop, reqs + n++, 0, fs_cb)); - ASSERT(0 == uv_fs_fstat(loop, reqs + n++, 0, fs_cb)); - ASSERT(0 == uv_fs_fsync(loop, reqs + n++, 0, fs_cb)); - ASSERT(0 == uv_fs_ftruncate(loop, reqs + n++, 0, 0, fs_cb)); - ASSERT(0 == uv_fs_futime(loop, reqs + n++, 0, 0, 0, fs_cb)); - ASSERT(0 == uv_fs_link(loop, reqs + n++, "/", "/", fs_cb)); - ASSERT(0 == uv_fs_lstat(loop, reqs + n++, "/", fs_cb)); - ASSERT(0 == uv_fs_mkdir(loop, reqs + n++, "/", 0, fs_cb)); - ASSERT(0 == uv_fs_open(loop, reqs + n++, "/", 0, 0, fs_cb)); - ASSERT(0 == uv_fs_read(loop, reqs + n++, -1, &iov, 1, 0, fs_cb)); - ASSERT(0 == uv_fs_scandir(loop, reqs + n++, "/", 0, fs_cb)); - ASSERT(0 == uv_fs_readlink(loop, reqs + n++, "/", fs_cb)); - ASSERT(0 == uv_fs_realpath(loop, reqs + n++, "/", fs_cb)); - ASSERT(0 == uv_fs_rename(loop, reqs + n++, "/", "/", fs_cb)); - ASSERT(0 == uv_fs_mkdir(loop, reqs + n++, "/", 0, fs_cb)); - ASSERT(0 == uv_fs_sendfile(loop, reqs + n++, 0, 0, 0, 0, fs_cb)); - ASSERT(0 == uv_fs_stat(loop, reqs + n++, "/", fs_cb)); - ASSERT(0 == uv_fs_symlink(loop, reqs + n++, "/", "/", 0, fs_cb)); - ASSERT(0 == uv_fs_unlink(loop, reqs + n++, "/", fs_cb)); - ASSERT(0 == uv_fs_utime(loop, reqs + n++, "/", 0, 0, fs_cb)); - ASSERT(0 == uv_fs_write(loop, reqs + n++, -1, &iov, 1, 0, fs_cb)); - ASSERT(n == ARRAY_SIZE(reqs)); - - ASSERT(0 == uv_timer_init(loop, &ci.timer_handle)); - ASSERT(0 == uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(n == fs_cb_called); - ASSERT(1 == timer_cb_called); + ASSERT_OK(uv_fs_chmod(loop, reqs + n++, "/", 0, fs_cb)); + ASSERT_OK(uv_fs_chown(loop, reqs + n++, "/", 0, 0, fs_cb)); + ASSERT_OK(uv_fs_close(loop, reqs + n++, 0, fs_cb)); + ASSERT_OK(uv_fs_fchmod(loop, reqs + n++, 0, 0, fs_cb)); + ASSERT_OK(uv_fs_fchown(loop, reqs + n++, 0, 0, 0, fs_cb)); + ASSERT_OK(uv_fs_fdatasync(loop, reqs + n++, 0, fs_cb)); + ASSERT_OK(uv_fs_fstat(loop, reqs + n++, 0, fs_cb)); + ASSERT_OK(uv_fs_fsync(loop, reqs + n++, 0, fs_cb)); + ASSERT_OK(uv_fs_ftruncate(loop, reqs + n++, 0, 0, fs_cb)); + ASSERT_OK(uv_fs_futime(loop, reqs + n++, 0, 0, 0, fs_cb)); + ASSERT_OK(uv_fs_link(loop, reqs + n++, "/", "/", fs_cb)); + ASSERT_OK(uv_fs_lstat(loop, reqs + n++, "/", fs_cb)); + ASSERT_OK(uv_fs_mkdir(loop, reqs + n++, "/", 0, fs_cb)); + ASSERT_OK(uv_fs_open(loop, reqs + n++, "/", 0, 0, fs_cb)); + ASSERT_OK(uv_fs_read(loop, reqs + n++, -1, &iov, 1, 0, fs_cb)); + ASSERT_OK(uv_fs_scandir(loop, reqs + n++, "/", 0, fs_cb)); + ASSERT_OK(uv_fs_readlink(loop, reqs + n++, "/", fs_cb)); + ASSERT_OK(uv_fs_realpath(loop, reqs + n++, "/", fs_cb)); + ASSERT_OK(uv_fs_rename(loop, reqs + n++, "/", "/", fs_cb)); + ASSERT_OK(uv_fs_mkdir(loop, reqs + n++, "/", 0, fs_cb)); + ASSERT_OK(uv_fs_sendfile(loop, reqs + n++, 0, 0, 0, 0, fs_cb)); + ASSERT_OK(uv_fs_stat(loop, reqs + n++, "/", fs_cb)); + ASSERT_OK(uv_fs_symlink(loop, reqs + n++, "/", "/", 0, fs_cb)); + ASSERT_OK(uv_fs_unlink(loop, reqs + n++, "/", fs_cb)); + ASSERT_OK(uv_fs_utime(loop, reqs + n++, "/", 0, 0, fs_cb)); + ASSERT_OK(uv_fs_write(loop, reqs + n++, -1, &iov, 1, 0, fs_cb)); + ASSERT_EQ(n, ARRAY_SIZE(reqs)); + + ASSERT_OK(uv_timer_init(loop, &ci.timer_handle)); + ASSERT_OK(uv_timer_start(&ci.timer_handle, timer_cb, 10, 0)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(n, fs_cb_called); + ASSERT_EQ(1, timer_cb_called); MAKE_VALGRIND_HAPPY(loop); @@ -368,12 +369,12 @@ TEST_IMPL(threadpool_cancel_single) { saturate_threadpool(); loop = uv_default_loop(); - ASSERT(0 == uv_queue_work(loop, &req, (uv_work_cb) abort, nop_done_cb)); - ASSERT(0 == uv_cancel((uv_req_t*) &req)); - ASSERT(0 == done_cb_called); + ASSERT_OK(uv_queue_work(loop, &req, (uv_work_cb) abort, nop_done_cb)); + ASSERT_OK(uv_cancel((uv_req_t*) &req)); + ASSERT_OK(done_cb_called); unblock_threadpool(); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); - ASSERT(1 == done_cb_called); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_EQ(1, done_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -404,7 +405,7 @@ TEST_IMPL(threadpool_cancel_when_busy) { ASSERT_EQ(uv_cancel((uv_req_t*) &req), UV_EBUSY); ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT_EQ(done_cb_called, 1); + ASSERT_EQ(1, done_cb_called); uv_sem_destroy(&sem_lock); diff --git a/deps/uv/test/test-threadpool.c b/deps/uv/test/test-threadpool.c index 5254131bce303d..fb5e5732e6aa34 100644 --- a/deps/uv/test/test-threadpool.c +++ b/deps/uv/test/test-threadpool.c @@ -29,16 +29,16 @@ static char data; static void work_cb(uv_work_t* req) { - ASSERT(req == &work_req); - ASSERT(req->data == &data); + ASSERT_PTR_EQ(req, &work_req); + ASSERT_PTR_EQ(req->data, &data); work_cb_count++; } static void after_work_cb(uv_work_t* req, int status) { - ASSERT(status == 0); - ASSERT(req == &work_req); - ASSERT(req->data == &data); + ASSERT_OK(status); + ASSERT_PTR_EQ(req, &work_req); + ASSERT_PTR_EQ(req->data, &data); after_work_cb_count++; } @@ -48,11 +48,11 @@ TEST_IMPL(threadpool_queue_work_simple) { work_req.data = &data; r = uv_queue_work(uv_default_loop(), &work_req, work_cb, after_work_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(work_cb_count == 1); - ASSERT(after_work_cb_count == 1); + ASSERT_EQ(1, work_cb_count); + ASSERT_EQ(1, after_work_cb_count); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -64,12 +64,12 @@ TEST_IMPL(threadpool_queue_work_einval) { work_req.data = &data; r = uv_queue_work(uv_default_loop(), &work_req, NULL, after_work_cb); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(work_cb_count == 0); - ASSERT(after_work_cb_count == 0); + ASSERT_OK(work_cb_count); + ASSERT_OK(after_work_cb_count); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-timer-again.c b/deps/uv/test/test-timer-again.c index cb298956aa94ac..d7f0b83ab5576f 100644 --- a/deps/uv/test/test-timer-again.c +++ b/deps/uv/test/test-timer-again.c @@ -44,8 +44,8 @@ static void close_cb(uv_handle_t* handle) { static void repeat_1_cb(uv_timer_t* handle) { int r; - ASSERT(handle == &repeat_1); - ASSERT(uv_timer_get_repeat((uv_timer_t*)handle) == 50); + ASSERT_PTR_EQ(handle, &repeat_1); + ASSERT_EQ(50, uv_timer_get_repeat((uv_timer_t*)handle)); fprintf(stderr, "repeat_1_cb called after %ld ms\n", (long int)(uv_now(uv_default_loop()) - start_time)); @@ -54,7 +54,7 @@ static void repeat_1_cb(uv_timer_t* handle) { repeat_1_cb_called++; r = uv_timer_again(&repeat_2); - ASSERT(r == 0); + ASSERT_OK(r); if (repeat_1_cb_called == 10) { uv_close((uv_handle_t*)handle, close_cb); @@ -67,7 +67,7 @@ static void repeat_1_cb(uv_timer_t* handle) { static void repeat_2_cb(uv_timer_t* handle) { - ASSERT(handle == &repeat_2); + ASSERT_PTR_EQ(handle, &repeat_2); ASSERT(repeat_2_cb_allowed); fprintf(stderr, "repeat_2_cb called after %ld ms\n", @@ -77,7 +77,7 @@ static void repeat_2_cb(uv_timer_t* handle) { repeat_2_cb_called++; if (uv_timer_get_repeat(&repeat_2) == 0) { - ASSERT(0 == uv_is_active((uv_handle_t*) handle)); + ASSERT_OK(uv_is_active((uv_handle_t*) handle)); uv_close((uv_handle_t*)handle, close_cb); return; } @@ -85,7 +85,7 @@ static void repeat_2_cb(uv_timer_t* handle) { fprintf(stderr, "uv_timer_get_repeat %ld ms\n", (long int)uv_timer_get_repeat(&repeat_2)); fflush(stderr); - ASSERT(uv_timer_get_repeat(&repeat_2) == 100); + ASSERT_EQ(100, uv_timer_get_repeat(&repeat_2)); /* This shouldn't take effect immediately. */ uv_timer_set_repeat(&repeat_2, 0); @@ -96,41 +96,41 @@ TEST_IMPL(timer_again) { int r; start_time = uv_now(uv_default_loop()); - ASSERT(0 < start_time); + ASSERT_LT(0, start_time); /* Verify that it is not possible to uv_timer_again a never-started timer. */ r = uv_timer_init(uv_default_loop(), &dummy); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_again(&dummy); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_unref((uv_handle_t*)&dummy); /* Start timer repeat_1. */ r = uv_timer_init(uv_default_loop(), &repeat_1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&repeat_1, repeat_1_cb, 50, 0); - ASSERT(r == 0); - ASSERT(uv_timer_get_repeat(&repeat_1) == 0); + ASSERT_OK(r); + ASSERT_OK(uv_timer_get_repeat(&repeat_1)); /* Actually make repeat_1 repeating. */ uv_timer_set_repeat(&repeat_1, 50); - ASSERT(uv_timer_get_repeat(&repeat_1) == 50); + ASSERT_EQ(50, uv_timer_get_repeat(&repeat_1)); /* * Start another repeating timer. It'll be again()ed by the repeat_1 so * it should not time out until repeat_1 stops. */ r = uv_timer_init(uv_default_loop(), &repeat_2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&repeat_2, repeat_2_cb, 100, 100); - ASSERT(r == 0); - ASSERT(uv_timer_get_repeat(&repeat_2) == 100); + ASSERT_OK(r); + ASSERT_EQ(100, uv_timer_get_repeat(&repeat_2)); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(repeat_1_cb_called == 10); - ASSERT(repeat_2_cb_called == 2); - ASSERT(close_cb_called == 2); + ASSERT_EQ(10, repeat_1_cb_called); + ASSERT_EQ(2, repeat_2_cb_called); + ASSERT_EQ(2, close_cb_called); fprintf(stderr, "Test took %ld ms (expected ~700 ms)\n", (long int)(uv_now(uv_default_loop()) - start_time)); diff --git a/deps/uv/test/test-timer-from-check.c b/deps/uv/test/test-timer-from-check.c index e1a002d8121065..e5f5cb2f60a491 100644 --- a/deps/uv/test/test-timer-from-check.c +++ b/deps/uv/test/test-timer-from-check.c @@ -32,49 +32,49 @@ static int timer_cb_called; static void prepare_cb(uv_prepare_t* handle) { - ASSERT(0 == uv_prepare_stop(&prepare_handle)); - ASSERT(0 == prepare_cb_called); - ASSERT(1 == check_cb_called); - ASSERT(0 == timer_cb_called); + ASSERT_OK(uv_prepare_stop(&prepare_handle)); + ASSERT_OK(prepare_cb_called); + ASSERT_EQ(1, check_cb_called); + ASSERT_OK(timer_cb_called); prepare_cb_called++; } static void timer_cb(uv_timer_t* handle) { - ASSERT(0 == uv_timer_stop(&timer_handle)); - ASSERT(1 == prepare_cb_called); - ASSERT(1 == check_cb_called); - ASSERT(0 == timer_cb_called); + ASSERT_OK(uv_timer_stop(&timer_handle)); + ASSERT_EQ(1, prepare_cb_called); + ASSERT_EQ(1, check_cb_called); + ASSERT_OK(timer_cb_called); timer_cb_called++; } static void check_cb(uv_check_t* handle) { - ASSERT(0 == uv_check_stop(&check_handle)); - ASSERT(0 == uv_timer_stop(&timer_handle)); /* Runs before timer_cb. */ - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 50, 0)); - ASSERT(0 == uv_prepare_start(&prepare_handle, prepare_cb)); - ASSERT(0 == prepare_cb_called); - ASSERT(0 == check_cb_called); - ASSERT(0 == timer_cb_called); + ASSERT_OK(uv_check_stop(&check_handle)); + ASSERT_OK(uv_timer_stop(&timer_handle)); /* Runs before timer_cb. */ + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 50, 0)); + ASSERT_OK(uv_prepare_start(&prepare_handle, prepare_cb)); + ASSERT_OK(prepare_cb_called); + ASSERT_OK(check_cb_called); + ASSERT_OK(timer_cb_called); check_cb_called++; } TEST_IMPL(timer_from_check) { - ASSERT(0 == uv_prepare_init(uv_default_loop(), &prepare_handle)); - ASSERT(0 == uv_check_init(uv_default_loop(), &check_handle)); - ASSERT(0 == uv_check_start(&check_handle, check_cb)); - ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 50, 0)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(1 == prepare_cb_called); - ASSERT(1 == check_cb_called); - ASSERT(1 == timer_cb_called); + ASSERT_OK(uv_prepare_init(uv_default_loop(), &prepare_handle)); + ASSERT_OK(uv_check_init(uv_default_loop(), &check_handle)); + ASSERT_OK(uv_check_start(&check_handle, check_cb)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, 50, 0)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_EQ(1, prepare_cb_called); + ASSERT_EQ(1, check_cb_called); + ASSERT_EQ(1, timer_cb_called); uv_close((uv_handle_t*) &prepare_handle, NULL); uv_close((uv_handle_t*) &check_handle, NULL); uv_close((uv_handle_t*) &timer_handle, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } diff --git a/deps/uv/test/test-timer.c b/deps/uv/test/test-timer.c index 2488f14c204b8b..d889e707731886 100644 --- a/deps/uv/test/test-timer.c +++ b/deps/uv/test/test-timer.c @@ -41,7 +41,7 @@ static void once_close_cb(uv_handle_t* handle) { printf("ONCE_CLOSE_CB\n"); ASSERT_NOT_NULL(handle); - ASSERT(0 == uv_is_active(handle)); + ASSERT_OK(uv_is_active(handle)); once_close_cb_called++; } @@ -51,7 +51,7 @@ static void once_cb(uv_timer_t* handle) { printf("ONCE_CB %d\n", once_cb_called); ASSERT_NOT_NULL(handle); - ASSERT(0 == uv_is_active((uv_handle_t*) handle)); + ASSERT_OK(uv_is_active((uv_handle_t*) handle)); once_cb_called++; @@ -65,7 +65,7 @@ static void twice_close_cb(uv_handle_t* handle) { printf("TWICE_CLOSE_CB\n"); ASSERT_NOT_NULL(handle); - ASSERT(0 == uv_is_active(handle)); + ASSERT_OK(uv_is_active(handle)); twice_close_cb_called++; } @@ -74,7 +74,7 @@ static void twice_cb(uv_timer_t* handle) { printf("TWICE_CB %d\n", twice_cb_called); ASSERT_NOT_NULL(handle); - ASSERT(0 == uv_is_active((uv_handle_t*) handle)); + ASSERT_OK(uv_is_active((uv_handle_t*) handle)); twice_cb_called++; @@ -96,7 +96,7 @@ static void repeat_cb(uv_timer_t* handle) { printf("REPEAT_CB\n"); ASSERT_NOT_NULL(handle); - ASSERT(1 == uv_is_active((uv_handle_t*) handle)); + ASSERT_EQ(1, uv_is_active((uv_handle_t*) handle)); repeat_cb_called++; @@ -119,41 +119,41 @@ TEST_IMPL(timer) { int r; start_time = uv_now(uv_default_loop()); - ASSERT(0 < start_time); + ASSERT_LT(0, start_time); /* Let 10 timers time out in 500 ms total. */ for (i = 0; i < ARRAY_SIZE(once_timers); i++) { once = once_timers + i; r = uv_timer_init(uv_default_loop(), once); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(once, once_cb, i * 50, 0); - ASSERT(r == 0); + ASSERT_OK(r); } /* The 11th timer is a repeating timer that runs 4 times */ r = uv_timer_init(uv_default_loop(), &repeat); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&repeat, repeat_cb, 100, 100); - ASSERT(r == 0); + ASSERT_OK(r); /* The 12th timer should not do anything. */ r = uv_timer_init(uv_default_loop(), &never); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&never, never_cb, 100, 100); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_stop(&never); - ASSERT(r == 0); + ASSERT_OK(r); uv_unref((uv_handle_t*)&never); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(once_cb_called == 10); - ASSERT(once_close_cb_called == 10); + ASSERT_EQ(10, once_cb_called); + ASSERT_EQ(10, once_close_cb_called); printf("repeat_cb_called %d\n", repeat_cb_called); - ASSERT(repeat_cb_called == 5); - ASSERT(repeat_close_cb_called == 1); + ASSERT_EQ(5, repeat_cb_called); + ASSERT_EQ(1, repeat_close_cb_called); - ASSERT(500 <= uv_now(uv_default_loop()) - start_time); + ASSERT_LE(500, uv_now(uv_default_loop()) - start_time); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -165,15 +165,15 @@ TEST_IMPL(timer_start_twice) { int r; r = uv_timer_init(uv_default_loop(), &once); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&once, never_cb, 86400 * 1000, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&once, twice_cb, 10, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(twice_cb_called == 1); + ASSERT_EQ(1, twice_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -183,10 +183,10 @@ TEST_IMPL(timer_start_twice) { TEST_IMPL(timer_init) { uv_timer_t handle; - ASSERT(0 == uv_timer_init(uv_default_loop(), &handle)); - ASSERT(0 == uv_timer_get_repeat(&handle)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &handle)); + ASSERT_OK(uv_timer_get_repeat(&handle)); ASSERT_UINT64_LE(0, uv_timer_get_due_in(&handle)); - ASSERT(0 == uv_is_active((uv_handle_t*) &handle)); + ASSERT_OK(uv_is_active((uv_handle_t*) &handle)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -194,12 +194,12 @@ TEST_IMPL(timer_init) { static void order_cb_a(uv_timer_t *handle) { - ASSERT(order_cb_called++ == *(int*)handle->data); + ASSERT_EQ(order_cb_called++, *(int*)handle->data); } static void order_cb_b(uv_timer_t *handle) { - ASSERT(order_cb_called++ == *(int*)handle->data); + ASSERT_EQ(order_cb_called++, *(int*)handle->data); } @@ -211,31 +211,31 @@ TEST_IMPL(timer_order) { first = 0; second = 1; - ASSERT(0 == uv_timer_init(uv_default_loop(), &handle_a)); - ASSERT(0 == uv_timer_init(uv_default_loop(), &handle_b)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &handle_a)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &handle_b)); /* Test for starting handle_a then handle_b */ handle_a.data = &first; - ASSERT(0 == uv_timer_start(&handle_a, order_cb_a, 0, 0)); + ASSERT_OK(uv_timer_start(&handle_a, order_cb_a, 0, 0)); handle_b.data = &second; - ASSERT(0 == uv_timer_start(&handle_b, order_cb_b, 0, 0)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_timer_start(&handle_b, order_cb_b, 0, 0)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(order_cb_called == 2); + ASSERT_EQ(2, order_cb_called); - ASSERT(0 == uv_timer_stop(&handle_a)); - ASSERT(0 == uv_timer_stop(&handle_b)); + ASSERT_OK(uv_timer_stop(&handle_a)); + ASSERT_OK(uv_timer_stop(&handle_b)); /* Test for starting handle_b then handle_a */ order_cb_called = 0; handle_b.data = &first; - ASSERT(0 == uv_timer_start(&handle_b, order_cb_b, 0, 0)); + ASSERT_OK(uv_timer_start(&handle_b, order_cb_b, 0, 0)); handle_a.data = &second; - ASSERT(0 == uv_timer_start(&handle_a, order_cb_a, 0, 0)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_timer_start(&handle_a, order_cb_a, 0, 0)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(order_cb_called == 2); + ASSERT_EQ(2, order_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -243,7 +243,7 @@ TEST_IMPL(timer_order) { static void tiny_timer_cb(uv_timer_t* handle) { - ASSERT(handle == &tiny_timer); + ASSERT_PTR_EQ(handle, &tiny_timer); uv_close((uv_handle_t*) &tiny_timer, NULL); uv_close((uv_handle_t*) &huge_timer1, NULL); uv_close((uv_handle_t*) &huge_timer2, NULL); @@ -251,16 +251,19 @@ static void tiny_timer_cb(uv_timer_t* handle) { TEST_IMPL(timer_huge_timeout) { - ASSERT(0 == uv_timer_init(uv_default_loop(), &tiny_timer)); - ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer1)); - ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer2)); - ASSERT(0 == uv_timer_start(&tiny_timer, tiny_timer_cb, 1, 0)); - ASSERT(0 == uv_timer_start(&huge_timer1, tiny_timer_cb, 0xffffffffffffLL, 0)); - ASSERT(0 == uv_timer_start(&huge_timer2, tiny_timer_cb, (uint64_t) -1, 0)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &tiny_timer)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &huge_timer1)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &huge_timer2)); + ASSERT_OK(uv_timer_start(&tiny_timer, tiny_timer_cb, 1, 0)); + ASSERT_OK(uv_timer_start(&huge_timer1, + tiny_timer_cb, + 0xffffffffffffLL, + 0)); + ASSERT_OK(uv_timer_start(&huge_timer2, tiny_timer_cb, (uint64_t) -1, 0)); ASSERT_UINT64_EQ(1, uv_timer_get_due_in(&tiny_timer)); ASSERT_UINT64_EQ(281474976710655, uv_timer_get_due_in(&huge_timer1)); ASSERT_UINT64_LE(0, uv_timer_get_due_in(&huge_timer2)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } @@ -270,9 +273,9 @@ static void huge_repeat_cb(uv_timer_t* handle) { static int ncalls; if (ncalls == 0) - ASSERT(handle == &huge_timer1); + ASSERT_PTR_EQ(handle, &huge_timer1); else - ASSERT(handle == &tiny_timer); + ASSERT_PTR_EQ(handle, &tiny_timer); if (++ncalls == 10) { uv_close((uv_handle_t*) &tiny_timer, NULL); @@ -282,11 +285,11 @@ static void huge_repeat_cb(uv_timer_t* handle) { TEST_IMPL(timer_huge_repeat) { - ASSERT(0 == uv_timer_init(uv_default_loop(), &tiny_timer)); - ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer1)); - ASSERT(0 == uv_timer_start(&tiny_timer, huge_repeat_cb, 2, 2)); - ASSERT(0 == uv_timer_start(&huge_timer1, huge_repeat_cb, 1, (uint64_t) -1)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &tiny_timer)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &huge_timer1)); + ASSERT_OK(uv_timer_start(&tiny_timer, huge_repeat_cb, 2, 2)); + ASSERT_OK(uv_timer_start(&huge_timer1, huge_repeat_cb, 1, (uint64_t) -1)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; } @@ -303,17 +306,17 @@ static void timer_run_once_timer_cb(uv_timer_t* handle) { TEST_IMPL(timer_run_once) { uv_timer_t timer_handle; - ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_run_once_timer_cb, 0, 0)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); - ASSERT(1 == timer_run_once_timer_cb_called); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, timer_run_once_timer_cb, 0, 0)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_EQ(1, timer_run_once_timer_cb_called); - ASSERT(0 == uv_timer_start(&timer_handle, timer_run_once_timer_cb, 1, 0)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); - ASSERT(2 == timer_run_once_timer_cb_called); + ASSERT_OK(uv_timer_start(&timer_handle, timer_run_once_timer_cb, 1, 0)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_EQ(2, timer_run_once_timer_cb_called); uv_close((uv_handle_t*) &timer_handle, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_ONCE)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -323,10 +326,10 @@ TEST_IMPL(timer_run_once) { TEST_IMPL(timer_is_closing) { uv_timer_t handle; - ASSERT(0 == uv_timer_init(uv_default_loop(), &handle)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &handle)); uv_close((uv_handle_t *)&handle, NULL); - ASSERT(UV_EINVAL == uv_timer_start(&handle, never_cb, 100, 100)); + ASSERT_EQ(UV_EINVAL, uv_timer_start(&handle, never_cb, 100, 100)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -336,8 +339,8 @@ TEST_IMPL(timer_is_closing) { TEST_IMPL(timer_null_callback) { uv_timer_t handle; - ASSERT(0 == uv_timer_init(uv_default_loop(), &handle)); - ASSERT(UV_EINVAL == uv_timer_start(&handle, NULL, 100, 100)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &handle)); + ASSERT_EQ(UV_EINVAL, uv_timer_start(&handle, NULL, 100, 100)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -349,7 +352,7 @@ static uint64_t timer_early_check_expected_time; static void timer_early_check_cb(uv_timer_t* handle) { uint64_t hrtime = uv_hrtime() / 1000000; - ASSERT(hrtime >= timer_early_check_expected_time); + ASSERT_GE(hrtime, timer_early_check_expected_time); } @@ -359,12 +362,15 @@ TEST_IMPL(timer_early_check) { timer_early_check_expected_time = uv_now(uv_default_loop()) + timeout_ms; - ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle)); - ASSERT(0 == uv_timer_start(&timer_handle, timer_early_check_cb, timeout_ms, 0)); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, + timer_early_check_cb, + timeout_ms, + 0)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); uv_close((uv_handle_t*) &timer_handle, NULL); - ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -378,11 +384,11 @@ TEST_IMPL(timer_no_double_call_once) { uv_timer_t timer_handle; const uint64_t timeout_ms = 10; - ASSERT_EQ(0, uv_timer_init(uv_default_loop(), &timer_handle)); - ASSERT_EQ(0, uv_timer_start(&timer_handle, - timer_check_double_call, - timeout_ms, - timeout_ms)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, + timer_check_double_call, + timeout_ms, + timeout_ms)); uv_sleep(timeout_ms * 2); ASSERT_EQ(1, uv_run(uv_default_loop(), UV_RUN_ONCE)); ASSERT_EQ(1, timer_check_double_call_called); @@ -395,11 +401,11 @@ TEST_IMPL(timer_no_double_call_nowait) { uv_timer_t timer_handle; const uint64_t timeout_ms = 10; - ASSERT_EQ(0, uv_timer_init(uv_default_loop(), &timer_handle)); - ASSERT_EQ(0, uv_timer_start(&timer_handle, - timer_check_double_call, - timeout_ms, - timeout_ms)); + ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); + ASSERT_OK(uv_timer_start(&timer_handle, + timer_check_double_call, + timeout_ms, + timeout_ms)); uv_sleep(timeout_ms * 2); ASSERT_EQ(1, uv_run(uv_default_loop(), UV_RUN_NOWAIT)); ASSERT_EQ(1, timer_check_double_call_called); @@ -414,7 +420,7 @@ TEST_IMPL(timer_no_run_on_unref) { ASSERT_OK(uv_timer_init(uv_default_loop(), &timer_handle)); ASSERT_OK(uv_timer_start(&timer_handle, (uv_timer_cb) abort, 0, 0)); uv_unref((uv_handle_t*) &timer_handle); - ASSERT_EQ(uv_run(uv_default_loop(), UV_RUN_DEFAULT), 0); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-tmpdir.c b/deps/uv/test/test-tmpdir.c index 86f72e25431a15..a4e9ce950aaa12 100644 --- a/deps/uv/test/test-tmpdir.c +++ b/deps/uv/test/test-tmpdir.c @@ -36,46 +36,46 @@ TEST_IMPL(tmpdir) { len = sizeof tmpdir; tmpdir[0] = '\0'; - ASSERT(strlen(tmpdir) == 0); + ASSERT_OK(strlen(tmpdir)); r = uv_os_tmpdir(tmpdir, &len); - ASSERT(r == 0); - ASSERT(strlen(tmpdir) == len); - ASSERT(len > 0); - ASSERT(tmpdir[len] == '\0'); + ASSERT_OK(r); + ASSERT_EQ(strlen(tmpdir), len); + ASSERT_GT(len, 0); + ASSERT_EQ(tmpdir[len], '\0'); if (len > 1) { last = tmpdir[len - 1]; #ifdef _WIN32 - ASSERT(last != '\\'); + ASSERT_NE(last, '\\'); #else - ASSERT(last != '/'); + ASSERT_NE(last, '/'); #endif } /* Test the case where the buffer is too small */ len = SMALLPATH; r = uv_os_tmpdir(tmpdir, &len); - ASSERT(r == UV_ENOBUFS); - ASSERT(len > SMALLPATH); + ASSERT_EQ(r, UV_ENOBUFS); + ASSERT_GT(len, SMALLPATH); /* Test invalid inputs */ r = uv_os_tmpdir(NULL, &len); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_os_tmpdir(tmpdir, NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); len = 0; r = uv_os_tmpdir(tmpdir, &len); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); #ifdef _WIN32 const char *name = "TMP"; char tmpdir_win[] = "C:\\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; r = uv_os_setenv(name, tmpdir_win); - ASSERT(r == 0); + ASSERT_OK(r); char tmpdirx[PATHMAX]; size_t lenx = sizeof tmpdirx; r = uv_os_tmpdir(tmpdirx, &lenx); - ASSERT(r == 0); + ASSERT_OK(r); #endif return 0; diff --git a/deps/uv/test/test-tty-duplicate-key.c b/deps/uv/test/test-tty-duplicate-key.c index 6ba96c81352337..871d580266ad8d 100644 --- a/deps/uv/test/test-tty-duplicate-key.c +++ b/deps/uv/test/test-tty-duplicate-key.c @@ -73,7 +73,7 @@ static void tty_read(uv_stream_t* tty_in, ssize_t nread, const uv_buf_t* buf) { } uv_close((uv_handle_t*) tty_in, NULL); } else { - ASSERT(nread == 0); + ASSERT_OK(nread); } } @@ -150,25 +150,25 @@ TEST_IMPL(tty_duplicate_vt100_fn_key) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyin_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyin_fd >= 0); - ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + ASSERT_GE(ttyin_fd, 0); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyin_fd)); r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */ - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); r = uv_read_start((uv_stream_t*)&tty_in, tty_alloc, tty_read); - ASSERT(r == 0); + ASSERT_OK(r); expect_str = ESC"[[A"; expect_nread = strlen(expect_str); /* Turn on raw mode. */ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); - ASSERT(r == 0); + ASSERT_OK(r); /* * Send F1 keystrokes. Test of issue cause by #2114 that vt100 fn key @@ -176,7 +176,7 @@ TEST_IMPL(tty_duplicate_vt100_fn_key) { */ make_key_event_records(VK_F1, 0, TRUE, records); WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); - ASSERT(written == ARRAY_SIZE(records)); + ASSERT_EQ(written, ARRAY_SIZE(records)); uv_run(loop, UV_RUN_DEFAULT); @@ -204,45 +204,45 @@ TEST_IMPL(tty_duplicate_alt_modifier_key) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyin_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyin_fd >= 0); - ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + ASSERT_GE(ttyin_fd, 0); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyin_fd)); r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */ - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); r = uv_read_start((uv_stream_t*)&tty_in, tty_alloc, tty_read); - ASSERT(r == 0); + ASSERT_OK(r); expect_str = ESC"a"ESC"a"; expect_nread = strlen(expect_str); /* Turn on raw mode. */ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); - ASSERT(r == 0); + ASSERT_OK(r); /* Emulate transmission of M-a at normal console */ make_key_event_records(VK_MENU, 0, TRUE, alt_records); WriteConsoleInputW(handle, &alt_records[0], 1, &written); - ASSERT(written == 1); + ASSERT_EQ(1, written); make_key_event_records(L'A', LEFT_ALT_PRESSED, FALSE, records); WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); - ASSERT(written == 2); + ASSERT_EQ(2, written); WriteConsoleInputW(handle, &alt_records[1], 1, &written); - ASSERT(written == 1); + ASSERT_EQ(1, written); /* Emulate transmission of M-a at WSL(#2111) */ make_key_event_records(VK_MENU, 0, TRUE, alt_records); WriteConsoleInputW(handle, &alt_records[0], 1, &written); - ASSERT(written == 1); + ASSERT_EQ(1, written); make_key_event_records(L'A', LEFT_ALT_PRESSED, TRUE, records); WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); - ASSERT(written == 2); + ASSERT_EQ(2, written); WriteConsoleInputW(handle, &alt_records[1], 1, &written); - ASSERT(written == 1); + ASSERT_EQ(1, written); uv_run(loop, UV_RUN_DEFAULT); @@ -270,25 +270,25 @@ TEST_IMPL(tty_composing_character) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyin_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyin_fd >= 0); - ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + ASSERT_GE(ttyin_fd, 0); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyin_fd)); r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */ - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); r = uv_read_start((uv_stream_t*)&tty_in, tty_alloc, tty_read); - ASSERT(r == 0); + ASSERT_OK(r); expect_str = EUR_UTF8; expect_nread = strlen(expect_str); /* Turn on raw mode. */ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); - ASSERT(r == 0); + ASSERT_OK(r); /* Emulate EUR inputs by LEFT ALT+NUMPAD ASCII KeyComos */ make_key_event_records(VK_MENU, 0, FALSE, alt_records); @@ -296,16 +296,16 @@ TEST_IMPL(tty_composing_character) { WriteConsoleInputW(handle, &alt_records[0], 1, &written); make_key_event_records(VK_NUMPAD0, LEFT_ALT_PRESSED, FALSE, records); WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); - ASSERT(written == ARRAY_SIZE(records)); + ASSERT_EQ(written, ARRAY_SIZE(records)); make_key_event_records(VK_NUMPAD1, LEFT_ALT_PRESSED, FALSE, records); WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); - ASSERT(written == ARRAY_SIZE(records)); + ASSERT_EQ(written, ARRAY_SIZE(records)); make_key_event_records(VK_NUMPAD2, LEFT_ALT_PRESSED, FALSE, records); WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); - ASSERT(written == ARRAY_SIZE(records)); + ASSERT_EQ(written, ARRAY_SIZE(records)); make_key_event_records(VK_NUMPAD8, LEFT_ALT_PRESSED, FALSE, records); WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); - ASSERT(written == ARRAY_SIZE(records)); + ASSERT_EQ(written, ARRAY_SIZE(records)); WriteConsoleInputW(handle, &alt_records[1], 1, &written); uv_run(loop, UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-tty-escape-sequence-processing.c b/deps/uv/test/test-tty-escape-sequence-processing.c index 2f7d0364b8b5f0..4a041db11dfcea 100644 --- a/deps/uv/test/test-tty-escape-sequence-processing.c +++ b/deps/uv/test/test-tty-escape-sequence-processing.c @@ -165,8 +165,8 @@ static void write_console(uv_tty_t* tty_out, char* src) { buf.len = strlen(buf.base); r = uv_try_write((uv_stream_t*) tty_out, &buf, 1); - ASSERT(r >= 0); - ASSERT((unsigned int) r == buf.len); + ASSERT_GE(r, 0); + ASSERT_EQ((unsigned int) r, buf.len); } static void setup_screen(uv_tty_t* tty_out) { @@ -178,8 +178,8 @@ static void setup_screen(uv_tty_t* tty_out) { origin.X = 0; origin.Y = info.srWindow.Top; ASSERT(FillConsoleOutputCharacter( - tty_out->handle, '.', length, origin, &number_of_written)); - ASSERT(length == number_of_written); + tty_out->handle, '.', length, origin, &number_of_written)); + ASSERT_EQ(length, number_of_written); } static void clear_screen(uv_tty_t* tty_out, struct screen_info* si) { @@ -192,10 +192,10 @@ static void clear_screen(uv_tty_t* tty_out, struct screen_info* si) { origin.Y = info.srWindow.Top; FillConsoleOutputCharacterA( tty_out->handle, ' ', length, origin, &number_of_written); - ASSERT(length == number_of_written); + ASSERT_EQ(length, number_of_written); FillConsoleOutputAttribute( tty_out->handle, si->default_attr, length, origin, &number_of_written); - ASSERT(length == number_of_written); + ASSERT_EQ(length, number_of_written); } static void free_screen(struct captured_screen* cs) { @@ -216,11 +216,11 @@ static void capture_screen(uv_tty_t* tty_out, struct captured_screen* cs) { cs->attributes = (WORD*) malloc(cs->si.length * sizeof(*cs->attributes)); ASSERT_NOT_NULL(cs->attributes); ASSERT(ReadConsoleOutputCharacter( - tty_out->handle, cs->text, cs->si.length, origin, &length)); - ASSERT((unsigned int) cs->si.length == length); + tty_out->handle, cs->text, cs->si.length, origin, &length)); + ASSERT_EQ((unsigned int) cs->si.length, length); ASSERT(ReadConsoleOutputAttribute( - tty_out->handle, cs->attributes, cs->si.length, origin, &length)); - ASSERT((unsigned int) cs->si.length == length); + tty_out->handle, cs->attributes, cs->si.length, origin, &length)); + ASSERT_EQ((unsigned int) cs->si.length, length); } static void make_expect_screen_erase(struct captured_screen* cs, @@ -261,8 +261,8 @@ static void make_expect_screen_erase(struct captured_screen* cs, } else { ASSERT(FALSE); } - ASSERT(start < end); - ASSERT(end - cs->text <= cs->si.length); + ASSERT_PTR_LT(start, end); + ASSERT_LE(end - cs->text, cs->si.length); for (; start < end; start++) { *start = ' '; } @@ -360,13 +360,13 @@ static void initialize_tty(uv_tty_t* tty_out) { NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyout_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyout_fd >= 0); - ASSERT(UV_TTY == uv_guess_handle(ttyout_fd)); + ASSERT_GE(ttyout_fd, 0); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyout_fd)); r = uv_tty_init(uv_default_loop(), tty_out, ttyout_fd, 0); /* Writable. */ - ASSERT(r == 0); + ASSERT_OK(r); } static void terminate_tty(uv_tty_t* tty_out) { @@ -394,16 +394,16 @@ TEST_IMPL(tty_cursor_up) { snprintf(buffer, sizeof(buffer), "%sA", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y - 1 == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y - 1, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); /* cursor up nth times */ cursor_pos_old = cursor_pos; snprintf(buffer, sizeof(buffer), "%s%dA", CSI, si.height / 4); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y - si.height / 4 == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y - si.height / 4, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); /* cursor up from Window top does nothing */ cursor_pos_old.X = 1; @@ -412,8 +412,8 @@ TEST_IMPL(tty_cursor_up) { snprintf(buffer, sizeof(buffer), "%sA", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); ASSERT(!is_scrolling(&tty_out, si)); terminate_tty(&tty_out); @@ -445,16 +445,16 @@ TEST_IMPL(tty_cursor_down) { snprintf(buffer, sizeof(buffer), "%sB", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y + 1 == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y + 1, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); /* cursor down nth times */ cursor_pos_old = cursor_pos; snprintf(buffer, sizeof(buffer), "%s%dB", CSI, si.height / 4); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y + si.height / 4 == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y + si.height / 4, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); /* cursor down from bottom line does nothing */ cursor_pos_old.X = si.width / 2; @@ -463,8 +463,8 @@ TEST_IMPL(tty_cursor_down) { snprintf(buffer, sizeof(buffer), "%sB", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); ASSERT(!is_scrolling(&tty_out, si)); terminate_tty(&tty_out); @@ -496,16 +496,16 @@ TEST_IMPL(tty_cursor_forward) { snprintf(buffer, sizeof(buffer), "%sC", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X + 1 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X + 1, cursor_pos.X); /* cursor forward nth times */ cursor_pos_old = cursor_pos; snprintf(buffer, sizeof(buffer), "%s%dC", CSI, si.width / 4); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X + si.width / 4 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X + si.width / 4, cursor_pos.X); /* cursor forward from end of line does nothing*/ cursor_pos_old.X = si.width; @@ -514,8 +514,8 @@ TEST_IMPL(tty_cursor_forward) { snprintf(buffer, sizeof(buffer), "%sC", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); /* cursor forward from end of screen does nothing */ cursor_pos_old.X = si.width; @@ -524,8 +524,8 @@ TEST_IMPL(tty_cursor_forward) { snprintf(buffer, sizeof(buffer), "%sC", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); ASSERT(!is_scrolling(&tty_out, si)); terminate_tty(&tty_out); @@ -557,16 +557,16 @@ TEST_IMPL(tty_cursor_back) { snprintf(buffer, sizeof(buffer), "%sD", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X - 1 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X - 1, cursor_pos.X); /* cursor back nth times */ cursor_pos_old = cursor_pos; snprintf(buffer, sizeof(buffer), "%s%dD", CSI, si.width / 4); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X - si.width / 4 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X - si.width / 4, cursor_pos.X); /* cursor back from beginning of line does nothing */ cursor_pos_old.X = 1; @@ -575,8 +575,8 @@ TEST_IMPL(tty_cursor_back) { snprintf(buffer, sizeof(buffer), "%sD", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(cursor_pos_old.X == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(cursor_pos_old.X, cursor_pos.X); /* cursor back from top of screen does nothing */ cursor_pos_old.X = 1; @@ -585,8 +585,8 @@ TEST_IMPL(tty_cursor_back) { snprintf(buffer, sizeof(buffer), "%sD", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(1 == cursor_pos.Y); - ASSERT(1 == cursor_pos.X); + ASSERT_EQ(1, cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); ASSERT(!is_scrolling(&tty_out, si)); terminate_tty(&tty_out); @@ -618,16 +618,16 @@ TEST_IMPL(tty_cursor_next_line) { snprintf(buffer, sizeof(buffer), "%sE", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y + 1 == cursor_pos.Y); - ASSERT(1 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y + 1, cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); /* cursor next line nth times */ cursor_pos_old = cursor_pos; snprintf(buffer, sizeof(buffer), "%s%dE", CSI, si.height / 4); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y + si.height / 4 == cursor_pos.Y); - ASSERT(1 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y + si.height / 4, cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); /* cursor next line from buttom row moves beginning of line */ cursor_pos_old.X = si.width / 2; @@ -636,8 +636,8 @@ TEST_IMPL(tty_cursor_next_line) { snprintf(buffer, sizeof(buffer), "%sE", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); - ASSERT(1 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); ASSERT(!is_scrolling(&tty_out, si)); terminate_tty(&tty_out); @@ -669,16 +669,16 @@ TEST_IMPL(tty_cursor_previous_line) { snprintf(buffer, sizeof(buffer), "%sF", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y - 1 == cursor_pos.Y); - ASSERT(1 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y - 1, cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); /* cursor previous line nth times */ cursor_pos_old = cursor_pos; snprintf(buffer, sizeof(buffer), "%s%dF", CSI, si.height / 4); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos_old.Y - si.height / 4 == cursor_pos.Y); - ASSERT(1 == cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y - si.height / 4, cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); /* cursor previous line from top of screen does nothing */ cursor_pos_old.X = 1; @@ -687,8 +687,8 @@ TEST_IMPL(tty_cursor_previous_line) { snprintf(buffer, sizeof(buffer), "%sD", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(1 == cursor_pos.Y); - ASSERT(1 == cursor_pos.X); + ASSERT_EQ(1, cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); ASSERT(!is_scrolling(&tty_out, si)); terminate_tty(&tty_out); @@ -720,22 +720,22 @@ TEST_IMPL(tty_cursor_horizontal_move_absolute) { snprintf(buffer, sizeof(buffer), "%sG", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(1 == cursor_pos.X); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); /* Move cursor to nth character */ snprintf(buffer, sizeof(buffer), "%s%dG", CSI, si.width / 4); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(si.width / 4 == cursor_pos.X); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); + ASSERT_EQ(si.width / 4, cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); /* Moving out of screen will fit within screen */ snprintf(buffer, sizeof(buffer), "%s%dG", CSI, si.width + 1); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(si.width == cursor_pos.X); - ASSERT(cursor_pos_old.Y == cursor_pos.Y); + ASSERT_EQ(si.width, cursor_pos.X); + ASSERT_EQ(cursor_pos_old.Y, cursor_pos.Y); terminate_tty(&tty_out); @@ -766,31 +766,31 @@ TEST_IMPL(tty_cursor_move_absolute) { snprintf(buffer, sizeof(buffer), "%sH", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(1 == cursor_pos.X); - ASSERT(1 == cursor_pos.Y); + ASSERT_EQ(1, cursor_pos.X); + ASSERT_EQ(1, cursor_pos.Y); /* Move the cursor to the middle of the screen */ snprintf( buffer, sizeof(buffer), "%s%d;%df", CSI, si.height / 2, si.width / 2); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(si.width / 2 == cursor_pos.X); - ASSERT(si.height / 2 == cursor_pos.Y); + ASSERT_EQ(si.width / 2, cursor_pos.X); + ASSERT_EQ(si.height / 2, cursor_pos.Y); /* Moving out of screen will fit within screen */ snprintf( buffer, sizeof(buffer), "%s%d;%df", CSI, si.height / 2, si.width + 1); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(si.width == cursor_pos.X); - ASSERT(si.height / 2 == cursor_pos.Y); + ASSERT_EQ(si.width, cursor_pos.X); + ASSERT_EQ(si.height / 2, cursor_pos.Y); snprintf( buffer, sizeof(buffer), "%s%d;%df", CSI, si.height + 1, si.width / 2); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(si.width / 2 == cursor_pos.X); - ASSERT(si.height == cursor_pos.Y); + ASSERT_EQ(si.width / 2, cursor_pos.X); + ASSERT_EQ(si.height, cursor_pos.Y); ASSERT(!is_scrolling(&tty_out, si)); terminate_tty(&tty_out); @@ -1000,38 +1000,38 @@ TEST_IMPL(tty_set_cursor_shape) { set_cursor_size(&tty_out, CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_LARGE); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_LARGE); /* cursor size large */ set_cursor_size(&tty_out, CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s1 q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_LARGE); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_LARGE); set_cursor_size(&tty_out, CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s2 q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_LARGE); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_LARGE); /* cursor size small */ set_cursor_size(&tty_out, CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s3 q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_SMALL); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_SMALL); set_cursor_size(&tty_out, CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s6 q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_SMALL); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_SMALL); /* Nothing occurs with arguments outside valid range */ set_cursor_size(&tty_out, CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s7 q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_MIDDLE); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_MIDDLE); /* restore cursor size if arguments is zero */ snprintf(buffer, sizeof(buffer), "%s0 q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == saved_cursor_size); + ASSERT_EQ(get_cursor_size(&tty_out), saved_cursor_size); terminate_tty(&tty_out); @@ -1122,7 +1122,7 @@ TEST_IMPL(tty_set_style) { } /* Set foreground and background color */ - ASSERT(ARRAY_SIZE(fg_attrs) == ARRAY_SIZE(bg_attrs)); + ASSERT_EQ(ARRAY_SIZE(fg_attrs), ARRAY_SIZE(bg_attrs)); length = ARRAY_SIZE(bg_attrs); for (i = 0; i < length; i++) { capture_screen(&tty_out, &expect); @@ -1271,8 +1271,8 @@ TEST_IMPL(tty_save_restore_cursor_position) { snprintf(buffer, sizeof(buffer), "%su", CSI); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos.X == cursor_pos_old.X); - ASSERT(cursor_pos.Y == cursor_pos_old.Y); + ASSERT_EQ(cursor_pos.X, cursor_pos_old.X); + ASSERT_EQ(cursor_pos.Y, cursor_pos_old.Y); cursor_pos_old.X = si.width / 2; cursor_pos_old.Y = si.height / 2; @@ -1290,8 +1290,8 @@ TEST_IMPL(tty_save_restore_cursor_position) { snprintf(buffer, sizeof(buffer), "%s8", ESC); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos.X == cursor_pos_old.X); - ASSERT(cursor_pos.Y == cursor_pos_old.Y); + ASSERT_EQ(cursor_pos.X, cursor_pos_old.X); + ASSERT_EQ(cursor_pos.Y, cursor_pos_old.Y); terminate_tty(&tty_out); @@ -1332,9 +1332,9 @@ TEST_IMPL(tty_full_reset) { write_console(&tty_out, buffer); capture_screen(&tty_out, &actual); ASSERT(compare_screen(&tty_out, &actual, &expect)); - ASSERT(get_cursor_size(&tty_out) == saved_cursor_size); - ASSERT(get_cursor_visibility(&tty_out) == saved_cursor_visibility); - ASSERT(actual.si.csbi.srWindow.Top == 0); + ASSERT_EQ(get_cursor_size(&tty_out), saved_cursor_size); + ASSERT_EQ(get_cursor_visibility(&tty_out), saved_cursor_visibility); + ASSERT_OK(actual.si.csbi.srWindow.Top); terminate_tty(&tty_out); @@ -1520,8 +1520,8 @@ TEST_IMPL(tty_escape_sequence_processing) { snprintf(buffer, sizeof(buffer), "%s1;%dH", CSI, UINT16_MAX + 1); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos.X == 1); - ASSERT(cursor_pos.Y == 1); + ASSERT_EQ(1, cursor_pos.X); + ASSERT_EQ(1, cursor_pos.Y); /* Too many argument are ignored */ cursor_pos.X = 1; @@ -1554,18 +1554,18 @@ TEST_IMPL(tty_escape_sequence_processing) { expect.si.width / 2); write_console(&tty_out, buffer); get_cursor_position(&tty_out, &cursor_pos); - ASSERT(cursor_pos.X == 1); - ASSERT(cursor_pos.Y == 1); + ASSERT_EQ(1, cursor_pos.X); + ASSERT_EQ(1, cursor_pos.Y); /* Invalid sequence are ignored */ saved_cursor_size = get_cursor_size(&tty_out); set_cursor_size(&tty_out, CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s 1q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_MIDDLE); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_MIDDLE); snprintf(buffer, sizeof(buffer), "%s 1 q", CSI); write_console(&tty_out, buffer); - ASSERT(get_cursor_size(&tty_out) == CURSOR_SIZE_MIDDLE); + ASSERT_EQ(get_cursor_size(&tty_out), CURSOR_SIZE_MIDDLE); set_cursor_size(&tty_out, saved_cursor_size); /* #1874 2. */ diff --git a/deps/uv/test/test-tty.c b/deps/uv/test/test-tty.c index 418ec31e4b53b3..1b11303829a137 100644 --- a/deps/uv/test/test-tty.c +++ b/deps/uv/test/test-tty.c @@ -57,7 +57,7 @@ TEST_IMPL(tty) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyin_fd = _open_osfhandle((intptr_t) handle, 0); handle = CreateFileA("conout$", @@ -67,7 +67,7 @@ TEST_IMPL(tty) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyout_fd = _open_osfhandle((intptr_t) handle, 0); #else /* unix */ @@ -86,26 +86,26 @@ TEST_IMPL(tty) { } #endif - ASSERT(ttyin_fd >= 0); - ASSERT(ttyout_fd >= 0); + ASSERT_GE(ttyin_fd, 0); + ASSERT_GE(ttyout_fd, 0); - ASSERT(UV_UNKNOWN_HANDLE == uv_guess_handle(-1)); + ASSERT_EQ(UV_UNKNOWN_HANDLE, uv_guess_handle(-1)); - ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); - ASSERT(UV_TTY == uv_guess_handle(ttyout_fd)); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyin_fd)); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyout_fd)); r = uv_tty_init(loop, &tty_in, ttyin_fd, 1); /* Readable. */ - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); r = uv_tty_init(loop, &tty_out, ttyout_fd, 0); /* Writable. */ - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(!uv_is_readable((uv_stream_t*) &tty_out)); ASSERT(uv_is_writable((uv_stream_t*) &tty_out)); r = uv_tty_get_winsize(&tty_out, &width, &height); - ASSERT(r == 0); + ASSERT_OK(r); printf("width=%d height=%d\n", width, height); @@ -121,18 +121,18 @@ TEST_IMPL(tty) { /* Turn on raw mode. */ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); - ASSERT(r == 0); + ASSERT_OK(r); /* Turn off raw mode. */ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_NORMAL); - ASSERT(r == 0); + ASSERT_OK(r); /* Calling uv_tty_reset_mode() repeatedly should not clobber errno. */ errno = 0; - ASSERT(0 == uv_tty_reset_mode()); - ASSERT(0 == uv_tty_reset_mode()); - ASSERT(0 == uv_tty_reset_mode()); - ASSERT(0 == errno); + ASSERT_OK(uv_tty_reset_mode()); + ASSERT_OK(uv_tty_reset_mode()); + ASSERT_OK(uv_tty_reset_mode()); + ASSERT_OK(errno); /* TODO check the actual mode! */ @@ -154,11 +154,11 @@ static void tty_raw_alloc(uv_handle_t* handle, size_t size, uv_buf_t* buf) { static void tty_raw_read(uv_stream_t* tty_in, ssize_t nread, const uv_buf_t* buf) { if (nread > 0) { - ASSERT(nread == 1); - ASSERT(buf->base[0] == ' '); + ASSERT_EQ(1, nread ); + ASSERT_EQ(buf->base[0], ' '); uv_close((uv_handle_t*) tty_in, NULL); } else { - ASSERT(nread == 0); + ASSERT_OK(nread); } } @@ -179,25 +179,25 @@ TEST_IMPL(tty_raw) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyin_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyin_fd >= 0); - ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + ASSERT_GE(ttyin_fd, 0); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyin_fd)); r = uv_tty_init(loop, &tty_in, ttyin_fd, 1); /* Readable. */ - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); r = uv_read_start((uv_stream_t*)&tty_in, tty_raw_alloc, tty_raw_read); - ASSERT(r == 0); + ASSERT_OK(r); /* Give uv_tty_line_read_thread time to block on ReadConsoleW */ Sleep(100); /* Turn on raw mode. */ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); - ASSERT(r == 0); + ASSERT_OK(r); /* Write ' ' that should be read in raw mode */ record.EventType = KEY_EVENT; @@ -235,15 +235,15 @@ TEST_IMPL(tty_empty_write) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyout_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyout_fd >= 0); + ASSERT_GE(ttyout_fd, 0); - ASSERT(UV_TTY == uv_guess_handle(ttyout_fd)); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyout_fd)); r = uv_tty_init(loop, &tty_out, ttyout_fd, 0); /* Writable. */ - ASSERT(r == 0); + ASSERT_OK(r); ASSERT(!uv_is_readable((uv_stream_t*) &tty_out)); ASSERT(uv_is_writable((uv_stream_t*) &tty_out)); @@ -251,7 +251,7 @@ TEST_IMPL(tty_empty_write) { bufs[0].base = &dummy[0]; r = uv_try_write((uv_stream_t*) &tty_out, bufs, 1); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &tty_out, NULL); @@ -281,15 +281,15 @@ TEST_IMPL(tty_large_write) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyout_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyout_fd >= 0); + ASSERT_GE(ttyout_fd, 0); - ASSERT(UV_TTY == uv_guess_handle(ttyout_fd)); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyout_fd)); r = uv_tty_init(loop, &tty_out, ttyout_fd, 0); /* Writable. */ - ASSERT(r == 0); + ASSERT_OK(r); memset(dummy, '.', sizeof(dummy) - 1); dummy[sizeof(dummy) - 1] = '\n'; @@ -297,7 +297,7 @@ TEST_IMPL(tty_large_write) { bufs[0] = uv_buf_init(dummy, sizeof(dummy)); r = uv_try_write((uv_stream_t*) &tty_out, bufs, 1); - ASSERT(r == 10000); + ASSERT_EQ(10000, r); uv_close((uv_handle_t*) &tty_out, NULL); @@ -321,20 +321,20 @@ TEST_IMPL(tty_raw_cancel) { OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - ASSERT(handle != INVALID_HANDLE_VALUE); + ASSERT_PTR_NE(handle, INVALID_HANDLE_VALUE); ttyin_fd = _open_osfhandle((intptr_t) handle, 0); - ASSERT(ttyin_fd >= 0); - ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + ASSERT_GE(ttyin_fd, 0); + ASSERT_EQ(UV_TTY, uv_guess_handle(ttyin_fd)); r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */ - ASSERT(r == 0); + ASSERT_OK(r); r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_start((uv_stream_t*)&tty_in, tty_raw_alloc, tty_raw_read); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_read_stop((uv_stream_t*) &tty_in); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -350,35 +350,35 @@ TEST_IMPL(tty_file) { uv_tty_t tty_wo; int fd; - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); fd = open("test/fixtures/empty_file", O_RDONLY); if (fd != -1) { - ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); - ASSERT(0 == close(fd)); + ASSERT_EQ(UV_EINVAL, uv_tty_init(&loop, &tty, fd, 1)); + ASSERT_OK(close(fd)); /* test EBADF handling */ - ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); + ASSERT_EQ(UV_EINVAL, uv_tty_init(&loop, &tty, fd, 1)); } /* Bug on AIX where '/dev/random' returns 1 from isatty() */ #ifndef _AIX fd = open("/dev/random", O_RDONLY); if (fd != -1) { - ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); - ASSERT(0 == close(fd)); + ASSERT_EQ(UV_EINVAL, uv_tty_init(&loop, &tty, fd, 1)); + ASSERT_OK(close(fd)); } #endif /* _AIX */ fd = open("/dev/zero", O_RDONLY); if (fd != -1) { - ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); - ASSERT(0 == close(fd)); + ASSERT_EQ(UV_EINVAL, uv_tty_init(&loop, &tty, fd, 1)); + ASSERT_OK(close(fd)); } fd = open("/dev/tty", O_RDWR); if (fd != -1) { - ASSERT(0 == uv_tty_init(&loop, &tty, fd, 1)); - ASSERT(0 == close(fd)); /* TODO: it's indeterminate who owns fd now */ + ASSERT_OK(uv_tty_init(&loop, &tty, fd, 1)); + ASSERT_OK(close(fd)); /* TODO: it's indeterminate who owns fd now */ ASSERT(uv_is_readable((uv_stream_t*) &tty)); ASSERT(uv_is_writable((uv_stream_t*) &tty)); uv_close((uv_handle_t*) &tty, NULL); @@ -388,8 +388,8 @@ TEST_IMPL(tty_file) { fd = open("/dev/tty", O_RDONLY); if (fd != -1) { - ASSERT(0 == uv_tty_init(&loop, &tty_ro, fd, 1)); - ASSERT(0 == close(fd)); /* TODO: it's indeterminate who owns fd now */ + ASSERT_OK(uv_tty_init(&loop, &tty_ro, fd, 1)); + ASSERT_OK(close(fd)); /* TODO: it's indeterminate who owns fd now */ ASSERT(uv_is_readable((uv_stream_t*) &tty_ro)); ASSERT(!uv_is_writable((uv_stream_t*) &tty_ro)); uv_close((uv_handle_t*) &tty_ro, NULL); @@ -399,8 +399,8 @@ TEST_IMPL(tty_file) { fd = open("/dev/tty", O_WRONLY); if (fd != -1) { - ASSERT(0 == uv_tty_init(&loop, &tty_wo, fd, 0)); - ASSERT(0 == close(fd)); /* TODO: it's indeterminate who owns fd now */ + ASSERT_OK(uv_tty_init(&loop, &tty_wo, fd, 0)); + ASSERT_OK(close(fd)); /* TODO: it's indeterminate who owns fd now */ ASSERT(!uv_is_readable((uv_stream_t*) &tty_wo)); ASSERT(uv_is_writable((uv_stream_t*) &tty_wo)); uv_close((uv_handle_t*) &tty_wo, NULL); @@ -409,7 +409,7 @@ TEST_IMPL(tty_file) { } - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(&loop); #endif @@ -436,14 +436,14 @@ TEST_IMPL(tty_pty) { uv_loop_t loop; uv_tty_t master_tty, slave_tty; - ASSERT(0 == uv_loop_init(&loop)); + ASSERT_OK(uv_loop_init(&loop)); r = openpty(&master_fd, &slave_fd, NULL, NULL, &w); if (r != 0) RETURN_SKIP("No pty available, skipping."); - ASSERT(0 == uv_tty_init(&loop, &slave_tty, slave_fd, 0)); - ASSERT(0 == uv_tty_init(&loop, &master_tty, master_fd, 0)); + ASSERT_OK(uv_tty_init(&loop, &slave_tty, slave_fd, 0)); + ASSERT_OK(uv_tty_init(&loop, &master_tty, master_fd, 0)); ASSERT(uv_is_readable((uv_stream_t*) &slave_tty)); ASSERT(uv_is_writable((uv_stream_t*) &slave_tty)); ASSERT(uv_is_readable((uv_stream_t*) &master_tty)); @@ -451,16 +451,16 @@ TEST_IMPL(tty_pty) { /* Check if the file descriptor was reopened. If it is, * UV_HANDLE_BLOCKING_WRITES (value 0x100000) isn't set on flags. */ - ASSERT(0 == (slave_tty.flags & 0x100000)); + ASSERT_OK((slave_tty.flags & 0x100000)); /* The master_fd of a pty should never be reopened. */ ASSERT(master_tty.flags & 0x100000); - ASSERT(0 == close(slave_fd)); + ASSERT_OK(close(slave_fd)); uv_close((uv_handle_t*) &slave_tty, NULL); - ASSERT(0 == close(master_fd)); + ASSERT_OK(close(master_fd)); uv_close((uv_handle_t*) &master_tty, NULL); - ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(&loop); #endif diff --git a/deps/uv/test/test-udp-alloc-cb-fail.c b/deps/uv/test/test-udp-alloc-cb-fail.c index 073dea977821d6..ae4bbee325e9b8 100644 --- a/deps/uv/test/test-udp-alloc-cb-fail.c +++ b/deps/uv/test/test-udp-alloc-cb-fail.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -60,7 +60,7 @@ static void cl_alloc_cb(uv_handle_t* handle, static void close_cb(uv_handle_t* handle) { CHECK_HANDLE(handle); - ASSERT(1 == uv_is_closing(handle)); + ASSERT_EQ(1, uv_is_closing(handle)); close_cb_called++; } @@ -71,8 +71,8 @@ static void cl_recv_cb(uv_udp_t* handle, const struct sockaddr* addr, unsigned flags) { CHECK_HANDLE(handle); - ASSERT(flags == 0); - ASSERT(nread == UV_ENOBUFS); + ASSERT_OK(flags); + ASSERT_EQ(nread, UV_ENOBUFS); cl_recv_cb_called++; @@ -84,11 +84,11 @@ static void cl_send_cb(uv_udp_send_t* req, int status) { int r; ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); r = uv_udp_recv_start(req->handle, cl_alloc_cb, cl_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); cl_send_cb_called++; } @@ -96,7 +96,7 @@ static void cl_send_cb(uv_udp_send_t* req, int status) { static void sv_send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); uv_close((uv_handle_t*) req->handle, close_cb); @@ -126,21 +126,21 @@ static void sv_recv_cb(uv_udp_t* handle, } CHECK_HANDLE(handle); - ASSERT(flags == 0); + ASSERT_OK(flags); ASSERT_NOT_NULL(addr); - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT(!memcmp("PING", rcvbuf->base, nread)); r = uv_udp_recv_stop(handle); - ASSERT(r == 0); + ASSERT_OK(r); req = malloc(sizeof *req); ASSERT_NOT_NULL(req); sndbuf = uv_buf_init("PONG", 4); r = uv_udp_send(req, handle, &sndbuf, 1, addr, sv_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); sv_recv_cb_called++; } @@ -152,21 +152,21 @@ TEST_IMPL(udp_alloc_cb_fail) { uv_buf_t buf; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, sv_alloc_cb, sv_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); buf = uv_buf_init("PING", 4); r = uv_udp_send(&req, @@ -175,21 +175,21 @@ TEST_IMPL(udp_alloc_cb_fail) { 1, (const struct sockaddr*) &addr, cl_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(cl_send_cb_called == 0); - ASSERT(cl_recv_cb_called == 0); - ASSERT(sv_send_cb_called == 0); - ASSERT(sv_recv_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(cl_send_cb_called); + ASSERT_OK(cl_recv_cb_called); + ASSERT_OK(sv_send_cb_called); + ASSERT_OK(sv_recv_cb_called); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(cl_send_cb_called == 1); - ASSERT(cl_recv_cb_called == 1); - ASSERT(sv_send_cb_called == 1); - ASSERT(sv_recv_cb_called == 1); - ASSERT(close_cb_called == 2); + ASSERT_EQ(1, cl_send_cb_called); + ASSERT_EQ(1, cl_recv_cb_called); + ASSERT_EQ(1, sv_send_cb_called); + ASSERT_EQ(1, sv_recv_cb_called); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-bind.c b/deps/uv/test/test-udp-bind.c index 200cdc7c927fa9..519f9b02fa2cc2 100644 --- a/deps/uv/test/test-udp-bind.c +++ b/deps/uv/test/test-udp-bind.c @@ -33,27 +33,27 @@ TEST_IMPL(udp_bind) { uv_udp_t h1, h2; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); loop = uv_default_loop(); r = uv_udp_init(loop, &h1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(loop, &h2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&h1, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&h2, (const struct sockaddr*) &addr, 0); - ASSERT(r == UV_EADDRINUSE); + ASSERT_EQ(r, UV_EADDRINUSE); uv_close((uv_handle_t*) &h1, NULL); uv_close((uv_handle_t*) &h2, NULL); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -66,27 +66,27 @@ TEST_IMPL(udp_bind_reuseaddr) { uv_udp_t h1, h2; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); loop = uv_default_loop(); r = uv_udp_init(loop, &h1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(loop, &h2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&h1, (const struct sockaddr*) &addr, UV_UDP_REUSEADDR); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&h2, (const struct sockaddr*) &addr, UV_UDP_REUSEADDR); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &h1, NULL); uv_close((uv_handle_t*) &h2, NULL); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-udp-connect.c b/deps/uv/test/test-udp-connect.c index c1e4064b94e255..88314acc69b073 100644 --- a/deps/uv/test/test-udp-connect.c +++ b/deps/uv/test/test-udp-connect.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -45,7 +45,7 @@ static void alloc_cb(uv_handle_t* handle, uv_buf_t* buf) { static char slab[65536]; CHECK_HANDLE(handle); - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -62,19 +62,19 @@ static void cl_send_cb(uv_udp_send_t* req, int status) { int r; ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); if (++cl_send_cb_called == 1) { uv_udp_connect(&client, NULL); r = uv_udp_send(req, &client, &buf, 1, NULL, cl_send_cb); - ASSERT(r == UV_EDESTADDRREQ); + ASSERT_EQ(r, UV_EDESTADDRREQ); r = uv_udp_send(req, &client, &buf, 1, (const struct sockaddr*) &lo_addr, cl_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); } } @@ -86,9 +86,9 @@ static void sv_recv_cb(uv_udp_t* handle, const struct sockaddr* addr, unsigned flags) { if (nread > 0) { - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT_NOT_NULL(addr); - ASSERT(memcmp("EXIT", rcvbuf->base, nread) == 0); + ASSERT_OK(memcmp("EXIT", rcvbuf->base, nread)); if (++sv_recv_cb_called == 4) { uv_close((uv_handle_t*) &server, close_cb); uv_close((uv_handle_t*) &client, close_cb); @@ -107,89 +107,89 @@ TEST_IMPL(udp_connect) { int r; int addrlen; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &lo_addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &lo_addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &lo_addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, sv_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); buf = uv_buf_init("EXIT", 4); /* connect() to INADDR_ANY fails on Windows with WSAEADDRNOTAVAIL */ - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &tmp_addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &tmp_addr)); r = uv_udp_connect(&client, (const struct sockaddr*) &tmp_addr); #ifdef _WIN32 ASSERT_EQ(r, UV_EADDRNOTAVAIL); #else - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_connect(&client, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); #endif - ASSERT(0 == uv_ip4_addr("8.8.8.8", TEST_PORT, &ext_addr)); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &lo_addr)); + ASSERT_OK(uv_ip4_addr("8.8.8.8", TEST_PORT, &ext_addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &lo_addr)); r = uv_udp_connect(&client, (const struct sockaddr*) &lo_addr); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_connect(&client, (const struct sockaddr*) &ext_addr); - ASSERT(r == UV_EISCONN); + ASSERT_EQ(r, UV_EISCONN); addrlen = sizeof(tmp_addr); r = uv_udp_getpeername(&client, (struct sockaddr*) &tmp_addr, &addrlen); - ASSERT(r == 0); + ASSERT_OK(r); /* To send messages in connected UDP sockets addr must be NULL */ r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &lo_addr); - ASSERT(r == UV_EISCONN); + ASSERT_EQ(r, UV_EISCONN); r = uv_udp_try_send(&client, &buf, 1, NULL); - ASSERT(r == 4); + ASSERT_EQ(4, r); r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &ext_addr); - ASSERT(r == UV_EISCONN); + ASSERT_EQ(r, UV_EISCONN); r = uv_udp_connect(&client, NULL); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_connect(&client, NULL); - ASSERT(r == UV_ENOTCONN); + ASSERT_EQ(r, UV_ENOTCONN); addrlen = sizeof(tmp_addr); r = uv_udp_getpeername(&client, (struct sockaddr*) &tmp_addr, &addrlen); - ASSERT(r == UV_ENOTCONN); + ASSERT_EQ(r, UV_ENOTCONN); /* To send messages in disconnected UDP sockets addr must be set */ r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &lo_addr); - ASSERT(r == 4); + ASSERT_EQ(4, r); r = uv_udp_try_send(&client, &buf, 1, NULL); - ASSERT(r == UV_EDESTADDRREQ); + ASSERT_EQ(r, UV_EDESTADDRREQ); r = uv_udp_connect(&client, (const struct sockaddr*) &lo_addr); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_send(&req, &client, &buf, 1, (const struct sockaddr*) &lo_addr, cl_send_cb); - ASSERT(r == UV_EISCONN); + ASSERT_EQ(r, UV_EISCONN); r = uv_udp_send(&req, &client, &buf, 1, NULL, cl_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 2); - ASSERT(sv_recv_cb_called == 4); - ASSERT(cl_send_cb_called == 2); + ASSERT_EQ(2, close_cb_called); + ASSERT_EQ(4, sv_recv_cb_called); + ASSERT_EQ(2, cl_send_cb_called); - ASSERT(client.send_queue_size == 0); - ASSERT(server.send_queue_size == 0); + ASSERT_OK(client.send_queue_size); + ASSERT_OK(server.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-connect6.c b/deps/uv/test/test-udp-connect6.c index 076d8d77b92df4..bbc4033c55f9fd 100644 --- a/deps/uv/test/test-udp-connect6.c +++ b/deps/uv/test/test-udp-connect6.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -62,7 +62,7 @@ static void cl_send_cb(uv_udp_send_t* req, int status) { int r; ASSERT_NOT_NULL(req); - ASSERT_EQ(status, 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); if (++cl_send_cb_called == 1) { uv_udp_connect(&client, NULL); @@ -74,7 +74,7 @@ static void cl_send_cb(uv_udp_send_t* req, int status) { 1, (const struct sockaddr*) &lo_addr, cl_send_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } } @@ -86,9 +86,9 @@ static void sv_recv_cb(uv_udp_t* handle, const struct sockaddr* addr, unsigned flags) { if (nread > 0) { - ASSERT_EQ(nread, 4); + ASSERT_EQ(4, nread); ASSERT_NOT_NULL(addr); - ASSERT_EQ(memcmp("EXIT", rcvbuf->base, nread), 0); + ASSERT_OK(memcmp("EXIT", rcvbuf->base, nread)); if (++sv_recv_cb_called == 4) { uv_close((uv_handle_t*) &server, close_cb); uv_close((uv_handle_t*) &client, close_cb); @@ -110,55 +110,55 @@ TEST_IMPL(udp_connect6) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT_EQ(0, uv_ip6_addr("::", TEST_PORT, &lo_addr)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT, &lo_addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &lo_addr, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, sv_recv_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &client); - ASSERT_EQ(r, 0); + ASSERT_OK(r); buf = uv_buf_init("EXIT", 4); /* connect() to INADDR_ANY fails on Windows wih WSAEADDRNOTAVAIL */ - ASSERT_EQ(0, uv_ip6_addr("::", TEST_PORT, &tmp_addr)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT, &tmp_addr)); r = uv_udp_connect(&client, (const struct sockaddr*) &tmp_addr); #ifdef _WIN32 ASSERT_EQ(r, UV_EADDRNOTAVAIL); #else - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_connect(&client, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); #endif - ASSERT_EQ(0, uv_ip6_addr("2001:4860:4860::8888", TEST_PORT, &ext_addr)); - ASSERT_EQ(0, uv_ip6_addr("::1", TEST_PORT, &lo_addr)); + ASSERT_OK(uv_ip6_addr("2001:4860:4860::8888", TEST_PORT, &ext_addr)); + ASSERT_OK(uv_ip6_addr("::1", TEST_PORT, &lo_addr)); r = uv_udp_connect(&client, (const struct sockaddr*) &lo_addr); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_connect(&client, (const struct sockaddr*) &ext_addr); ASSERT_EQ(r, UV_EISCONN); addrlen = sizeof(tmp_addr); r = uv_udp_getpeername(&client, (struct sockaddr*) &tmp_addr, &addrlen); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* To send messages in connected UDP sockets addr must be NULL */ r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &lo_addr); ASSERT_EQ(r, UV_EISCONN); r = uv_udp_try_send(&client, &buf, 1, NULL); - ASSERT_EQ(r, 4); + ASSERT_EQ(4, r); r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &ext_addr); ASSERT_EQ(r, UV_EISCONN); r = uv_udp_connect(&client, NULL); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_connect(&client, NULL); ASSERT_EQ(r, UV_ENOTCONN); @@ -168,13 +168,13 @@ TEST_IMPL(udp_connect6) { /* To send messages in disconnected UDP sockets addr must be set */ r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &lo_addr); - ASSERT_EQ(r, 4); + ASSERT_EQ(4, r); r = uv_udp_try_send(&client, &buf, 1, NULL); ASSERT_EQ(r, UV_EDESTADDRREQ); r = uv_udp_connect(&client, (const struct sockaddr*) &lo_addr); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_send(&req, &client, &buf, @@ -183,16 +183,16 @@ TEST_IMPL(udp_connect6) { cl_send_cb); ASSERT_EQ(r, UV_EISCONN); r = uv_udp_send(&req, &client, &buf, 1, NULL, cl_send_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT_EQ(close_cb_called, 2); - ASSERT_EQ(sv_recv_cb_called, 4); - ASSERT_EQ(cl_send_cb_called, 2); + ASSERT_EQ(2, close_cb_called); + ASSERT_EQ(4, sv_recv_cb_called); + ASSERT_EQ(2, cl_send_cb_called); - ASSERT_EQ(client.send_queue_size, 0); - ASSERT_EQ(server.send_queue_size, 0); + ASSERT_OK(client.send_queue_size); + ASSERT_OK(server.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-create-socket-early.c b/deps/uv/test/test-udp-create-socket-early.c index f51e275ba1e352..f2e166af9c2b80 100644 --- a/deps/uv/test/test-udp-create-socket-early.c +++ b/deps/uv/test/test-udp-create-socket-early.c @@ -38,32 +38,34 @@ TEST_IMPL(udp_create_early) { uv_os_fd_t fd; int r, namelen; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_udp_init_ex(uv_default_loop(), &client, AF_INET); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((const uv_handle_t*) &client, &fd); - ASSERT(r == 0); - ASSERT(fd != INVALID_FD); + ASSERT_OK(r); /* Windows returns WSAEINVAL if the socket is not bound */ #ifndef _WIN32 + ASSERT_NE(fd, INVALID_FD); namelen = sizeof sockname; r = uv_udp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); - ASSERT(r == 0); - ASSERT(sockname.sin_family == AF_INET); + ASSERT_OK(r); + ASSERT_EQ(sockname.sin_family, AF_INET); +#else + ASSERT_PTR_NE(fd, INVALID_FD); #endif r = uv_udp_bind(&client, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); namelen = sizeof sockname; r = uv_udp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); - ASSERT(r == 0); - ASSERT(memcmp(&addr.sin_addr, - &sockname.sin_addr, - sizeof(addr.sin_addr)) == 0); + ASSERT_OK(r); + ASSERT_OK(memcmp(&addr.sin_addr, + &sockname.sin_addr, + sizeof(addr.sin_addr))); uv_close((uv_handle_t*) &client, NULL); uv_run(uv_default_loop(), UV_RUN_DEFAULT); @@ -82,32 +84,34 @@ TEST_IMPL(udp_create_early_bad_bind) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_udp_init_ex(uv_default_loop(), &client, AF_INET6); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_fileno((const uv_handle_t*) &client, &fd); - ASSERT(r == 0); - ASSERT(fd != INVALID_FD); + ASSERT_OK(r); /* Windows returns WSAEINVAL if the socket is not bound */ -#ifndef _WIN32 - { +#ifndef _WIN32 + ASSERT_NE(fd, INVALID_FD); + { int namelen; struct sockaddr_in6 sockname; namelen = sizeof sockname; r = uv_udp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); - ASSERT(r == 0); - ASSERT(sockname.sin6_family == AF_INET6); + ASSERT_OK(r); + ASSERT_EQ(sockname.sin6_family, AF_INET6); } +#else + ASSERT_PTR_NE(fd, INVALID_FD); #endif r = uv_udp_bind(&client, (const struct sockaddr*) &addr, 0); #if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MSYS__) - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); #else - ASSERT(r == UV_EFAULT); + ASSERT_EQ(r, UV_EFAULT); #endif uv_close((uv_handle_t*) &client, NULL); @@ -123,10 +127,10 @@ TEST_IMPL(udp_create_early_bad_domain) { int r; r = uv_udp_init_ex(uv_default_loop(), &client, 47); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); r = uv_udp_init_ex(uv_default_loop(), &client, 1024); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); uv_run(uv_default_loop(), UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-udp-dgram-too-big.c b/deps/uv/test/test-udp-dgram-too-big.c index 9db8b47be18da8..8fae756e5c4c88 100644 --- a/deps/uv/test/test-udp-dgram-too-big.c +++ b/deps/uv/test/test-udp-dgram-too-big.c @@ -27,10 +27,10 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &handle_) + ASSERT_PTR_EQ((uv_udp_t*)(handle), &handle_) #define CHECK_REQ(req) \ - ASSERT((req) == &req_); + ASSERT_PTR_EQ((req), &req_); static uv_udp_t handle_; static uv_udp_send_t req_; @@ -49,7 +49,7 @@ static void send_cb(uv_udp_send_t* req, int status) { CHECK_REQ(req); CHECK_HANDLE(req->handle); - ASSERT(status == UV_EMSGSIZE); + ASSERT_EQ(status, UV_EMSGSIZE); uv_close((uv_handle_t*)req->handle, close_cb); send_cb_called++; @@ -65,10 +65,10 @@ TEST_IMPL(udp_dgram_too_big) { memset(dgram, 42, sizeof dgram); /* silence valgrind */ r = uv_udp_init(uv_default_loop(), &handle_); - ASSERT(r == 0); + ASSERT_OK(r); buf = uv_buf_init(dgram, sizeof dgram); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_udp_send(&req_, &handle_, @@ -76,15 +76,15 @@ TEST_IMPL(udp_dgram_too_big) { 1, (const struct sockaddr*) &addr, send_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(send_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(send_cb_called); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(send_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, send_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-ipv6.c b/deps/uv/test/test-udp-ipv6.c index ae55cd01b0b2a7..8ad80b9b5a9b6d 100644 --- a/deps/uv/test/test-udp-ipv6.c +++ b/deps/uv/test/test-udp-ipv6.c @@ -30,13 +30,13 @@ #include #endif -#define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server \ - || (uv_udp_t*)(handle) == &client \ - || (uv_timer_t*)(handle) == &timeout) +#define CHECK_HANDLE(handle) \ + ASSERT_NE((uv_udp_t*)(handle) == &server \ + || (uv_udp_t*)(handle) == &client \ + || (uv_timer_t*)(handle) == &timeout, 0) #define CHECK_REQ(req) \ - ASSERT((req) == &req_); + ASSERT_PTR_EQ((req), &req_); static uv_udp_t client; static uv_udp_t server; @@ -81,7 +81,7 @@ static void close_cb(uv_handle_t* handle) { static void send_cb(uv_udp_send_t* req, int status) { CHECK_REQ(req); CHECK_HANDLE(req->handle); - ASSERT(status == 0); + ASSERT_OK(status); send_cb_called++; } @@ -92,7 +92,7 @@ static int is_from_client(const struct sockaddr* addr) { /* Debugging output, and filter out unwanted network traffic */ if (addr != NULL) { - ASSERT(addr->sa_family == AF_INET6); + ASSERT_EQ(addr->sa_family, AF_INET6); addr6 = (struct sockaddr_in6*) addr; r = uv_inet_ntop(addr->sa_family, &addr6->sin6_addr, dst, sizeof(dst)); if (r == 0) @@ -129,7 +129,7 @@ static void ipv6_recv_ok(uv_udp_t* handle, if (!is_from_client(addr) || (nread == 0 && addr == NULL)) return; - ASSERT(nread == 9); + ASSERT_EQ(9, nread); ASSERT(!memcmp(buf->base, data, 9)); recv_cb_called++; } @@ -151,31 +151,39 @@ static void do_test(uv_udp_recv_cb recv_cb, int bind_flags) { char dst[256]; int r; - ASSERT(0 == uv_ip6_addr("::0", TEST_PORT, &addr6)); + ASSERT_OK(uv_ip6_addr("::0", TEST_PORT, &addr6)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &addr6, bind_flags); - ASSERT(r == 0); + ASSERT_OK(r); addr6_len = sizeof(addr6); - ASSERT(uv_udp_getsockname(&server, (struct sockaddr*) &addr6, &addr6_len) == 0); - ASSERT(uv_inet_ntop(addr6.sin6_family, &addr6.sin6_addr, dst, sizeof(dst)) == 0); + ASSERT_OK(uv_udp_getsockname(&server, + (struct sockaddr*) &addr6, + &addr6_len)); + ASSERT_OK(uv_inet_ntop(addr6.sin6_family, + &addr6.sin6_addr, + dst, + sizeof(dst))); printf("on [%.*s]:%d\n", (int) sizeof(dst), dst, addr6.sin6_port); r = uv_udp_recv_start(&server, alloc_cb, recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT(uv_inet_ntop(addr.sin_family, &addr.sin_addr, dst, sizeof(dst)) == 0); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_inet_ntop(addr.sin_family, &addr.sin_addr, dst, sizeof(dst))); printf("to [%.*s]:%d\n", (int) sizeof(dst), dst, addr.sin_port); /* Create some unique data to send */ - ASSERT(9 == snprintf(data, sizeof(data), "PING%5u", uv_os_getpid() & 0xFFFF)); + ASSERT_EQ(9, snprintf(data, + sizeof(data), + "PING%5u", + uv_os_getpid() & 0xFFFF)); buf = uv_buf_init(data, 9); printf("sending %s\n", data); @@ -185,27 +193,27 @@ static void do_test(uv_udp_recv_cb recv_cb, int bind_flags) { 1, (const struct sockaddr*) &addr, send_cb); - ASSERT(r == 0); + ASSERT_OK(r); addr_len = sizeof(addr); - ASSERT(uv_udp_getsockname(&client, (struct sockaddr*) &addr, &addr_len) == 0); - ASSERT(uv_inet_ntop(addr.sin_family, &addr.sin_addr, dst, sizeof(dst)) == 0); + ASSERT_OK(uv_udp_getsockname(&client, (struct sockaddr*) &addr, &addr_len)); + ASSERT_OK(uv_inet_ntop(addr.sin_family, &addr.sin_addr, dst, sizeof(dst))); printf("from [%.*s]:%d\n", (int) sizeof(dst), dst, addr.sin_port); client_port = addr.sin_port; r = uv_timer_init(uv_default_loop(), &timeout); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timeout, timeout_cb, 500, 0); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(send_cb_called == 0); - ASSERT(recv_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(send_cb_called); + ASSERT_OK(recv_cb_called); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 3); + ASSERT_EQ(3, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); } @@ -231,8 +239,8 @@ TEST_IMPL(udp_dual_stack) { printf("recv_cb_called %d\n", recv_cb_called); printf("send_cb_called %d\n", send_cb_called); - ASSERT(recv_cb_called == 1); - ASSERT(send_cb_called == 1); + ASSERT_EQ(1, recv_cb_called); + ASSERT_EQ(1, send_cb_called); return 0; } @@ -244,8 +252,8 @@ TEST_IMPL(udp_ipv6_only) { do_test(ipv6_recv_fail, UV_UDP_IPV6ONLY); - ASSERT(recv_cb_called == 0); - ASSERT(send_cb_called == 1); + ASSERT_OK(recv_cb_called); + ASSERT_EQ(1, send_cb_called); return 0; } diff --git a/deps/uv/test/test-udp-mmsg.c b/deps/uv/test/test-udp-mmsg.c index c37343f8c9f4c5..c0e000b9d92bbf 100644 --- a/deps/uv/test/test-udp-mmsg.c +++ b/deps/uv/test/test-udp-mmsg.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &recver || (uv_udp_t*)(handle) == &sender) + ASSERT_NE((uv_udp_t*)(handle) == &recver || (uv_udp_t*)(handle) == &sender, 0) #define BUFFER_MULTIPLIER 20 #define MAX_DGRAM_SIZE (64 * 1024) @@ -77,7 +77,7 @@ static void recv_cb(uv_udp_t* handle, /* free and return if this is a mmsg free-only callback invocation */ if (flags & UV_UDP_MMSG_FREE) { - ASSERT_EQ(nread, 0); + ASSERT_OK(nread); ASSERT_NULL(addr); free(rcvbuf->base); return; @@ -87,7 +87,7 @@ static void recv_cb(uv_udp_t* handle, /* There can be no more available data for the time being. */ ASSERT_NULL(addr); } else { - ASSERT_EQ(nread, 4); + ASSERT_EQ(4, nread); ASSERT_NOT_NULL(addr); ASSERT_MEM_EQ("PING", rcvbuf->base, nread); received_datagrams++; @@ -110,31 +110,31 @@ TEST_IMPL(udp_mmsg) { uv_buf_t buf; int i; - ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - ASSERT_EQ(0, uv_udp_init_ex(uv_default_loop(), &recver, - AF_UNSPEC | UV_UDP_RECVMMSG)); + ASSERT_OK(uv_udp_init_ex(uv_default_loop(), &recver, + AF_UNSPEC | UV_UDP_RECVMMSG)); - ASSERT_EQ(0, uv_udp_bind(&recver, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_udp_bind(&recver, (const struct sockaddr*) &addr, 0)); - ASSERT_EQ(0, uv_udp_recv_start(&recver, alloc_cb, recv_cb)); + ASSERT_OK(uv_udp_recv_start(&recver, alloc_cb, recv_cb)); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT_EQ(0, uv_udp_init(uv_default_loop(), &sender)); + ASSERT_OK(uv_udp_init(uv_default_loop(), &sender)); buf = uv_buf_init("PING", 4); for (i = 0; i < NUM_SENDS; i++) { ASSERT_EQ(4, uv_udp_try_send(&sender, &buf, 1, (const struct sockaddr*) &addr)); } - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT_EQ(close_cb_called, 2); + ASSERT_EQ(2, close_cb_called); ASSERT_EQ(received_datagrams, NUM_SENDS); - ASSERT_EQ(sender.send_queue_size, 0); - ASSERT_EQ(recver.send_queue_size, 0); + ASSERT_OK(sender.send_queue_size); + ASSERT_OK(recver.send_queue_size); printf("%d allocs for %d recvs\n", alloc_cb_called, recv_cb_called); diff --git a/deps/uv/test/test-udp-multicast-interface.c b/deps/uv/test/test-udp-multicast-interface.c index 447d3487f5cefc..2c558c8b0f156e 100644 --- a/deps/uv/test/test-udp-multicast-interface.c +++ b/deps/uv/test/test-udp-multicast-interface.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -65,17 +65,17 @@ TEST_IMPL(udp_multicast_interface) { struct sockaddr_in addr; struct sockaddr_in baddr; - ASSERT(0 == uv_ip4_addr("239.255.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("239.255.0.1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &baddr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", 0, &baddr)); r = uv_udp_bind(&server, (const struct sockaddr*)&baddr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_set_multicast_interface(&server, "0.0.0.0"); - ASSERT(r == 0); + ASSERT_OK(r); /* server sends "PING" */ buf = uv_buf_init("PING", 4); @@ -85,19 +85,19 @@ TEST_IMPL(udp_multicast_interface) { 1, (const struct sockaddr*)&addr, sv_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(sv_send_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(sv_send_cb_called); /* run the loop till all events are processed */ uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(sv_send_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, sv_send_cb_called); + ASSERT_EQ(1, close_cb_called); - ASSERT(client.send_queue_size == 0); - ASSERT(server.send_queue_size == 0); + ASSERT_OK(client.send_queue_size); + ASSERT_OK(server.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-multicast-interface6.c b/deps/uv/test/test-udp-multicast-interface6.c index 1d40aefa8cb236..54fc87ed4e93ae 100644 --- a/deps/uv/test/test-udp-multicast-interface6.c +++ b/deps/uv/test/test-udp-multicast-interface6.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -44,7 +44,7 @@ static void close_cb(uv_handle_t* handle) { static void sv_send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); sv_send_cb_called++; @@ -68,21 +68,21 @@ TEST_IMPL(udp_multicast_interface6) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr("::1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip6_addr("::", 0, &baddr)); + ASSERT_OK(uv_ip6_addr("::", 0, &baddr)); r = uv_udp_bind(&server, (const struct sockaddr*)&baddr, 0); - ASSERT(r == 0); + ASSERT_OK(r); #if defined(__APPLE__) || defined(__FreeBSD__) r = uv_udp_set_multicast_interface(&server, "::1%lo0"); #else r = uv_udp_set_multicast_interface(&server, NULL); #endif - ASSERT(r == 0); + ASSERT_OK(r); /* server sends "PING" */ buf = uv_buf_init("PING", 4); @@ -92,16 +92,16 @@ TEST_IMPL(udp_multicast_interface6) { 1, (const struct sockaddr*)&addr, sv_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(sv_send_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(sv_send_cb_called); /* run the loop till all events are processed */ uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(sv_send_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, sv_send_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-multicast-join.c b/deps/uv/test/test-udp-multicast-join.c index dddcea4662f1d9..7e8fbe39f08c3b 100644 --- a/deps/uv/test/test-udp-multicast-join.c +++ b/deps/uv/test/test-udp-multicast-join.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) #define MULTICAST_ADDR "239.255.0.1" @@ -47,7 +47,7 @@ static void alloc_cb(uv_handle_t* handle, uv_buf_t* buf) { static char slab[65536]; CHECK_HANDLE(handle); - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -61,7 +61,7 @@ static void close_cb(uv_handle_t* handle) { static void sv_send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); sv_send_cb_called++; @@ -77,7 +77,7 @@ static int do_send(uv_udp_send_t* send_req) { buf = uv_buf_init("PING", 4); - ASSERT(0 == uv_ip4_addr(MULTICAST_ADDR, TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr(MULTICAST_ADDR, TEST_PORT, &addr)); /* client sends "PING" */ return uv_udp_send(send_req, @@ -95,7 +95,7 @@ static void cl_recv_cb(uv_udp_t* handle, const struct sockaddr* addr, unsigned flags) { CHECK_HANDLE(handle); - ASSERT(flags == 0); + ASSERT_OK(flags); if (nread < 0) { ASSERT(0 && "unexpected error"); @@ -108,7 +108,7 @@ static void cl_recv_cb(uv_udp_t* handle, } ASSERT_NOT_NULL(addr); - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT(!memcmp("PING", buf->base, nread)); cl_recv_cb_called++; @@ -121,18 +121,18 @@ static void cl_recv_cb(uv_udp_t* handle, char source_addr[64]; r = uv_ip4_name((const struct sockaddr_in*)addr, source_addr, sizeof(source_addr)); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_set_membership(&server, MULTICAST_ADDR, NULL, UV_LEAVE_GROUP); - ASSERT(r == 0); + ASSERT_OK(r); #if !defined(__OpenBSD__) && !defined(__NetBSD__) r = uv_udp_set_source_membership(&server, MULTICAST_ADDR, NULL, source_addr, UV_JOIN_GROUP); - ASSERT(r == 0); + ASSERT_OK(r); #endif r = do_send(&req_ss); - ASSERT(r == 0); + ASSERT_OK(r); } } @@ -144,40 +144,40 @@ TEST_IMPL(udp_multicast_join) { int r; struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); /* bind to the desired port */ r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); /* join the multicast channel */ r = uv_udp_set_membership(&server, MULTICAST_ADDR, NULL, UV_JOIN_GROUP); if (r == UV_ENODEV) RETURN_SKIP("No multicast support."); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, cl_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = do_send(&req); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(cl_recv_cb_called == 0); - ASSERT(sv_send_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(cl_recv_cb_called); + ASSERT_OK(sv_send_cb_called); /* run the loop till all events are processed */ uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(cl_recv_cb_called == 2); - ASSERT(sv_send_cb_called == 2); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, cl_recv_cb_called); + ASSERT_EQ(2, sv_send_cb_called); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-multicast-join6.c b/deps/uv/test/test-udp-multicast-join6.c index d5262b6a9a07bf..11efb0a6f67d78 100644 --- a/deps/uv/test/test-udp-multicast-join6.c +++ b/deps/uv/test/test-udp-multicast-join6.c @@ -28,7 +28,7 @@ #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) #if defined(__APPLE__) || \ defined(_AIX) || \ @@ -58,7 +58,7 @@ static void alloc_cb(uv_handle_t* handle, uv_buf_t* buf) { static char slab[65536]; CHECK_HANDLE(handle); - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -72,7 +72,7 @@ static void close_cb(uv_handle_t* handle) { static void sv_send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); sv_send_cb_called++; @@ -88,7 +88,7 @@ static int do_send(uv_udp_send_t* send_req) { buf = uv_buf_init("PING", 4); - ASSERT(0 == uv_ip6_addr(MULTICAST_ADDR, TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr(MULTICAST_ADDR, TEST_PORT, &addr)); /* client sends "PING" */ return uv_udp_send(send_req, @@ -106,7 +106,7 @@ static void cl_recv_cb(uv_udp_t* handle, const struct sockaddr* addr, unsigned flags) { CHECK_HANDLE(handle); - ASSERT(flags == 0); + ASSERT_OK(flags); if (nread < 0) { ASSERT(0 && "unexpected error"); @@ -119,7 +119,7 @@ static void cl_recv_cb(uv_udp_t* handle, } ASSERT_NOT_NULL(addr); - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT(!memcmp("PING", buf->base, nread)); cl_recv_cb_called++; @@ -132,16 +132,16 @@ static void cl_recv_cb(uv_udp_t* handle, char source_addr[64]; r = uv_ip6_name((const struct sockaddr_in6*)addr, source_addr, sizeof(source_addr)); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_set_membership(&server, MULTICAST_ADDR, INTERFACE_ADDR, UV_LEAVE_GROUP); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_set_source_membership(&server, MULTICAST_ADDR, INTERFACE_ADDR, source_addr, UV_JOIN_GROUP); - ASSERT(r == 0); + ASSERT_OK(r); r = do_send(&req_ss); - ASSERT(r == 0); + ASSERT_OK(r); } } @@ -172,17 +172,17 @@ TEST_IMPL(udp_multicast_join6) { if (!can_ipv6_external()) RETURN_SKIP("No external IPv6 interface available"); - ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); /* bind to the desired port */ r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_set_membership(&server, MULTICAST_ADDR, INTERFACE_ADDR, UV_JOIN_GROUP); if (r == UV_ENODEV) { @@ -190,28 +190,28 @@ TEST_IMPL(udp_multicast_join6) { RETURN_SKIP("No ipv6 multicast route"); } - ASSERT(r == 0); + ASSERT_OK(r); /* TODO(gengjiawen): Fix test on QEMU. */ #if defined(__QEMU__) RETURN_SKIP("Test does not currently work in QEMU"); #endif r = uv_udp_recv_start(&server, alloc_cb, cl_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = do_send(&req); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(cl_recv_cb_called == 0); - ASSERT(sv_send_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(cl_recv_cb_called); + ASSERT_OK(sv_send_cb_called); /* run the loop till all events are processed */ uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(cl_recv_cb_called == 2); - ASSERT(sv_send_cb_called == 2); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, cl_recv_cb_called); + ASSERT_EQ(2, sv_send_cb_called); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-multicast-ttl.c b/deps/uv/test/test-udp-multicast-ttl.c index 9aa5bb9147ffbe..50bc54a066ff44 100644 --- a/deps/uv/test/test-udp-multicast-ttl.c +++ b/deps/uv/test/test-udp-multicast-ttl.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -60,34 +60,34 @@ TEST_IMPL(udp_multicast_ttl) { struct sockaddr_in addr; r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", 0, &addr)); r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_set_multicast_ttl(&server, 32); - ASSERT(r == 0); + ASSERT_OK(r); /* server sends "PING" */ buf = uv_buf_init("PING", 4); - ASSERT(0 == uv_ip4_addr("239.255.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("239.255.0.1", TEST_PORT, &addr)); r = uv_udp_send(&req, &server, &buf, 1, (const struct sockaddr*) &addr, sv_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(sv_send_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(sv_send_cb_called); /* run the loop till all events are processed */ uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(sv_send_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, sv_send_cb_called); + ASSERT_EQ(1, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-open.c b/deps/uv/test/test-udp-open.c index 0e09f56a49fa59..6fddc93717ba30 100644 --- a/deps/uv/test/test-udp-open.c +++ b/deps/uv/test/test-udp-open.c @@ -41,7 +41,7 @@ static void startup(void) { #ifdef _WIN32 struct WSAData wsa_data; int r = WSAStartup(MAKEWORD(2, 2), &wsa_data); - ASSERT(r == 0); + ASSERT_OK(r); #endif } @@ -51,9 +51,9 @@ static uv_os_sock_t create_udp_socket(void) { sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); #ifdef _WIN32 - ASSERT(sock != INVALID_SOCKET); + ASSERT_NE(sock, INVALID_SOCKET); #else - ASSERT(sock >= 0); + ASSERT_GE(sock, 0); #endif #ifndef _WIN32 @@ -61,7 +61,7 @@ static uv_os_sock_t create_udp_socket(void) { /* Allow reuse of the port. */ int yes = 1; int r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); - ASSERT(r == 0); + ASSERT_OK(r); } #endif @@ -76,7 +76,7 @@ static void close_socket(uv_os_sock_t sock) { #else r = close(sock); #endif - ASSERT(r == 0); + ASSERT_OK(r); } @@ -84,7 +84,7 @@ static void alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { static char slab[65536]; - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -113,14 +113,14 @@ static void recv_cb(uv_udp_t* handle, return; } - ASSERT(flags == 0); + ASSERT_OK(flags); ASSERT_NOT_NULL(addr); - ASSERT(nread == 4); - ASSERT(memcmp("PING", buf->base, nread) == 0); + ASSERT_EQ(4, nread); + ASSERT_OK(memcmp("PING", buf->base, nread)); r = uv_udp_recv_stop(handle); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) handle, close_cb); } @@ -128,7 +128,7 @@ static void recv_cb(uv_udp_t* handle, static void send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); send_cb_called++; uv_close((uv_handle_t*)req->handle, close_cb); @@ -142,22 +142,22 @@ TEST_IMPL(udp_open) { uv_os_sock_t sock; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); startup(); sock = create_udp_socket(); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_open(&client, sock); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&client, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&client, alloc_cb, recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_send(&send_req, &client, @@ -165,15 +165,15 @@ TEST_IMPL(udp_open) { 1, (const struct sockaddr*) &addr, send_cb); - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 { r = uv_udp_init(uv_default_loop(), &client2); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_open(&client2, sock); - ASSERT(r == UV_EEXIST); + ASSERT_EQ(r, UV_EEXIST); uv_close((uv_handle_t*) &client2, NULL); } @@ -183,10 +183,10 @@ TEST_IMPL(udp_open) { uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(send_cb_called == 1); - ASSERT(close_cb_called == 1); + ASSERT_EQ(1, send_cb_called); + ASSERT_EQ(1, close_cb_called); - ASSERT(client.send_queue_size == 0); + ASSERT_OK(client.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -203,13 +203,13 @@ TEST_IMPL(udp_open_twice) { sock2 = create_udp_socket(); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_open(&client, sock1); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_open(&client, sock2); - ASSERT(r == UV_EBUSY); + ASSERT_EQ(r, UV_EBUSY); close_socket(sock2); uv_close((uv_handle_t*) &client, NULL); @@ -225,22 +225,22 @@ TEST_IMPL(udp_open_bound) { uv_os_sock_t sock; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); startup(); sock = create_udp_socket(); r = bind(sock, (struct sockaddr*) &addr, sizeof(addr)); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_open(&client, sock); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&client, alloc_cb, recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*) &client, NULL); uv_run(uv_default_loop(), UV_RUN_DEFAULT); @@ -257,28 +257,28 @@ TEST_IMPL(udp_open_connect) { uv_os_sock_t sock; int r; - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); startup(); sock = create_udp_socket(); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); r = connect(sock, (const struct sockaddr*) &addr, sizeof(addr)); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_open(&client, sock); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_send(&send_req, &client, @@ -286,14 +286,14 @@ TEST_IMPL(udp_open_connect) { 1, NULL, send_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(send_cb_called == 1); - ASSERT(close_cb_called == 2); + ASSERT_EQ(1, send_cb_called); + ASSERT_EQ(2, close_cb_called); - ASSERT(client.send_queue_size == 0); + ASSERT_OK(client.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; @@ -315,20 +315,20 @@ TEST_IMPL(udp_send_unix) { memset(&addr, 0, sizeof addr); addr.sun_family = AF_UNIX; - ASSERT(strlen(TEST_PIPENAME) < sizeof(addr.sun_path)); + ASSERT_LT(strlen(TEST_PIPENAME), sizeof(addr.sun_path)); memcpy(addr.sun_path, TEST_PIPENAME, strlen(TEST_PIPENAME)); fd = socket(AF_UNIX, SOCK_STREAM, 0); - ASSERT(fd >= 0); + ASSERT_GE(fd, 0); unlink(TEST_PIPENAME); - ASSERT(0 == bind(fd, (const struct sockaddr*)&addr, sizeof addr)); - ASSERT(0 == listen(fd, 1)); + ASSERT_OK(bind(fd, (const struct sockaddr*)&addr, sizeof addr)); + ASSERT_OK(listen(fd, 1)); r = uv_udp_init(loop, &handle); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_open(&handle, fd); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(loop, UV_RUN_DEFAULT); r = uv_udp_send(&req, @@ -337,7 +337,7 @@ TEST_IMPL(udp_send_unix) { 1, (const struct sockaddr*) &addr, NULL); - ASSERT(r == 0); + ASSERT_OK(r); uv_close((uv_handle_t*)&handle, NULL); uv_run(loop, UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-udp-options.c b/deps/uv/test/test-udp-options.c index 11e58b996a18ac..bb4a24ca7d1c47 100644 --- a/deps/uv/test/test-udp-options.c +++ b/deps/uv/test/test-udp-options.c @@ -36,56 +36,56 @@ static int udp_options_test(const struct sockaddr* addr) { loop = uv_default_loop(); r = uv_udp_init(loop, &h); - ASSERT(r == 0); + ASSERT_OK(r); uv_unref((uv_handle_t*)&h); /* don't keep the loop alive */ r = uv_udp_bind(&h, addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_set_broadcast(&h, 1); r |= uv_udp_set_broadcast(&h, 1); r |= uv_udp_set_broadcast(&h, 0); r |= uv_udp_set_broadcast(&h, 0); - ASSERT(r == 0); + ASSERT_OK(r); /* values 1-255 should work */ for (i = 1; i <= 255; i++) { r = uv_udp_set_ttl(&h, i); #if defined(__MVS__) if (addr->sa_family == AF_INET6) - ASSERT(r == 0); + ASSERT_OK(r); else - ASSERT(r == UV_ENOTSUP); + ASSERT_EQ(r, UV_ENOTSUP); #else - ASSERT(r == 0); + ASSERT_OK(r); #endif } for (i = 0; i < (int) ARRAY_SIZE(invalid_ttls); i++) { r = uv_udp_set_ttl(&h, invalid_ttls[i]); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); } r = uv_udp_set_multicast_loop(&h, 1); r |= uv_udp_set_multicast_loop(&h, 1); r |= uv_udp_set_multicast_loop(&h, 0); r |= uv_udp_set_multicast_loop(&h, 0); - ASSERT(r == 0); + ASSERT_OK(r); /* values 0-255 should work */ for (i = 0; i <= 255; i++) { r = uv_udp_set_multicast_ttl(&h, i); - ASSERT(r == 0); + ASSERT_OK(r); } /* anything >255 should fail */ r = uv_udp_set_multicast_ttl(&h, 256); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* don't test ttl=-1, it's a valid value on some platforms */ r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); + ASSERT_OK(r); MAKE_VALGRIND_HAPPY(loop); return 0; @@ -95,7 +95,7 @@ static int udp_options_test(const struct sockaddr* addr) { TEST_IMPL(udp_options) { struct sockaddr_in addr; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); return udp_options_test((const struct sockaddr*) &addr); } @@ -106,7 +106,7 @@ TEST_IMPL(udp_options6) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); - ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr)); + ASSERT_OK(uv_ip6_addr("::", TEST_PORT, &addr)); return udp_options_test((const struct sockaddr*) &addr); } @@ -119,41 +119,41 @@ TEST_IMPL(udp_no_autobind) { loop = uv_default_loop(); /* Test a lazy initialized socket. */ - ASSERT(0 == uv_udp_init(loop, &h)); - ASSERT(UV_EBADF == uv_udp_set_multicast_ttl(&h, 32)); - ASSERT(UV_EBADF == uv_udp_set_broadcast(&h, 1)); + ASSERT_OK(uv_udp_init(loop, &h)); + ASSERT_EQ(UV_EBADF, uv_udp_set_multicast_ttl(&h, 32)); + ASSERT_EQ(UV_EBADF, uv_udp_set_broadcast(&h, 1)); #if defined(__MVS__) - ASSERT(UV_ENOTSUP == uv_udp_set_ttl(&h, 1)); + ASSERT_EQ(UV_ENOTSUP, uv_udp_set_ttl(&h, 1)); #else - ASSERT(UV_EBADF == uv_udp_set_ttl(&h, 1)); + ASSERT_EQ(UV_EBADF, uv_udp_set_ttl(&h, 1)); #endif - ASSERT(UV_EBADF == uv_udp_set_multicast_loop(&h, 1)); + ASSERT_EQ(UV_EBADF, uv_udp_set_multicast_loop(&h, 1)); /* TODO(gengjiawen): Fix test on QEMU. */ #if defined(__QEMU__) RETURN_SKIP("Test does not currently work in QEMU"); #endif - ASSERT(UV_EBADF == uv_udp_set_multicast_interface(&h, "0.0.0.0")); + ASSERT_EQ(UV_EBADF, uv_udp_set_multicast_interface(&h, "0.0.0.0")); uv_close((uv_handle_t*) &h, NULL); /* Test a non-lazily initialized socket. */ - ASSERT(0 == uv_udp_init_ex(loop, &h2, AF_INET | UV_UDP_RECVMMSG)); - ASSERT(0 == uv_udp_set_multicast_ttl(&h2, 32)); - ASSERT(0 == uv_udp_set_broadcast(&h2, 1)); + ASSERT_OK(uv_udp_init_ex(loop, &h2, AF_INET | UV_UDP_RECVMMSG)); + ASSERT_OK(uv_udp_set_multicast_ttl(&h2, 32)); + ASSERT_OK(uv_udp_set_broadcast(&h2, 1)); #if defined(__MVS__) /* zOS only supports setting ttl for IPv6 sockets. */ - ASSERT(UV_ENOTSUP == uv_udp_set_ttl(&h2, 1)); + ASSERT_EQ(UV_ENOTSUP, uv_udp_set_ttl(&h2, 1)); #else - ASSERT(0 == uv_udp_set_ttl(&h2, 1)); + ASSERT_OK(uv_udp_set_ttl(&h2, 1)); #endif - ASSERT(0 == uv_udp_set_multicast_loop(&h2, 1)); - ASSERT(0 == uv_udp_set_multicast_interface(&h2, "0.0.0.0")); + ASSERT_OK(uv_udp_set_multicast_loop(&h2, 1)); + ASSERT_OK(uv_udp_set_multicast_interface(&h2, "0.0.0.0")); uv_close((uv_handle_t*) &h2, NULL); - ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(loop, UV_RUN_DEFAULT)); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-udp-recv-in-a-row.c b/deps/uv/test/test-udp-recv-in-a-row.c index 98aca28e193693..30745def0f602d 100644 --- a/deps/uv/test/test-udp-recv-in-a-row.c +++ b/deps/uv/test/test-udp-recv-in-a-row.c @@ -53,7 +53,7 @@ static void sv_recv_cb(uv_udp_t* handle, if (++ recv_cnt < N) { ASSERT_EQ(sizeof(send_data), nread); } else { - ASSERT_EQ(0, nread); + ASSERT_OK(nread); } } @@ -69,7 +69,7 @@ static void check_cb(uv_check_t* handle) { check_cb_called = 1; /* we are done */ - ASSERT_EQ(0, uv_check_stop(handle)); + ASSERT_OK(uv_check_stop(handle)); uv_close((uv_handle_t*) &client, NULL); uv_close((uv_handle_t*) &check_handle, NULL); uv_close((uv_handle_t*) &server, NULL); @@ -79,16 +79,16 @@ static void check_cb(uv_check_t* handle) { TEST_IMPL(udp_recv_in_a_row) { int i, r; - ASSERT_EQ(0, uv_check_init(uv_default_loop(), &check_handle)); - ASSERT_EQ(0, uv_check_start(&check_handle, check_cb)); + ASSERT_OK(uv_check_init(uv_default_loop(), &check_handle)); + ASSERT_OK(uv_check_start(&check_handle, check_cb)); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT_EQ(0, uv_udp_init(uv_default_loop(), &server)); - ASSERT_EQ(0, uv_udp_bind(&server, (const struct sockaddr*) &addr, 0)); - ASSERT_EQ(0, uv_udp_recv_start(&server, alloc_cb, sv_recv_cb)); + ASSERT_OK(uv_udp_init(uv_default_loop(), &server)); + ASSERT_OK(uv_udp_bind(&server, (const struct sockaddr*) &addr, 0)); + ASSERT_OK(uv_udp_recv_start(&server, alloc_cb, sv_recv_cb)); - ASSERT_EQ(0, uv_udp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_udp_init(uv_default_loop(), &client)); /* send N-1 udp packets */ buf = uv_buf_init(send_data, sizeof(send_data)); @@ -106,13 +106,13 @@ TEST_IMPL(udp_recv_in_a_row) { &buf, 1, (const struct sockaddr*) &addr); - ASSERT_EQ(0, r); + ASSERT_OK(r); /* check_cb() asserts that the N packets can be received * before it gets called. */ - ASSERT_EQ(0, uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT)); ASSERT(check_cb_called); diff --git a/deps/uv/test/test-udp-send-and-recv.c b/deps/uv/test/test-udp-send-and-recv.c index ab60e84a138179..b24fe1d0532822 100644 --- a/deps/uv/test/test-udp-send-and-recv.c +++ b/deps/uv/test/test-udp-send-and-recv.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -46,7 +46,7 @@ static void alloc_cb(uv_handle_t* handle, uv_buf_t* buf) { static char slab[65536]; CHECK_HANDLE(handle); - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -54,7 +54,7 @@ static void alloc_cb(uv_handle_t* handle, static void close_cb(uv_handle_t* handle) { CHECK_HANDLE(handle); - ASSERT(1 == uv_is_closing(handle)); + ASSERT_EQ(1, uv_is_closing(handle)); close_cb_called++; } @@ -65,7 +65,7 @@ static void cl_recv_cb(uv_udp_t* handle, const struct sockaddr* addr, unsigned flags) { CHECK_HANDLE(handle); - ASSERT(flags == 0); + ASSERT_OK(flags); if (nread < 0) { ASSERT(0 && "unexpected error"); @@ -78,7 +78,7 @@ static void cl_recv_cb(uv_udp_t* handle, } ASSERT_NOT_NULL(addr); - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT(!memcmp("PONG", buf->base, nread)); cl_recv_cb_called++; @@ -91,11 +91,11 @@ static void cl_send_cb(uv_udp_send_t* req, int status) { int r; ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); r = uv_udp_recv_start(req->handle, alloc_cb, cl_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); cl_send_cb_called++; } @@ -103,7 +103,7 @@ static void cl_send_cb(uv_udp_send_t* req, int status) { static void sv_send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); uv_close((uv_handle_t*) req->handle, close_cb); @@ -133,10 +133,10 @@ static void sv_recv_cb(uv_udp_t* handle, } CHECK_HANDLE(handle); - ASSERT(flags == 0); + ASSERT_OK(flags); ASSERT_NOT_NULL(addr); - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT(!memcmp("PING", rcvbuf->base, nread)); /* FIXME? `uv_udp_recv_stop` does what it says: recv_cb is not called @@ -144,14 +144,14 @@ static void sv_recv_cb(uv_udp_t* handle, * either... Not sure I like that but it's consistent with `uv_read_stop`. */ r = uv_udp_recv_stop(handle); - ASSERT(r == 0); + ASSERT_OK(r); req = malloc(sizeof *req); ASSERT_NOT_NULL(req); sndbuf = uv_buf_init("PONG", 4); r = uv_udp_send(req, handle, &sndbuf, 1, addr, sv_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); sv_recv_cb_called++; } @@ -163,21 +163,21 @@ TEST_IMPL(udp_send_and_recv) { uv_buf_t buf; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, sv_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); /* client sends "PING", expects "PONG" */ buf = uv_buf_init("PING", 4); @@ -188,24 +188,24 @@ TEST_IMPL(udp_send_and_recv) { 1, (const struct sockaddr*) &addr, cl_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(close_cb_called == 0); - ASSERT(cl_send_cb_called == 0); - ASSERT(cl_recv_cb_called == 0); - ASSERT(sv_send_cb_called == 0); - ASSERT(sv_recv_cb_called == 0); + ASSERT_OK(close_cb_called); + ASSERT_OK(cl_send_cb_called); + ASSERT_OK(cl_recv_cb_called); + ASSERT_OK(sv_send_cb_called); + ASSERT_OK(sv_recv_cb_called); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(cl_send_cb_called == 1); - ASSERT(cl_recv_cb_called == 1); - ASSERT(sv_send_cb_called == 1); - ASSERT(sv_recv_cb_called == 1); - ASSERT(close_cb_called == 2); + ASSERT_EQ(1, cl_send_cb_called); + ASSERT_EQ(1, cl_recv_cb_called); + ASSERT_EQ(1, sv_send_cb_called); + ASSERT_EQ(1, sv_recv_cb_called); + ASSERT_EQ(2, close_cb_called); - ASSERT(client.send_queue_size == 0); - ASSERT(server.send_queue_size == 0); + ASSERT_OK(client.send_queue_size); + ASSERT_OK(server.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-send-hang-loop.c b/deps/uv/test/test-udp-send-hang-loop.c index b1e02263d3ca5a..763bb28bdb0d80 100644 --- a/deps/uv/test/test-udp-send-hang-loop.c +++ b/deps/uv/test/test-udp-send-hang-loop.c @@ -27,7 +27,7 @@ #include #define CHECK_OBJECT(handle, type, parent) \ - ASSERT((type*)(handle) == &(parent)) + ASSERT_PTR_EQ((type*)(handle), &(parent)) static uv_udp_t client; static uv_idle_t idle_handle; @@ -46,7 +46,7 @@ static void idle_cb(uv_idle_t* handle) { ASSERT_NULL(send_req.handle); CHECK_OBJECT(handle, uv_idle_t, idle_handle); - ASSERT(0 == uv_idle_stop(handle)); + ASSERT_OK(uv_idle_stop(handle)); /* It probably would have stalled by now if it's going to stall at all. */ if (++loop_hang_called > 1000) { @@ -61,7 +61,7 @@ static void idle_cb(uv_idle_t* handle) { 1, (const struct sockaddr*) &addr, send_cb); - ASSERT(r == 0); + ASSERT_OK(r); } @@ -72,27 +72,27 @@ static void send_cb(uv_udp_send_t* req, int status) { CHECK_OBJECT(req, uv_udp_send_t, send_req); req->handle = NULL; - ASSERT(0 == uv_idle_start(&idle_handle, idle_cb)); + ASSERT_OK(uv_idle_start(&idle_handle, idle_cb)); } TEST_IMPL(udp_send_hang_loop) { - ASSERT(0 == uv_idle_init(uv_default_loop(), &idle_handle)); + ASSERT_OK(uv_idle_init(uv_default_loop(), &idle_handle)); - /* 192.0.2.0/8 is "TEST-NET" and reserved for documentation. + /* 192.0.2.0/24 is "TEST-NET" and reserved for documentation. * Good for us, though. Since we want to have something unreachable. */ - ASSERT(0 == uv_ip4_addr("192.0.2.3", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("192.0.2.3", TEST_PORT, &addr)); - ASSERT(0 == uv_udp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_udp_init(uv_default_loop(), &client)); buf = uv_buf_init(send_data, sizeof(send_data)); - ASSERT(0 == uv_idle_start(&idle_handle, idle_cb)); + ASSERT_OK(uv_idle_start(&idle_handle, idle_cb)); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(loop_hang_called > 1000); + ASSERT_GT(loop_hang_called, 1000); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-send-immediate.c b/deps/uv/test/test-udp-send-immediate.c index ee70a6165a21da..8e7f83ff05bc2c 100644 --- a/deps/uv/test/test-udp-send-immediate.c +++ b/deps/uv/test/test-udp-send-immediate.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -42,7 +42,7 @@ static void alloc_cb(uv_handle_t* handle, uv_buf_t* buf) { static char slab[65536]; CHECK_HANDLE(handle); - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -50,14 +50,14 @@ static void alloc_cb(uv_handle_t* handle, static void close_cb(uv_handle_t* handle) { CHECK_HANDLE(handle); - ASSERT(1 == uv_is_closing(handle)); + ASSERT_EQ(1, uv_is_closing(handle)); close_cb_called++; } static void cl_send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); + ASSERT_OK(status); CHECK_HANDLE(req->handle); cl_send_cb_called++; @@ -80,10 +80,10 @@ static void sv_recv_cb(uv_udp_t* handle, } CHECK_HANDLE(handle); - ASSERT(flags == 0); + ASSERT_OK(flags); ASSERT_NOT_NULL(addr); - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT(memcmp("PING", rcvbuf->base, nread) == 0 || memcmp("PANG", rcvbuf->base, nread) == 0); @@ -100,21 +100,21 @@ TEST_IMPL(udp_send_immediate) { uv_buf_t buf; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, sv_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); /* client sends "PING", then "PANG" */ buf = uv_buf_init("PING", 4); @@ -125,7 +125,7 @@ TEST_IMPL(udp_send_immediate) { 1, (const struct sockaddr*) &addr, cl_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); buf = uv_buf_init("PANG", 4); @@ -135,13 +135,13 @@ TEST_IMPL(udp_send_immediate) { 1, (const struct sockaddr*) &addr, cl_send_cb); - ASSERT(r == 0); + ASSERT_OK(r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(cl_send_cb_called == 2); - ASSERT(sv_recv_cb_called == 2); - ASSERT(close_cb_called == 2); + ASSERT_EQ(2, cl_send_cb_called); + ASSERT_EQ(2, sv_recv_cb_called); + ASSERT_EQ(2, close_cb_called); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-send-unreachable.c b/deps/uv/test/test-udp-send-unreachable.c index 7075deb189666b..0a2f4a47a97580 100644 --- a/deps/uv/test/test-udp-send-unreachable.c +++ b/deps/uv/test/test-udp-send-unreachable.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &client || (uv_udp_t*)(handle) == &client2) + ASSERT_NE((uv_udp_t*)(handle) == &client || (uv_udp_t*)(handle) == &client2, 0) static uv_udp_t client; static uv_udp_t client2; @@ -61,8 +61,8 @@ static void close_cb(uv_handle_t* handle) { static void send_cb(uv_udp_send_t* req, int status) { ASSERT_NOT_NULL(req); - ASSERT(status == 0); - ASSERT_EQ(status, 0); + ASSERT_OK(status); + ASSERT_OK(status); CHECK_HANDLE(req->handle); send_cb_called++; } @@ -115,24 +115,24 @@ TEST_IMPL(udp_send_unreachable) { can_recverr = 1; #endif - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT_2, &addr2)); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT_3, &addr3)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT_2, &addr2)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT_3, &addr3)); r = uv_timer_init( uv_default_loop(), &timer ); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_timer_start( &timer, timer_cb, 1000, 0 ); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_init(uv_default_loop(), &client); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_bind(&client, (const struct sockaddr*) &addr2, 0); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_recv_start(&client, alloc_cb, recv_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* client sends "PING", then "PANG" */ buf = uv_buf_init("PING", 4); @@ -143,7 +143,7 @@ TEST_IMPL(udp_send_unreachable) { 1, (const struct sockaddr*) &addr, send_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); buf = uv_buf_init("PANG", 4); @@ -153,19 +153,19 @@ TEST_IMPL(udp_send_unreachable) { 1, (const struct sockaddr*) &addr, send_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); if (can_recverr) { r = uv_udp_init(uv_default_loop(), &client2); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_bind(&client2, (const struct sockaddr*) &addr3, UV_UDP_LINUX_RECVERR); - ASSERT_EQ(r, 0); + ASSERT_OK(r); r = uv_udp_recv_start(&client2, alloc_cb, recv_cb); - ASSERT_EQ(r, 0); + ASSERT_OK(r); /* client sends "PING", then "PANG" */ buf = uv_buf_init("PING", 4); @@ -176,7 +176,7 @@ TEST_IMPL(udp_send_unreachable) { 1, (const struct sockaddr*) &addr, send_cb_recverr); - ASSERT_EQ(r, 0); + ASSERT_OK(r); buf = uv_buf_init("PANG", 4); @@ -186,14 +186,14 @@ TEST_IMPL(udp_send_unreachable) { 1, (const struct sockaddr*) &addr, send_cb_recverr); - ASSERT_EQ(r, 0); + ASSERT_OK(r); } uv_run(uv_default_loop(), UV_RUN_DEFAULT); ASSERT_EQ(send_cb_called, (long)(can_recverr ? 4 : 2)); ASSERT_EQ(recv_cb_called, alloc_cb_called); - ASSERT_EQ(timer_cb_called, 1); + ASSERT_EQ(1, timer_cb_called); ASSERT_EQ(close_cb_called, (long)(can_recverr ? 3 : 2)); MAKE_VALGRIND_HAPPY(uv_default_loop()); diff --git a/deps/uv/test/test-udp-sendmmsg-error.c b/deps/uv/test/test-udp-sendmmsg-error.c index 7b1741a3e04f2f..0b647585e4f4b8 100644 --- a/deps/uv/test/test-udp-sendmmsg-error.c +++ b/deps/uv/test/test-udp-sendmmsg-error.c @@ -55,20 +55,20 @@ TEST_IMPL(udp_sendmmsg_error) { uv_buf_t buf; int i; - ASSERT_EQ(0, uv_udp_init(uv_default_loop(), &client)); - ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); - ASSERT_EQ(0, uv_udp_connect(&client, (const struct sockaddr*)&addr)); + ASSERT_OK(uv_udp_init(uv_default_loop(), &client)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_udp_connect(&client, (const struct sockaddr*)&addr)); buf = uv_buf_init("TEST", 4); for (i = 0; i < DATAGRAMS; ++i) - ASSERT_EQ(0, uv_udp_send(&req[i], &client, &buf, 1, NULL, send_cb)); + ASSERT_OK(uv_udp_send(&req[i], &client, &buf, 1, NULL, send_cb)); uv_run(uv_default_loop(), UV_RUN_DEFAULT); ASSERT_EQ(1, close_cb_called); ASSERT_EQ(DATAGRAMS, send_cb_called); - ASSERT_EQ(0, client.send_queue_size); + ASSERT_OK(client.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-udp-try-send.c b/deps/uv/test/test-udp-try-send.c index b81506cc39f3ce..0c76fb1c84df68 100644 --- a/deps/uv/test/test-udp-try-send.c +++ b/deps/uv/test/test-udp-try-send.c @@ -27,7 +27,7 @@ #include #define CHECK_HANDLE(handle) \ - ASSERT((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client) + ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) static uv_udp_t server; static uv_udp_t client; @@ -42,7 +42,7 @@ static void alloc_cb(uv_handle_t* handle, uv_buf_t* buf) { static char slab[65536]; CHECK_HANDLE(handle); - ASSERT(suggested_size <= sizeof(slab)); + ASSERT_LE(suggested_size, sizeof(slab)); buf->base = slab; buf->len = sizeof(slab); } @@ -60,17 +60,17 @@ static void sv_recv_cb(uv_udp_t* handle, const uv_buf_t* rcvbuf, const struct sockaddr* addr, unsigned flags) { - ASSERT(nread > 0); + ASSERT_GT(nread, 0); if (nread == 0) { ASSERT_NULL(addr); return; } - ASSERT(nread == 4); + ASSERT_EQ(4, nread); ASSERT_NOT_NULL(addr); - ASSERT(memcmp("EXIT", rcvbuf->base, nread) == 0); + ASSERT_OK(memcmp("EXIT", rcvbuf->base, nread)); uv_close((uv_handle_t*) handle, close_cb); uv_close((uv_handle_t*) &client, close_cb); @@ -84,37 +84,37 @@ TEST_IMPL(udp_try_send) { uv_buf_t buf; int r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, sv_recv_cb); - ASSERT(r == 0); + ASSERT_OK(r); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &client); - ASSERT(r == 0); + ASSERT_OK(r); buf = uv_buf_init(buffer, sizeof(buffer)); r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &addr); - ASSERT(r == UV_EMSGSIZE); + ASSERT_EQ(r, UV_EMSGSIZE); buf = uv_buf_init("EXIT", 4); r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &addr); - ASSERT(r == 4); + ASSERT_EQ(4, r); uv_run(uv_default_loop(), UV_RUN_DEFAULT); - ASSERT(close_cb_called == 2); - ASSERT(sv_recv_cb_called == 1); + ASSERT_EQ(2, close_cb_called); + ASSERT_EQ(1, sv_recv_cb_called); - ASSERT(client.send_queue_size == 0); - ASSERT(server.send_queue_size == 0); + ASSERT_OK(client.send_queue_size); + ASSERT_OK(server.send_queue_size); MAKE_VALGRIND_HAPPY(uv_default_loop()); return 0; diff --git a/deps/uv/test/test-uname.c b/deps/uv/test/test-uname.c index 105a17fe67771a..a384e9f8422666 100644 --- a/deps/uv/test/test-uname.c +++ b/deps/uv/test/test-uname.c @@ -39,28 +39,28 @@ TEST_IMPL(uname) { /* Verify that NULL is handled properly. */ r = uv_os_uname(NULL); - ASSERT(r == UV_EINVAL); + ASSERT_EQ(r, UV_EINVAL); /* Verify the happy path. */ r = uv_os_uname(&buffer); - ASSERT(r == 0); + ASSERT_OK(r); #ifndef _WIN32 - ASSERT(uname(&buf) != -1); - ASSERT(strcmp(buffer.sysname, buf.sysname) == 0); - ASSERT(strcmp(buffer.version, buf.version) == 0); + ASSERT_NE(uname(&buf), -1); + ASSERT_OK(strcmp(buffer.sysname, buf.sysname)); + ASSERT_OK(strcmp(buffer.version, buf.version)); # ifdef _AIX snprintf(temp, sizeof(temp), "%s.%s", buf.version, buf.release); - ASSERT(strcmp(buffer.release, temp) == 0); + ASSERT_OK(strcmp(buffer.release, temp)); # else - ASSERT(strcmp(buffer.release, buf.release) == 0); + ASSERT_OK(strcmp(buffer.release, buf.release)); # endif /* _AIX */ # if defined(_AIX) || defined(__PASE__) - ASSERT(strcmp(buffer.machine, "ppc64") == 0); + ASSERT_OK(strcmp(buffer.machine, "ppc64")); # else - ASSERT(strcmp(buffer.machine, buf.machine) == 0); + ASSERT_OK(strcmp(buffer.machine, buf.machine)); # endif /* defined(_AIX) || defined(__PASE__) */ #endif /* _WIN32 */ diff --git a/deps/uv/test/test-walk-handles.c b/deps/uv/test/test-walk-handles.c index 50f0ce84f1e846..86fcb04907e7ef 100644 --- a/deps/uv/test/test-walk-handles.c +++ b/deps/uv/test/test-walk-handles.c @@ -31,7 +31,7 @@ static uv_timer_t timer; static void walk_cb(uv_handle_t* handle, void* arg) { - ASSERT(arg == (void*)magic_cookie); + ASSERT_PTR_EQ(arg, (void*)magic_cookie); if (handle == (uv_handle_t*)&timer) { seen_timer_handle++; @@ -42,7 +42,7 @@ static void walk_cb(uv_handle_t* handle, void* arg) { static void timer_cb(uv_timer_t* handle) { - ASSERT(handle == &timer); + ASSERT_PTR_EQ(handle, &timer); uv_walk(handle->loop, walk_cb, magic_cookie); uv_close((uv_handle_t*)handle, NULL); @@ -56,21 +56,21 @@ TEST_IMPL(walk_handles) { loop = uv_default_loop(); r = uv_timer_init(loop, &timer); - ASSERT(r == 0); + ASSERT_OK(r); r = uv_timer_start(&timer, timer_cb, 1, 0); - ASSERT(r == 0); + ASSERT_OK(r); /* Start event loop, expect to see the timer handle in walk_cb. */ - ASSERT(seen_timer_handle == 0); + ASSERT_OK(seen_timer_handle); r = uv_run(loop, UV_RUN_DEFAULT); - ASSERT(r == 0); - ASSERT(seen_timer_handle == 1); + ASSERT_OK(r); + ASSERT_EQ(1, seen_timer_handle); /* Loop is finished, walk_cb should not see our timer handle. */ seen_timer_handle = 0; uv_walk(loop, walk_cb, magic_cookie); - ASSERT(seen_timer_handle == 0); + ASSERT_OK(seen_timer_handle); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-watcher-cross-stop.c b/deps/uv/test/test-watcher-cross-stop.c index bbc0c30574a7f7..8f79abb7b03e4d 100644 --- a/deps/uv/test/test-watcher-cross-stop.c +++ b/deps/uv/test/test-watcher-cross-stop.c @@ -76,22 +76,22 @@ TEST_IMPL(watcher_cross_stop) { TEST_FILE_LIMIT(ARRAY_SIZE(sockets) + 32); - ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + ASSERT_OK(uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); memset(big_string, 'A', sizeof(big_string)); buf = uv_buf_init(big_string, sizeof(big_string)); for (i = 0; i < ARRAY_SIZE(sockets); i++) { - ASSERT(0 == uv_udp_init(loop, &sockets[i])); - ASSERT(0 == uv_udp_bind(&sockets[i], - (const struct sockaddr*) &addr, - UV_UDP_REUSEADDR)); - ASSERT(0 == uv_udp_recv_start(&sockets[i], alloc_cb, recv_cb)); - ASSERT(0 == uv_udp_send(&reqs[i], - &sockets[i], - &buf, - 1, - (const struct sockaddr*) &addr, - send_cb)); + ASSERT_OK(uv_udp_init(loop, &sockets[i])); + ASSERT_OK(uv_udp_bind(&sockets[i], + (const struct sockaddr*) &addr, + UV_UDP_REUSEADDR)); + ASSERT_OK(uv_udp_recv_start(&sockets[i], alloc_cb, recv_cb)); + ASSERT_OK(uv_udp_send(&reqs[i], + &sockets[i], + &buf, + 1, + (const struct sockaddr*) &addr, + send_cb)); } while (recv_cb_called == 0) @@ -100,12 +100,12 @@ TEST_IMPL(watcher_cross_stop) { for (i = 0; i < ARRAY_SIZE(sockets); i++) uv_close((uv_handle_t*) &sockets[i], close_cb); - ASSERT(recv_cb_called > 0); + ASSERT_GT(recv_cb_called, 0); uv_run(loop, UV_RUN_DEFAULT); - ASSERT(ARRAY_SIZE(sockets) == send_cb_called); - ASSERT(ARRAY_SIZE(sockets) == close_cb_called); + ASSERT_EQ(ARRAY_SIZE(sockets), send_cb_called); + ASSERT_EQ(ARRAY_SIZE(sockets), close_cb_called); MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index 81754343f2c921..7d804cd2dd0bb1 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -18,7 +18,7 @@ This a list of all the dependencies: * [googletest 76bb2af][] * [histogram 0.11.8][] * [icu-small 74.1][] -* [libuv 1.46.0][] +* [libuv 1.47.0][] * [llhttp 9.1.3][] * [minimatch 9.0.3][] * [nghttp2 1.58.0][] @@ -207,7 +207,7 @@ and Java libraries providing Unicode and Globalization support for software applications. See [maintaining-icu][] for more informations. -### libuv 1.46.0 +### libuv 1.47.0 The [libuv](https://github.com/libuv/libuv) dependency is a multi-platform support library with a focus on asynchronous I/O. @@ -335,7 +335,7 @@ performance improvements not currently available in standard zlib. [googletest 76bb2af]: #googletest-76bb2af [histogram 0.11.8]: #histogram-0118 [icu-small 74.1]: #icu-small-741 -[libuv 1.46.0]: #libuv-1460 +[libuv 1.47.0]: #libuv-1470 [llhttp 9.1.3]: #llhttp-913 [maintaining-V8]: ./maintaining-V8.md [maintaining-cjs-module-lexer]: ./maintaining-cjs-module-lexer.md From 95d8a273ccef2bc46dabd958f766fa711c9f3046 Mon Sep 17 00:00:00 2001 From: Abdirahim Musse <33973272+abmusse@users.noreply.github.com> Date: Sat, 18 Nov 2023 18:19:16 +0000 Subject: [PATCH 14/67] deps: cherry-pick bfbe4e38d7 from libuv upstream Original commit message: aix: disable ipv6 link local (#4229) AIX does not implement ifaddrs and when retrieving the network interfaces with uv_interface_addresses there was a test failure in tcp_connect6_link_local. For now disable ipv6 link local on aix to: 1) fix broken aix build 2) stop blocking libuv upgrade in node Refs: https://github.com/libuv/libuv/pull/4222#issuecomment-1812962233 Refs: https://github.com/nodejs/node/pull/50650 Refs: https://github.com/libuv/libuv/commit/bfbe4e38d7253ed5cfa87bfa44ae66fd7bf1957f PR-URL: https://github.com/nodejs/node/pull/50650 Reviewed-By: Ben Noordhuis Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca --- deps/uv/src/unix/tcp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/deps/uv/src/unix/tcp.c b/deps/uv/src/unix/tcp.c index a6b53e5913271d..a02b6bbf88ef3a 100644 --- a/deps/uv/src/unix/tcp.c +++ b/deps/uv/src/unix/tcp.c @@ -30,12 +30,8 @@ #include #include -#if defined(__PASE__) -#include -#define ifaddrs ifaddrs_pase -#define getifaddrs Qp2getifaddrs -#define freeifaddrs Qp2freeifaddrs -#else +/* ifaddrs is not implemented on AIX and IBM i PASE */ +#if !defined(_AIX) #include #endif @@ -224,6 +220,10 @@ static int uv__is_ipv6_link_local(const struct sockaddr* addr) { static int uv__ipv6_link_local_scope_id(void) { +/* disable link local on AIX & PASE for now */ +#if defined(_AIX) + return 0; +#else struct sockaddr_in6* a6; struct ifaddrs* ifa; struct ifaddrs* p; @@ -244,6 +244,7 @@ static int uv__ipv6_link_local_scope_id(void) { freeifaddrs(ifa); return rv; +#endif } From 4ddd0daf5fe0784ef758b77cdc213b7727935317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Tue, 5 Dec 2023 01:17:48 +0100 Subject: [PATCH 15/67] test: escape cwd in regexp Co-authored-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/50980 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Chemi Atlow Reviewed-By: Moshe Atlow Reviewed-By: Antoine du Hamel --- test/parallel/test-runner-output.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-runner-output.mjs b/test/parallel/test-runner-output.mjs index 0e41ff101b843f..e40ce896bff465 100644 --- a/test/parallel/test-runner-output.mjs +++ b/test/parallel/test-runner-output.mjs @@ -15,7 +15,7 @@ function replaceTestDuration(str) { } const color = '(\\[\\d+m)'; -const stackTraceBasePath = new RegExp(`${color}\\(${process.cwd()}/?${color}(.*)${color}\\)`, 'g'); +const stackTraceBasePath = new RegExp(`${color}\\(${process.cwd().replaceAll(/[\\^$*+?.()|[\]{}]/g, '\\$&')}/?${color}(.*)${color}\\)`, 'g'); function replaceSpecDuration(str) { return str From 2b4671125ec31e2c45a71dfdf3648df23e081383 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Tue, 5 Dec 2023 02:37:00 +0200 Subject: [PATCH 16/67] tools: update lint-md-dependencies to rollup@4.6.1 PR-URL: https://github.com/nodejs/node/pull/51022 Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca --- tools/lint-md/package-lock.json | 110 ++++++++++++++++---------------- tools/lint-md/package.json | 2 +- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/tools/lint-md/package-lock.json b/tools/lint-md/package-lock.json index 5fafc3b177cd10..0a17b1a9bcf40d 100644 --- a/tools/lint-md/package-lock.json +++ b/tools/lint-md/package-lock.json @@ -18,7 +18,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", - "rollup": "^4.5.2", + "rollup": "^4.6.1", "rollup-plugin-cleanup": "^3.2.1" } }, @@ -79,9 +79,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", - "integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", @@ -101,9 +101,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.5.2.tgz", - "integrity": "sha512-ee7BudTwwrglFYSc3UnqInDDjCLWHKrFmGNi4aK7jlEyg4CyPa1DCMrZfsN1O13YT76UFEqXz2CoN7BCGpUlJw==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.6.1.tgz", + "integrity": "sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==", "cpu": [ "arm" ], @@ -114,9 +114,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.5.2.tgz", - "integrity": "sha512-xOuhj9HHtn8128ir8veoQsBbAUBasDbHIBniYTEx02pAmu9EXL+ZjJqngnNEy6ZgZ4h1JwL33GMNu3yJL5Mzow==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.6.1.tgz", + "integrity": "sha512-1TKm25Rn20vr5aTGGZqo6E4mzPicCUD79k17EgTLAsXc1zysyi4xXKACfUbwyANEPAEIxkzwue6JZ+stYzWUTA==", "cpu": [ "arm64" ], @@ -127,9 +127,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.5.2.tgz", - "integrity": "sha512-NTGJWoL8bKyqyWFn9/RzSv4hQ4wTbaAv0lHHRwf4OnpiiP4P8W0jiXbm8Nc5BCXKmWAwuvJY82mcIU2TayC20g==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.6.1.tgz", + "integrity": "sha512-cEXJQY/ZqMACb+nxzDeX9IPLAg7S94xouJJCNVE5BJM8JUEP4HeTF+ti3cmxWeSJo+5D+o8Tc0UAWUkfENdeyw==", "cpu": [ "arm64" ], @@ -140,9 +140,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.5.2.tgz", - "integrity": "sha512-hlKqj7bpPvU15sZo4za14u185lpMzdwWLMc9raMqPK4wywt0wR23y1CaVQ4oAFXat3b5/gmRntyfpwWTKl+vvA==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.6.1.tgz", + "integrity": "sha512-LoSU9Xu56isrkV2jLldcKspJ7sSXmZWkAxg7sW/RfF7GS4F5/v4EiqKSMCFbZtDu2Nc1gxxFdQdKwkKS4rwxNg==", "cpu": [ "x64" ], @@ -153,9 +153,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.5.2.tgz", - "integrity": "sha512-7ZIZx8c3u+pfI0ohQsft/GywrXez0uR6dUP0JhBuCK3sFO5TfdLn/YApnVkvPxuTv3+YKPIZend9Mt7Cz6sS3Q==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.6.1.tgz", + "integrity": "sha512-EfI3hzYAy5vFNDqpXsNxXcgRDcFHUWSx5nnRSCKwXuQlI5J9dD84g2Usw81n3FLBNsGCegKGwwTVsSKK9cooSQ==", "cpu": [ "arm" ], @@ -166,9 +166,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.5.2.tgz", - "integrity": "sha512-7Pk/5mO11JW/cH+a8lL/i0ZxmRGrbpYqN0VwO2DHhU+SJWWOH2zE1RAcPaj8KqiwC8DCDIJOSxjV9+9lLb6aeA==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.6.1.tgz", + "integrity": "sha512-9lhc4UZstsegbNLhH0Zu6TqvDfmhGzuCWtcTFXY10VjLLUe4Mr0Ye2L3rrtHaDd/J5+tFMEuo5LTCSCMXWfUKw==", "cpu": [ "arm64" ], @@ -179,9 +179,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.5.2.tgz", - "integrity": "sha512-KrRnuG5phJx756e62wxvWH2e+TK84MP2IVuPwfge+GBvWqIUfVzFRn09TKruuQBXzZp52Vyma7FjMDkwlA9xpg==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.6.1.tgz", + "integrity": "sha512-FfoOK1yP5ksX3wwZ4Zk1NgyGHZyuRhf99j64I5oEmirV8EFT7+OhUZEnP+x17lcP/QHJNWGsoJwrz4PJ9fBEXw==", "cpu": [ "arm64" ], @@ -192,9 +192,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.5.2.tgz", - "integrity": "sha512-My+53GasPa2D2tU5dXiyHYwrELAUouSfkNlZ3bUKpI7btaztO5vpALEs3mvFjM7aKTvEbc7GQckuXeXIDKQ0fg==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.6.1.tgz", + "integrity": "sha512-DNGZvZDO5YF7jN5fX8ZqmGLjZEXIJRdJEdTFMhiyXqyXubBa0WVLDWSNlQ5JR2PNgDbEV1VQowhVRUh+74D+RA==", "cpu": [ "x64" ], @@ -205,9 +205,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.5.2.tgz", - "integrity": "sha512-/f0Q6Sc+Vw54Ws6N8fxaEe4R7at3b8pFyv+O/F2VaQ4hODUJcRUcCBJh6zuqtgQQt7w845VTkGLFgWZkP3tUoQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.6.1.tgz", + "integrity": "sha512-RkJVNVRM+piYy87HrKmhbexCHg3A6Z6MU0W9GHnJwBQNBeyhCJG9KDce4SAMdicQnpURggSvtbGo9xAWOfSvIQ==", "cpu": [ "x64" ], @@ -218,9 +218,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.5.2.tgz", - "integrity": "sha512-NCKuuZWLht6zj7s6EIFef4BxCRX1GMr83S2W4HPCA0RnJ4iHE4FS1695q6Ewoa6A9nFjJe1//yUu0kgBU07Edw==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.6.1.tgz", + "integrity": "sha512-v2FVT6xfnnmTe3W9bJXl6r5KwJglMK/iRlkKiIFfO6ysKs0rDgz7Cwwf3tjldxQUrHL9INT/1r4VA0n9L/F1vQ==", "cpu": [ "arm64" ], @@ -231,9 +231,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.5.2.tgz", - "integrity": "sha512-J5zL3riR4AOyU/J3M/i4k/zZ8eP1yT+nTmAKztCXJtnI36jYH0eepvob22mAQ/kLwfsK2TB6dbyVY1F8c/0H5A==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.6.1.tgz", + "integrity": "sha512-YEeOjxRyEjqcWphH9dyLbzgkF8wZSKAKUkldRY6dgNR5oKs2LZazqGB41cWJ4Iqqcy9/zqYgmzBkRoVz3Q9MLw==", "cpu": [ "ia32" ], @@ -244,9 +244,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.5.2.tgz", - "integrity": "sha512-pL0RXRHuuGLhvs7ayX/SAHph1hrDPXOM5anyYUQXWJEENxw3nfHkzv8FfVlEVcLyKPAEgDRkd6RKZq2SMqS/yg==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.6.1.tgz", + "integrity": "sha512-0zfTlFAIhgz8V2G8STq8toAjsYYA6eci1hnXuyOTUFnymrtJwnS6uGKiv3v5UrPZkBlamLvrLV2iiaeqCKzb0A==", "cpu": [ "x64" ], @@ -5778,9 +5778,9 @@ } }, "node_modules/rollup": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.5.2.tgz", - "integrity": "sha512-CRK1uoROBfkcqrZKyaFcqCcZWNsvJ6yVYZkqTlRocZhO2s5yER6Z3f/QaYtO8RGyloPnmhwgzuPQpNGeK210xQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.6.1.tgz", + "integrity": "sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -5790,18 +5790,18 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.5.2", - "@rollup/rollup-android-arm64": "4.5.2", - "@rollup/rollup-darwin-arm64": "4.5.2", - "@rollup/rollup-darwin-x64": "4.5.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.5.2", - "@rollup/rollup-linux-arm64-gnu": "4.5.2", - "@rollup/rollup-linux-arm64-musl": "4.5.2", - "@rollup/rollup-linux-x64-gnu": "4.5.2", - "@rollup/rollup-linux-x64-musl": "4.5.2", - "@rollup/rollup-win32-arm64-msvc": "4.5.2", - "@rollup/rollup-win32-ia32-msvc": "4.5.2", - "@rollup/rollup-win32-x64-msvc": "4.5.2", + "@rollup/rollup-android-arm-eabi": "4.6.1", + "@rollup/rollup-android-arm64": "4.6.1", + "@rollup/rollup-darwin-arm64": "4.6.1", + "@rollup/rollup-darwin-x64": "4.6.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.6.1", + "@rollup/rollup-linux-arm64-gnu": "4.6.1", + "@rollup/rollup-linux-arm64-musl": "4.6.1", + "@rollup/rollup-linux-x64-gnu": "4.6.1", + "@rollup/rollup-linux-x64-musl": "4.6.1", + "@rollup/rollup-win32-arm64-msvc": "4.6.1", + "@rollup/rollup-win32-ia32-msvc": "4.6.1", + "@rollup/rollup-win32-x64-msvc": "4.6.1", "fsevents": "~2.3.2" } }, diff --git a/tools/lint-md/package.json b/tools/lint-md/package.json index cb5c7fb152778f..0292176c3ed45b 100644 --- a/tools/lint-md/package.json +++ b/tools/lint-md/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", - "rollup": "^4.5.2", + "rollup": "^4.6.1", "rollup-plugin-cleanup": "^3.2.1" } } From 0b61823e8b13246c9caaf0a2e85880e5ee6f1087 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Tue, 5 Dec 2023 02:37:10 +0200 Subject: [PATCH 17/67] deps: update undici to 5.28.2 PR-URL: https://github.com/nodejs/node/pull/51024 Reviewed-By: Matthew Aitken Reviewed-By: Antoine du Hamel --- deps/undici/src/lib/api/api-request.js | 1 + deps/undici/src/lib/api/readable.js | 2 +- deps/undici/src/lib/cache/symbols.js | 2 +- deps/undici/src/lib/core/symbols.js | 3 +- deps/undici/src/lib/fetch/dataURL.js | 13 +- deps/undici/src/lib/fetch/headers.js | 5 +- deps/undici/src/lib/fetch/index.js | 2 +- deps/undici/src/lib/fetch/request.js | 13 +- deps/undici/src/lib/fetch/response.js | 10 +- deps/undici/src/lib/handler/RetryHandler.js | 4 +- deps/undici/src/lib/proxy-agent.js | 10 +- deps/undici/src/package-lock.json | 392 ++++++++---------- deps/undici/src/package.json | 8 +- deps/undici/src/types/fetch.d.ts | 2 +- deps/undici/undici.js | 40 +- .../maintaining/maintaining-dependencies.md | 6 +- src/undici_version.h | 2 +- 17 files changed, 231 insertions(+), 284 deletions(-) diff --git a/deps/undici/src/lib/api/api-request.js b/deps/undici/src/lib/api/api-request.js index f130ecc9867a88..d4281ce2449f16 100644 --- a/deps/undici/src/lib/api/api-request.js +++ b/deps/undici/src/lib/api/api-request.js @@ -177,3 +177,4 @@ function request (opts, callback) { } module.exports = request +module.exports.RequestHandler = RequestHandler diff --git a/deps/undici/src/lib/api/readable.js b/deps/undici/src/lib/api/readable.js index 89913eaa621854..5269dfae50cbad 100644 --- a/deps/undici/src/lib/api/readable.js +++ b/deps/undici/src/lib/api/readable.js @@ -180,7 +180,7 @@ module.exports = class BodyReadable extends Readable { this .on('close', function () { signalListenerCleanup() - if (signal?.aborted) { + if (signal && signal.aborted) { reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' })) } else { resolve(null) diff --git a/deps/undici/src/lib/cache/symbols.js b/deps/undici/src/lib/cache/symbols.js index f9b19740af8281..40448d6001e0f6 100644 --- a/deps/undici/src/lib/cache/symbols.js +++ b/deps/undici/src/lib/cache/symbols.js @@ -1,5 +1,5 @@ 'use strict' module.exports = { - kConstruct: Symbol('constructable') + kConstruct: require('../core/symbols').kConstruct } diff --git a/deps/undici/src/lib/core/symbols.js b/deps/undici/src/lib/core/symbols.js index 1d5dc4e3db0360..68d8566fac03de 100644 --- a/deps/undici/src/lib/core/symbols.js +++ b/deps/undici/src/lib/core/symbols.js @@ -58,5 +58,6 @@ module.exports = { kHTTP1BuildRequest: Symbol('http1 build request'), kHTTP2CopyHeaders: Symbol('http2 copy headers'), kHTTPConnVersion: Symbol('http connection version'), - kRetryHandlerDefaultRetry: Symbol('retry agent default retry') + kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), + kConstruct: Symbol('constructable') } diff --git a/deps/undici/src/lib/fetch/dataURL.js b/deps/undici/src/lib/fetch/dataURL.js index 6df4fcc8cc6375..7b6a606106dd69 100644 --- a/deps/undici/src/lib/fetch/dataURL.js +++ b/deps/undici/src/lib/fetch/dataURL.js @@ -119,17 +119,14 @@ function dataURLProcessor (dataURL) { * @param {boolean} excludeFragment */ function URLSerializer (url, excludeFragment = false) { - const href = url.href - if (!excludeFragment) { - return href + return url.href } - const hash = href.lastIndexOf('#') - if (hash === -1) { - return href - } - return href.slice(0, hash) + const href = url.href + const hashLength = url.hash.length + + return hashLength === 0 ? href : href.substring(0, href.length - hashLength) } // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points diff --git a/deps/undici/src/lib/fetch/headers.js b/deps/undici/src/lib/fetch/headers.js index 69acaaad9964af..2f1c0be5a47309 100644 --- a/deps/undici/src/lib/fetch/headers.js +++ b/deps/undici/src/lib/fetch/headers.js @@ -2,7 +2,7 @@ 'use strict' -const { kHeadersList } = require('../core/symbols') +const { kHeadersList, kConstruct } = require('../core/symbols') const { kGuard } = require('./symbols') const { kEnumerableProperty } = require('../core/util') const { @@ -240,6 +240,9 @@ class HeadersList { // https://fetch.spec.whatwg.org/#headers-class class Headers { constructor (init = undefined) { + if (init === kConstruct) { + return + } this[kHeadersList] = new HeadersList() // The new Headers(init) constructor steps are: diff --git a/deps/undici/src/lib/fetch/index.js b/deps/undici/src/lib/fetch/index.js index c109a01bf1f8e8..17c3d87ea62727 100644 --- a/deps/undici/src/lib/fetch/index.js +++ b/deps/undici/src/lib/fetch/index.js @@ -286,7 +286,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') { } // 8. If response’s timing allow passed flag is not set, then: - if (!timingInfo.timingAllowPassed) { + if (!response.timingAllowPassed) { // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. timingInfo = createOpaqueTimingInfo({ startTime: timingInfo.startTime diff --git a/deps/undici/src/lib/fetch/request.js b/deps/undici/src/lib/fetch/request.js index 3b813aa77df9d1..6fe4dff64c4472 100644 --- a/deps/undici/src/lib/fetch/request.js +++ b/deps/undici/src/lib/fetch/request.js @@ -28,13 +28,12 @@ const { kHeaders, kSignal, kState, kGuard, kRealm } = require('./symbols') const { webidl } = require('./webidl') const { getGlobalOrigin } = require('./global') const { URLSerializer } = require('./dataURL') -const { kHeadersList } = require('../core/symbols') +const { kHeadersList, kConstruct } = require('../core/symbols') const assert = require('assert') const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('events') let TransformStream = globalThis.TransformStream -const kInit = Symbol('init') const kAbortController = Symbol('abortController') const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { @@ -45,7 +44,7 @@ const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { class Request { // https://fetch.spec.whatwg.org/#dom-request constructor (input, init = {}) { - if (input === kInit) { + if (input === kConstruct) { return } @@ -302,7 +301,7 @@ class Request { } // 23. If init["integrity"] exists, then set request’s integrity metadata to it. - if (init.integrity !== undefined && init.integrity != null) { + if (init.integrity != null) { request.integrity = String(init.integrity) } @@ -398,7 +397,7 @@ class Request { // 30. Set this’s headers to a new Headers object with this’s relevant // Realm, whose header list is request’s header list and guard is // "request". - this[kHeaders] = new Headers() + this[kHeaders] = new Headers(kConstruct) this[kHeaders][kHeadersList] = request.headersList this[kHeaders][kGuard] = 'request' this[kHeaders][kRealm] = this[kRealm] @@ -725,10 +724,10 @@ class Request { // 3. Let clonedRequestObject be the result of creating a Request object, // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. - const clonedRequestObject = new Request(kInit) + const clonedRequestObject = new Request(kConstruct) clonedRequestObject[kState] = clonedRequest clonedRequestObject[kRealm] = this[kRealm] - clonedRequestObject[kHeaders] = new Headers() + clonedRequestObject[kHeaders] = new Headers(kConstruct) clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] diff --git a/deps/undici/src/lib/fetch/response.js b/deps/undici/src/lib/fetch/response.js index 23cf55c51dc1c5..73386123e33c8d 100644 --- a/deps/undici/src/lib/fetch/response.js +++ b/deps/undici/src/lib/fetch/response.js @@ -23,7 +23,7 @@ const { webidl } = require('./webidl') const { FormData } = require('./formdata') const { getGlobalOrigin } = require('./global') const { URLSerializer } = require('./dataURL') -const { kHeadersList } = require('../core/symbols') +const { kHeadersList, kConstruct } = require('../core/symbols') const assert = require('assert') const { types } = require('util') @@ -144,7 +144,7 @@ class Response { // 2. Set this’s headers to a new Headers object with this’s relevant // Realm, whose header list is this’s response’s header list and guard // is "response". - this[kHeaders] = new Headers() + this[kHeaders] = new Headers(kConstruct) this[kHeaders][kGuard] = 'response' this[kHeaders][kHeadersList] = this[kState].headersList this[kHeaders][kRealm] = this[kRealm] @@ -514,11 +514,7 @@ webidl.converters.XMLHttpRequestBodyInit = function (V) { return webidl.converters.Blob(V, { strict: false }) } - if ( - types.isAnyArrayBuffer(V) || - types.isTypedArray(V) || - types.isDataView(V) - ) { + if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { return webidl.converters.BufferSource(V) } diff --git a/deps/undici/src/lib/handler/RetryHandler.js b/deps/undici/src/lib/handler/RetryHandler.js index a8112b36ee443e..371044719fd33d 100644 --- a/deps/undici/src/lib/handler/RetryHandler.js +++ b/deps/undici/src/lib/handler/RetryHandler.js @@ -1,4 +1,4 @@ -const assert = require('node:assert') +const assert = require('assert') const { kRetryHandlerDefaultRetry } = require('../core/symbols') const { RequestRetryError } = require('../core/errors') @@ -95,7 +95,7 @@ class RetryHandler { } onBodySent (chunk) { - return this.handler.onBodySent(chunk) + if (this.handler.onBodySent) return this.handler.onBodySent(chunk) } static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { diff --git a/deps/undici/src/lib/proxy-agent.js b/deps/undici/src/lib/proxy-agent.js index c710948cc5bbca..e3c0f6f3d46d90 100644 --- a/deps/undici/src/lib/proxy-agent.js +++ b/deps/undici/src/lib/proxy-agent.js @@ -65,6 +65,9 @@ class ProxyAgent extends DispatcherBase { this[kProxyTls] = opts.proxyTls this[kProxyHeaders] = opts.headers || {} + const resolvedUrl = new URL(opts.uri) + const { origin, port, host, username, password } = resolvedUrl + if (opts.auth && opts.token) { throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') } else if (opts.auth) { @@ -72,11 +75,10 @@ class ProxyAgent extends DispatcherBase { this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` } else if (opts.token) { this[kProxyHeaders]['proxy-authorization'] = opts.token + } else if (username && password) { + this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` } - const resolvedUrl = new URL(opts.uri) - const { origin, port, host } = resolvedUrl - const connect = buildConnector({ ...opts.proxyTls }) this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) this[kClient] = clientFactory(resolvedUrl, { connect }) @@ -100,7 +102,7 @@ class ProxyAgent extends DispatcherBase { }) if (statusCode !== 200) { socket.on('error', () => {}).destroy() - callback(new RequestAbortedError('Proxy response !== 200 when HTTP Tunneling')) + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) } if (opts.protocol !== 'https:') { callback(null, socket) diff --git a/deps/undici/src/package-lock.json b/deps/undici/src/package-lock.json index d4498d439c288f..a9f655fb0bf7ab 100644 --- a/deps/undici/src/package-lock.json +++ b/deps/undici/src/package-lock.json @@ -1,12 +1,12 @@ { "name": "undici", - "version": "5.28.1", + "version": "5.28.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "undici", - "version": "5.28.1", + "version": "5.28.2", "license": "MIT", "dependencies": { "@fastify/busboy": "^2.0.0" @@ -26,12 +26,12 @@ "dns-packet": "^5.4.0", "docsify-cli": "^4.4.3", "form-data": "^4.0.0", - "formdata-node": "^4.3.1", + "formdata-node": "^6.0.3", "https-pem": "^3.0.0", "husky": "^8.0.1", "import-fresh": "^3.3.0", "jest": "^29.0.2", - "jsdom": "^22.1.0", + "jsdom": "^23.0.0", "jsfuzz": "^1.0.15", "mocha": "^10.0.0", "mockttp": "^3.9.2", @@ -40,7 +40,7 @@ "proxy": "^1.0.2", "proxyquire": "^2.1.3", "semver": "^7.5.4", - "sinon": "^16.1.0", + "sinon": "^17.0.1", "snazzy": "^9.0.0", "standard": "^17.0.0", "table": "^6.8.0", @@ -805,9 +805,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", - "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -896,9 +896,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", - "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", + "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1598,15 +1598,6 @@ "node": ">=6" } }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/@tootallnate/quickjs-emscripten": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", @@ -1764,9 +1755,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.18.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.14.tgz", - "integrity": "sha512-iSOeNeXYNYNLLOMDSVPvIFojclvMZ/HDY2dU17kUlcsOsSQETbWIslJbYLZgA+ox8g2XQwSHKTkght1a5X26lQ==", + "version": "18.19.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.1.tgz", + "integrity": "sha512-mZJ9V11gG5Vp0Ox2oERpeFDl+JvCwK24PGy76vVY/UgBtjwJWc5rYBThFxmbnYOm9UPZNm6wEl/sxHt2SU7x9A==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1823,13 +1814,6 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "deprecated": "Use your platform's native atob() and btoa() methods instead", - "dev": true - }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -1886,15 +1870,15 @@ } }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", "dev": true, "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/agent-base/node_modules/debug": { @@ -3515,17 +3499,16 @@ } }, "node_modules/data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/date-fns": { @@ -4145,19 +4128,6 @@ "node": ">=6.0.0" } }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "deprecated": "Use your platform's native DOMException instead", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -4195,9 +4165,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.597", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.597.tgz", - "integrity": "sha512-0XOQNqHhg2YgRVRUrS4M4vWjFCFIP2ETXcXe/0KIQBjXE9Cpy+tgzzYfuq6HGai3hWq0YywtG+5XK8fyG08EjA==", + "version": "1.4.601", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.601.tgz", + "integrity": "sha512-SpwUMDWe9tQu8JX5QCO1+p/hChAi9AE9UpoC3rcHVc+gdCGlbT3SGb5I1klgb952HRIyvt9wZhSz9bNBYz9swA==", "dev": true }, "node_modules/emittery": { @@ -4450,15 +4420,15 @@ } }, "node_modules/eslint": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", - "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", + "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.54.0", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.55.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -5788,16 +5758,12 @@ } }, "node_modules/formdata-node": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", - "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-6.0.3.tgz", + "integrity": "sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg==", "dev": true, - "dependencies": { - "node-domexception": "1.0.0", - "web-streams-polyfill": "4.0.0-beta.3" - }, "engines": { - "node": ">= 12.20" + "node": ">= 18" } }, "node_modules/forwarded": { @@ -6453,15 +6419,15 @@ "dev": true }, "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dev": true, "dependencies": { - "whatwg-encoding": "^2.0.0" + "whatwg-encoding": "^3.1.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/html-escaper": { @@ -6513,17 +6479,16 @@ } }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", "dev": true, "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/http-proxy-agent/node_modules/debug": { @@ -6573,16 +6538,16 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", "dev": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/https-proxy-agent/node_modules/debug": { @@ -8062,40 +8027,38 @@ } }, "node_modules/jsdom": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", - "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.0.1.tgz", + "integrity": "sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==", "dev": true, "dependencies": { - "abab": "^2.0.6", "cssstyle": "^3.0.0", - "data-urls": "^4.0.0", + "data-urls": "^5.0.0", "decimal.js": "^10.4.3", - "domexception": "^4.0.0", "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.4", + "nwsapi": "^2.2.7", "parse5": "^7.1.2", "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", + "tough-cookie": "^4.1.3", + "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.1", - "ws": "^8.13.0", - "xml-name-validator": "^4.0.0" + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.14.2", + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=16" + "node": ">=18" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^2.11.2" }, "peerDependenciesMeta": { "canvas": { @@ -9263,6 +9226,48 @@ "node": ">=14.14.0" } }, + "node_modules/mockttp/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/mockttp/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mockttp/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/mockttp/node_modules/lru-cache": { "version": "7.18.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", @@ -9272,6 +9277,12 @@ "node": ">=12" } }, + "node_modules/mockttp/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/module-not-found-error": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", @@ -9396,25 +9407,6 @@ "isarray": "0.0.1" } }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -9485,9 +9477,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "node_modules/normalize-package-data": { @@ -10142,13 +10134,13 @@ } }, "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -10481,18 +10473,6 @@ "node": ">= 14" } }, - "node_modules/pac-proxy-agent/node_modules/agent-base": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", - "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", - "dev": true, - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/pac-proxy-agent/node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -10510,32 +10490,6 @@ } } }, - "node_modules/pac-proxy-agent/node_modules/http-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", - "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", - "dev": true, - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", - "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", - "dev": true, - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/pac-proxy-agent/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -12049,16 +12003,16 @@ "dev": true }, "node_modules/sinon": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-16.1.3.tgz", - "integrity": "sha512-mjnWWeyxcAf9nC0bXcPmiDut+oE8HYridTNzBbF98AYVLmWwGRp2ISEpyhYflG1ifILT+eNn3BmKUJPxjXUPlA==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.1.tgz", + "integrity": "sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^10.3.0", + "@sinonjs/fake-timers": "^11.2.2", "@sinonjs/samsam": "^8.0.0", "diff": "^5.1.0", - "nise": "^5.1.4", + "nise": "^5.1.5", "supports-color": "^7.2.0" }, "funding": { @@ -12066,15 +12020,6 @@ "url": "https://opencollective.com/sinon" } }, - "node_modules/sinon/node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, "node_modules/sinon/node_modules/diff": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", @@ -12212,6 +12157,18 @@ "node": ">= 10" } }, + "node_modules/socks-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/socks-proxy-agent/node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -15224,15 +15181,15 @@ } }, "node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", "dev": true, "dependencies": { - "punycode": "^2.3.0" + "punycode": "^2.3.1" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/tree-kill": { @@ -15726,15 +15683,15 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, "dependencies": { - "xml-name-validator": "^4.0.0" + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/wait-on": { @@ -15765,15 +15722,6 @@ "makeerror": "1.0.12" } }, - "node_modules/web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -15784,15 +15732,15 @@ } }, "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, "dependencies": { "iconv-lite": "0.6.3" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-encoding/node_modules/iconv-lite": { @@ -15808,25 +15756,25 @@ } }, "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", "dev": true, "dependencies": { - "tr46": "^4.1.1", + "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/which": { @@ -16026,12 +15974,12 @@ } }, "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/xmlchars": { diff --git a/deps/undici/src/package.json b/deps/undici/src/package.json index f30f5070ff27fa..2b64daf41e2822 100644 --- a/deps/undici/src/package.json +++ b/deps/undici/src/package.json @@ -1,6 +1,6 @@ { "name": "undici", - "version": "5.28.1", + "version": "5.28.2", "description": "An HTTP/1.1 client, written from scratch for Node.js", "homepage": "https://undici.nodejs.org", "bugs": { @@ -110,12 +110,12 @@ "dns-packet": "^5.4.0", "docsify-cli": "^4.4.3", "form-data": "^4.0.0", - "formdata-node": "^4.3.1", + "formdata-node": "^6.0.3", "https-pem": "^3.0.0", "husky": "^8.0.1", "import-fresh": "^3.3.0", "jest": "^29.0.2", - "jsdom": "^22.1.0", + "jsdom": "^23.0.0", "jsfuzz": "^1.0.15", "mocha": "^10.0.0", "mockttp": "^3.9.2", @@ -124,7 +124,7 @@ "proxy": "^1.0.2", "proxyquire": "^2.1.3", "semver": "^7.5.4", - "sinon": "^16.1.0", + "sinon": "^17.0.1", "snazzy": "^9.0.0", "standard": "^17.0.0", "table": "^6.8.0", diff --git a/deps/undici/src/types/fetch.d.ts b/deps/undici/src/types/fetch.d.ts index fa4619c9182739..440f2b003978fe 100644 --- a/deps/undici/src/types/fetch.d.ts +++ b/deps/undici/src/types/fetch.d.ts @@ -108,7 +108,7 @@ export interface RequestInit { body?: BodyInit redirect?: RequestRedirect integrity?: string - signal?: AbortSignal + signal?: AbortSignal | null credentials?: RequestCredentials mode?: RequestMode referrer?: string diff --git a/deps/undici/undici.js b/deps/undici/undici.js index 7cfe0e013390c8..847a8814336f5a 100644 --- a/deps/undici/undici.js +++ b/deps/undici/undici.js @@ -69,7 +69,8 @@ var require_symbols = __commonJS({ kHTTP1BuildRequest: Symbol("http1 build request"), kHTTP2CopyHeaders: Symbol("http2 copy headers"), kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry") + kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), + kConstruct: Symbol("constructable") }; } }); @@ -1994,7 +1995,7 @@ var require_webidl = __commonJS({ var require_headers = __commonJS({ "lib/fetch/headers.js"(exports2, module2) { "use strict"; - var { kHeadersList } = require_symbols(); + var { kHeadersList, kConstruct } = require_symbols(); var { kGuard } = require_symbols2(); var { kEnumerableProperty } = require_util(); var { @@ -2156,6 +2157,9 @@ var require_headers = __commonJS({ __name(this, "Headers"); } constructor(init = void 0) { + if (init === kConstruct) { + return; + } this[kHeadersList] = new HeadersList(); this[kGuard] = "none"; if (init !== void 0) { @@ -4438,15 +4442,12 @@ var require_dataURL = __commonJS({ } __name(dataURLProcessor, "dataURLProcessor"); function URLSerializer(url, excludeFragment = false) { - const href = url.href; if (!excludeFragment) { - return href; + return url.href; } - const hash = href.lastIndexOf("#"); - if (hash === -1) { - return href; - } - return href.slice(0, hash); + const href = url.href; + const hashLength = url.hash.length; + return hashLength === 0 ? href : href.substring(0, href.length - hashLength); } __name(URLSerializer, "URLSerializer"); function collectASequenceOfCodePoints(condition, input, position) { @@ -5463,7 +5464,7 @@ var require_response = __commonJS({ var { FormData } = require_formdata(); var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); - var { kHeadersList } = require_symbols(); + var { kHeadersList, kConstruct } = require_symbols(); var assert = require("assert"); var { types } = require("util"); var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream; @@ -5535,7 +5536,7 @@ var require_response = __commonJS({ init = webidl.converters.ResponseInit(init); this[kRealm] = { settingsObject: {} }; this[kState] = makeResponse({}); - this[kHeaders] = new Headers(); + this[kHeaders] = new Headers(kConstruct); this[kHeaders][kGuard] = "response"; this[kHeaders][kHeadersList] = this[kState].headersList; this[kHeaders][kRealm] = this[kRealm]; @@ -5778,7 +5779,7 @@ var require_response = __commonJS({ if (isBlobLike(V)) { return webidl.converters.Blob(V, { strict: false }); } - if (types.isAnyArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { + if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { return webidl.converters.BufferSource(V); } if (util.isFormDataLike(V)) { @@ -5903,11 +5904,10 @@ var require_request = __commonJS({ var { webidl } = require_webidl(); var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); - var { kHeadersList } = require_symbols(); + var { kHeadersList, kConstruct } = require_symbols(); var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kInit = Symbol("init"); var kAbortController = Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); @@ -5918,7 +5918,7 @@ var require_request = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-request constructor(input, init = {}) { - if (input === kInit) { + if (input === kConstruct) { return; } webidl.argumentLengthCheck(arguments, 1, { header: "Request constructor" }); @@ -6073,7 +6073,7 @@ var require_request = __commonJS({ if (init.redirect !== void 0) { request.redirect = init.redirect; } - if (init.integrity !== void 0 && init.integrity != null) { + if (init.integrity != null) { request.integrity = String(init.integrity); } if (init.keepalive !== void 0) { @@ -6126,7 +6126,7 @@ var require_request = __commonJS({ requestFinalizer.register(ac, { signal, abort }); } } - this[kHeaders] = new Headers(); + this[kHeaders] = new Headers(kConstruct); this[kHeaders][kHeadersList] = request.headersList; this[kHeaders][kGuard] = "request"; this[kHeaders][kRealm] = this[kRealm]; @@ -6322,10 +6322,10 @@ var require_request = __commonJS({ throw new TypeError("unusable"); } const clonedRequest = cloneRequest(this[kState]); - const clonedRequestObject = new _Request(kInit); + const clonedRequestObject = new _Request(kConstruct); clonedRequestObject[kState] = clonedRequest; clonedRequestObject[kRealm] = this[kRealm]; - clonedRequestObject[kHeaders] = new Headers(); + clonedRequestObject[kHeaders] = new Headers(kConstruct); clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList; clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]; clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]; @@ -10294,7 +10294,7 @@ var require_fetch = __commonJS({ if (timingInfo === null) { return; } - if (!timingInfo.timingAllowPassed) { + if (!response.timingAllowPassed) { timingInfo = createOpaqueTimingInfo({ startTime: timingInfo.startTime }); diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index 7d804cd2dd0bb1..ce440fbf41861e 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -29,7 +29,7 @@ This a list of all the dependencies: * [postject 1.0.0-alpha.6][] * [simdjson 3.6.0][] * [simdutf 4.0.4][] -* [undici 5.28.1][] +* [undici 5.28.2][] * [uvwasi 0.0.19][] * [V8 11.8.172.12][] * [zlib 1.2.13.1-motley-5daffc7][] @@ -297,7 +297,7 @@ a C++ library for fast JSON parsing. The [simdutf](https://github.com/simdutf/simdutf) dependency is a C++ library for fast UTF-8 decoding and encoding. -### undici 5.28.1 +### undici 5.28.2 The [undici](https://github.com/nodejs/undici) dependency is an HTTP/1.1 client, written from scratch for Node.js.. @@ -352,7 +352,7 @@ performance improvements not currently available in standard zlib. [postject 1.0.0-alpha.6]: #postject-100-alpha6 [simdjson 3.6.0]: #simdutf-360 [simdutf 4.0.4]: #simdutf-404 -[undici 5.28.1]: #undici-5281 +[undici 5.28.2]: #undici-5282 [update-openssl-action]: ../../../.github/workflows/update-openssl.yml [uvwasi 0.0.19]: #uvwasi-0019 [v8 11.8.172.12]: #v8-11817212 diff --git a/src/undici_version.h b/src/undici_version.h index 03d3b6bb7f9641..02433e7e0c3a84 100644 --- a/src/undici_version.h +++ b/src/undici_version.h @@ -2,5 +2,5 @@ // Refer to tools/dep_updaters/update-undici.sh #ifndef SRC_UNDICI_VERSION_H_ #define SRC_UNDICI_VERSION_H_ -#define UNDICI_VERSION "5.28.1" +#define UNDICI_VERSION "5.28.2" #endif // SRC_UNDICI_VERSION_H_ From c9841583db93c48900326ee194d73e761c5167f9 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Tue, 5 Dec 2023 02:37:20 +0200 Subject: [PATCH 18/67] tools: update eslint to 8.55.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51025 Reviewed-By: Moshe Atlow Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca --- .../eslint/lib/rules/no-restricted-imports.js | 85 +++--- .../@babel/code-frame/lib/index.js | 4 +- .../@babel/code-frame/package.json | 6 +- .../@babel/compat-data/package.json | 2 +- .../@babel/core/lib/config/files/plugins.js | 15 +- .../node_modules/@babel/core/lib/index.js | 2 +- .../core/lib/vendor/import-meta-resolve.js | 243 ++++++++++-------- .../node_modules/@babel/core/package.json | 16 +- .../@babel/generator/lib/printer.js | 37 ++- .../@babel/generator/package.json | 8 +- .../@babel/helper-string-parser/package.json | 2 +- .../helper-validator-option/package.json | 2 +- .../@babel/helpers/lib/helpers-generated.js | 5 +- .../@babel/helpers/lib/helpers.js | 3 +- .../helpers/lib/helpers/applyDecs2305.js | 205 +++++---------- .../node_modules/@babel/helpers/lib/index.js | 7 +- .../node_modules/@babel/helpers/package.json | 13 +- .../helpers/scripts/generate-helpers.js | 44 +++- .../@babel/highlight/lib/index.js | 4 +- .../@babel/highlight/package.json | 2 +- .../node_modules/@babel/parser/package.json | 8 +- .../@babel/traverse/lib/path/comments.js | 8 +- .../@babel/traverse/lib/path/removal.js | 6 +- .../node_modules/@babel/traverse/package.json | 12 +- .../lib/retrievers/getBindingIdentifiers.js | 5 +- .../node_modules/@babel/types/package.json | 8 +- .../@eslint/eslintrc/dist/eslintrc.cjs | 15 +- .../eslintrc/lib/config-array-factory.js | 2 + .../lib/config-array/config-dependency.js | 11 +- .../@eslint/eslintrc/lib/flat-compat.js | 2 +- .../@eslint/eslintrc/package.json | 2 +- .../node_modules/@eslint/js/package.json | 2 +- .../node_modules/caniuse-lite/data/agents.js | 2 +- .../caniuse-lite/data/browserVersions.js | 2 +- .../caniuse-lite/data/features/aac.js | 2 +- .../data/features/abortcontroller.js | 2 +- .../caniuse-lite/data/features/ac3-ec3.js | 2 +- .../data/features/accelerometer.js | 2 +- .../data/features/addeventlistener.js | 2 +- .../data/features/alternate-stylesheet.js | 2 +- .../data/features/ambient-light.js | 2 +- .../caniuse-lite/data/features/apng.js | 2 +- .../data/features/array-find-index.js | 2 +- .../caniuse-lite/data/features/array-find.js | 2 +- .../caniuse-lite/data/features/array-flat.js | 2 +- .../data/features/array-includes.js | 2 +- .../data/features/arrow-functions.js | 2 +- .../caniuse-lite/data/features/asmjs.js | 2 +- .../data/features/async-clipboard.js | 2 +- .../data/features/async-functions.js | 2 +- .../caniuse-lite/data/features/atob-btoa.js | 2 +- .../caniuse-lite/data/features/audio-api.js | 2 +- .../caniuse-lite/data/features/audio.js | 2 +- .../caniuse-lite/data/features/audiotracks.js | 2 +- .../caniuse-lite/data/features/autofocus.js | 2 +- .../caniuse-lite/data/features/auxclick.js | 2 +- .../caniuse-lite/data/features/av1.js | 2 +- .../caniuse-lite/data/features/avif.js | 2 +- .../data/features/background-attachment.js | 2 +- .../data/features/background-clip-text.js | 2 +- .../data/features/background-img-opts.js | 2 +- .../data/features/background-position-x-y.js | 2 +- .../features/background-repeat-round-space.js | 2 +- .../data/features/background-sync.js | 2 +- .../data/features/battery-status.js | 2 +- .../caniuse-lite/data/features/beacon.js | 2 +- .../data/features/beforeafterprint.js | 2 +- .../caniuse-lite/data/features/bigint.js | 2 +- .../caniuse-lite/data/features/blobbuilder.js | 2 +- .../caniuse-lite/data/features/bloburls.js | 2 +- .../data/features/border-image.js | 2 +- .../data/features/border-radius.js | 2 +- .../data/features/broadcastchannel.js | 2 +- .../caniuse-lite/data/features/brotli.js | 2 +- .../caniuse-lite/data/features/calc.js | 2 +- .../data/features/canvas-blending.js | 2 +- .../caniuse-lite/data/features/canvas-text.js | 2 +- .../caniuse-lite/data/features/canvas.js | 2 +- .../caniuse-lite/data/features/ch-unit.js | 2 +- .../data/features/chacha20-poly1305.js | 2 +- .../data/features/channel-messaging.js | 2 +- .../data/features/childnode-remove.js | 2 +- .../caniuse-lite/data/features/classlist.js | 2 +- .../client-hints-dpr-width-viewport.js | 2 +- .../caniuse-lite/data/features/clipboard.js | 2 +- .../caniuse-lite/data/features/colr-v1.js | 2 +- .../caniuse-lite/data/features/colr.js | 2 +- .../data/features/comparedocumentposition.js | 2 +- .../data/features/console-basic.js | 2 +- .../data/features/console-time.js | 2 +- .../caniuse-lite/data/features/const.js | 2 +- .../data/features/constraint-validation.js | 2 +- .../data/features/contenteditable.js | 2 +- .../data/features/contentsecuritypolicy.js | 2 +- .../data/features/contentsecuritypolicy2.js | 2 +- .../data/features/cookie-store-api.js | 2 +- .../caniuse-lite/data/features/cors.js | 2 +- .../data/features/createimagebitmap.js | 2 +- .../data/features/credential-management.js | 2 +- .../data/features/cryptography.js | 2 +- .../caniuse-lite/data/features/css-all.js | 2 +- .../data/features/css-anchor-positioning.js | 2 +- .../data/features/css-animation.js | 2 +- .../data/features/css-any-link.js | 2 +- .../data/features/css-appearance.js | 2 +- .../data/features/css-at-counter-style.js | 2 +- .../data/features/css-autofill.js | 2 +- .../data/features/css-backdrop-filter.js | 2 +- .../data/features/css-background-offsets.js | 2 +- .../data/features/css-backgroundblendmode.js | 2 +- .../data/features/css-boxdecorationbreak.js | 2 +- .../data/features/css-boxshadow.js | 2 +- .../caniuse-lite/data/features/css-canvas.js | 2 +- .../data/features/css-caret-color.js | 2 +- .../data/features/css-cascade-layers.js | 2 +- .../data/features/css-cascade-scope.js | 2 +- .../data/features/css-case-insensitive.js | 2 +- .../data/features/css-clip-path.js | 2 +- .../data/features/css-color-adjust.js | 2 +- .../data/features/css-color-function.js | 2 +- .../data/features/css-conic-gradients.js | 2 +- .../features/css-container-queries-style.js | 2 +- .../data/features/css-container-queries.js | 2 +- .../features/css-container-query-units.js | 2 +- .../data/features/css-containment.js | 2 +- .../data/features/css-content-visibility.js | 2 +- .../data/features/css-counters.js | 2 +- .../data/features/css-crisp-edges.js | 2 +- .../data/features/css-cross-fade.js | 2 +- .../data/features/css-default-pseudo.js | 2 +- .../data/features/css-descendant-gtgt.js | 2 +- .../data/features/css-deviceadaptation.js | 2 +- .../data/features/css-dir-pseudo.js | 2 +- .../data/features/css-display-contents.js | 2 +- .../data/features/css-element-function.js | 2 +- .../data/features/css-env-function.js | 2 +- .../data/features/css-exclusions.js | 2 +- .../data/features/css-featurequeries.js | 2 +- .../data/features/css-file-selector-button.js | 2 +- .../data/features/css-filter-function.js | 2 +- .../caniuse-lite/data/features/css-filters.js | 2 +- .../data/features/css-first-letter.js | 2 +- .../data/features/css-first-line.js | 2 +- .../caniuse-lite/data/features/css-fixed.js | 2 +- .../data/features/css-focus-visible.js | 2 +- .../data/features/css-focus-within.js | 2 +- .../data/features/css-font-palette.js | 2 +- .../features/css-font-rendering-controls.js | 2 +- .../data/features/css-font-stretch.js | 2 +- .../data/features/css-gencontent.js | 2 +- .../data/features/css-gradients.js | 2 +- .../data/features/css-grid-animation.js | 2 +- .../caniuse-lite/data/features/css-grid.js | 2 +- .../data/features/css-hanging-punctuation.js | 2 +- .../caniuse-lite/data/features/css-has.js | 2 +- .../caniuse-lite/data/features/css-hyphens.js | 2 +- .../data/features/css-image-orientation.js | 2 +- .../data/features/css-image-set.js | 2 +- .../data/features/css-in-out-of-range.js | 2 +- .../data/features/css-indeterminate-pseudo.js | 2 +- .../data/features/css-initial-letter.js | 2 +- .../data/features/css-initial-value.js | 2 +- .../caniuse-lite/data/features/css-lch-lab.js | 2 +- .../data/features/css-letter-spacing.js | 2 +- .../data/features/css-line-clamp.js | 2 +- .../data/features/css-logical-props.js | 2 +- .../data/features/css-marker-pseudo.js | 2 +- .../caniuse-lite/data/features/css-masks.js | 2 +- .../data/features/css-matches-pseudo.js | 2 +- .../data/features/css-math-functions.js | 2 +- .../data/features/css-media-interaction.js | 2 +- .../data/features/css-media-range-syntax.js | 2 +- .../data/features/css-media-resolution.js | 2 +- .../data/features/css-media-scripting.js | 2 +- .../data/features/css-mediaqueries.js | 2 +- .../data/features/css-mixblendmode.js | 2 +- .../data/features/css-motion-paths.js | 2 +- .../data/features/css-namespaces.js | 2 +- .../caniuse-lite/data/features/css-nesting.js | 2 +- .../data/features/css-not-sel-list.js | 2 +- .../data/features/css-nth-child-of.js | 2 +- .../caniuse-lite/data/features/css-opacity.js | 2 +- .../data/features/css-optional-pseudo.js | 2 +- .../data/features/css-overflow-anchor.js | 2 +- .../data/features/css-overflow-overlay.js | 2 +- .../data/features/css-overflow.js | 2 +- .../data/features/css-overscroll-behavior.js | 2 +- .../data/features/css-page-break.js | 2 +- .../data/features/css-paged-media.js | 2 +- .../data/features/css-paint-api.js | 2 +- .../data/features/css-placeholder-shown.js | 2 +- .../data/features/css-placeholder.js | 2 +- .../data/features/css-print-color-adjust.js | 2 +- .../data/features/css-read-only-write.js | 2 +- .../data/features/css-rebeccapurple.js | 2 +- .../data/features/css-reflections.js | 2 +- .../caniuse-lite/data/features/css-regions.js | 2 +- .../data/features/css-relative-colors.js | 2 +- .../data/features/css-repeating-gradients.js | 2 +- .../caniuse-lite/data/features/css-resize.js | 2 +- .../data/features/css-revert-value.js | 2 +- .../data/features/css-rrggbbaa.js | 2 +- .../data/features/css-scroll-behavior.js | 2 +- .../data/features/css-scroll-timeline.js | 2 +- .../data/features/css-scrollbar.js | 2 +- .../caniuse-lite/data/features/css-sel2.js | 2 +- .../caniuse-lite/data/features/css-sel3.js | 2 +- .../data/features/css-selection.js | 2 +- .../caniuse-lite/data/features/css-shapes.js | 2 +- .../data/features/css-snappoints.js | 2 +- .../caniuse-lite/data/features/css-sticky.js | 2 +- .../caniuse-lite/data/features/css-subgrid.js | 2 +- .../data/features/css-supports-api.js | 2 +- .../caniuse-lite/data/features/css-table.js | 2 +- .../data/features/css-text-align-last.js | 2 +- .../data/features/css-text-box-trim.js | 2 +- .../data/features/css-text-indent.js | 2 +- .../data/features/css-text-justify.js | 2 +- .../data/features/css-text-orientation.js | 2 +- .../data/features/css-text-spacing.js | 2 +- .../data/features/css-text-wrap-balance.js | 2 +- .../data/features/css-textshadow.js | 2 +- .../data/features/css-touch-action.js | 2 +- .../data/features/css-transitions.js | 2 +- .../data/features/css-unicode-bidi.js | 2 +- .../data/features/css-unset-value.js | 2 +- .../data/features/css-variables.js | 2 +- .../data/features/css-when-else.js | 2 +- .../data/features/css-widows-orphans.js | 2 +- .../data/features/css-width-stretch.js | 2 +- .../data/features/css-writing-mode.js | 2 +- .../caniuse-lite/data/features/css-zoom.js | 2 +- .../caniuse-lite/data/features/css3-attr.js | 2 +- .../data/features/css3-boxsizing.js | 2 +- .../caniuse-lite/data/features/css3-colors.js | 2 +- .../data/features/css3-cursors-grab.js | 2 +- .../data/features/css3-cursors-newer.js | 2 +- .../data/features/css3-cursors.js | 2 +- .../data/features/css3-tabsize.js | 2 +- .../data/features/currentcolor.js | 2 +- .../data/features/custom-elements.js | 2 +- .../data/features/custom-elementsv1.js | 2 +- .../caniuse-lite/data/features/customevent.js | 2 +- .../caniuse-lite/data/features/datalist.js | 2 +- .../caniuse-lite/data/features/dataset.js | 2 +- .../caniuse-lite/data/features/datauri.js | 2 +- .../data/features/date-tolocaledatestring.js | 2 +- .../data/features/declarative-shadow-dom.js | 2 +- .../caniuse-lite/data/features/decorators.js | 2 +- .../caniuse-lite/data/features/details.js | 2 +- .../data/features/deviceorientation.js | 2 +- .../data/features/devicepixelratio.js | 2 +- .../caniuse-lite/data/features/dialog.js | 2 +- .../data/features/dispatchevent.js | 2 +- .../caniuse-lite/data/features/dnssec.js | 2 +- .../data/features/do-not-track.js | 2 +- .../data/features/document-currentscript.js | 2 +- .../data/features/document-evaluate-xpath.js | 2 +- .../data/features/document-execcommand.js | 2 +- .../data/features/document-policy.js | 2 +- .../features/document-scrollingelement.js | 2 +- .../data/features/documenthead.js | 2 +- .../data/features/dom-manip-convenience.js | 2 +- .../caniuse-lite/data/features/dom-range.js | 2 +- .../data/features/domcontentloaded.js | 2 +- .../caniuse-lite/data/features/dommatrix.js | 2 +- .../caniuse-lite/data/features/download.js | 2 +- .../caniuse-lite/data/features/dragndrop.js | 2 +- .../data/features/element-closest.js | 2 +- .../data/features/element-from-point.js | 2 +- .../data/features/element-scroll-methods.js | 2 +- .../caniuse-lite/data/features/eme.js | 2 +- .../caniuse-lite/data/features/eot.js | 2 +- .../caniuse-lite/data/features/es5.js | 2 +- .../caniuse-lite/data/features/es6-class.js | 2 +- .../data/features/es6-generators.js | 2 +- .../features/es6-module-dynamic-import.js | 2 +- .../caniuse-lite/data/features/es6-module.js | 2 +- .../caniuse-lite/data/features/es6-number.js | 2 +- .../data/features/es6-string-includes.js | 2 +- .../caniuse-lite/data/features/es6.js | 2 +- .../caniuse-lite/data/features/eventsource.js | 2 +- .../data/features/extended-system-fonts.js | 2 +- .../data/features/feature-policy.js | 2 +- .../caniuse-lite/data/features/fetch.js | 2 +- .../data/features/fieldset-disabled.js | 2 +- .../caniuse-lite/data/features/fileapi.js | 2 +- .../caniuse-lite/data/features/filereader.js | 2 +- .../data/features/filereadersync.js | 2 +- .../caniuse-lite/data/features/filesystem.js | 2 +- .../caniuse-lite/data/features/flac.js | 2 +- .../caniuse-lite/data/features/flexbox-gap.js | 2 +- .../caniuse-lite/data/features/flexbox.js | 2 +- .../caniuse-lite/data/features/flow-root.js | 2 +- .../data/features/focusin-focusout-events.js | 2 +- .../data/features/font-family-system-ui.js | 2 +- .../data/features/font-feature.js | 2 +- .../data/features/font-kerning.js | 2 +- .../data/features/font-loading.js | 2 +- .../data/features/font-size-adjust.js | 2 +- .../caniuse-lite/data/features/font-smooth.js | 2 +- .../data/features/font-unicode-range.js | 2 +- .../data/features/font-variant-alternates.js | 2 +- .../data/features/font-variant-numeric.js | 2 +- .../caniuse-lite/data/features/fontface.js | 2 +- .../data/features/form-attribute.js | 2 +- .../data/features/form-submit-attributes.js | 2 +- .../data/features/form-validation.js | 2 +- .../caniuse-lite/data/features/forms.js | 2 +- .../caniuse-lite/data/features/fullscreen.js | 2 +- .../caniuse-lite/data/features/gamepad.js | 2 +- .../caniuse-lite/data/features/geolocation.js | 2 +- .../data/features/getboundingclientrect.js | 2 +- .../data/features/getcomputedstyle.js | 2 +- .../data/features/getelementsbyclassname.js | 2 +- .../data/features/getrandomvalues.js | 2 +- .../caniuse-lite/data/features/gyroscope.js | 2 +- .../data/features/hardwareconcurrency.js | 2 +- .../caniuse-lite/data/features/hashchange.js | 2 +- .../caniuse-lite/data/features/heif.js | 2 +- .../caniuse-lite/data/features/hevc.js | 2 +- .../caniuse-lite/data/features/hidden.js | 2 +- .../data/features/high-resolution-time.js | 2 +- .../caniuse-lite/data/features/history.js | 2 +- .../data/features/html-media-capture.js | 2 +- .../data/features/html5semantic.js | 2 +- .../data/features/http-live-streaming.js | 2 +- .../caniuse-lite/data/features/http2.js | 2 +- .../caniuse-lite/data/features/http3.js | 2 +- .../data/features/iframe-sandbox.js | 2 +- .../data/features/iframe-seamless.js | 2 +- .../data/features/iframe-srcdoc.js | 2 +- .../data/features/imagecapture.js | 2 +- .../caniuse-lite/data/features/ime.js | 2 +- .../img-naturalwidth-naturalheight.js | 2 +- .../caniuse-lite/data/features/import-maps.js | 2 +- .../caniuse-lite/data/features/imports.js | 2 +- .../data/features/indeterminate-checkbox.js | 2 +- .../caniuse-lite/data/features/indexeddb.js | 2 +- .../caniuse-lite/data/features/indexeddb2.js | 2 +- .../data/features/inline-block.js | 2 +- .../caniuse-lite/data/features/innertext.js | 2 +- .../data/features/input-autocomplete-onoff.js | 2 +- .../caniuse-lite/data/features/input-color.js | 2 +- .../data/features/input-datetime.js | 2 +- .../data/features/input-email-tel-url.js | 2 +- .../caniuse-lite/data/features/input-event.js | 2 +- .../data/features/input-file-accept.js | 2 +- .../data/features/input-file-directory.js | 2 +- .../data/features/input-file-multiple.js | 2 +- .../data/features/input-inputmode.js | 2 +- .../data/features/input-minlength.js | 2 +- .../data/features/input-number.js | 2 +- .../data/features/input-pattern.js | 2 +- .../data/features/input-placeholder.js | 2 +- .../caniuse-lite/data/features/input-range.js | 2 +- .../data/features/input-search.js | 2 +- .../data/features/input-selection.js | 2 +- .../data/features/insert-adjacent.js | 2 +- .../data/features/insertadjacenthtml.js | 2 +- .../data/features/internationalization.js | 2 +- .../data/features/intersectionobserver-v2.js | 2 +- .../data/features/intersectionobserver.js | 2 +- .../data/features/intl-pluralrules.js | 2 +- .../data/features/intrinsic-width.js | 2 +- .../caniuse-lite/data/features/jpeg2000.js | 2 +- .../caniuse-lite/data/features/jpegxl.js | 2 +- .../caniuse-lite/data/features/jpegxr.js | 2 +- .../data/features/js-regexp-lookbehind.js | 2 +- .../caniuse-lite/data/features/json.js | 2 +- .../features/justify-content-space-evenly.js | 2 +- .../data/features/kerning-pairs-ligatures.js | 2 +- .../data/features/keyboardevent-charcode.js | 2 +- .../data/features/keyboardevent-code.js | 2 +- .../keyboardevent-getmodifierstate.js | 2 +- .../data/features/keyboardevent-key.js | 2 +- .../data/features/keyboardevent-location.js | 2 +- .../data/features/keyboardevent-which.js | 2 +- .../caniuse-lite/data/features/lazyload.js | 2 +- .../caniuse-lite/data/features/let.js | 2 +- .../data/features/link-icon-png.js | 2 +- .../data/features/link-icon-svg.js | 2 +- .../data/features/link-rel-dns-prefetch.js | 2 +- .../data/features/link-rel-modulepreload.js | 2 +- .../data/features/link-rel-preconnect.js | 2 +- .../data/features/link-rel-prefetch.js | 2 +- .../data/features/link-rel-preload.js | 2 +- .../data/features/link-rel-prerender.js | 2 +- .../data/features/loading-lazy-attr.js | 2 +- .../data/features/localecompare.js | 2 +- .../data/features/magnetometer.js | 2 +- .../data/features/matchesselector.js | 2 +- .../caniuse-lite/data/features/matchmedia.js | 2 +- .../caniuse-lite/data/features/mathml.js | 2 +- .../caniuse-lite/data/features/maxlength.js | 2 +- .../mdn-css-backdrop-pseudo-element.js | 2 +- .../mdn-css-unicode-bidi-isolate-override.js | 2 +- .../features/mdn-css-unicode-bidi-isolate.js | 2 +- .../mdn-css-unicode-bidi-plaintext.js | 2 +- .../features/mdn-text-decoration-color.js | 2 +- .../data/features/mdn-text-decoration-line.js | 2 +- .../features/mdn-text-decoration-shorthand.js | 2 +- .../features/mdn-text-decoration-style.js | 2 +- .../data/features/media-fragments.js | 2 +- .../data/features/mediacapture-fromelement.js | 2 +- .../data/features/mediarecorder.js | 2 +- .../caniuse-lite/data/features/mediasource.js | 2 +- .../caniuse-lite/data/features/menu.js | 2 +- .../data/features/meta-theme-color.js | 2 +- .../caniuse-lite/data/features/meter.js | 2 +- .../caniuse-lite/data/features/midi.js | 2 +- .../caniuse-lite/data/features/minmaxwh.js | 2 +- .../caniuse-lite/data/features/mp3.js | 2 +- .../caniuse-lite/data/features/mpeg-dash.js | 2 +- .../caniuse-lite/data/features/mpeg4.js | 2 +- .../data/features/multibackgrounds.js | 2 +- .../caniuse-lite/data/features/multicolumn.js | 2 +- .../data/features/mutation-events.js | 2 +- .../data/features/mutationobserver.js | 2 +- .../data/features/namevalue-storage.js | 2 +- .../data/features/native-filesystem-api.js | 2 +- .../caniuse-lite/data/features/nav-timing.js | 2 +- .../caniuse-lite/data/features/netinfo.js | 2 +- .../data/features/notifications.js | 2 +- .../data/features/object-entries.js | 2 +- .../caniuse-lite/data/features/object-fit.js | 2 +- .../data/features/object-observe.js | 2 +- .../data/features/object-values.js | 2 +- .../caniuse-lite/data/features/objectrtc.js | 2 +- .../data/features/offline-apps.js | 2 +- .../data/features/offscreencanvas.js | 2 +- .../caniuse-lite/data/features/ogg-vorbis.js | 2 +- .../caniuse-lite/data/features/ogv.js | 2 +- .../caniuse-lite/data/features/ol-reversed.js | 2 +- .../data/features/once-event-listener.js | 2 +- .../data/features/online-status.js | 2 +- .../caniuse-lite/data/features/opus.js | 2 +- .../data/features/orientation-sensor.js | 2 +- .../caniuse-lite/data/features/outline.js | 2 +- .../data/features/pad-start-end.js | 2 +- .../data/features/page-transition-events.js | 2 +- .../data/features/pagevisibility.js | 2 +- .../data/features/passive-event-listener.js | 2 +- .../caniuse-lite/data/features/passkeys.js | 2 +- .../data/features/passwordrules.js | 2 +- .../caniuse-lite/data/features/path2d.js | 2 +- .../data/features/payment-request.js | 2 +- .../caniuse-lite/data/features/pdf-viewer.js | 2 +- .../data/features/permissions-api.js | 2 +- .../data/features/permissions-policy.js | 2 +- .../data/features/picture-in-picture.js | 2 +- .../caniuse-lite/data/features/picture.js | 2 +- .../caniuse-lite/data/features/ping.js | 2 +- .../caniuse-lite/data/features/png-alpha.js | 2 +- .../data/features/pointer-events.js | 2 +- .../caniuse-lite/data/features/pointer.js | 2 +- .../caniuse-lite/data/features/pointerlock.js | 2 +- .../caniuse-lite/data/features/portals.js | 2 +- .../data/features/prefers-color-scheme.js | 2 +- .../data/features/prefers-reduced-motion.js | 2 +- .../caniuse-lite/data/features/progress.js | 2 +- .../data/features/promise-finally.js | 2 +- .../caniuse-lite/data/features/promises.js | 2 +- .../caniuse-lite/data/features/proximity.js | 2 +- .../caniuse-lite/data/features/proxy.js | 2 +- .../data/features/publickeypinning.js | 2 +- .../caniuse-lite/data/features/push-api.js | 2 +- .../data/features/queryselector.js | 2 +- .../data/features/readonly-attr.js | 2 +- .../data/features/referrer-policy.js | 2 +- .../data/features/registerprotocolhandler.js | 2 +- .../data/features/rel-noopener.js | 2 +- .../data/features/rel-noreferrer.js | 2 +- .../caniuse-lite/data/features/rellist.js | 2 +- .../caniuse-lite/data/features/rem.js | 2 +- .../data/features/requestanimationframe.js | 2 +- .../data/features/requestidlecallback.js | 2 +- .../data/features/resizeobserver.js | 2 +- .../data/features/resource-timing.js | 2 +- .../data/features/rest-parameters.js | 2 +- .../data/features/rtcpeerconnection.js | 2 +- .../caniuse-lite/data/features/ruby.js | 2 +- .../caniuse-lite/data/features/run-in.js | 2 +- .../features/same-site-cookie-attribute.js | 2 +- .../data/features/screen-orientation.js | 2 +- .../data/features/script-async.js | 2 +- .../data/features/script-defer.js | 2 +- .../data/features/scrollintoview.js | 2 +- .../data/features/scrollintoviewifneeded.js | 2 +- .../caniuse-lite/data/features/sdch.js | 2 +- .../data/features/selection-api.js | 2 +- .../data/features/server-timing.js | 2 +- .../data/features/serviceworkers.js | 2 +- .../data/features/setimmediate.js | 2 +- .../caniuse-lite/data/features/shadowdom.js | 2 +- .../caniuse-lite/data/features/shadowdomv1.js | 2 +- .../data/features/sharedarraybuffer.js | 2 +- .../data/features/sharedworkers.js | 2 +- .../caniuse-lite/data/features/sni.js | 2 +- .../caniuse-lite/data/features/spdy.js | 2 +- .../data/features/speech-recognition.js | 2 +- .../data/features/speech-synthesis.js | 2 +- .../data/features/spellcheck-attribute.js | 2 +- .../caniuse-lite/data/features/sql-storage.js | 2 +- .../caniuse-lite/data/features/srcset.js | 2 +- .../caniuse-lite/data/features/stream.js | 2 +- .../caniuse-lite/data/features/streams.js | 2 +- .../data/features/stricttransportsecurity.js | 2 +- .../data/features/style-scoped.js | 2 +- .../data/features/subresource-bundling.js | 2 +- .../data/features/subresource-integrity.js | 2 +- .../caniuse-lite/data/features/svg-css.js | 2 +- .../caniuse-lite/data/features/svg-filters.js | 2 +- .../caniuse-lite/data/features/svg-fonts.js | 2 +- .../data/features/svg-fragment.js | 2 +- .../caniuse-lite/data/features/svg-html.js | 2 +- .../caniuse-lite/data/features/svg-html5.js | 2 +- .../caniuse-lite/data/features/svg-img.js | 2 +- .../caniuse-lite/data/features/svg-smil.js | 2 +- .../caniuse-lite/data/features/svg.js | 2 +- .../caniuse-lite/data/features/sxg.js | 2 +- .../data/features/tabindex-attr.js | 2 +- .../data/features/template-literals.js | 2 +- .../caniuse-lite/data/features/template.js | 2 +- .../caniuse-lite/data/features/temporal.js | 2 +- .../caniuse-lite/data/features/testfeat.js | 2 +- .../data/features/text-decoration.js | 2 +- .../data/features/text-emphasis.js | 2 +- .../data/features/text-overflow.js | 2 +- .../data/features/text-size-adjust.js | 2 +- .../caniuse-lite/data/features/text-stroke.js | 2 +- .../caniuse-lite/data/features/textcontent.js | 2 +- .../caniuse-lite/data/features/textencoder.js | 2 +- .../caniuse-lite/data/features/tls1-1.js | 2 +- .../caniuse-lite/data/features/tls1-2.js | 2 +- .../caniuse-lite/data/features/tls1-3.js | 2 +- .../caniuse-lite/data/features/touch.js | 2 +- .../data/features/transforms2d.js | 2 +- .../data/features/transforms3d.js | 2 +- .../data/features/trusted-types.js | 2 +- .../caniuse-lite/data/features/ttf.js | 2 +- .../caniuse-lite/data/features/typedarrays.js | 2 +- .../caniuse-lite/data/features/u2f.js | 2 +- .../data/features/unhandledrejection.js | 2 +- .../data/features/upgradeinsecurerequests.js | 2 +- .../features/url-scroll-to-text-fragment.js | 2 +- .../caniuse-lite/data/features/url.js | 2 +- .../data/features/urlsearchparams.js | 2 +- .../caniuse-lite/data/features/use-strict.js | 2 +- .../data/features/user-select-none.js | 2 +- .../caniuse-lite/data/features/user-timing.js | 2 +- .../data/features/variable-fonts.js | 2 +- .../data/features/vector-effect.js | 2 +- .../caniuse-lite/data/features/vibration.js | 2 +- .../caniuse-lite/data/features/video.js | 2 +- .../caniuse-lite/data/features/videotracks.js | 2 +- .../data/features/view-transitions.js | 2 +- .../data/features/viewport-unit-variants.js | 2 +- .../data/features/viewport-units.js | 2 +- .../caniuse-lite/data/features/wai-aria.js | 2 +- .../caniuse-lite/data/features/wake-lock.js | 2 +- .../caniuse-lite/data/features/wasm.js | 2 +- .../caniuse-lite/data/features/wav.js | 2 +- .../caniuse-lite/data/features/wbr-element.js | 2 +- .../data/features/web-animation.js | 2 +- .../data/features/web-app-manifest.js | 2 +- .../data/features/web-bluetooth.js | 2 +- .../caniuse-lite/data/features/web-serial.js | 2 +- .../caniuse-lite/data/features/web-share.js | 2 +- .../caniuse-lite/data/features/webauthn.js | 2 +- .../caniuse-lite/data/features/webcodecs.js | 2 +- .../caniuse-lite/data/features/webgl.js | 2 +- .../caniuse-lite/data/features/webgl2.js | 2 +- .../caniuse-lite/data/features/webgpu.js | 2 +- .../caniuse-lite/data/features/webhid.js | 2 +- .../data/features/webkit-user-drag.js | 2 +- .../caniuse-lite/data/features/webm.js | 2 +- .../caniuse-lite/data/features/webnfc.js | 2 +- .../caniuse-lite/data/features/webp.js | 2 +- .../caniuse-lite/data/features/websockets.js | 2 +- .../data/features/webtransport.js | 2 +- .../caniuse-lite/data/features/webusb.js | 2 +- .../caniuse-lite/data/features/webvr.js | 2 +- .../caniuse-lite/data/features/webvtt.js | 2 +- .../caniuse-lite/data/features/webworkers.js | 2 +- .../caniuse-lite/data/features/webxr.js | 2 +- .../caniuse-lite/data/features/will-change.js | 2 +- .../caniuse-lite/data/features/woff.js | 2 +- .../caniuse-lite/data/features/woff2.js | 2 +- .../caniuse-lite/data/features/word-break.js | 2 +- .../caniuse-lite/data/features/wordwrap.js | 2 +- .../data/features/x-doc-messaging.js | 2 +- .../data/features/x-frame-options.js | 2 +- .../caniuse-lite/data/features/xhr2.js | 2 +- .../caniuse-lite/data/features/xhtml.js | 2 +- .../caniuse-lite/data/features/xhtmlsmil.js | 2 +- .../data/features/xml-serializer.js | 2 +- .../caniuse-lite/data/features/zstd.js | 2 +- .../node_modules/caniuse-lite/package.json | 2 +- .../full-chromium-versions.js | 36 ++- .../full-chromium-versions.json | 2 +- .../electron-to-chromium/full-versions.js | 22 +- .../electron-to-chromium/full-versions.json | 2 +- .../electron-to-chromium/package.json | 2 +- .../node-releases/data/processed/envs.json | 2 +- .../release-schedule/release-schedule.json | 2 +- .../node_modules/node-releases/package.json | 2 +- tools/node_modules/eslint/package.json | 10 +- 608 files changed, 1057 insertions(+), 943 deletions(-) diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js index 6abfcacae137b1..eb59f4c23a9b56 100644 --- a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js +++ b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -74,6 +74,9 @@ const arrayOfStringsOrObjectPatterns = { minItems: 1, uniqueItems: true }, + importNamePattern: { + type: "string" + }, message: { type: "string", minLength: 1 @@ -115,8 +118,12 @@ module.exports = { patternAndImportNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}", patternAndEverything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern.", + + patternAndEverythingWithRegexImportName: "* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used.", // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period patternAndEverythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternAndEverythingWithRegexImportNameAndCustomMessage: "* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used. {{customMessage}}", everything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.", // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period @@ -175,10 +182,11 @@ module.exports = { } // relative paths are supported for this rule - const restrictedPatternGroups = restrictedPatterns.map(({ group, message, caseSensitive, importNames }) => ({ + const restrictedPatternGroups = restrictedPatterns.map(({ group, message, caseSensitive, importNames, importNamePattern }) => ({ matcher: ignore({ allowRelativePaths: true, ignorecase: !caseSensitive }).add(group), customMessage: message, - importNames + importNames, + importNamePattern })); // if no imports are restricted we don't need to check @@ -262,12 +270,13 @@ module.exports = { const customMessage = group.customMessage; const restrictedImportNames = group.importNames; + const restrictedImportNamePattern = group.importNamePattern ? new RegExp(group.importNamePattern, "u") : null; /* * If we are not restricting to any specific import names and just the pattern itself, * report the error and move on */ - if (!restrictedImportNames) { + if (!restrictedImportNames && !restrictedImportNamePattern) { context.report({ node, messageId: customMessage ? "patternWithCustomMessage" : "patterns", @@ -279,40 +288,54 @@ module.exports = { return; } - if (importNames.has("*")) { - const specifierData = importNames.get("*")[0]; - - context.report({ - node, - messageId: customMessage ? "patternAndEverythingWithCustomMessage" : "patternAndEverything", - loc: specifierData.loc, - data: { - importSource, - importNames: restrictedImportNames, - customMessage + importNames.forEach((specifiers, importName) => { + if (importName === "*") { + const [specifier] = specifiers; + + if (restrictedImportNames) { + context.report({ + node, + messageId: customMessage ? "patternAndEverythingWithCustomMessage" : "patternAndEverything", + loc: specifier.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } else { + context.report({ + node, + messageId: customMessage ? "patternAndEverythingWithRegexImportNameAndCustomMessage" : "patternAndEverythingWithRegexImportName", + loc: specifier.loc, + data: { + importSource, + importNames: restrictedImportNamePattern, + customMessage + } + }); } - }); - } - restrictedImportNames.forEach(importName => { - if (!importNames.has(importName)) { return; } - const specifiers = importNames.get(importName); - - specifiers.forEach(specifier => { - context.report({ - node, - messageId: customMessage ? "patternAndImportNameWithCustomMessage" : "patternAndImportName", - loc: specifier.loc, - data: { - importSource, - customMessage, - importName - } + if ( + (restrictedImportNames && restrictedImportNames.includes(importName)) || + (restrictedImportNamePattern && restrictedImportNamePattern.test(importName)) + ) { + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "patternAndImportNameWithCustomMessage" : "patternAndImportName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); }); - }); + } }); } diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js index 74495b0d852b72..2f900ebacdc6cd 100644 --- a/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js @@ -7,8 +7,8 @@ exports.codeFrameColumns = codeFrameColumns; exports.default = _default; var _highlight = require("@babel/highlight"); var _chalk = _interopRequireWildcard(require("chalk"), true); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } let chalkWithForcedColor = undefined; function getChalk(forceColor) { if (forceColor) { diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json index c3afdc1557675c..46a9ba9db12f07 100644 --- a/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json @@ -1,6 +1,6 @@ { "name": "@babel/code-frame", - "version": "7.22.13", + "version": "7.23.5", "description": "Generate errors that contain a code frame that point to source locations.", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-code-frame", @@ -16,11 +16,11 @@ }, "main": "./lib/index.js", "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "devDependencies": { - "import-meta-resolve": "^3.0.0", + "import-meta-resolve": "^4.0.0", "strip-ansi": "^4.0.0" }, "engines": { diff --git a/tools/node_modules/eslint/node_modules/@babel/compat-data/package.json b/tools/node_modules/eslint/node_modules/@babel/compat-data/package.json index 00b888020f64fd..a3d3f20c927047 100644 --- a/tools/node_modules/eslint/node_modules/@babel/compat-data/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/compat-data/package.json @@ -1,6 +1,6 @@ { "name": "@babel/compat-data", - "version": "7.23.3", + "version": "7.23.5", "author": "The Babel Team (https://babel.dev/team)", "license": "MIT", "description": "", diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js index d6cfa71a6a3778..25435ae424af77 100644 --- a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js +++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js @@ -30,6 +30,13 @@ function _url() { return data; } var _importMetaResolve = require("../../vendor/import-meta-resolve.js"); +function _fs() { + const data = require("fs"); + _fs = function () { + return data; + }; + return data; +} const debug = _debug()("babel:config:loading:files:plugins"); const EXACT_RE = /^module:/; const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/; @@ -163,7 +170,13 @@ function resolveStandardizedName(type, name, dirname, resolveESM) { return resolveStandardizedNameForRequire(type, name, dirname); } try { - return resolveStandardizedNameForImport(type, name, dirname); + const resolved = resolveStandardizedNameForImport(type, name, dirname); + if (!(0, _fs().existsSync)(resolved)) { + throw Object.assign(new Error(`Could not resolve "${name}" in file ${dirname}.`), { + type: "MODULE_NOT_FOUND" + }); + } + return resolved; } catch (e) { try { return resolveStandardizedNameForRequire(type, name, dirname); diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/index.js index 3e1143712a81cd..55d2a9586d82af 100644 --- a/tools/node_modules/eslint/node_modules/@babel/core/lib/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/index.js @@ -224,7 +224,7 @@ var _transformAst = require("./transform-ast.js"); var _parse = require("./parse.js"); var thisFile = require("./index.js"); ; -const version = exports.version = "7.23.3"; +const version = exports.version = "7.23.5"; const DEFAULT_EXTENSIONS = exports.DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]); ; { diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/vendor/import-meta-resolve.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/vendor/import-meta-resolve.js index 18deee53e257f6..eae3148cef362e 100644 --- a/tools/node_modules/eslint/node_modules/@babel/core/lib/vendor/import-meta-resolve.js +++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/vendor/import-meta-resolve.js @@ -63,7 +63,6 @@ function _util() { } function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -const isWindows = _process().platform === 'win32'; const own$1 = {}.hasOwnProperty; const classRegExp = /^([A-Z][a-z\d]*)+$/; const kTypes = new Set(['string', 'function', 'number', 'object', 'Function', 'Object', 'boolean', 'bigint', 'symbol']); @@ -141,8 +140,8 @@ codes.ERR_INVALID_PACKAGE_TARGET = createError('ERR_INVALID_PACKAGE_TARGET', (pk } return `Invalid "${isImport ? 'imports' : 'exports'}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ''}${relError ? '; targets must start with "./"' : ''}`; }, Error); -codes.ERR_MODULE_NOT_FOUND = createError('ERR_MODULE_NOT_FOUND', (path, base, type = 'package') => { - return `Cannot find ${type} '${path}' imported from ${base}`; +codes.ERR_MODULE_NOT_FOUND = createError('ERR_MODULE_NOT_FOUND', (path, base, exactUrl = false) => { + return `Cannot find ${exactUrl ? 'module' : 'package'} '${path}' imported from ${base}`; }, Error); codes.ERR_NETWORK_IMPORT_DISALLOWED = createError('ERR_NETWORK_IMPORT_DISALLOWED', "import of '%s' by %s is not supported: %s", Error); codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError('ERR_PACKAGE_IMPORT_NOT_DEFINED', (specifier, packagePath, base) => { @@ -164,14 +163,6 @@ codes.ERR_INVALID_ARG_VALUE = createError('ERR_INVALID_ARG_VALUE', (name, value, const type = name.includes('.') ? 'property' : 'argument'; return `The ${type} '${name}' ${reason}. Received ${inspected}`; }, TypeError); -codes.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError('ERR_UNSUPPORTED_ESM_URL_SCHEME', (url, supported) => { - let message = `Only URLs with a scheme in: ${formatList(supported)} are supported by the default ESM loader`; - if (isWindows && url.protocol.length === 2) { - message += '. On Windows, absolute paths must be valid file:// URLs'; - } - message += `. Received protocol '${url.protocol}'`; - return message; -}, Error); function createError(sym, value, def) { messages.set(sym, value); return makeNodeErrorWithCode(def, sym); @@ -272,89 +263,93 @@ function determineSpecificType(value) { } return `type ${typeof value} (${inspected})`; } +const hasOwnProperty$1 = {}.hasOwnProperty; +const { + ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 +} = codes; +const cache = new Map(); const reader = { read }; var packageJsonReader = reader; -function read(jsonPath) { - try { - const string = _fs().default.readFileSync(_path().toNamespacedPath(_path().join(_path().dirname(jsonPath), 'package.json')), 'utf8'); - return { - string - }; - } catch (error) { - const exception = error; - if (exception.code === 'ENOENT') { - return { - string: undefined - }; - } - throw exception; - } -} -const { - ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 -} = codes; -const packageJsonCache = new Map(); -function getPackageConfig(path, specifier, base) { - const existing = packageJsonCache.get(path); - if (existing !== undefined) { +function read(jsonPath, { + base, + specifier +}) { + const existing = cache.get(jsonPath); + if (existing) { return existing; } - const source = packageJsonReader.read(path).string; - if (source === undefined) { - const packageConfig = { - pjsonPath: path, - exists: false, - main: undefined, - name: undefined, - type: 'none', - exports: undefined, - imports: undefined - }; - packageJsonCache.set(path, packageConfig); - return packageConfig; - } - let packageJson; + let string; try { - packageJson = JSON.parse(source); + string = _fs().default.readFileSync(_path().toNamespacedPath(jsonPath), 'utf8'); } catch (error) { const exception = error; - throw new ERR_INVALID_PACKAGE_CONFIG$1(path, (base ? `"${specifier}" from ` : '') + (0, _url().fileURLToPath)(base || specifier), exception.message); + if (exception.code !== 'ENOENT') { + throw exception; + } } - const { - exports, - imports, - main, - name, - type - } = packageJson; - const packageConfig = { - pjsonPath: path, - exists: true, - main: typeof main === 'string' ? main : undefined, - name: typeof name === 'string' ? name : undefined, - type: type === 'module' || type === 'commonjs' ? type : 'none', - exports, - imports: imports && typeof imports === 'object' ? imports : undefined + const result = { + exists: false, + pjsonPath: jsonPath, + main: undefined, + name: undefined, + type: 'none', + exports: undefined, + imports: undefined }; - packageJsonCache.set(path, packageConfig); - return packageConfig; + if (string !== undefined) { + let parsed; + try { + parsed = JSON.parse(string); + } catch (error_) { + const cause = error_; + const error = new ERR_INVALID_PACKAGE_CONFIG$1(jsonPath, (base ? `"${specifier}" from ` : '') + (0, _url().fileURLToPath)(base || specifier), cause.message); + error.cause = cause; + throw error; + } + result.exists = true; + if (hasOwnProperty$1.call(parsed, 'name') && typeof parsed.name === 'string') { + result.name = parsed.name; + } + if (hasOwnProperty$1.call(parsed, 'main') && typeof parsed.main === 'string') { + result.main = parsed.main; + } + if (hasOwnProperty$1.call(parsed, 'exports')) { + result.exports = parsed.exports; + } + if (hasOwnProperty$1.call(parsed, 'imports')) { + result.imports = parsed.imports; + } + if (hasOwnProperty$1.call(parsed, 'type') && (parsed.type === 'commonjs' || parsed.type === 'module')) { + result.type = parsed.type; + } + } + cache.set(jsonPath, result); + return result; } function getPackageScopeConfig(resolved) { - let packageJsonUrl = new (_url().URL)('package.json', resolved); + let packageJSONUrl = new (_url().URL)('package.json', resolved); while (true) { - const packageJsonPath = packageJsonUrl.pathname; - if (packageJsonPath.endsWith('node_modules/package.json')) break; - const packageConfig = getPackageConfig((0, _url().fileURLToPath)(packageJsonUrl), resolved); - if (packageConfig.exists) return packageConfig; - const lastPackageJsonUrl = packageJsonUrl; - packageJsonUrl = new (_url().URL)('../package.json', packageJsonUrl); - if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname) break; - } - const packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl); - const packageConfig = { - pjsonPath: packageJsonPath, + const packageJSONPath = packageJSONUrl.pathname; + if (packageJSONPath.endsWith('node_modules/package.json')) { + break; + } + const packageConfig = packageJsonReader.read((0, _url().fileURLToPath)(packageJSONUrl), { + specifier: resolved + }); + if (packageConfig.exists) { + return packageConfig; + } + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new (_url().URL)('../package.json', packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break; + } + } + const packageJSONPath = (0, _url().fileURLToPath)(packageJSONUrl); + return { + pjsonPath: packageJSONPath, exists: false, main: undefined, name: undefined, @@ -362,8 +357,6 @@ function getPackageScopeConfig(resolved) { exports: undefined, imports: undefined }; - packageJsonCache.set(packageJsonPath, packageConfig); - return packageConfig; } function getPackageType(url) { const packageConfig = getPackageScopeConfig(url); @@ -418,7 +411,18 @@ function extname(url) { function getFileProtocolModuleFormat(url, _context, ignoreErrors) { const ext = extname(url); if (ext === '.js') { - return getPackageType(url) === 'module' ? 'module' : 'commonjs'; + const packageType = getPackageType(url); + if (packageType !== 'none') { + return packageType; + } + return 'commonjs'; + } + if (ext === '') { + const packageType = getPackageType(url); + if (packageType === 'none' || packageType === 'commonjs') { + return 'commonjs'; + } + return 'module'; } const format = extensionFormatMap[ext]; if (format) return format; @@ -430,10 +434,11 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) { } function getHttpProtocolModuleFormat() {} function defaultGetFormatWithoutErrors(url, context) { - if (!hasOwnProperty.call(protocolHandlers, url.protocol)) { + const protocol = url.protocol; + if (!hasOwnProperty.call(protocolHandlers, protocol)) { return null; } - return protocolHandlers[url.protocol](url, context, true) || null; + return protocolHandlers[protocol](url, context, true) || null; } const { ERR_INVALID_ARG_VALUE @@ -456,7 +461,6 @@ function getConditionsSet(conditions) { return getDefaultConditionsSet(); } const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; -const experimentalNetworkImports = false; const { ERR_NETWORK_IMPORT_DISALLOWED, ERR_INVALID_MODULE_SPECIFIER, @@ -465,8 +469,7 @@ const { ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, - ERR_UNSUPPORTED_DIR_IMPORT, - ERR_UNSUPPORTED_ESM_URL_SCHEME + ERR_UNSUPPORTED_DIR_IMPORT } = codes; const own = {}.hasOwnProperty; const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; @@ -477,19 +480,29 @@ const encodedSepRegEx = /%2f|%5c/i; const emittedPackageWarnings = new Set(); const doubleSlashRegEx = /[/\\]{2}/; function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) { + if (_process().noDeprecation) { + return; + } const pjsonPath = (0, _url().fileURLToPath)(packageJsonUrl); const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; _process().emitWarning(`Use of deprecated ${double ? 'double slash' : 'leading or trailing slash matching'} resolving "${target}" for module ` + `request "${request}" ${request === match ? '' : `matched to "${match}" `}in the "${internal ? 'imports' : 'exports'}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, _url().fileURLToPath)(base)}` : ''}.`, 'DeprecationWarning', 'DEP0166'); } function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) { + if (_process().noDeprecation) { + return; + } const format = defaultGetFormatWithoutErrors(url, { parentURL: base.href }); if (format !== 'module') return; - const path = (0, _url().fileURLToPath)(url.href); + const urlPath = (0, _url().fileURLToPath)(url.href); const pkgPath = (0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl)); const basePath = (0, _url().fileURLToPath)(base); - if (main) _process().emitWarning(`Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, ` + `excluding the full filename and extension to the resolved file at "${path.slice(pkgPath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is` + 'deprecated for ES modules.', 'DeprecationWarning', 'DEP0151');else _process().emitWarning(`No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path.slice(pkgPath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, 'DeprecationWarning', 'DEP0151'); + if (!main) { + _process().emitWarning(`No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${urlPath.slice(pkgPath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, 'DeprecationWarning', 'DEP0151'); + } else if (_path().resolve(pkgPath, main) !== urlPath) { + _process().emitWarning(`Package ${pkgPath} has a "main" field set to "${main}", ` + `excluding the full filename and extension to the resolved file at "${urlPath.slice(pkgPath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is ` + 'deprecated for ES modules.', 'DeprecationWarning', 'DEP0151'); + } } function tryStatSync(path) { try { @@ -536,8 +549,22 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) { throw new ERR_MODULE_NOT_FOUND((0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl)), (0, _url().fileURLToPath)(base)); } function finalizeResolution(resolved, base, preserveSymlinks) { - if (encodedSepRegEx.exec(resolved.pathname) !== null) throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, 'must not include encoded "/" or "\\" characters', (0, _url().fileURLToPath)(base)); - const filePath = (0, _url().fileURLToPath)(resolved); + if (encodedSepRegEx.exec(resolved.pathname) !== null) { + throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, 'must not include encoded "/" or "\\" characters', (0, _url().fileURLToPath)(base)); + } + let filePath; + try { + filePath = (0, _url().fileURLToPath)(resolved); + } catch (error) { + const cause = error; + Object.defineProperty(cause, 'input', { + value: String(resolved) + }); + Object.defineProperty(cause, 'module', { + value: String(base) + }); + throw cause; + } const stats = tryStatSync(filePath.endsWith('/') ? filePath.slice(-1) : filePath); if (stats.isDirectory()) { const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, _url().fileURLToPath)(base)); @@ -545,7 +572,9 @@ function finalizeResolution(resolved, base, preserveSymlinks) { throw error; } if (!stats.isFile()) { - throw new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && (0, _url().fileURLToPath)(base), 'module'); + const error = new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && (0, _url().fileURLToPath)(base), true); + error.url = String(resolved); + throw error; } if (!preserveSymlinks) { const real = (0, _fs().realpathSync)(filePath); @@ -703,6 +732,9 @@ function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { return isConditionalSugar; } function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { + if (_process().noDeprecation) { + return; + } const pjsonPath = (0, _url().fileURLToPath)(pjsonUrl); if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return; emittedPackageWarnings.add(pjsonPath + '|' + match); @@ -861,7 +893,10 @@ function packageResolve(specifier, base, conditions) { packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl); continue; } - const packageConfig = getPackageConfig(packageJsonPath, specifier, base); + const packageConfig = packageJsonReader.read(packageJsonPath, { + base, + specifier + }); if (packageConfig.exports !== undefined && packageConfig.exports !== null) { return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions); } @@ -870,7 +905,7 @@ function packageResolve(specifier, base, conditions) { } return new (_url().URL)(packageSubpath, packageJsonUrl); } while (packageJsonPath.length !== lastPath.length); - throw new ERR_MODULE_NOT_FOUND(packageName, (0, _url().fileURLToPath)(base)); + throw new ERR_MODULE_NOT_FOUND(packageName, (0, _url().fileURLToPath)(base), false); } function isRelativeSpecifier(specifier) { if (specifier[0] === '.') { @@ -940,18 +975,6 @@ function throwIfInvalidParentURL(parentURL) { throw new codes.ERR_INVALID_ARG_TYPE('parentURL', ['string', 'URL'], parentURL); } } -function throwIfUnsupportedURLProtocol(url) { - const protocol = url.protocol; - if (protocol !== 'file:' && protocol !== 'data:' && protocol !== 'node:') { - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url); - } -} -function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) { - const protocol = parsed == null ? void 0 : parsed.protocol; - if (protocol && protocol !== 'file:' && protocol !== 'data:' && (!experimentalNetworkImports || protocol !== 'https:' && protocol !== 'http:')) { - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, ['file', 'data'].concat(experimentalNetworkImports ? ['https', 'http'] : [])); - } -} function defaultResolve(specifier, context = {}) { const { parentURL @@ -968,7 +991,7 @@ function defaultResolve(specifier, context = {}) { try { parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new (_url().URL)(specifier, parsedParentURL) : new (_url().URL)(specifier); const protocol = parsed.protocol; - if (protocol === 'data:' || experimentalNetworkImports && (protocol === 'https:' || protocol === 'http:')) { + if (protocol === 'data:') { return { url: parsed.href, format: null @@ -980,10 +1003,8 @@ function defaultResolve(specifier, context = {}) { if (parsed && parsed.protocol === 'node:') return { url: specifier }; - throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports); const conditions = getConditionsSet(context.conditions); const url = moduleResolve(specifier, new (_url().URL)(parentURL), conditions, false); - throwIfUnsupportedURLProtocol(url); return { url: url.href, format: defaultGetFormatWithoutErrors(url, { @@ -1001,7 +1022,7 @@ function resolve(specifier, parent) { }).url; } catch (error) { const exception = error; - if (exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' && typeof exception.url === 'string') { + if ((exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' || exception.code === 'ERR_MODULE_NOT_FOUND') && typeof exception.url === 'string') { return exception.url; } throw error; diff --git a/tools/node_modules/eslint/node_modules/@babel/core/package.json b/tools/node_modules/eslint/node_modules/@babel/core/package.json index ae6b8136ad6f9b..aa2e37e28e29f1 100644 --- a/tools/node_modules/eslint/node_modules/@babel/core/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.23.3", + "version": "7.23.5", "description": "Babel compiler core.", "main": "./lib/index.js", "author": "The Babel Team (https://babel.dev/team)", @@ -47,15 +47,15 @@ }, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.2", - "@babel/parser": "^7.23.3", + "@babel/helpers": "^7.23.5", + "@babel/parser": "^7.23.5", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.3", - "@babel/types": "^7.23.3", + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -67,7 +67,7 @@ "@babel/plugin-syntax-flow": "^7.23.3", "@babel/plugin-transform-flow-strip-types": "^7.23.3", "@babel/plugin-transform-modules-commonjs": "^7.23.3", - "@babel/preset-env": "^7.23.3", + "@babel/preset-env": "^7.23.5", "@babel/preset-typescript": "^7.23.3", "@jridgewell/trace-mapping": "^0.3.17", "@types/convert-source-map": "^2.0.0", diff --git a/tools/node_modules/eslint/node_modules/@babel/generator/lib/printer.js b/tools/node_modules/eslint/node_modules/@babel/generator/lib/printer.js index 1df6d2fc6d21fd..848b3d24beea11 100644 --- a/tools/node_modules/eslint/node_modules/@babel/generator/lib/printer.js +++ b/tools/node_modules/eslint/node_modules/@babel/generator/lib/printer.js @@ -17,7 +17,6 @@ const { } = _t; const SCIENTIFIC_NOTATION = /e/i; const ZERO_DECIMAL_INTEGER = /\.0+$/; -const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/; const HAS_NEWLINE = /[\n\r\u2028\u2029]/; const HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\n\r\u2028\u2029]|\*\//; const { @@ -258,9 +257,7 @@ class Printer { } const chaPost = str.charCodeAt(i + 1); if (chaPost === 42) { - if (PURE_ANNOTATION_RE.test(str.slice(i + 2, len - 2))) { - return; - } + return; } else if (chaPost !== 47) { this._parenPushNewlineState = null; return; @@ -309,7 +306,7 @@ class Printer { } } print(node, parent, noLineTerminatorAfter, trailingCommentsLineOffset, forceParens) { - var _node$extra; + var _node$extra, _node$leadingComments; if (!node) return; this._endsWithInnerRaw = false; const nodeType = node.type; @@ -326,7 +323,24 @@ class Printer { const oldInAux = this._insideAux; this._insideAux = node.loc == undefined; this._maybeAddAuxComment(this._insideAux && !oldInAux); - const shouldPrintParens = forceParens || format.retainFunctionParens && nodeType === "FunctionExpression" && ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized) || needsParens(node, parent, this._printStack); + const parenthesized = (_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized; + let shouldPrintParens = forceParens || parenthesized && format.retainFunctionParens && nodeType === "FunctionExpression" || needsParens(node, parent, this._printStack); + if (!shouldPrintParens && parenthesized && (_node$leadingComments = node.leadingComments) != null && _node$leadingComments.length && node.leadingComments[0].type === "CommentBlock") { + const parentType = parent == null ? void 0 : parent.type; + switch (parentType) { + case "ExpressionStatement": + case "VariableDeclarator": + case "AssignmentExpression": + case "ReturnStatement": + break; + case "CallExpression": + case "OptionalCallExpression": + case "NewExpression": + if (parent.callee !== node) break; + default: + shouldPrintParens = true; + } + } if (shouldPrintParens) { this.tokenChar(40); this._endsWithInnerRaw = false; @@ -409,6 +423,10 @@ class Printer { opts.iterator == null || opts.iterator(node, i); if (i < len - 1) separator == null || separator(); if (opts.statement) { + var _node$trailingComment; + if (!((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.length)) { + this._lastCommentLine = 0; + } if (i + 1 === len) { this.newline(1); } else { @@ -533,6 +551,13 @@ class Printer { } let val; if (isBlockComment) { + const { + _parenPushNewlineState + } = this; + if ((_parenPushNewlineState == null ? void 0 : _parenPushNewlineState.printed) === false && HAS_NEWLINE.test(comment.value)) { + this.tokenChar(40); + _parenPushNewlineState.printed = true; + } val = `/*${comment.value}*/`; if (this.format.indent.adjustMultilineComment) { var _comment$loc; diff --git a/tools/node_modules/eslint/node_modules/@babel/generator/package.json b/tools/node_modules/eslint/node_modules/@babel/generator/package.json index 74dd416164c098..04061c6322f89b 100644 --- a/tools/node_modules/eslint/node_modules/@babel/generator/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.23.3", + "version": "7.23.5", "description": "Turns an AST into code.", "author": "The Babel Team (https://babel.dev/team)", "license": "MIT", @@ -19,14 +19,14 @@ "lib" ], "dependencies": { - "@babel/types": "^7.23.3", + "@babel/types": "^7.23.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "devDependencies": { - "@babel/helper-fixtures": "^7.22.19", - "@babel/parser": "^7.23.3", + "@babel/helper-fixtures": "^7.23.4", + "@babel/parser": "^7.23.5", "@jridgewell/sourcemap-codec": "^1.4.15", "@types/jsesc": "^2.5.0", "charcodes": "^0.2.0" diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-string-parser/package.json b/tools/node_modules/eslint/node_modules/@babel/helper-string-parser/package.json index a977dea9b17d39..f05afe5b87664e 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helper-string-parser/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/helper-string-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-string-parser", - "version": "7.22.5", + "version": "7.23.4", "description": "A utility package to parse strings", "repository": { "type": "git", diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-option/package.json b/tools/node_modules/eslint/node_modules/@babel/helper-validator-option/package.json index c6ed03172f2ce8..8e58a9c2222287 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-option/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/helper-validator-option/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-validator-option", - "version": "7.22.15", + "version": "7.23.5", "description": "Validate plugin/preset options", "repository": { "type": "git", diff --git a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers-generated.js b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers-generated.js index d06e9b31291a06..9e97850870319d 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers-generated.js +++ b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers-generated.js @@ -13,14 +13,14 @@ function helper(minVersion, source) { }) }); } -var _default = Object.freeze({ +var _default = exports.default = Object.freeze({ AsyncGenerator: helper("7.0.0-beta.0", 'import OverloadYield from"OverloadYield";export default function AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then((function(t){if(u){var i="return"===r?"return":"next";if(!o.k||t.done)return resume(i,t);t=e[i](t).value}settle(n.done?"return":"normal",t)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":r.resolve({value:n,done:!0});break;case"throw":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function(e,n){return new Promise((function(o,u){var i={key:e,arg:n,resolve:o,reject:u,next:null};t?t=t.next=i:(r=t=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};'), OverloadYield: helper("7.18.14", "export default function _OverloadYield(t,e){this.v=t,this.k=e}"), applyDecs: helper("7.17.8", 'function old_createMetadataMethodsForProperty(e,t,a,r){return{getMetadata:function(o){old_assertNotFinished(r,"getMetadata"),old_assertMetadataKey(o);var i=e[o];if(void 0!==i)if(1===t){var n=i.public;if(void 0!==n)return n[a]}else if(2===t){var l=i.private;if(void 0!==l)return l.get(a)}else if(Object.hasOwnProperty.call(i,"constructor"))return i.constructor},setMetadata:function(o,i){old_assertNotFinished(r,"setMetadata"),old_assertMetadataKey(o);var n=e[o];if(void 0===n&&(n=e[o]={}),1===t){var l=n.public;void 0===l&&(l=n.public={}),l[a]=i}else if(2===t){var s=n.priv;void 0===s&&(s=n.private=new Map),s.set(a,i)}else n.constructor=i}}}function old_convertMetadataMapToFinal(e,t){var a=e[Symbol.metadata||Symbol.for("Symbol.metadata")],r=Object.getOwnPropertySymbols(t);if(0!==r.length){for(var o=0;o=0;y--){var b;if(void 0!==(f=old_memberDec(h[y],r,c,l,s,o,i,n,u)))old_assertValidReturnValue(o,f),0===o?b=f:1===o?(b=old_getInit(f),p=f.get||u.get,v=f.set||u.set,u={get:p,set:v}):u=f,void 0!==b&&(void 0===d?d=b:"function"==typeof d?d=[d,b]:d.push(b))}if(0===o||1===o){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var g=d;d=function(e,t){for(var a=t,r=0;r3,b=v>=5;if(b?(u=t,f=r,0!==(v-=5)&&(p=n=n||[])):(u=t.prototype,f=a,0!==v&&(p=i=i||[])),0!==v&&!y){var g=b?s:l,m=g.get(h)||0;if(!0===m||3===m&&4!==v||4===m&&3!==v)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);!m&&v>2?g.set(h,v):g.set(h,!0)}old_applyMemberDec(e,u,d,h,v,b,y,f,p)}}old_pushInitializers(e,i),old_pushInitializers(e,n)}function old_pushInitializers(e,t){t&&e.push((function(e){for(var a=0;a0){for(var o=[],i=t,n=t.name,l=r.length-1;l>=0;l--){var s={v:!1};try{var c=Object.assign({kind:"class",name:n,addInitializer:old_createAddInitializerMethod(o,s)},old_createMetadataMethodsForProperty(a,0,n,s)),d=r[l](i,c)}finally{s.v=!0}void 0!==d&&(old_assertValidReturnValue(10,d),i=d)}e.push(i,(function(){for(var e=0;e=0;v--){var g;if(void 0!==(f=memberDec(h[v],a,c,o,n,i,s,u)))assertValidReturnValue(n,f),0===n?g=f:1===n?(g=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f,void 0!==g&&(void 0===l?l=g:"function"==typeof l?l=[l,g]:l.push(g))}if(0===n||1===n){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var y=l;l=function(e,t){for(var r=t,a=0;a3,h=f>=5;if(h?(l=t,0!=(f-=5)&&(u=n=n||[])):(l=t.prototype,0!==f&&(u=a=a||[])),0!==f&&!d){var v=h?s:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(e,l,c,p,f,h,d,u)}}pushInitializers(e,a),pushInitializers(e,n)}(a,e,t),function(e,t,r){if(r.length>0){for(var a=[],n=t,i=t.name,s=r.length-1;s>=0;s--){var o={v:!1};try{var c=r[s](n,{kind:"class",name:i,addInitializer:createAddInitializerMethod(a,o)})}finally{o.v=!0}void 0!==c&&(assertValidReturnValue(10,c),n=c)}e.push(n,(function(){for(var e=0;e=0;v--){var g;if(void 0!==(f=memberDec(h[v],n,c,o,a,i,s,u)))assertValidReturnValue(a,f),0===a?g=f:1===a?(g=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f,void 0!==g&&(void 0===l?l=g:"function"==typeof l?l=[l,g]:l.push(g))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var y=l;l=function(e,t){for(var r=t,n=0;n3,h=f>=5;if(h?(l=e,0!==(f-=5)&&(u=n=n||[])):(l=e.prototype,0!==f&&(u=r=r||[])),0!==f&&!d){var v=h?s:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(a,l,c,p,f,h,d,u)}}return pushInitializers(a,r),pushInitializers(a,n),a}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e=0;y--){var m;if(void 0!==(d=memberDec(g[y],n,u,o,a,i,s,f,c)))assertValidReturnValue(a,d),0===a?m=d:1===a?(m=d.init,h=d.get||f.get,v=d.set||f.set,f={get:h,set:v}):f=d,void 0!==m&&(void 0===l?l=m:"function"==typeof l?l=[l,m]:l.push(m))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var b=l;l=function(e,t){for(var r=t,n=0;n3,g=d>=5,y=r;if(g?(f=e,0!==(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),y=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=g?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,g,v,p,y)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e=0;b-=g){var I;if(void 0!==(h=memberDec(m[b],a?m[b-1]:void 0,n,f,c,i,s,o,p,l,u)))assertValidReturnValue(i,h),0===i?I=h:1===i?(I=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==I&&(void 0===d?d=I:"function"==typeof d?d=[d,I]:d.push(I))}if(0===i||1===i){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var w=d;d=function(e,t){for(var r=t,a=w.length-1;a>=0;a--)r=w[a].call(e,r);return r}}else{var M=d;d=function(e,t){return M.call(e,t)}}e.push(d)}0!==i&&(1===i?(f.get=p.get,f.set=p.set):2===i?f.value=p:3===i?f.get=p:4===i&&(f.set=p),o?1===i?(e.push((function(e,t){return p.get.call(e,t)})),e.push((function(e,t){return p.set.call(e,t)}))):2===i?e.push(p):e.push((function(e,t){return p.call(e,t)})):Object.defineProperty(t,n,f))}function applyMemberDecs(e,t,r,a){for(var n,i,s,o=[],c=new Map,l=new Map,u=0;u3,m=16&h,g=!!(8&h),b=r;if(h&=7,g?(d=e,0!==h&&(p=i=i||[]),y&&!s&&(s=function(t){return checkInRHS(t)===e}),b=s):(d=e.prototype,0!==h&&(p=n=n||[])),0!==h&&!y){var I=g?l:c,w=I.get(v)||0;if(!0===w||3===w&&4!==h||4===w&&3!==h)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+v);I.set(v,!(!w&&h>2)||h)}applyMemberDec(o,d,f,m,v,h,g,y,p,b,a)}}return pushInitializers(o,n),pushInitializers(o,i),o}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r=0;c-=o){var l={v:!1};try{var u=t[c].call(r?t[c-1]:void 0,i,{kind:"class",name:s,addInitializer:createAddInitializerMethod(n,l),metadata:a})}finally{l.v=!0}void 0!==u&&(assertValidReturnValue(5,u),i=u)}return[defineMetadata(i,a),function(){for(var e=0;e=6)var s=i[Symbol.metadata||Symbol.for("Symbol.metadata")];var o=Object.create(void 0===s?null:s),c=applyMemberDecs(e,t,n,o);return r.length||defineMetadata(e,o),{e:c,get c(){return applyClassDecs(e,r,a,o)}}}'), + applyDecs2305: helper("7.21.0", 'import checkInRHS from"checkInRHS";function _bindPropCall(e,t){return function(r,a){return e[t].call(r,a)}}function createAddInitializerMethod(e,t){return function(r){if(t.v)throw new Error("attempted to call addInitializer after decoration was finished");assertCallable(r,"An initializer",!0),e.push(r)}}function memberDec(e,t,r,a,n,i,o,s,l,c,u){function assertInstanceIfPrivate(e){return function(t,r){if(!c(t))throw new TypeError("Attempted to access private element on non-instance");return e(t,r)}}var f,d,p={v:!1},v={kind:["field","accessor","method","getter","setter","field"][i],name:s?"#"+r:r,static:o,private:s,metadata:u,addInitializer:createAddInitializerMethod(n,p)};if(s||0!==i&&2!==i)if(2===i)f=assertInstanceIfPrivate((function(){return a.value}));else{var h=0===i||1===i;(h||3===i)&&(f=_bindPropCall(a,"get"),s&&(f=assertInstanceIfPrivate(f))),(h||4===i)&&(d=_bindPropCall(a,"set"),s&&(d=assertInstanceIfPrivate(d)))}else f=function(e){return e[r]},0===i&&(d=function(e,t){e[r]=t});var m=s?c.bind():function(e){return r in e},b=v.access={has:m};f&&(b.get=f),d&&(b.set=d);try{return e.call(t,l,v)}finally{p.v=!0}}function assertCallable(e,t,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||!t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");assertCallable(t.get,"accessor.get"),assertCallable(t.set,"accessor.set"),assertCallable(t.init,"accessor.init")}else if("function"!==r)throw new TypeError((0===e?"field":5===e?"class":"method")+" decorators must return a function or void 0")}function applyMemberDec(e,t,r,a,n,i,o,s,l,c,u){var f,d,p,v,h=r[0],m=r[3];a||Array.isArray(h)||(h=[h]),s?f=0===i||1===i?{get:function(){return m(this)},set:function(e){r[4](this,e)}}:3===i?{get:m}:4===i?{set:m}:{value:m}:0!==i&&(f=Object.getOwnPropertyDescriptor(t,n)),1===i?p={get:f.get,set:f.set}:2===i?p=f.value:3===i?p=f.get:4===i&&(p=f.set);for(var b=a?2:1,y=h.length-1;y>=0;y-=b){var g;if(void 0!==(v=memberDec(h[y],a?h[y-1]:void 0,n,f,l,i,o,s,p,c,u)))assertValidReturnValue(i,v),0===i?g=v:1===i?(g=v.init,p={get:v.get||p.get,set:v.set||p.set}):p=v,void 0!==g&&(void 0===d?d=g:"function"==typeof d?d=[d,g]:d.push(g))}if(0===i||1===i){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var I=d;d=function(e,t){for(var r=t,a=I.length-1;a>=0;a--)r=I[a].call(e,r);return r}}else{var w=d;d=d.call.bind(w)}e.push(d)}0!==i&&(1===i?(f.get=p.get,f.set=p.set):2===i?f.value=p:3===i?f.get=p:4===i&&(f.set=p),s?1===i?e.push(_bindPropCall(f,"get"),_bindPropCall(f,"set")):e.push(2===i?p:Function.call.bind(p)):Object.defineProperty(t,n,f))}function applyMemberDecs(e,t,r,a){var n,i,o,s=[],l=new Map,c=new Map;function pushInitializers(e){e&&s.push((function(t){for(var r=0;r3,b=16&v,y=!!(8&v),g=r;if(v&=7,y?(d=e,p=i=i||[],m&&!o&&(o=function(t){return checkInRHS(t)===e}),g=o):(d=e.prototype,p=n=n||[]),0!==v&&!m){var I=y?c:l,w=I.get(h)||0;if(!0===w||3===w&&4!==v||4===w&&3!==v)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);I.set(h,!(!w&&v>2)||v)}applyMemberDec(s,d,f,b,h,v,y,m,p,g,a)}}return pushInitializers(n),pushInitializers(i),s}function applyClassDecs(e,t,r,a){if(t.length){for(var n=[],i=e,o=e.name,s=r?2:1,l=t.length-1;l>=0;l-=s){var c={v:!1};try{var u=t[l].call(r?t[l-1]:void 0,i,{kind:"class",name:o,addInitializer:createAddInitializerMethod(n,c),metadata:a})}finally{c.v=!0}void 0!==u&&(assertValidReturnValue(5,u),i=u)}return[defineMetadata(i,a),function(){for(var e=0;e=6)var o=i[Symbol.metadata||Symbol.for("Symbol.metadata")];var s=Object.create(void 0===o?null:o),l=applyMemberDecs(e,t,n,s);return r.length||defineMetadata(e,s),{e:l,get c(){return applyClassDecs(e,r,a,s)}}}'), asyncGeneratorDelegate: helper("7.0.0-beta.0", 'import OverloadYield from"OverloadYield";export default function _asyncGeneratorDelegate(t){var e={},n=!1;function pump(e,r){return n=!0,r=new Promise((function(n){n(t[e](r))})),{done:!1,value:new OverloadYield(r,1)}}return e["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},e.next=function(t){return n?(n=!1,t):pump("next",t)},"function"==typeof t.throw&&(e.throw=function(t){if(n)throw n=!1,t;return pump("throw",t)}),"function"==typeof t.return&&(e.return=function(t){return n?(n=!1,t):pump("return",t)}),e}'), asyncIterator: helper("7.15.9", 'export default function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then((function(r){return{value:r,done:n}}))}return AsyncFromSyncIterator=function(r){this.s=r,this.n=r.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},throw:function(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new AsyncFromSyncIterator(r)}'), awaitAsyncGenerator: helper("7.0.0-beta.0", 'import OverloadYield from"OverloadYield";export default function _awaitAsyncGenerator(e){return new OverloadYield(e,0)}'), @@ -38,6 +38,5 @@ var _default = Object.freeze({ using: helper("7.22.0", 'export default function _using(o,e,n){if(null==e)return e;if("object"!=typeof e)throw new TypeError("using declarations can only be used with objects, null, or undefined.");if(n)var r=e[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(null==r&&(r=e[Symbol.dispose||Symbol.for("Symbol.dispose")]),"function"!=typeof r)throw new TypeError("Property [Symbol.dispose] is not a function.");return o.push({v:e,d:r,a:n}),e}'), wrapRegExp: helper("7.19.0", 'import setPrototypeOf from"setPrototypeOf";import inherits from"inherits";export default function _wrapRegExp(){_wrapRegExp=function(e,r){return new BabelRegExp(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function BabelRegExp(e,t,p){var o=new RegExp(e,t);return r.set(o,p||r.get(e)),setPrototypeOf(o,BabelRegExp.prototype)}function buildGroups(e,t){var p=r.get(t);return Object.keys(p).reduce((function(r,t){var o=p[t];if("number"==typeof o)r[t]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1]+)>/g,(function(e,r){var t=o[r];return"$"+(Array.isArray(t)?t.join("$"):t)})))}if("function"==typeof p){var i=this;return e[Symbol.replace].call(this,t,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(buildGroups(e,i)),p.apply(this,e)}))}return e[Symbol.replace].call(this,t,p)},_wrapRegExp.apply(this,arguments)}') }); -exports.default = _default; //# sourceMappingURL=helpers-generated.js.map diff --git a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers.js b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers.js index d23e0325664ca5..6a9e81e6f0b58b 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers.js +++ b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers.js @@ -9,8 +9,7 @@ var _helpersGenerated = require("./helpers-generated.js"); const helpers = Object.assign({ __proto__: null }, _helpersGenerated.default); -var _default = helpers; -exports.default = _default; +var _default = exports.default = helpers; const helper = minVersion => tpl => ({ minVersion, ast: () => _template.default.program.ast(tpl) diff --git a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js index 35ad119c41b6e5..a471bbce0f1290 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js +++ b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js @@ -5,49 +5,40 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = applyDecs2305; var _checkInRHS = require("checkInRHS"); +function _bindPropCall(obj, name) { + return function (_this, value) { + return obj[name].call(_this, value); + }; +} function createAddInitializerMethod(initializers, decoratorFinishedRef) { return function addInitializer(initializer) { - assertNotFinished(decoratorFinishedRef, "addInitializer"); - assertCallable(initializer, "An initializer"); + if (decoratorFinishedRef.v) { + throw new Error("attempted to call addInitializer after decoration was finished"); + } + assertCallable(initializer, "An initializer", true); initializers.push(initializer); }; } -function assertInstanceIfPrivate(has, target) { - if (!has(target)) { - throw new TypeError("Attempted to access private element on non-instance"); - } -} function memberDec(dec, thisArg, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand, metadata) { - var kindStr; - switch (kind) { - case 1: - kindStr = "accessor"; - break; - case 2: - kindStr = "method"; - break; - case 3: - kindStr = "getter"; - break; - case 4: - kindStr = "setter"; - break; - default: - kindStr = "field"; + function assertInstanceIfPrivate(callback) { + return function (target, value) { + if (!hasPrivateBrand(target)) { + throw new TypeError("Attempted to access private element on non-instance"); + } + return callback(target, value); + }; } + var decoratorFinishedRef = { + v: false + }; var ctx = { - kind: kindStr, + kind: ["field", "accessor", "method", "getter", "setter", "field"][kind], name: isPrivate ? "#" + name : name, static: isStatic, private: isPrivate, - metadata: metadata + metadata: metadata, + addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef) }; - var decoratorFinishedRef = { - v: false - }; - if (kind !== 0) { - ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef); - } var get, set; if (!isPrivate && (kind === 0 || kind === 2)) { get = function (target) { @@ -59,106 +50,61 @@ function memberDec(dec, thisArg, name, desc, initializers, kind, isStatic, isPri }; } } else if (kind === 2) { - get = function (target) { - assertInstanceIfPrivate(hasPrivateBrand, target); + get = assertInstanceIfPrivate(function () { return desc.value; - }; + }); } else { var t = kind === 0 || kind === 1; if (t || kind === 3) { + get = _bindPropCall(desc, "get"); if (isPrivate) { - get = function (target) { - assertInstanceIfPrivate(hasPrivateBrand, target); - return desc.get.call(target); - }; - } else { - get = function (target) { - return desc.get.call(target); - }; + get = assertInstanceIfPrivate(get); } } if (t || kind === 4) { + set = _bindPropCall(desc, "set"); if (isPrivate) { - set = function (target, value) { - assertInstanceIfPrivate(hasPrivateBrand, target); - desc.set.call(target, value); - }; - } else { - set = function (target, value) { - desc.set.call(target, value); - }; + set = assertInstanceIfPrivate(set); } } } var has = isPrivate ? hasPrivateBrand.bind() : function (target) { return name in target; }; - ctx.access = get && set ? { - get: get, - set: set, - has: has - } : get ? { - get: get, - has: has - } : { - set: set, + var access = ctx.access = { has: has }; + if (get) access.get = get; + if (set) access.set = set; try { return dec.call(thisArg, value, ctx); } finally { decoratorFinishedRef.v = true; } } -function assertNotFinished(decoratorFinishedRef, fnName) { - if (decoratorFinishedRef.v) { - throw new Error("attempted to call " + fnName + " after decoration was finished"); - } -} -function assertCallable(fn, hint) { +function assertCallable(fn, hint, throwUndefined) { if (typeof fn !== "function") { - throw new TypeError(hint + " must be a function"); + if (throwUndefined || fn !== void 0) { + throw new TypeError(hint + " must be a function"); + } } } function assertValidReturnValue(kind, value) { var type = typeof value; if (kind === 1) { - if (type !== "object" || value === null) { + if (type !== "object" || !value) { throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } - if (value.get !== undefined) { - assertCallable(value.get, "accessor.get"); - } - if (value.set !== undefined) { - assertCallable(value.set, "accessor.set"); - } - if (value.init !== undefined) { - assertCallable(value.init, "accessor.init"); - } + assertCallable(value.get, "accessor.get"); + assertCallable(value.set, "accessor.set"); + assertCallable(value.init, "accessor.init"); } else if (type !== "function") { - var hint; - if (kind === 0) { - hint = "field"; - } else if (kind === 5) { - hint = "class"; - } else { - hint = "method"; - } - throw new TypeError(hint + " decorators must return a function or void 0"); + throw new TypeError((kind === 0 ? "field" : kind === 5 ? "class" : "method") + " decorators must return a function or void 0"); } } -function curryThis1(fn) { - return function () { - return fn(this); - }; -} -function curryThis2(fn) { - return function (value) { - fn(this, value); - }; -} function applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand, metadata) { - var decs = decInfo[0]; + var decs = decInfo[0], + decVal = decInfo[3]; if (!decoratorsHaveThis && !Array.isArray(decs)) { decs = [decs]; } @@ -166,21 +112,25 @@ function applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isSt if (isPrivate) { if (kind === 0 || kind === 1) { desc = { - get: curryThis1(decInfo[3]), - set: curryThis2(decInfo[4]) + get: function () { + return decVal(this); + }, + set: function (value) { + decInfo[4](this, value); + } }; } else { if (kind === 3) { desc = { - get: decInfo[3] + get: decVal }; } else if (kind === 4) { desc = { - set: decInfo[3] + set: decVal }; } else { desc = { - value: decInfo[3] + value: decVal }; } } @@ -247,9 +197,7 @@ function applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isSt }; } else { var originalInitializer = init; - init = function (instance, init) { - return originalInitializer.call(instance, init); - }; + init = init.call.bind(originalInitializer); } ret.push(init); } @@ -266,18 +214,9 @@ function applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isSt } if (isPrivate) { if (kind === 1) { - ret.push(function (instance, args) { - return value.get.call(instance, args); - }); - ret.push(function (instance, args) { - return value.set.call(instance, args); - }); - } else if (kind === 2) { - ret.push(value); + ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set")); } else { - ret.push(function (instance, args) { - return value.call(instance, args); - }); + ret.push(kind === 2 ? value : Function.call.bind(value)); } } else { Object.defineProperty(base, name, desc); @@ -291,6 +230,16 @@ function applyMemberDecs(Class, decInfos, instanceBrand, metadata) { var staticBrand; var existingProtoNonFields = new Map(); var existingStaticNonFields = new Map(); + function pushInitializers(initializers) { + if (initializers) { + ret.push(function (instance) { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(instance); + } + return instance; + }); + } + } for (var i = 0; i < decInfos.length; i++) { var decInfo = decInfos[i]; if (!Array.isArray(decInfo)) continue; @@ -305,10 +254,8 @@ function applyMemberDecs(Class, decInfos, instanceBrand, metadata) { kind &= 7; if (isStatic) { base = Class; - if (kind !== 0) { - staticInitializers = staticInitializers || []; - initializers = staticInitializers; - } + staticInitializers = staticInitializers || []; + initializers = staticInitializers; if (isPrivate && !staticBrand) { staticBrand = function (_) { return _checkInRHS(_) === Class; @@ -317,10 +264,8 @@ function applyMemberDecs(Class, decInfos, instanceBrand, metadata) { hasPrivateBrand = staticBrand; } else { base = Class.prototype; - if (kind !== 0) { - protoInitializers = protoInitializers || []; - initializers = protoInitializers; - } + protoInitializers = protoInitializers || []; + initializers = protoInitializers; } if (kind !== 0 && !isPrivate) { var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields; @@ -332,20 +277,10 @@ function applyMemberDecs(Class, decInfos, instanceBrand, metadata) { } applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand, metadata); } - pushInitializers(ret, protoInitializers); - pushInitializers(ret, staticInitializers); + pushInitializers(protoInitializers); + pushInitializers(staticInitializers); return ret; } -function pushInitializers(ret, initializers) { - if (initializers) { - ret.push(function (instance) { - for (var i = 0; i < initializers.length; i++) { - initializers[i].call(instance); - } - return instance; - }); - } -} function applyClassDecs(targetClass, classDecs, decoratorsHaveThis, metadata) { if (classDecs.length) { var initializers = []; diff --git a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/index.js index a6e1c96d084149..711eb5f3dcf7c9 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helpers/lib/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/helpers/lib/index.js @@ -134,6 +134,7 @@ function permuteHelperAST(file, metadata, id, localBindings, getDependency) { }); const toRename = {}; const bindings = new Set(localBindings || []); + if (id.type === "Identifier") bindings.add(id.name); localBindingNames.forEach(name => { let newName = name; while (bindings.has(newName)) newName = "_" + newName; @@ -234,9 +235,7 @@ function ensure(name, newFileClass) { FileClass || (FileClass = newFileClass); loadHelper(name); } -const list = Object.keys(_helpers.default).map(name => name.replace(/^_/, "")); -exports.list = list; -var _default = get; -exports.default = _default; +const list = exports.list = Object.keys(_helpers.default).map(name => name.replace(/^_/, "")); +var _default = exports.default = get; //# sourceMappingURL=index.js.map diff --git a/tools/node_modules/eslint/node_modules/@babel/helpers/package.json b/tools/node_modules/eslint/node_modules/@babel/helpers/package.json index 794abfc00d04e5..f3a9107682c040 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helpers/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helpers", - "version": "7.23.2", + "version": "7.23.5", "description": "Collection of helper functions used by Babel transforms.", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-helpers", @@ -16,15 +16,14 @@ "main": "./lib/index.js", "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0" + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5" }, "devDependencies": { - "@babel/generator": "^7.23.0", + "@babel/generator": "^7.23.5", "@babel/helper-plugin-test-runner": "^7.22.5", - "@babel/parser": "^7.23.0", - "regenerator-runtime": "^0.14.0", - "terser": "^5.19.2" + "@babel/parser": "^7.23.5", + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" diff --git a/tools/node_modules/eslint/node_modules/@babel/helpers/scripts/generate-helpers.js b/tools/node_modules/eslint/node_modules/@babel/helpers/scripts/generate-helpers.js index e2a318865937e3..31c5c6cf970500 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helpers/scripts/generate-helpers.js +++ b/tools/node_modules/eslint/node_modules/@babel/helpers/scripts/generate-helpers.js @@ -1,7 +1,10 @@ +/* eslint-disable import/no-extraneous-dependencies */ import fs from "fs"; import { join } from "path"; import { URL, fileURLToPath } from "url"; -import { minify } from "terser"; // eslint-disable-line import/no-extraneous-dependencies +import { minify } from "terser"; +import { transformSync } from "@babel/core"; +import presetTypescript from "@babel/preset-typescript"; const HELPERS_FOLDER = new URL("../src/helpers", import.meta.url); const IGNORED_FILES = new Set(["package.json"]); @@ -30,14 +33,16 @@ export default Object.freeze({ const [helperName] = file.split("."); + const isTs = file.endsWith(".ts"); + const filePath = join(fileURLToPath(HELPERS_FOLDER), file); - if (!file.endsWith(".js")) { + if (!file.endsWith(".js") && !isTs) { console.error("ignoring", filePath); continue; } - const fileContents = await fs.promises.readFile(filePath, "utf8"); - const minVersionMatch = fileContents.match( + let code = await fs.promises.readFile(filePath, "utf8"); + const minVersionMatch = code.match( /^\s*\/\*\s*@minVersion\s+(?\S+)\s*\*\/\s*$/m ); if (!minVersionMatch) { @@ -45,16 +50,35 @@ export default Object.freeze({ } const { minVersion } = minVersionMatch.groups; - const source = await minify(fileContents, { - mangle: { keep_fnames: true }, - // The _typeof helper has a custom directive that we must keep - compress: { directives: false }, - }); + if (isTs) { + code = transformSync(code, { + configFile: false, + babelrc: false, + filename: filePath, + presets: [ + [ + presetTypescript, + { + onlyRemoveTypeImports: true, + optimizeConstEnums: true, + }, + ], + ], + }).code; + } + + code = ( + await minify(code, { + mangle: { keep_fnames: true }, + // The _typeof helper has a custom directive that we must keep + compress: { directives: false }, + }) + ).code; output += `\ ${JSON.stringify(helperName)}: helper( ${JSON.stringify(minVersion)}, - ${JSON.stringify(source.code)}, + ${JSON.stringify(code)}, ), `; } diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js index cb718afd154ce0..a45bc5a8805500 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js @@ -8,8 +8,8 @@ exports.shouldHighlight = shouldHighlight; var _jsTokens = require("js-tokens"); var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); var _chalk = _interopRequireWildcard(require("chalk"), true); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); function getDefs(chalk) { return { diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json index d88c972268588e..640f8366199981 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@babel/highlight", - "version": "7.22.20", + "version": "7.23.4", "description": "Syntax highlight JavaScript strings for output in terminals.", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-highlight", diff --git a/tools/node_modules/eslint/node_modules/@babel/parser/package.json b/tools/node_modules/eslint/node_modules/@babel/parser/package.json index c1a75cb90995b3..cbe3a52a86ca12 100644 --- a/tools/node_modules/eslint/node_modules/@babel/parser/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.23.3", + "version": "7.23.5", "description": "A JavaScript parser", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-parser", @@ -34,10 +34,10 @@ "node": ">=6.0.0" }, "devDependencies": { - "@babel/code-frame": "^7.22.13", + "@babel/code-frame": "^7.23.5", "@babel/helper-check-duplicate-nodes": "^7.22.5", - "@babel/helper-fixtures": "^7.22.19", - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-fixtures": "^7.23.4", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "charcodes": "^0.2.0" }, diff --git a/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/comments.js b/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/comments.js index 0a4eed6fac94ff..43b3b72acdd502 100644 --- a/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/comments.js +++ b/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/comments.js @@ -36,12 +36,10 @@ function shareCommentsWithSiblings() { } } function removeIfExisting(list, toRemove) { - if (!toRemove) return list; - let lastFoundIndex = -1; + if (!(toRemove != null && toRemove.length)) return list; + const set = new Set(toRemove); return list.filter(el => { - const i = toRemove.indexOf(el, lastFoundIndex); - if (i === -1) return true; - lastFoundIndex = i; + return !set.has(el); }); } function addComment(type, content, line) { diff --git a/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/removal.js b/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/removal.js index 220cdc946fbeb2..7b1ce871f55553 100644 --- a/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/removal.js +++ b/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/removal.js @@ -12,6 +12,10 @@ exports.remove = remove; var _removalHooks = require("./lib/removal-hooks.js"); var _cache = require("../cache.js"); var _index = require("./index.js"); +var _t = require("@babel/types"); +const { + getBindingIdentifiers +} = _t; function remove() { var _this$opts; this._assertUnremoved(); @@ -28,7 +32,7 @@ function remove() { this._markRemoved(); } function _removeFromScope() { - const bindings = this.getBindingIdentifiers(); + const bindings = getBindingIdentifiers(this.node, false, false, true); Object.keys(bindings).forEach(name => this.scope.removeBinding(name)); } function _callRemovalHooks() { diff --git a/tools/node_modules/eslint/node_modules/@babel/traverse/package.json b/tools/node_modules/eslint/node_modules/@babel/traverse/package.json index 0c16f4d884bf47..0fabd752426218 100644 --- a/tools/node_modules/eslint/node_modules/@babel/traverse/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.23.3", + "version": "7.23.5", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-traverse", @@ -16,19 +16,19 @@ }, "main": "./lib/index.js", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.3", - "@babel/types": "^7.23.3", + "@babel/parser": "^7.23.5", + "@babel/types": "^7.23.5", "debug": "^4.1.0", "globals": "^11.1.0" }, "devDependencies": { - "@babel/core": "^7.23.3", + "@babel/core": "^7.23.5", "@babel/helper-plugin-test-runner": "^7.22.5" }, "engines": { diff --git a/tools/node_modules/eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js b/tools/node_modules/eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js index dc90bdb35be202..86b4d1d2e4e280 100644 --- a/tools/node_modules/eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +++ b/tools/node_modules/eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js @@ -5,12 +5,15 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = getBindingIdentifiers; var _index = require("../validators/generated/index.js"); -function getBindingIdentifiers(node, duplicates, outerOnly) { +function getBindingIdentifiers(node, duplicates, outerOnly, newBindingsOnly) { const search = [].concat(node); const ids = Object.create(null); while (search.length) { const id = search.shift(); if (!id) continue; + if (newBindingsOnly && ((0, _index.isAssignmentExpression)(id) || (0, _index.isUnaryExpression)(id))) { + continue; + } const keys = getBindingIdentifiers.keys[id.type]; if ((0, _index.isIdentifier)(id)) { if (duplicates) { diff --git a/tools/node_modules/eslint/node_modules/@babel/types/package.json b/tools/node_modules/eslint/node_modules/@babel/types/package.json index 33bff1d868000e..0fd8968dde92ee 100644 --- a/tools/node_modules/eslint/node_modules/@babel/types/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.23.3", + "version": "7.23.5", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-types", @@ -24,13 +24,13 @@ } }, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "devDependencies": { - "@babel/generator": "^7.23.3", - "@babel/parser": "^7.23.3", + "@babel/generator": "^7.23.5", + "@babel/parser": "^7.23.5", "glob": "^7.2.0" }, "engines": { diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs index 9902a90e7ee453..eb2ed8d37ffef4 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs @@ -941,6 +941,7 @@ class ConfigDependency { * Initialize this instance. * @param {Object} data The dependency data. * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {T} [data.original] The original, non-normalized dependency if the loading succeeded. * @param {Error} [data.error] The error object if the loading failed. * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. * @param {string} data.id The ID of this dependency. @@ -949,6 +950,7 @@ class ConfigDependency { */ constructor({ definition = null, + original = null, error = null, filePath = null, id, @@ -962,6 +964,12 @@ class ConfigDependency { */ this.definition = definition; + /** + * The original dependency as loaded directly from disk if the loading succeeded. + * @type {T|null} + */ + this.original = original; + /** * The error object if the loading failed. * @type {Error|null} @@ -1014,7 +1022,8 @@ class ConfigDependency { */ [util__default["default"].inspect.custom]() { const { - definition: _ignore, // eslint-disable-line no-unused-vars + definition: _ignore1, // eslint-disable-line no-unused-vars + original: _ignore2, // eslint-disable-line no-unused-vars ...obj } = this; @@ -3390,6 +3399,7 @@ class ConfigArrayFactory { if (plugin) { return new ConfigDependency({ definition: normalizePlugin(plugin), + original: plugin, filePath: "", // It's unknown where the plugin came from. id, importerName: ctx.name, @@ -3426,6 +3436,7 @@ class ConfigArrayFactory { return new ConfigDependency({ definition: normalizePlugin(pluginDefinition), + original: pluginDefinition, filePath, id, importerName: ctx.name, @@ -4117,7 +4128,7 @@ function translateESLintRC(eslintrcConfig, { debug(`Translating plugin: ${pluginName}`); debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); - const { definition: plugin, error } = eslintrcConfig.plugins[pluginName]; + const { original: plugin, error } = eslintrcConfig.plugins[pluginName]; if (error) { throw error; diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js index 99851e15f9d791..58c1e808beb94c 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js @@ -1053,6 +1053,7 @@ class ConfigArrayFactory { if (plugin) { return new ConfigDependency({ definition: normalizePlugin(plugin), + original: plugin, filePath: "", // It's unknown where the plugin came from. id, importerName: ctx.name, @@ -1089,6 +1090,7 @@ class ConfigArrayFactory { return new ConfigDependency({ definition: normalizePlugin(pluginDefinition), + original: pluginDefinition, filePath, id, importerName: ctx.name, diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js index 2883c3a2a703d6..080e6405e9ba2c 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js @@ -28,6 +28,7 @@ class ConfigDependency { * Initialize this instance. * @param {Object} data The dependency data. * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {T} [data.original] The original, non-normalized dependency if the loading succeeded. * @param {Error} [data.error] The error object if the loading failed. * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. * @param {string} data.id The ID of this dependency. @@ -36,6 +37,7 @@ class ConfigDependency { */ constructor({ definition = null, + original = null, error = null, filePath = null, id, @@ -49,6 +51,12 @@ class ConfigDependency { */ this.definition = definition; + /** + * The original dependency as loaded directly from disk if the loading succeeded. + * @type {T|null} + */ + this.original = original; + /** * The error object if the loading failed. * @type {Error|null} @@ -101,7 +109,8 @@ class ConfigDependency { */ [util.inspect.custom]() { const { - definition: _ignore, // eslint-disable-line no-unused-vars + definition: _ignore1, // eslint-disable-line no-unused-vars + original: _ignore2, // eslint-disable-line no-unused-vars ...obj } = this; diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js index e0d7ab6699b549..6c307a99246ae0 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js @@ -132,7 +132,7 @@ function translateESLintRC(eslintrcConfig, { debug(`Translating plugin: ${pluginName}`); debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); - const { definition: plugin, error } = eslintrcConfig.plugins[pluginName]; + const { original: plugin, error } = eslintrcConfig.plugins[pluginName]; if (error) { throw error; diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json index 6f148ac71ffec5..aa43e7563bb912 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/eslintrc", - "version": "2.1.3", + "version": "2.1.4", "description": "The legacy ESLintRC config file format for ESLint", "type": "module", "main": "./dist/eslintrc.cjs", diff --git a/tools/node_modules/eslint/node_modules/@eslint/js/package.json b/tools/node_modules/eslint/node_modules/@eslint/js/package.json index bd5977876b0091..2c7aacae88a39e 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/js/package.json +++ b/tools/node_modules/eslint/node_modules/@eslint/js/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/js", - "version": "8.54.0", + "version": "8.55.0", "description": "ESLint JavaScript language implementation", "main": "./src/index.js", "scripts": {}, diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/agents.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/agents.js index b34f928c64e7c5..0759871725b96a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/agents.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/agents.js @@ -1 +1 @@ -module.exports={A:{A:{J:0,E:0,F:0.0126987,G:0.0634934,A:0,B:0.368262,PC:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","PC","J","E","F","G","A","B","","",""],E:"IE",F:{PC:962323200,J:998870400,E:1161129600,F:1237420800,G:1300060800,A:1346716800,B:1381968000}},B:{A:{"0":0.100804,"1":0.02291,"2":0.036656,"3":0.041238,"4":0.109968,"5":2.53385,"6":2.08939,C:0.009164,K:0.009164,L:0.009164,H:0.009164,M:0,N:0.004582,O:0.013746,P:0,Q:0.009164,R:0.009164,S:0.009164,T:0.009164,U:0.004582,V:0.009164,W:0.041238,X:0.004582,Y:0.004582,Z:0.009164,a:0,b:0.013746,c:0,d:0,e:0,f:0,g:0,h:0,i:0.018328,j:0,k:0,l:0,m:0,s:0,t:0,u:0,v:0.009164,w:0.009164,x:0.073312,y:0.013746,z:0.100804,D:0.009164},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","K","L","H","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","D","","",""],E:"Edge",F:{"0":1680825600,"1":1683158400,"2":1685664000,"3":1689897600,"4":1692576000,"5":1694649600,"6":1697155200,C:1438128000,K:1447286400,L:1470096000,H:1491868800,M:1508198400,N:1525046400,O:1542067200,P:1579046400,Q:1581033600,R:1586736000,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:1611360000,Y:1614816000,Z:1618358400,a:1622073600,b:1626912000,c:1630627200,d:1632441600,e:1634774400,f:1637539200,g:1641427200,h:1643932800,i:1646265600,j:1649635200,k:1651190400,l:1653955200,m:1655942400,s:1659657600,t:1661990400,u:1664755200,v:1666915200,w:1670198400,x:1673481600,y:1675900800,z:1678665600,D:1698969600},D:{C:"ms",K:"ms",L:"ms",H:"ms",M:"ms",N:"ms",O:"ms"}},C:{A:{"0":0.009164,"1":0.013746,"2":0.013746,"3":0.339068,"4":0.02291,"5":0.096222,"6":1.49831,"7":0,"8":0,"9":0,QC:0,"4B":0,I:0,J:0,E:0,F:0,G:0,A:0,B:0.009164,C:0,K:0,L:0,H:0,M:0,N:0,O:0,n:0,o:0,p:0,q:0,AB:0,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0,KB:0,LB:0,MB:0,NB:0,OB:0,PB:0,QB:0,RB:0,SB:0,TB:0.004582,UB:0,VB:0,WB:0,XB:0.02291,YB:0,ZB:0.013746,aB:0,bB:0.054984,cB:0.004582,dB:0.013746,eB:0.004582,fB:0.018328,gB:0,hB:0,"5B":0.009164,iB:0,"6B":0,jB:0,kB:0.004582,lB:0,mB:0,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,r:0,uB:0,vB:0,wB:0,xB:0,yB:0.036656,P:0,Q:0,R:0,"7B":0,S:0.004582,T:0,U:0,V:0,W:0,X:0.004582,Y:0,Z:0,a:0.004582,b:0,c:0,d:0.004582,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0.050402,m:0.036656,s:0,t:0.004582,u:0,v:0.004582,w:0.009164,x:0.009164,y:0.009164,z:0.009164,D:0.27492,"8B":0,"9B":0,AC:0,RC:0,SC:0},B:"moz",C:["QC","4B","RC","SC","I","7","J","E","F","G","A","B","C","K","L","H","M","N","O","8","n","o","p","q","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","5B","iB","6B","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","r","uB","vB","wB","xB","yB","P","Q","R","7B","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","D","8B","9B","AC"],E:"Firefox",F:{"0":1681171200,"1":1683590400,"2":1686009600,"3":1688428800,"4":1690848000,"5":1693267200,"6":1695686400,"7":1308614400,"8":1357603200,"9":1375747200,QC:1161648000,"4B":1213660800,RC:1246320000,SC:1264032000,I:1300752000,J:1313452800,E:1317081600,F:1317081600,G:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,L:1338854400,H:1342483200,M:1346112000,N:1349740800,O:1353628800,n:1361232000,o:1364860800,p:1368489600,q:1372118400,AB:1379376000,BB:1386633600,CB:1391472000,DB:1395100800,EB:1398729600,FB:1402358400,GB:1405987200,HB:1409616000,IB:1413244800,JB:1417392000,KB:1421107200,LB:1424736000,MB:1428278400,NB:1431475200,OB:1435881600,PB:1439251200,QB:1442880000,RB:1446508800,SB:1450137600,TB:1453852800,UB:1457395200,VB:1461628800,WB:1465257600,XB:1470096000,YB:1474329600,ZB:1479168000,aB:1485216000,bB:1488844800,cB:1492560000,dB:1497312000,eB:1502150400,fB:1506556800,gB:1510617600,hB:1516665600,"5B":1520985600,iB:1525824000,"6B":1529971200,jB:1536105600,kB:1540252800,lB:1544486400,mB:1548720000,nB:1552953600,oB:1558396800,pB:1562630400,qB:1567468800,rB:1571788800,sB:1575331200,tB:1578355200,r:1581379200,uB:1583798400,vB:1586304000,wB:1588636800,xB:1591056000,yB:1593475200,P:1595894400,Q:1598313600,R:1600732800,"7B":1603152000,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392000,d:1635811200,e:1638835200,f:1641859200,g:1644364800,h:1646697600,i:1649116800,j:1651536000,k:1653955200,l:1656374400,m:1658793600,s:1661212800,t:1663632000,u:1666051200,v:1668470400,w:1670889600,x:1673913600,y:1676332800,z:1678752000,D:1698105600,"8B":null,"9B":null,AC:null}},D:{A:{"0":0.187862,"1":0.169534,"2":0.522348,"3":0.361978,"4":1.46624,"5":9.96127,"6":9.54889,"7":0,"8":0,"9":0,I:0,J:0,E:0,F:0,G:0,A:0,B:0,C:0,K:0,L:0,H:0,M:0,N:0,O:0,n:0,o:0,p:0,q:0,AB:0,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0.004582,KB:0,LB:0,MB:0,NB:0.013746,OB:0,PB:0,QB:0.004582,RB:0,SB:0,TB:0,UB:0.009164,VB:0,WB:0.009164,XB:0.018328,YB:0.041238,ZB:0.009164,aB:0,bB:0,cB:0.009164,dB:0,eB:0.009164,fB:0.018328,gB:0.009164,hB:0.004582,"5B":0,iB:0.032074,"6B":0.004582,jB:0,kB:0.009164,lB:0,mB:0.013746,nB:0.02291,oB:0.009164,pB:0.032074,qB:0.064148,rB:0.16037,sB:0.02291,tB:0.032074,r:0.041238,uB:0.036656,vB:0.036656,wB:0.109968,xB:0.032074,yB:0.041238,P:0.169534,Q:0.087058,R:0.059566,S:0.073312,T:0.036656,U:0.082476,V:0.087058,W:0.100804,X:0.054984,Y:0.04582,Z:0.054984,a:0.082476,b:0.04582,c:0.142042,d:0.041238,e:0.013746,f:0.018328,g:0.02291,h:0.06873,i:0.036656,j:0.036656,k:0.04582,l:0.036656,m:0.233682,s:0.050402,t:0.036656,u:0.059566,v:0.13746,w:0.178698,x:1.69534,y:0.155788,z:0.265756,D:0.027492,"8B":0.013746,"9B":0,AC:0},B:"webkit",C:["","","","","","I","7","J","E","F","G","A","B","C","K","L","H","M","N","O","8","n","o","p","q","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","5B","iB","6B","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","r","uB","vB","wB","xB","yB","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","D","8B","9B","AC"],E:"Chrome",F:{"0":1680566400,"1":1682985600,"2":1685404800,"3":1689724800,"4":1692057600,"5":1694476800,"6":1696896000,"7":1274745600,"8":1332892800,"9":1352246400,I:1264377600,J:1283385600,E:1287619200,F:1291248000,G:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,L:1316131200,H:1316131200,M:1319500800,N:1323734400,O:1328659200,n:1337040000,o:1340668800,p:1343692800,q:1348531200,AB:1357862400,BB:1361404800,CB:1364428800,DB:1369094400,EB:1374105600,FB:1376956800,GB:1384214400,HB:1389657600,IB:1392940800,JB:1397001600,KB:1400544000,LB:1405468800,MB:1409011200,NB:1412640000,OB:1416268800,PB:1421798400,QB:1425513600,RB:1429401600,SB:1432080000,TB:1437523200,UB:1441152000,VB:1444780800,WB:1449014400,XB:1453248000,YB:1456963200,ZB:1460592000,aB:1464134400,bB:1469059200,cB:1472601600,dB:1476230400,eB:1480550400,fB:1485302400,gB:1489017600,hB:1492560000,"5B":1496707200,iB:1500940800,"6B":1504569600,jB:1508198400,kB:1512518400,lB:1516752000,mB:1520294400,nB:1523923200,oB:1527552000,pB:1532390400,qB:1536019200,rB:1539648000,sB:1543968000,tB:1548720000,r:1552348800,uB:1555977600,vB:1559606400,wB:1564444800,xB:1568073600,yB:1571702400,P:1575936000,Q:1580860800,R:1586304000,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272000,a:1621987200,b:1626739200,c:1630368000,d:1632268800,e:1634601600,f:1637020800,g:1641340800,h:1643673600,i:1646092800,j:1648512000,k:1650931200,l:1653350400,m:1655769600,s:1659398400,t:1661817600,u:1664236800,v:1666656000,w:1669680000,x:1673308800,y:1675728000,z:1678147200,D:1698710400,"8B":null,"9B":null,AC:null}},E:{A:{"7":0,I:0,J:0,E:0,F:0,G:0,A:0,B:0,C:0.004582,K:0.02291,L:0.096222,H:0.018328,TC:0,BC:0,UC:0.004582,VC:0,WC:0,XC:0.164952,CC:0,zB:0.009164,"0B":0.027492,DC:0.128296,YC:0.233682,ZC:0.041238,EC:0.032074,FC:0.06873,"1B":0.109968,aC:0.536094,"2B":0.064148,GC:0.16037,HC:0.146624,IC:0.34365,JC:0.146624,KC:0.398634,bC:2.1902,"3B":0.613988,LC:0.041238,MC:0,cC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","TC","BC","I","7","UC","J","VC","E","WC","F","G","XC","A","CC","B","zB","C","0B","K","DC","L","YC","H","ZC","EC","FC","1B","aC","2B","GC","HC","IC","JC","KC","bC","3B","LC","MC","cC",""],E:"Safari",F:{"7":1275868800,TC:1205798400,BC:1226534400,I:1244419200,UC:1311120000,J:1343174400,VC:1382400000,E:1382400000,WC:1410998400,F:1413417600,G:1443657600,XC:1458518400,A:1474329600,CC:1490572800,B:1505779200,zB:1522281600,C:1537142400,"0B":1553472000,K:1568851200,DC:1585008000,L:1600214400,YC:1619395200,H:1632096000,ZC:1635292800,EC:1639353600,FC:1647216000,"1B":1652745600,aC:1658275200,"2B":1662940800,GC:1666569600,HC:1670889600,IC:1674432000,JC:1679875200,KC:1684368000,bC:1690156800,"3B":1695686400,LC:1698192000,MC:null,cC:null}},F:{A:{"8":0,"9":0,G:0,B:0,C:0,H:0,M:0,N:0,O:0,n:0,o:0,p:0,q:0,AB:0,BB:0,CB:0,DB:0.004582,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0,KB:0,LB:0,MB:0,NB:0,OB:0,PB:0,QB:0,RB:0,SB:0,TB:0,UB:0,VB:0.013746,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0.004582,eB:0.004582,fB:0,gB:0,hB:0,iB:0,jB:0,kB:0,lB:0,mB:0,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,r:0,uB:0,vB:0,wB:0,xB:0,yB:0,P:0,Q:0,R:0,"7B":0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0.050402,f:0,g:0.09164,h:0,i:0.009164,j:0.009164,k:0.013746,l:1.61745,m:0.25201,dC:0,eC:0,fC:0,gC:0,zB:0,NC:0,hC:0,"0B":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","G","dC","eC","fC","gC","B","zB","NC","hC","C","0B","H","M","N","O","8","n","o","p","q","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","r","uB","vB","wB","xB","yB","P","Q","R","7B","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","","",""],E:"Opera",F:{"8":1390867200,"9":1409616000,G:1150761600,dC:1223424000,eC:1251763200,fC:1267488000,gC:1277942400,B:1292457600,zB:1302566400,NC:1309219200,hC:1323129600,C:1323129600,"0B":1352073600,H:1372723200,M:1377561600,N:1381104000,O:1386288000,n:1393891200,o:1399334400,p:1401753600,q:1405987200,AB:1413331200,BB:1417132800,CB:1422316800,DB:1425945600,EB:1430179200,FB:1433808000,GB:1438646400,HB:1442448000,IB:1445904000,JB:1449100800,KB:1454371200,LB:1457308800,MB:1462320000,NB:1465344000,OB:1470096000,PB:1474329600,QB:1477267200,RB:1481587200,SB:1486425600,TB:1490054400,UB:1494374400,VB:1498003200,WB:1502236800,XB:1506470400,YB:1510099200,ZB:1515024000,aB:1517961600,bB:1521676800,cB:1525910400,dB:1530144000,eB:1534982400,fB:1537833600,gB:1543363200,hB:1548201600,iB:1554768000,jB:1561593600,kB:1566259200,lB:1570406400,mB:1573689600,nB:1578441600,oB:1583971200,pB:1587513600,qB:1592956800,rB:1595894400,sB:1600128000,tB:1603238400,r:1613520000,uB:1612224000,vB:1616544000,wB:1619568000,xB:1623715200,yB:1627948800,P:1631577600,Q:1633392000,R:1635984000,"7B":1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152000,Z:1660780800,a:1663113600,b:1668816000,c:1668643200,d:1671062400,e:1675209600,f:1677024000,g:1679529600,h:1681948800,i:1684195200,j:1687219200,k:1690329600,l:1692748800,m:1696204800},D:{G:"o",B:"o",C:"o",dC:"o",eC:"o",fC:"o",gC:"o",zB:"o",NC:"o",hC:"o","0B":"o"}},G:{A:{F:0,BC:0,iC:0,OC:0.0027735,jC:0.00138675,kC:0.00416026,lC:0.00970726,mC:0.00138675,nC:0.00970726,oC:0.033282,pC:0.00138675,qC:0.0485363,rC:0.0457628,sC:0.016641,tC:0.0124808,uC:0.220494,vC:0.00693376,wC:0.0374423,xC:0.0138675,yC:0.0443761,zC:0.122034,"0C":0.196919,"1C":0.0776581,EC:0.0887521,FC:0.0984594,"1B":0.140062,"2C":0.96934,"2B":0.357782,GC:0.685055,HC:0.334207,IC:0.619878,JC:0.137288,KC:0.355009,"3C":6.64254,"3B":2.36719,LC:0.142835,MC:0.00416026},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","BC","iC","OC","jC","kC","lC","F","mC","nC","oC","pC","qC","rC","sC","tC","uC","vC","wC","xC","yC","zC","0C","1C","EC","FC","1B","2C","2B","GC","HC","IC","JC","KC","3C","3B","LC","MC","",""],E:"Safari on iOS",F:{BC:1270252800,iC:1283904000,OC:1299628800,jC:1331078400,kC:1359331200,lC:1394409600,F:1410912000,mC:1413763200,nC:1442361600,oC:1458518400,pC:1473724800,qC:1490572800,rC:1505779200,sC:1522281600,tC:1537142400,uC:1553472000,vC:1568851200,wC:1572220800,xC:1580169600,yC:1585008000,zC:1600214400,"0C":1619395200,"1C":1632096000,EC:1639353600,FC:1647216000,"1B":1652659200,"2C":1658275200,"2B":1662940800,GC:1666569600,HC:1670889600,IC:1674432000,JC:1679875200,KC:1684368000,"3C":1690156800,"3B":1694995200,LC:1698192000,MC:null}},H:{A:{"4C":0.06},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","4C","","",""],E:"Opera Mini",F:{"4C":1426464000}},I:{A:{"4B":0,I:0.000123508,D:0.61445,"5C":0,"6C":0.000185261,"7C":0,"8C":0.000123508,OC:0.000432277,"9C":0,AD:0.00185261},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","5C","6C","7C","4B","I","8C","OC","9C","AD","D","","",""],E:"Android Browser",F:{"5C":1256515200,"6C":1274313600,"7C":1291593600,"4B":1298332800,I:1318896000,"8C":1341792000,OC:1374624000,"9C":1386547200,AD:1401667200,D:1698710400}},J:{A:{E:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","E","A","","",""],E:"Blackberry Browser",F:{E:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,r:1.00715,zB:0,NC:0,"0B":0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","zB","NC","C","0B","r","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,zB:1314835200,NC:1318291200,C:1330300800,"0B":1349740800,r:1673827200},D:{r:"webkit"}},L:{A:{D:35.8038},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Chrome for Android",F:{D:1698710400}},M:{A:{D:0.276267},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Firefox for Android",F:{D:1698105600}},N:{A:{A:0,B:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{"1B":0.785465},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1B","","",""],E:"UC Browser for Android",F:{"1B":1687132800},D:{"1B":"webkit"}},P:{A:{I:0.0977276,n:0.0542931,o:0.108586,p:1.60708,q:0.347476,BD:0,CD:0,DD:0.0325759,ED:0,FD:0,CC:0,GD:0.0108586,HD:0,ID:0.0108586,JD:0,KD:0,"2B":0.0217172,"3B":0.0325759,LD:0.0217172,MD:0.0434345},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","BD","CD","DD","ED","FD","CC","GD","HD","ID","JD","KD","2B","3B","LD","MD","n","o","p","q","","",""],E:"Samsung Internet",F:{I:1461024000,BD:1481846400,CD:1509408000,DD:1528329600,ED:1546128000,FD:1554163200,CC:1567900800,GD:1582588800,HD:1593475200,ID:1605657600,JD:1618531200,KD:1629072000,"2B":1640736000,"3B":1651708800,LD:1659657600,MD:1667260800,n:1677369600,o:1684454400,p:1689292800,q:1697587200}},Q:{A:{DC:0.151676},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","DC","","",""],E:"QQ Browser",F:{DC:1663718400}},R:{A:{ND:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","ND","","",""],E:"Baidu Browser",F:{ND:1663027200}},S:{A:{OD:0.059587,PD:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","OD","PD","","",""],E:"KaiOS Browser",F:{OD:1527811200,PD:1631664000}}}; +module.exports={A:{A:{J:0,E:0,F:0.0126987,G:0.0634934,A:0,B:0.368262,PC:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","PC","J","E","F","G","A","B","","",""],E:"IE",F:{PC:962323200,J:998870400,E:1161129600,F:1237420800,G:1300060800,A:1346716800,B:1381968000}},B:{A:{"0":0.100804,"1":0.02291,"2":0.036656,"3":0.041238,"4":0.109968,"5":2.53385,"6":2.08939,C:0.009164,K:0.009164,L:0.009164,H:0.009164,M:0,N:0.004582,O:0.013746,P:0,Q:0.009164,R:0.009164,S:0.009164,T:0.009164,U:0.004582,V:0.009164,W:0.041238,X:0.004582,Y:0.004582,Z:0.009164,a:0,b:0.013746,c:0,d:0,e:0,f:0,g:0,h:0,i:0.018328,j:0,k:0,l:0,m:0,n:0,t:0,u:0,v:0.009164,w:0.009164,x:0.073312,y:0.013746,z:0.100804,D:0.009164},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","K","L","H","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","t","u","v","w","x","y","z","0","1","2","3","4","5","6","D","","",""],E:"Edge",F:{"0":1680825600,"1":1683158400,"2":1685664000,"3":1689897600,"4":1692576000,"5":1694649600,"6":1697155200,C:1438128000,K:1447286400,L:1470096000,H:1491868800,M:1508198400,N:1525046400,O:1542067200,P:1579046400,Q:1581033600,R:1586736000,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:1611360000,Y:1614816000,Z:1618358400,a:1622073600,b:1626912000,c:1630627200,d:1632441600,e:1634774400,f:1637539200,g:1641427200,h:1643932800,i:1646265600,j:1649635200,k:1651190400,l:1653955200,m:1655942400,n:1659657600,t:1661990400,u:1664755200,v:1666915200,w:1670198400,x:1673481600,y:1675900800,z:1678665600,D:1698969600},D:{C:"ms",K:"ms",L:"ms",H:"ms",M:"ms",N:"ms",O:"ms"}},C:{A:{"0":0.009164,"1":0.013746,"2":0.013746,"3":0.339068,"4":0.02291,"5":0.096222,"6":1.49831,"7":0,"8":0,"9":0,QC:0,"4B":0,I:0,J:0,E:0,F:0,G:0,A:0,B:0.009164,C:0,K:0,L:0,H:0,M:0,N:0,O:0,o:0,p:0,q:0,r:0,AB:0,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0,KB:0,LB:0,MB:0,NB:0,OB:0,PB:0,QB:0,RB:0,SB:0,TB:0.004582,UB:0,VB:0,WB:0,XB:0.02291,YB:0,ZB:0.013746,aB:0,bB:0.054984,cB:0.004582,dB:0.013746,eB:0.004582,fB:0.018328,gB:0,hB:0,"5B":0.009164,iB:0,"6B":0,jB:0,kB:0.004582,lB:0,mB:0,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,s:0,uB:0,vB:0,wB:0,xB:0,yB:0.036656,P:0,Q:0,R:0,"7B":0,S:0.004582,T:0,U:0,V:0,W:0,X:0.004582,Y:0,Z:0,a:0.004582,b:0,c:0,d:0.004582,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0.050402,m:0.036656,n:0,t:0.004582,u:0,v:0.004582,w:0.009164,x:0.009164,y:0.009164,z:0.009164,D:0.27492,"8B":0,"9B":0,AC:0,RC:0,SC:0,TC:0},B:"moz",C:["QC","4B","SC","TC","I","7","J","E","F","G","A","B","C","K","L","H","M","N","O","8","o","p","q","r","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","5B","iB","6B","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","s","uB","vB","wB","xB","yB","P","Q","R","7B","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","t","u","v","w","x","y","z","0","1","2","3","4","5","6","D","8B","9B","AC","RC"],E:"Firefox",F:{"0":1681171200,"1":1683590400,"2":1686009600,"3":1688428800,"4":1690848000,"5":1693267200,"6":1695686400,"7":1308614400,"8":1357603200,"9":1375747200,QC:1161648000,"4B":1213660800,SC:1246320000,TC:1264032000,I:1300752000,J:1313452800,E:1317081600,F:1317081600,G:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,L:1338854400,H:1342483200,M:1346112000,N:1349740800,O:1353628800,o:1361232000,p:1364860800,q:1368489600,r:1372118400,AB:1379376000,BB:1386633600,CB:1391472000,DB:1395100800,EB:1398729600,FB:1402358400,GB:1405987200,HB:1409616000,IB:1413244800,JB:1417392000,KB:1421107200,LB:1424736000,MB:1428278400,NB:1431475200,OB:1435881600,PB:1439251200,QB:1442880000,RB:1446508800,SB:1450137600,TB:1453852800,UB:1457395200,VB:1461628800,WB:1465257600,XB:1470096000,YB:1474329600,ZB:1479168000,aB:1485216000,bB:1488844800,cB:1492560000,dB:1497312000,eB:1502150400,fB:1506556800,gB:1510617600,hB:1516665600,"5B":1520985600,iB:1525824000,"6B":1529971200,jB:1536105600,kB:1540252800,lB:1544486400,mB:1548720000,nB:1552953600,oB:1558396800,pB:1562630400,qB:1567468800,rB:1571788800,sB:1575331200,tB:1578355200,s:1581379200,uB:1583798400,vB:1586304000,wB:1588636800,xB:1591056000,yB:1593475200,P:1595894400,Q:1598313600,R:1600732800,"7B":1603152000,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392000,d:1635811200,e:1638835200,f:1641859200,g:1644364800,h:1646697600,i:1649116800,j:1651536000,k:1653955200,l:1656374400,m:1658793600,n:1661212800,t:1663632000,u:1666051200,v:1668470400,w:1670889600,x:1673913600,y:1676332800,z:1678752000,D:1698105600,"8B":1700524800,"9B":null,AC:null,RC:null}},D:{A:{"0":0.187862,"1":0.169534,"2":0.522348,"3":0.361978,"4":1.46624,"5":9.96127,"6":9.54889,"7":0,"8":0,"9":0,I:0,J:0,E:0,F:0,G:0,A:0,B:0,C:0,K:0,L:0,H:0,M:0,N:0,O:0,o:0,p:0,q:0,r:0,AB:0,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0.004582,KB:0,LB:0,MB:0,NB:0.013746,OB:0,PB:0,QB:0.004582,RB:0,SB:0,TB:0,UB:0.009164,VB:0,WB:0.009164,XB:0.018328,YB:0.041238,ZB:0.009164,aB:0,bB:0,cB:0.009164,dB:0,eB:0.009164,fB:0.018328,gB:0.009164,hB:0.004582,"5B":0,iB:0.032074,"6B":0.004582,jB:0,kB:0.009164,lB:0,mB:0.013746,nB:0.02291,oB:0.009164,pB:0.032074,qB:0.064148,rB:0.16037,sB:0.02291,tB:0.032074,s:0.041238,uB:0.036656,vB:0.036656,wB:0.109968,xB:0.032074,yB:0.041238,P:0.169534,Q:0.087058,R:0.059566,S:0.073312,T:0.036656,U:0.082476,V:0.087058,W:0.100804,X:0.054984,Y:0.04582,Z:0.054984,a:0.082476,b:0.04582,c:0.142042,d:0.041238,e:0.013746,f:0.018328,g:0.02291,h:0.06873,i:0.036656,j:0.036656,k:0.04582,l:0.036656,m:0.233682,n:0.050402,t:0.036656,u:0.059566,v:0.13746,w:0.178698,x:1.69534,y:0.155788,z:0.265756,D:0.027492,"8B":0.013746,"9B":0,AC:0},B:"webkit",C:["","","","","","","I","7","J","E","F","G","A","B","C","K","L","H","M","N","O","8","o","p","q","r","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","5B","iB","6B","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","s","uB","vB","wB","xB","yB","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","t","u","v","w","x","y","z","0","1","2","3","4","5","6","D","8B","9B","AC"],E:"Chrome",F:{"0":1680566400,"1":1682985600,"2":1685404800,"3":1689724800,"4":1692057600,"5":1694476800,"6":1696896000,"7":1274745600,"8":1332892800,"9":1352246400,I:1264377600,J:1283385600,E:1287619200,F:1291248000,G:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,L:1316131200,H:1316131200,M:1319500800,N:1323734400,O:1328659200,o:1337040000,p:1340668800,q:1343692800,r:1348531200,AB:1357862400,BB:1361404800,CB:1364428800,DB:1369094400,EB:1374105600,FB:1376956800,GB:1384214400,HB:1389657600,IB:1392940800,JB:1397001600,KB:1400544000,LB:1405468800,MB:1409011200,NB:1412640000,OB:1416268800,PB:1421798400,QB:1425513600,RB:1429401600,SB:1432080000,TB:1437523200,UB:1441152000,VB:1444780800,WB:1449014400,XB:1453248000,YB:1456963200,ZB:1460592000,aB:1464134400,bB:1469059200,cB:1472601600,dB:1476230400,eB:1480550400,fB:1485302400,gB:1489017600,hB:1492560000,"5B":1496707200,iB:1500940800,"6B":1504569600,jB:1508198400,kB:1512518400,lB:1516752000,mB:1520294400,nB:1523923200,oB:1527552000,pB:1532390400,qB:1536019200,rB:1539648000,sB:1543968000,tB:1548720000,s:1552348800,uB:1555977600,vB:1559606400,wB:1564444800,xB:1568073600,yB:1571702400,P:1575936000,Q:1580860800,R:1586304000,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272000,a:1621987200,b:1626739200,c:1630368000,d:1632268800,e:1634601600,f:1637020800,g:1641340800,h:1643673600,i:1646092800,j:1648512000,k:1650931200,l:1653350400,m:1655769600,n:1659398400,t:1661817600,u:1664236800,v:1666656000,w:1669680000,x:1673308800,y:1675728000,z:1678147200,D:1698710400,"8B":null,"9B":null,AC:null}},E:{A:{"7":0,I:0,J:0,E:0,F:0,G:0,A:0,B:0,C:0.004582,K:0.02291,L:0.096222,H:0.018328,UC:0,BC:0,VC:0.004582,WC:0,XC:0,YC:0.164952,CC:0,zB:0.009164,"0B":0.027492,DC:0.128296,ZC:0.233682,aC:0.041238,EC:0.032074,FC:0.06873,"1B":0.109968,bC:0.536094,"2B":0.064148,GC:0.16037,HC:0.146624,IC:0.34365,JC:0.146624,KC:0.398634,cC:2.1902,"3B":0.613988,LC:0.041238,MC:0,dC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","UC","BC","I","7","VC","J","WC","E","XC","F","G","YC","A","CC","B","zB","C","0B","K","DC","L","ZC","H","aC","EC","FC","1B","bC","2B","GC","HC","IC","JC","KC","cC","3B","LC","MC","dC",""],E:"Safari",F:{"7":1275868800,UC:1205798400,BC:1226534400,I:1244419200,VC:1311120000,J:1343174400,WC:1382400000,E:1382400000,XC:1410998400,F:1413417600,G:1443657600,YC:1458518400,A:1474329600,CC:1490572800,B:1505779200,zB:1522281600,C:1537142400,"0B":1553472000,K:1568851200,DC:1585008000,L:1600214400,ZC:1619395200,H:1632096000,aC:1635292800,EC:1639353600,FC:1647216000,"1B":1652745600,bC:1658275200,"2B":1662940800,GC:1666569600,HC:1670889600,IC:1674432000,JC:1679875200,KC:1684368000,cC:1690156800,"3B":1695686400,LC:1698192000,MC:null,dC:null}},F:{A:{"8":0,"9":0,G:0,B:0,C:0,H:0,M:0,N:0,O:0,o:0,p:0,q:0,r:0,AB:0,BB:0,CB:0,DB:0.004582,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0,KB:0,LB:0,MB:0,NB:0,OB:0,PB:0,QB:0,RB:0,SB:0,TB:0,UB:0,VB:0.013746,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0.004582,eB:0.004582,fB:0,gB:0,hB:0,iB:0,jB:0,kB:0,lB:0,mB:0,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,s:0,uB:0,vB:0,wB:0,xB:0,yB:0,P:0,Q:0,R:0,"7B":0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0.050402,f:0,g:0.09164,h:0,i:0.009164,j:0.009164,k:0.013746,l:1.61745,m:0.25201,n:0,eC:0,fC:0,gC:0,hC:0,zB:0,NC:0,iC:0,"0B":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","G","eC","fC","gC","hC","B","zB","NC","iC","C","0B","H","M","N","O","8","o","p","q","r","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","s","uB","vB","wB","xB","yB","P","Q","R","7B","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","","",""],E:"Opera",F:{"8":1390867200,"9":1409616000,G:1150761600,eC:1223424000,fC:1251763200,gC:1267488000,hC:1277942400,B:1292457600,zB:1302566400,NC:1309219200,iC:1323129600,C:1323129600,"0B":1352073600,H:1372723200,M:1377561600,N:1381104000,O:1386288000,o:1393891200,p:1399334400,q:1401753600,r:1405987200,AB:1413331200,BB:1417132800,CB:1422316800,DB:1425945600,EB:1430179200,FB:1433808000,GB:1438646400,HB:1442448000,IB:1445904000,JB:1449100800,KB:1454371200,LB:1457308800,MB:1462320000,NB:1465344000,OB:1470096000,PB:1474329600,QB:1477267200,RB:1481587200,SB:1486425600,TB:1490054400,UB:1494374400,VB:1498003200,WB:1502236800,XB:1506470400,YB:1510099200,ZB:1515024000,aB:1517961600,bB:1521676800,cB:1525910400,dB:1530144000,eB:1534982400,fB:1537833600,gB:1543363200,hB:1548201600,iB:1554768000,jB:1561593600,kB:1566259200,lB:1570406400,mB:1573689600,nB:1578441600,oB:1583971200,pB:1587513600,qB:1592956800,rB:1595894400,sB:1600128000,tB:1603238400,s:1613520000,uB:1612224000,vB:1616544000,wB:1619568000,xB:1623715200,yB:1627948800,P:1631577600,Q:1633392000,R:1635984000,"7B":1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152000,Z:1660780800,a:1663113600,b:1668816000,c:1668643200,d:1671062400,e:1675209600,f:1677024000,g:1679529600,h:1681948800,i:1684195200,j:1687219200,k:1690329600,l:1692748800,m:1696204800,n:1699920000},D:{G:"o",B:"o",C:"o",eC:"o",fC:"o",gC:"o",hC:"o",zB:"o",NC:"o",iC:"o","0B":"o"}},G:{A:{F:0,BC:0,jC:0,OC:0.0027735,kC:0.00138675,lC:0.00416026,mC:0.00970726,nC:0.00138675,oC:0.00970726,pC:0.033282,qC:0.00138675,rC:0.0485363,sC:0.0457628,tC:0.016641,uC:0.0124808,vC:0.220494,wC:0.00693376,xC:0.0374423,yC:0.0138675,zC:0.0443761,"0C":0.122034,"1C":0.196919,"2C":0.0776581,EC:0.0887521,FC:0.0984594,"1B":0.140062,"3C":0.96934,"2B":0.357782,GC:0.685055,HC:0.334207,IC:0.619878,JC:0.137288,KC:0.355009,"4C":6.64254,"3B":2.36719,LC:0.142835,MC:0.00416026},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","BC","jC","OC","kC","lC","mC","F","nC","oC","pC","qC","rC","sC","tC","uC","vC","wC","xC","yC","zC","0C","1C","2C","EC","FC","1B","3C","2B","GC","HC","IC","JC","KC","4C","3B","LC","MC","",""],E:"Safari on iOS",F:{BC:1270252800,jC:1283904000,OC:1299628800,kC:1331078400,lC:1359331200,mC:1394409600,F:1410912000,nC:1413763200,oC:1442361600,pC:1458518400,qC:1473724800,rC:1490572800,sC:1505779200,tC:1522281600,uC:1537142400,vC:1553472000,wC:1568851200,xC:1572220800,yC:1580169600,zC:1585008000,"0C":1600214400,"1C":1619395200,"2C":1632096000,EC:1639353600,FC:1647216000,"1B":1652659200,"3C":1658275200,"2B":1662940800,GC:1666569600,HC:1670889600,IC:1674432000,JC:1679875200,KC:1684368000,"4C":1690156800,"3B":1694995200,LC:1698192000,MC:null}},H:{A:{"5C":0.06},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","5C","","",""],E:"Opera Mini",F:{"5C":1426464000}},I:{A:{"4B":0,I:0.000123508,D:0.61445,"6C":0,"7C":0.000185261,"8C":0,"9C":0.000123508,OC:0.000432277,AD:0,BD:0.00185261},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","6C","7C","8C","4B","I","9C","OC","AD","BD","D","","",""],E:"Android Browser",F:{"6C":1256515200,"7C":1274313600,"8C":1291593600,"4B":1298332800,I:1318896000,"9C":1341792000,OC:1374624000,AD:1386547200,BD:1401667200,D:1698710400}},J:{A:{E:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","E","A","","",""],E:"Blackberry Browser",F:{E:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,s:1.00715,zB:0,NC:0,"0B":0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","zB","NC","C","0B","s","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,zB:1314835200,NC:1318291200,C:1330300800,"0B":1349740800,s:1673827200},D:{s:"webkit"}},L:{A:{D:35.8038},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Chrome for Android",F:{D:1698710400}},M:{A:{D:0.276267},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Firefox for Android",F:{D:1698105600}},N:{A:{A:0,B:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{"1B":0.785465},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1B","","",""],E:"UC Browser for Android",F:{"1B":1687132800},D:{"1B":"webkit"}},P:{A:{I:0.0977276,o:0.0542931,p:0.108586,q:1.60708,r:0.347476,CD:0,DD:0,ED:0.0325759,FD:0,GD:0,CC:0,HD:0.0108586,ID:0,JD:0.0108586,KD:0,LD:0,"2B":0.0217172,"3B":0.0325759,MD:0.0217172,ND:0.0434345},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","CD","DD","ED","FD","GD","CC","HD","ID","JD","KD","LD","2B","3B","MD","ND","o","p","q","r","","",""],E:"Samsung Internet",F:{I:1461024000,CD:1481846400,DD:1509408000,ED:1528329600,FD:1546128000,GD:1554163200,CC:1567900800,HD:1582588800,ID:1593475200,JD:1605657600,KD:1618531200,LD:1629072000,"2B":1640736000,"3B":1651708800,MD:1659657600,ND:1667260800,o:1677369600,p:1684454400,q:1689292800,r:1697587200}},Q:{A:{DC:0.151676},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","DC","","",""],E:"QQ Browser",F:{DC:1663718400}},R:{A:{OD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","OD","","",""],E:"Baidu Browser",F:{OD:1663027200}},S:{A:{PD:0.059587,QD:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","PD","QD","","",""],E:"KaiOS Browser",F:{PD:1527811200,QD:1631664000}}}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/browserVersions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/browserVersions.js index 8bdc255845d0f0..b01d963e06e114 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/browserVersions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/browserVersions.js @@ -1 +1 @@ -module.exports={"0":"112","1":"113","2":"114","3":"115","4":"116","5":"117","6":"118","7":"5","8":"19","9":"24",A:"10",B:"11",C:"12",D:"119",E:"7",F:"8",G:"9",H:"15",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"96",g:"97",h:"98",i:"99",j:"100",k:"101",l:"102",m:"103",n:"20",o:"21",p:"22",q:"23",r:"73",s:"104",t:"105",u:"106",v:"107",w:"108",x:"109",y:"110",z:"111",AB:"25",BB:"26",CB:"27",DB:"28",EB:"29",FB:"30",GB:"31",HB:"32",IB:"33",JB:"34",KB:"35",LB:"36",MB:"37",NB:"38",OB:"39",PB:"40",QB:"41",RB:"42",SB:"43",TB:"44",UB:"45",VB:"46",WB:"47",XB:"48",YB:"49",ZB:"50",aB:"51",bB:"52",cB:"53",dB:"54",eB:"55",fB:"56",gB:"57",hB:"58",iB:"60",jB:"62",kB:"63",lB:"64",mB:"65",nB:"66",oB:"67",pB:"68",qB:"69",rB:"70",sB:"71",tB:"72",uB:"74",vB:"75",wB:"76",xB:"77",yB:"78",zB:"11.1","0B":"12.1","1B":"15.5","2B":"16.0","3B":"17.0","4B":"3","5B":"59","6B":"61","7B":"82","8B":"120","9B":"121",AC:"122",BC:"3.2",CC:"10.1",DC:"13.1",EC:"15.2-15.3",FC:"15.4",GC:"16.1",HC:"16.2",IC:"16.3",JC:"16.4",KC:"16.5",LC:"17.1",MC:"17.2",NC:"11.5",OC:"4.2-4.3",PC:"5.5",QC:"2",RC:"3.5",SC:"3.6",TC:"3.1",UC:"5.1",VC:"6.1",WC:"7.1",XC:"9.1",YC:"14.1",ZC:"15.1",aC:"15.6",bC:"16.6",cC:"TP",dC:"9.5-9.6",eC:"10.0-10.1",fC:"10.5",gC:"10.6",hC:"11.6",iC:"4.0-4.1",jC:"5.0-5.1",kC:"6.0-6.1",lC:"7.0-7.1",mC:"8.1-8.4",nC:"9.0-9.2",oC:"9.3",pC:"10.0-10.2",qC:"10.3",rC:"11.0-11.2",sC:"11.3-11.4",tC:"12.0-12.1",uC:"12.2-12.5",vC:"13.0-13.1",wC:"13.2",xC:"13.3",yC:"13.4-13.7",zC:"14.0-14.4","0C":"14.5-14.8","1C":"15.0-15.1","2C":"15.6-15.7","3C":"16.6-16.7","4C":"all","5C":"2.1","6C":"2.2","7C":"2.3","8C":"4.1","9C":"4.4",AD:"4.4.3-4.4.4",BD:"5.0-5.4",CD:"6.2-6.4",DD:"7.2-7.4",ED:"8.2",FD:"9.2",GD:"11.1-11.2",HD:"12.0",ID:"13.0",JD:"14.0",KD:"15.0",LD:"18.0",MD:"19.0",ND:"13.18",OD:"2.5",PD:"3.0-3.1"}; +module.exports={"0":"112","1":"113","2":"114","3":"115","4":"116","5":"117","6":"118","7":"5","8":"19","9":"24",A:"10",B:"11",C:"12",D:"119",E:"7",F:"8",G:"9",H:"15",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"96",g:"97",h:"98",i:"99",j:"100",k:"101",l:"102",m:"103",n:"104",o:"20",p:"21",q:"22",r:"23",s:"73",t:"105",u:"106",v:"107",w:"108",x:"109",y:"110",z:"111",AB:"25",BB:"26",CB:"27",DB:"28",EB:"29",FB:"30",GB:"31",HB:"32",IB:"33",JB:"34",KB:"35",LB:"36",MB:"37",NB:"38",OB:"39",PB:"40",QB:"41",RB:"42",SB:"43",TB:"44",UB:"45",VB:"46",WB:"47",XB:"48",YB:"49",ZB:"50",aB:"51",bB:"52",cB:"53",dB:"54",eB:"55",fB:"56",gB:"57",hB:"58",iB:"60",jB:"62",kB:"63",lB:"64",mB:"65",nB:"66",oB:"67",pB:"68",qB:"69",rB:"70",sB:"71",tB:"72",uB:"74",vB:"75",wB:"76",xB:"77",yB:"78",zB:"11.1","0B":"12.1","1B":"15.5","2B":"16.0","3B":"17.0","4B":"3","5B":"59","6B":"61","7B":"82","8B":"120","9B":"121",AC:"122",BC:"3.2",CC:"10.1",DC:"13.1",EC:"15.2-15.3",FC:"15.4",GC:"16.1",HC:"16.2",IC:"16.3",JC:"16.4",KC:"16.5",LC:"17.1",MC:"17.2",NC:"11.5",OC:"4.2-4.3",PC:"5.5",QC:"2",RC:"123",SC:"3.5",TC:"3.6",UC:"3.1",VC:"5.1",WC:"6.1",XC:"7.1",YC:"9.1",ZC:"14.1",aC:"15.1",bC:"15.6",cC:"16.6",dC:"TP",eC:"9.5-9.6",fC:"10.0-10.1",gC:"10.5",hC:"10.6",iC:"11.6",jC:"4.0-4.1",kC:"5.0-5.1",lC:"6.0-6.1",mC:"7.0-7.1",nC:"8.1-8.4",oC:"9.0-9.2",pC:"9.3",qC:"10.0-10.2",rC:"10.3",sC:"11.0-11.2",tC:"11.3-11.4",uC:"12.0-12.1",vC:"12.2-12.5",wC:"13.0-13.1",xC:"13.2",yC:"13.3",zC:"13.4-13.7","0C":"14.0-14.4","1C":"14.5-14.8","2C":"15.0-15.1","3C":"15.6-15.7","4C":"16.6-16.7","5C":"all","6C":"2.1","7C":"2.2","8C":"2.3","9C":"4.1",AD:"4.4",BD:"4.4.3-4.4.4",CD:"5.0-5.4",DD:"6.2-6.4",ED:"7.2-7.4",FD:"8.2",GD:"9.2",HD:"11.1-11.2",ID:"12.0",JD:"13.0",KD:"14.0",LD:"15.0",MD:"18.0",ND:"19.0",OD:"13.18",PD:"2.5",QD:"3.0-3.1"}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/aac.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/aac.js index a76bff8d56605d..1c02179b33dd94 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/aac.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/aac.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC","132":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G","16":"A B"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"1":"A","2":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"132":"OD PD"}},B:6,C:"AAC audio file format",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC","132":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G","16":"A B"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"1":"A","2":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"132":"PD QD"}},B:6,C:"AAC audio file format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/abortcontroller.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/abortcontroller.js index c5f0c9a113020a..90bee2aa5365a4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/abortcontroller.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/abortcontroller.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB RC SC"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC","130":"C zB"},F:{"1":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"AbortController & AbortSignal",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB SC TC"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC","130":"C zB"},F:{"1":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"AbortController & AbortSignal",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ac3-ec3.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ac3-ec3.js index 751613a2e42ec4..aedda573ecd294 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ac3-ec3.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ac3-ec3.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC","132":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","132":"A"},K:{"2":"A B C r zB NC","132":"0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"AC-3 (Dolby Digital) and EC-3 (Dolby Digital Plus) codecs",D:false}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC","132":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E","132":"A"},K:{"2":"A B C s zB NC","132":"0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"AC-3 (Dolby Digital) and EC-3 (Dolby Digital Plus) codecs",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/accelerometer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/accelerometer.js index 8b17820dba7e4b..0b829419f670cf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/accelerometer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/accelerometer.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:4,C:"Accelerometer",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:4,C:"Accelerometer",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/addeventlistener.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/addeventlistener.js index 22a78df41ebfeb..90a63839c17c51 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/addeventlistener.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/addeventlistener.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","130":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","257":"7 QC 4B I J RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"EventTarget.addEventListener()",D:true}; +module.exports={A:{A:{"1":"G A B","130":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","257":"7 QC 4B I J SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"EventTarget.addEventListener()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/alternate-stylesheet.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/alternate-stylesheet.js index fddb33dcd662f1..c8f19059d914cc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/alternate-stylesheet.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/alternate-stylesheet.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"G B C dC eC fC gC zB NC hC 0B","16":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"16":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"2":"r","16":"A B C zB NC 0B"},L:{"16":"D"},M:{"16":"D"},N:{"16":"A B"},O:{"16":"1B"},P:{"16":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"16":"ND"},S:{"1":"OD PD"}},B:1,C:"Alternate stylesheet",D:false}; +module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"G B C eC fC gC hC zB NC iC 0B","16":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"16":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"2":"s","16":"A B C zB NC 0B"},L:{"16":"D"},M:{"16":"D"},N:{"16":"A B"},O:{"16":"1B"},P:{"16":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"16":"OD"},S:{"1":"PD QD"}},B:1,C:"Alternate stylesheet",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ambient-light.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ambient-light.js index 125097bc5d9f85..4b266f0a7e2be7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ambient-light.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ambient-light.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K","132":"L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC","132":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","194":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","322":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB dC eC fC gC zB NC hC 0B","322":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"132":"OD PD"}},B:4,C:"Ambient Light Sensor",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K","132":"L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC","132":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","194":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","322":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB eC fC gC hC zB NC iC 0B","322":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"132":"PD QD"}},B:4,C:"Ambient Light Sensor",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/apng.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/apng.js index 73f76c961f2a26..161bd8647eaf1d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/apng.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/apng.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},E:{"1":"F G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC WC"},F:{"1":"B C VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"8 9 G H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Animated PNG (APNG)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},E:{"1":"F G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC XC"},F:{"1":"B C VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"8 9 G H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Animated PNG (APNG)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find-index.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find-index.js index 9ec8e308ebe1f0..623f38b5e7e9f3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find-index.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find-index.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q RC SC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB dC eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","16":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Array.prototype.findIndex",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r SC TC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB eC fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","16":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Array.prototype.findIndex",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find.js index df18594384a168..75e04f5eeabd76 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-find.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"C K L"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q RC SC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB dC eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","16":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Array.prototype.find",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"C K L"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r SC TC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB eC fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","16":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Array.prototype.find",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-flat.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-flat.js index f99848ef387123..5f2f328af6fc06 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-flat.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-flat.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B RC SC"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"C K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC zB"},F:{"1":"fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB dC eC fC gC zB NC hC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"flat & flatMap array methods",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B SC TC"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"C K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC zB"},F:{"1":"fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB eC fC gC hC zB NC iC 0B"},G:{"1":"uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"flat & flatMap array methods",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-includes.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-includes.js index 1a6ef6c41fded4..5fbf16186b8534 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-includes.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/array-includes.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB RC SC"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Array.prototype.includes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SC TC"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Array.prototype.includes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/arrow-functions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/arrow-functions.js index c0b02dc7301346..1ceb0ac6ec9212 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/arrow-functions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/arrow-functions.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Arrow functions",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Arrow functions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/asmjs.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/asmjs.js index 782ca79dba519f..b7f7594d3baf58 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/asmjs.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/asmjs.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","322":"C"},C:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB","132":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","132":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"r"},L:{"132":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"132":"1B"},P:{"2":"I","132":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"132":"DC"},R:{"132":"ND"},S:{"1":"OD PD"}},B:6,C:"asm.js",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","322":"C"},C:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB","132":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","132":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"s"},L:{"132":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"132":"1B"},P:{"2":"I","132":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"132":"DC"},R:{"132":"OD"},S:{"1":"PD QD"}},B:6,C:"asm.js",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-clipboard.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-clipboard.js index df303e64763d0d..16afe4ddf12d4d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-clipboard.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-clipboard.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB RC SC","132":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","66":"hB 5B iB 6B"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B"},F:{"1":"YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC","260":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","260":"D"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I BD CD DD ED","260":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD","132":"PD"}},B:5,C:"Asynchronous Clipboard API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB SC TC","132":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","66":"hB 5B iB 6B"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B"},F:{"1":"YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC","260":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","260":"D"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I CD DD ED FD","260":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD","132":"QD"}},B:5,C:"Asynchronous Clipboard API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-functions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-functions.js index cf243486abca15..91d1563c16dd57 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-functions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/async-functions.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K","194":"L"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB RC SC"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC","258":"CC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC","258":"qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"Async functions",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K","194":"L"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB SC TC"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC","258":"CC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC","258":"rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"Async functions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/atob-btoa.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/atob-btoa.js index acc97574925956..f33ff2a3d6f88e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/atob-btoa.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/atob-btoa.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","2":"G dC eC","16":"fC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","16":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Base64 encoding and decoding",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","2":"G eC fC","16":"gC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","16":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Base64 encoding and decoding",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio-api.js index 6a33075219b00e..cf6c59af78f55d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio-api.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q RC SC"},D:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","33":"8 9 L H M N O n o p q AB BB CB DB EB FB GB HB IB"},E:{"1":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","33":"J E F G A B C K L VC WC XC CC zB 0B DC"},F:{"1":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 H M N O n o"},G:{"1":"0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Web Audio API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r SC TC"},D:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","33":"8 9 L H M N O o p q r AB BB CB DB EB FB GB HB IB"},E:{"1":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","33":"J E F G A B C K L WC XC YC CC zB 0B DC"},F:{"1":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 H M N O o p"},G:{"1":"1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Web Audio API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio.js index 6509679d93d994..fa4fcaf60afa54 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audio.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","132":"7 8 I J E F G A B C K L H M N O RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G","4":"dC eC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","2":"5C 6C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Audio element",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","132":"7 8 I J E F G A B C K L H M N O SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G","4":"eC fC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","2":"6C 7C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Audio element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audiotracks.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audiotracks.js index c1fe3c8d42bd3f..96a1dcff4ad91b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audiotracks.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/audiotracks.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"C K L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC","194":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB","322":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB dC eC fC gC zB NC hC 0B","322":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","322":"r"},L:{"322":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"322":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"322":"DC"},R:{"322":"ND"},S:{"194":"OD PD"}},B:1,C:"Audio Tracks",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"C K L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC","194":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB","322":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB eC fC gC hC zB NC iC 0B","322":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","322":"s"},L:{"322":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"322":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"322":"DC"},R:{"322":"OD"},S:{"194":"PD QD"}},B:1,C:"Audio Tracks",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/autofocus.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/autofocus.js index c995fdaa0ecc78..543a4b1ab87791 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/autofocus.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/autofocus.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"Autofocus attribute",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"Autofocus attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/auxclick.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/auxclick.js index 58e31dca73b2ff..b2fd553ae345cc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/auxclick.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/auxclick.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC","129":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"Auxclick",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC","129":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"Auxclick",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/av1.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/av1.js index a714cebe937348..4755d0b00999bf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/av1.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/av1.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"4 5 6 C K L H M N D","194":"0 1 2 3 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB RC SC","66":"eB fB gB hB 5B iB 6B jB kB lB","260":"mB","516":"nB"},D:{"1":"0 1 2 3 4 5 6 rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB","66":"oB pB qB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC","1028":"3B LC MC cC"},F:{"1":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C","1028":"3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:6,C:"AV1 video format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"4 5 6 C K L H M N D","194":"0 1 2 3 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB SC TC","66":"eB fB gB hB 5B iB 6B jB kB lB","260":"mB","516":"nB"},D:{"1":"0 1 2 3 4 5 6 rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB","66":"oB pB qB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC","1028":"3B LC MC dC"},F:{"1":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C","1028":"3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:6,C:"AV1 video format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/avif.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/avif.js index b40c13867140d9..df978d711b708e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/avif.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/avif.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","4162":"2 3 4 5"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB RC SC","194":"xB yB P Q R 7B S T U V W X Y Z a b","257":"c d e f g h i j k l m s t u v w x y","2049":"0 z"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B","1796":"GC HC IC"},F:{"1":"sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C","257":"JC KC 3C 3B LC MC","1281":"2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:6,C:"AVIF image format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","4162":"2 3 4 5"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB SC TC","194":"xB yB P Q R 7B S T U V W X Y Z a b","257":"c d e f g h i j k l m n t u v w x y","2049":"0 z"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B","1796":"GC HC IC"},F:{"1":"sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C","257":"JC KC 4C 3B LC MC","1281":"2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:6,C:"AVIF image format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-attachment.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-attachment.js index 4f3e1fbc59d106..a151cb6a905f65 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-attachment.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-attachment.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C UC VC WC XC CC zB 0B FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","132":"I K TC BC DC","2050":"L H YC ZC EC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","132":"G dC eC"},G:{"2":"BC iC OC","772":"F jC kC lC mC nC oC pC qC rC sC tC uC","2050":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 9C AD","132":"8C OC"},J:{"260":"E A"},K:{"1":"B C r zB NC 0B","132":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"2":"I","1028":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS background-attachment",D:true}; +module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C VC WC XC YC CC zB 0B FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","132":"I K UC BC DC","2050":"L H ZC aC EC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","132":"G eC fC"},G:{"2":"BC jC OC","772":"F kC lC mC nC oC pC qC rC sC tC uC vC","2050":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C AD BD","132":"9C OC"},J:{"260":"E A"},K:{"1":"B C s zB NC 0B","132":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"2":"I","1028":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS background-attachment",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-clip-text.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-clip-text.js index 598d06335afb89..6154d66bdad893 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-clip-text.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-clip-text.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"H M N O","33":"0 1 2 3 4 5 6 C K L P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB RC SC"},D:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC","33":"7 I J E F G A B C K UC VC WC XC CC zB 0B DC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC","33":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"4C"},I:{"16":"4B 5C 6C 7C","33":"I D 8C OC 9C AD"},J:{"33":"E A"},K:{"16":"A B C zB NC 0B","33":"r"},L:{"33":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"33":"DC"},R:{"33":"ND"},S:{"1":"OD PD"}},B:7,C:"Background-clip: text",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"H M N O","33":"C K L","164":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC TC"},D:{"132":"8B 9B AC","164":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},E:{"16":"UC BC","132":"1B bC 2B GC HC IC JC KC cC 3B LC MC dC","388":"L H ZC aC EC FC","420":"7 I J E F G A B C K VC WC XC YC CC zB 0B DC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"16":"BC jC OC kC","132":"1B 3C 2B GC HC IC JC KC 4C 3B LC MC","388":"0C 1C 2C EC FC","420":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"5C"},I:{"16":"4B 6C 7C 8C","164":"I D 9C OC AD BD"},J:{"164":"E A"},K:{"16":"A B C zB NC 0B","164":"s"},L:{"164":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"164":"DC"},R:{"164":"OD"},S:{"1":"PD QD"}},B:7,C:"Background-clip: text",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-img-opts.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-img-opts.js index 913c857c2d68e1..1d8030e5a2b28a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-img-opts.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-img-opts.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC","36":"SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","516":"7 I J E F G A B C K L"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","772":"7 I J TC BC UC VC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC","36":"eC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","4":"BC iC OC kC","516":"jC"},H:{"132":"4C"},I:{"1":"D 9C AD","36":"5C","516":"4B I 8C OC","548":"6C 7C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 Background-image options",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC","36":"TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","516":"7 I J E F G A B C K L"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","772":"7 I J UC BC VC WC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC","36":"fC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","4":"BC jC OC lC","516":"kC"},H:{"132":"5C"},I:{"1":"D AD BD","36":"6C","516":"4B I 9C OC","548":"7C 8C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 Background-image options",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-position-x-y.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-position-x-y.js index b1a7b6628f6483..6e0cf9a393049f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-position-x-y.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-position-x-y.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:7,C:"background-position-x & background-position-y",D:true}; +module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:7,C:"background-position-x & background-position-y",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-repeat-round-space.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-repeat-round-space.js index 19888709c3a953..d25424b1ac9654 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-repeat-round-space.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-repeat-round-space.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F PC","132":"G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB RC SC"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC"},F:{"1":"8 9 B C n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G H M N O dC eC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"CSS background-repeat round and space",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F PC","132":"G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC TC"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC"},F:{"1":"8 9 B C o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G H M N O eC fC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"CSS background-repeat round and space",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-sync.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-sync.js index 1100ee9db7753d..e40693a5c46cab 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-sync.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/background-sync.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D RC SC","16":"8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Background Sync API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B SC TC","16":"9B AC RC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Background Sync API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/battery-status.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/battery-status.js index 50c87e97f32fee..8f7531d1d3130f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/battery-status.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/battery-status.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"SB TB UB VB WB XB YB ZB aB","2":"0 1 2 3 4 5 6 7 QC 4B I J E F G bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","132":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","164":"A B C K L H"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB","66":"MB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD","2":"PD"}},B:4,C:"Battery Status API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"SB TB UB VB WB XB YB ZB aB","2":"0 1 2 3 4 5 6 7 QC 4B I J E F G bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","132":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","164":"A B C K L H"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB","66":"MB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD","2":"QD"}},B:4,C:"Battery Status API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beacon.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beacon.js index ff336660ea8881..80edfcdee837b6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beacon.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beacon.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB RC SC"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Beacon API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB SC TC"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Beacon API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beforeafterprint.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beforeafterprint.js index 7e92cd13a489b5..a6fc587891160c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beforeafterprint.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/beforeafterprint.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB 0B"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB dC eC fC gC zB NC hC 0B"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"2":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","16":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Printing Events",D:true}; +module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB 0B"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB eC fC gC hC zB NC iC 0B"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"2":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","16":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Printing Events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bigint.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bigint.js index b91e32c51a666a..88c9cf2bba9459 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bigint.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bigint.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB RC SC","194":"mB nB oB"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B DC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"BigInt",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB SC TC","194":"mB nB oB"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},E:{"1":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B DC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B"},G:{"1":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"BigInt",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/blobbuilder.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/blobbuilder.js index 8655ed1e4f089c..687f3b4ca1cc50 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/blobbuilder.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/blobbuilder.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC","36":"J E F G A B C"},D:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E","36":"8 F G A B C K L H M N O"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B C dC eC fC gC zB NC hC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC"},H:{"2":"4C"},I:{"1":"D","2":"5C 6C 7C","36":"4B I 8C OC 9C AD"},J:{"1":"A","2":"E"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Blob constructing",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC","36":"J E F G A B C"},D:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E","36":"8 F G A B C K L H M N O"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B C eC fC gC hC zB NC iC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC"},H:{"2":"5C"},I:{"1":"D","2":"6C 7C 8C","36":"4B I 9C OC AD BD"},J:{"1":"A","2":"E"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Blob constructing",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bloburls.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bloburls.js index 259cca61501c24..156651e09fe3ae 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bloburls.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/bloburls.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E","33":"8 F G A B C K L H M N O n o p"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","33":"J"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B 5C 6C 7C","33":"I 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Blob URLs",D:true}; +module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E","33":"8 F G A B C K L H M N O o p q"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","33":"J"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B 6C 7C 8C","33":"I 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Blob URLs",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-image.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-image.js index 684d627ea218bc..681b51a5e68db7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-image.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-image.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","260":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","804":"7 I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","260":"aB bB cB dB eB","388":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","1412":"8 9 H M N O n o p q AB BB CB DB EB","1956":"7 I J E F G A B C K L"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","129":"A B C K L H XC CC zB 0B DC YC ZC EC","1412":"J E F G VC WC","1956":"7 I TC BC UC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G dC eC","260":"NB OB PB QB RB","388":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB","1796":"fC gC","1828":"B C zB NC hC 0B"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","129":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC","1412":"F kC lC mC nC","1956":"BC iC OC jC"},H:{"1828":"4C"},I:{"1":"D","388":"9C AD","1956":"4B I 5C 6C 7C 8C OC"},J:{"1412":"A","1924":"E"},K:{"1":"r","2":"A","1828":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","260":"BD CD","388":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","260":"OD"}},B:4,C:"CSS3 Border images",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","260":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","804":"7 I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","260":"aB bB cB dB eB","388":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","1412":"8 9 H M N O o p q r AB BB CB DB EB","1956":"7 I J E F G A B C K L"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","129":"A B C K L H YC CC zB 0B DC ZC aC EC","1412":"J E F G WC XC","1956":"7 I UC BC VC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G eC fC","260":"NB OB PB QB RB","388":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB","1796":"gC hC","1828":"B C zB NC iC 0B"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","129":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC","1412":"F lC mC nC oC","1956":"BC jC OC kC"},H:{"1828":"5C"},I:{"1":"D","388":"AD BD","1956":"4B I 6C 7C 8C 9C OC"},J:{"1412":"A","1924":"E"},K:{"1":"s","2":"A","1828":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","260":"CD DD","388":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","260":"PD"}},B:4,C:"CSS3 Border images",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-radius.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-radius.js index 8b904730b1ba80..fabb3fcdd7fcf1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-radius.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/border-radius.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","257":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","289":"4B RC SC","292":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"I"},E:{"1":"7 E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"I TC BC","129":"J UC VC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"BC"},H:{"2":"4C"},I:{"1":"4B I D 6C 7C 8C OC 9C AD","33":"5C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","257":"OD"}},B:4,C:"CSS3 Border-radius (rounded corners)",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","257":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","289":"4B SC TC","292":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"I"},E:{"1":"7 E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"I UC BC","129":"J VC WC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"BC"},H:{"2":"5C"},I:{"1":"4B I D 7C 8C 9C OC AD BD","33":"6C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","257":"PD"}},B:4,C:"CSS3 Border-radius (rounded corners)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/broadcastchannel.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/broadcastchannel.js index 1871a66e30f016..0a46e63f9b1750 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/broadcastchannel.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/broadcastchannel.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB RC SC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB dC eC fC gC zB NC hC 0B"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"BroadcastChannel",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB SC TC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB eC fC gC hC zB NC iC 0B"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"BroadcastChannel",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/brotli.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/brotli.js index 5f04b3235dc8b5..0b91feaed0e158 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/brotli.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/brotli.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB RC SC"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","194":"YB","257":"ZB"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","513":"B C zB 0B"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B","194":"LB MB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Brotli Accept-Encoding/Content-Encoding",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB SC TC"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","194":"YB","257":"ZB"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","513":"B C zB 0B"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B","194":"LB MB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Brotli Accept-Encoding/Content-Encoding",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/calc.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/calc.js index a5676dcb70b82a..bdbca2c454bf9a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/calc.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/calc.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","260":"G","516":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","33":"7 I J E F G A B C K L H"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O","33":"8 9 n o p q AB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","33":"J"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"kC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","132":"9C AD"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"calc() as CSS unit value",D:true}; +module.exports={A:{A:{"2":"J E F PC","260":"G","516":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","33":"7 I J E F G A B C K L H"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O","33":"8 9 o p q r AB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","33":"J"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"lC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","132":"AD BD"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"calc() as CSS unit value",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-blending.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-blending.js index 48955c2c6d130f..31ffd0ebba4d27 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-blending.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-blending.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O RC SC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC"},F:{"1":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H M dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Canvas blend modes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O SC TC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC"},F:{"1":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H M eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Canvas blend modes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-text.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-text.js index 0e409eee8501da..37d698f8c6257e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-text.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas-text.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","8":"G dC eC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","8":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Text API for Canvas",D:true}; +module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","8":"G eC fC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","8":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Text API for Canvas",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas.js index e56c87bd91f0cf..d1e051bdb747b4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/canvas.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","132":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","132":"TC BC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"260":"4C"},I:{"1":"4B I D 8C OC 9C AD","132":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Canvas (basic support)",D:true}; +module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","132":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","132":"UC BC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"260":"5C"},I:{"1":"4B I D 9C OC AD BD","132":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Canvas (basic support)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ch-unit.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ch-unit.js index cc50e12ee176c7..1c3f19acb3c75c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ch-unit.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ch-unit.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"ch (character) unit",D:true}; +module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"ch (character) unit",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/chacha20-poly1305.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/chacha20-poly1305.js index ddd3e9fe3c3ced..18ae49e38d1b0d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/chacha20-poly1305.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/chacha20-poly1305.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB","129":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C","16":"AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"ChaCha20-Poly1305 cipher suites for TLS",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB","129":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD","16":"BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"ChaCha20-Poly1305 cipher suites for TLS",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/channel-messaging.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/channel-messaging.js index 1e19a34a16c823..94f98a8ea8e983 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/channel-messaging.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/channel-messaging.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB RC SC","194":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","2":"G dC eC","16":"fC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Channel messaging",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB SC TC","194":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","2":"G eC fC","16":"gC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Channel messaging",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/childnode-remove.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/childnode-remove.js index 4fc44a8c0a8d8e..dbc6dc3a806722 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/childnode-remove.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/childnode-remove.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"C"},C:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o p RC SC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o p q"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","16":"J"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"ChildNode.remove()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"C"},C:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p q SC TC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p q r"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","16":"J"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"ChildNode.remove()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/classlist.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/classlist.js index 815a2d7a4e0e17..df8e3f12dac0f8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/classlist.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/classlist.js @@ -1 +1 @@ -module.exports={A:{A:{"8":"J E F G PC","1924":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"QC 4B RC","516":"9 AB","772":"7 8 I J E F G A B C K L H M N O n o p q SC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 I J E","516":"9 AB BB CB","772":"q","900":"8 F G A B C K L H M N O n o p"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I TC BC","900":"J UC VC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","8":"G B dC eC fC gC zB","900":"C NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC","900":"jC kC"},H:{"900":"4C"},I:{"1":"D 9C AD","8":"5C 6C 7C","900":"4B I 8C OC"},J:{"1":"A","900":"E"},K:{"1":"r","8":"A B","900":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"900":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"classList (DOMTokenList)",D:true}; +module.exports={A:{A:{"8":"J E F G PC","1924":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"QC 4B SC","516":"9 AB","772":"7 8 I J E F G A B C K L H M N O o p q r TC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"7 I J E","516":"9 AB BB CB","772":"r","900":"8 F G A B C K L H M N O o p q"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I UC BC","900":"J VC WC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","8":"G B eC fC gC hC zB","900":"C NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC","900":"kC lC"},H:{"900":"5C"},I:{"1":"D AD BD","8":"6C 7C 8C","900":"4B I 9C OC"},J:{"1":"A","900":"E"},K:{"1":"s","8":"A B","900":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"900":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"classList (DOMTokenList)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js index 5d6d0f9bf0df23..c07355c070ad14 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:6,C:"Client Hints: DPR, Width, Viewport-Width",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:6,C:"Client Hints: DPR, Width, Viewport-Width",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/clipboard.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/clipboard.js index c7181fea7de9c2..773f1940b6a3fc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/clipboard.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/clipboard.js @@ -1 +1 @@ -module.exports={A:{A:{"2436":"J E F G A B PC"},B:{"260":"N O","2436":"C K L H M","8196":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC","772":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","4100":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 I J E F G A B C","2564":"8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","8196":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","10244":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB"},E:{"1":"C K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC","2308":"A B CC zB","2820":"7 I J E F G UC VC WC XC"},F:{"2":"G B dC eC fC gC zB NC hC","16":"C","516":"0B","2564":"8 9 H M N O n o p q AB BB CB DB EB","8196":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","10244":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},G:{"1":"tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","2820":"F jC kC lC mC nC oC pC qC rC sC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","260":"D","2308":"9C AD"},J:{"2":"E","2308":"A"},K:{"2":"A B C zB NC","16":"0B","8196":"r"},L:{"8196":"D"},M:{"1028":"D"},N:{"2":"A B"},O:{"8196":"1B"},P:{"2052":"BD CD","2308":"I","8196":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"8196":"DC"},R:{"8196":"ND"},S:{"4100":"OD PD"}},B:5,C:"Synchronous Clipboard API",D:true}; +module.exports={A:{A:{"2436":"J E F G A B PC"},B:{"260":"N O","2436":"C K L H M","8196":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC","772":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","4100":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 I J E F G A B C","2564":"8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","8196":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","10244":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB"},E:{"1":"C K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC BC","2308":"A B CC zB","2820":"7 I J E F G VC WC XC YC"},F:{"2":"G B eC fC gC hC zB NC iC","16":"C","516":"0B","2564":"8 9 H M N O o p q r AB BB CB DB EB","8196":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","10244":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},G:{"1":"uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","2820":"F kC lC mC nC oC pC qC rC sC tC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","260":"D","2308":"AD BD"},J:{"2":"E","2308":"A"},K:{"2":"A B C zB NC","16":"0B","8196":"s"},L:{"8196":"D"},M:{"1028":"D"},N:{"2":"A B"},O:{"8196":"1B"},P:{"2052":"CD DD","2308":"I","8196":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"8196":"DC"},R:{"8196":"OD"},S:{"4100":"PD QD"}},B:5,C:"Synchronous Clipboard API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr-v1.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr-v1.js index cf78829f470b38..dadb84605a6708 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr-v1.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr-v1.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g"},C:{"1":"0 1 2 3 4 5 6 v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g RC SC","258":"h i j k l m s","578":"t u"},D:{"1":"0 1 2 3 4 5 6 h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y","194":"Z a b c d e f g"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"1":"n o p q LD MD","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"COLR/CPAL(v1) Font Formats",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g"},C:{"1":"0 1 2 3 4 5 6 v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g SC TC","258":"h i j k l m n","578":"t u"},D:{"1":"0 1 2 3 4 5 6 h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y","194":"Z a b c d e f g"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"1":"o p q r MD ND","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"COLR/CPAL(v1) Font Formats",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr.js index d4ecd51dcdb90a..6333a87eccb37d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/colr.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","257":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O y z D","513":"P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB RC SC"},D:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB","513":"sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC","2":"7 I J E F G A TC BC UC VC WC XC CC","129":"B C K zB 0B DC","1026":"3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB dC eC fC gC zB NC hC 0B","513":"hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C","2":"F BC iC OC jC kC lC mC nC oC pC qC","1026":"3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"COLR/CPAL(v0) Font Formats",D:true}; +module.exports={A:{A:{"2":"J E F PC","257":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O y z D","513":"P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB SC TC"},D:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB","513":"sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x"},E:{"1":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC","2":"7 I J E F G A UC BC VC WC XC YC CC","129":"B C K zB 0B DC","1026":"3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB eC fC gC hC zB NC iC 0B","513":"hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C","2":"F BC jC OC kC lC mC nC oC pC qC rC","1026":"3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"COLR/CPAL(v0) Font Formats",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/comparedocumentposition.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/comparedocumentposition.js index d1d0e10ab31274..c058f27780767a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/comparedocumentposition.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/comparedocumentposition.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O n o p q AB BB CB DB EB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I J TC BC","132":"E F G VC WC XC","260":"UC"},F:{"1":"8 9 C N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","16":"G B dC eC fC gC zB NC","132":"H M"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC","132":"F iC OC jC kC lC mC nC oC"},H:{"1":"4C"},I:{"1":"D 9C AD","16":"5C 6C","132":"4B I 7C 8C OC"},J:{"132":"E A"},K:{"1":"C r 0B","16":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Node.compareDocumentPosition()",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O o p q r AB BB CB DB EB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I J UC BC","132":"E F G WC XC YC","260":"VC"},F:{"1":"8 9 C N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","16":"G B eC fC gC hC zB NC","132":"H M"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC","132":"F jC OC kC lC mC nC oC pC"},H:{"1":"5C"},I:{"1":"D AD BD","16":"6C 7C","132":"4B I 8C 9C OC"},J:{"132":"E A"},K:{"1":"C s 0B","16":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Node.compareDocumentPosition()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-basic.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-basic.js index 5f64de38011f69..6ab85a4c71d14e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-basic.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-basic.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E PC","132":"F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G dC eC fC gC"},G:{"1":"BC iC OC jC","513":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"4097":"4C"},I:{"1025":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"258":"E A"},K:{"2":"A","258":"B C zB NC 0B","1025":"r"},L:{"1025":"D"},M:{"2049":"D"},N:{"258":"A B"},O:{"258":"1B"},P:{"1025":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1025":"ND"},S:{"1":"OD PD"}},B:1,C:"Basic console logging functions",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E PC","132":"F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G eC fC gC hC"},G:{"1":"BC jC OC kC","513":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"4097":"5C"},I:{"1025":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"258":"E A"},K:{"2":"A","258":"B C zB NC 0B","1025":"s"},L:{"1025":"D"},M:{"2049":"D"},N:{"258":"A B"},O:{"258":"1B"},P:{"1025":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1025":"OD"},S:{"1":"PD QD"}},B:1,C:"Basic console logging functions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-time.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-time.js index bd72386cbb7678..b5e7b9388ccd71 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-time.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/console-time.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G dC eC fC gC","16":"B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"r","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"console.time and console.timeEnd",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G eC fC gC hC","16":"B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"s","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"console.time and console.timeEnd",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/const.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/const.js index d3bb3b2e6772aa..4b7712995a8806 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/const.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/const.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","2052":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 QC 4B I J E F G A B C RC SC","260":"8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","260":"7 8 I J E F G A B C K L H M N O n","772":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","1028":"QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","260":"7 I A TC BC CC","772":"J E F G UC VC WC XC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G dC","132":"B eC fC gC zB NC","644":"C hC 0B","772":"8 9 H M N O n o p q AB BB CB","1028":"DB EB FB GB HB IB JB KB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","260":"BC iC OC pC qC","772":"F jC kC lC mC nC oC"},H:{"644":"4C"},I:{"1":"D","16":"5C 6C","260":"7C","772":"4B I 8C OC 9C AD"},J:{"772":"E A"},K:{"1":"r","132":"A B zB NC","644":"C 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","1028":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"const",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","2052":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","132":"7 QC 4B I J E F G A B C SC TC","260":"8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","260":"7 8 I J E F G A B C K L H M N O o","772":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","1028":"QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","260":"7 I A UC BC CC","772":"J E F G VC WC XC YC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G eC","132":"B fC gC hC zB NC","644":"C iC 0B","772":"8 9 H M N O o p q r AB BB CB","1028":"DB EB FB GB HB IB JB KB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","260":"BC jC OC qC rC","772":"F kC lC mC nC oC pC"},H:{"644":"5C"},I:{"1":"D","16":"6C 7C","260":"8C","772":"4B I 9C OC AD BD"},J:{"772":"E A"},K:{"1":"s","132":"A B zB NC","644":"C 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","1028":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"const",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/constraint-validation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/constraint-validation.js index f51d1c87cb8bcb..ddc7134aa0e89e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/constraint-validation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/constraint-validation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","900":"A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","388":"L H M","900":"C K"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","260":"YB ZB","388":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","900":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB"},D:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","388":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","900":"8 9 H M N O n o p q"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC","388":"F G WC XC","900":"J E UC VC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G B dC eC fC gC zB NC","388":"8 9 H M N O n o p q AB BB","900":"C hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC","388":"F lC mC nC oC","900":"jC kC"},H:{"2":"4C"},I:{"1":"D","16":"4B 5C 6C 7C","388":"9C AD","900":"I 8C OC"},J:{"16":"E","388":"A"},K:{"1":"r","16":"A B zB NC","900":"C 0B"},L:{"1":"D"},M:{"1":"D"},N:{"900":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","388":"OD"}},B:1,C:"Constraint Validation API",D:true}; +module.exports={A:{A:{"2":"J E F G PC","900":"A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","388":"L H M","900":"C K"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","260":"YB ZB","388":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","900":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB"},D:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","388":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","900":"8 9 H M N O o p q r"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC","388":"F G XC YC","900":"J E VC WC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G B eC fC gC hC zB NC","388":"8 9 H M N O o p q r AB BB","900":"C iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC","388":"F mC nC oC pC","900":"kC lC"},H:{"2":"5C"},I:{"1":"D","16":"4B 6C 7C 8C","388":"AD BD","900":"I 9C OC"},J:{"16":"E","388":"A"},K:{"1":"s","16":"A B zB NC","900":"C 0B"},L:{"1":"D"},M:{"1":"D"},N:{"900":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","388":"PD"}},B:1,C:"Constraint Validation API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contenteditable.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contenteditable.js index 0241f22d57fe9d..075db67843d6ad 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contenteditable.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contenteditable.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC","4":"4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"contenteditable attribute (basic support)",D:true}; +module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC","4":"4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"contenteditable attribute (basic support)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js index e8376bb3dcf3f3..59d3d10cbaf9d2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","129":"7 8 I J E F G A B C K L H M N O n o p"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","257":"8 9 L H M N O n o p q"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC","257":"J VC","260":"UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","257":"kC","260":"jC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E","257":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Content Security Policy 1.0",D:true}; +module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","129":"7 8 I J E F G A B C K L H M N O o p q"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","257":"8 9 L H M N O o p q r"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC","257":"J WC","260":"VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","257":"lC","260":"kC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E","257":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Content Security Policy 1.0",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js index 6af15fbe0d3a88..f2a2e6a2ff4bcc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L","4100":"H M N O"},C:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB RC SC","132":"GB HB IB JB","260":"KB","516":"LB MB NB OB PB QB RB SB TB"},D:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB","1028":"LB MB NB","2052":"OB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p dC eC fC gC zB NC hC 0B","1028":"9 q AB","2052":"BB"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Content Security Policy Level 2",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L","4100":"H M N O"},C:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB SC TC","132":"GB HB IB JB","260":"KB","516":"LB MB NB OB PB QB RB SB TB"},D:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB","1028":"LB MB NB","2052":"OB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q eC fC gC hC zB NC iC 0B","1028":"9 r AB","2052":"BB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Content Security Policy Level 2",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cookie-store-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cookie-store-api.js index 20d934f31f1b0f..82672698e5c372 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cookie-store-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cookie-store-api.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","194":"P Q R S T U V"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB","194":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB dC eC fC gC zB NC hC 0B","194":"aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Cookie Store API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","194":"P Q R S T U V"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB","194":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB eC fC gC hC zB NC iC 0B","194":"aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Cookie Store API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cors.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cors.js index a57642f8ba4d6d..baaf9691cafac4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cors.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cors.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E PC","132":"A","260":"F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B","1025":"6B jB kB lB mB nB oB pB qB rB"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 I J E F G A B C"},E:{"2":"TC BC","513":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","644":"7 I UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC"},G:{"513":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","644":"BC iC OC jC"},H:{"2":"4C"},I:{"1":"D 9C AD","132":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","132":"E"},K:{"1":"C r 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","132":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Cross-Origin Resource Sharing",D:true}; +module.exports={A:{A:{"1":"B","2":"J E PC","132":"A","260":"F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B","1025":"6B jB kB lB mB nB oB pB qB rB"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 I J E F G A B C"},E:{"2":"UC BC","513":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","644":"7 I VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC"},G:{"513":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","644":"BC jC OC kC"},H:{"2":"5C"},I:{"1":"D AD BD","132":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","132":"E"},K:{"1":"C s 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","132":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Cross-Origin Resource Sharing",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/createimagebitmap.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/createimagebitmap.js index 31286966238040..cacbf75cd45911 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/createimagebitmap.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/createimagebitmap.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RC SC","1028":"c d e f g","3076":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b","8196":"0 1 2 3 4 5 6 h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","132":"ZB aB","260":"bB cB","516":"dB eB fB gB hB"},E:{"2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC YC","4100":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB dC eC fC gC zB NC hC 0B","132":"MB NB","260":"OB PB","516":"QB RB SB TB UB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C","4100":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"8196":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","16":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"3076":"OD PD"}},B:1,C:"createImageBitmap",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB SC TC","1028":"c d e f g","3076":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b","8196":"0 1 2 3 4 5 6 h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","132":"ZB aB","260":"bB cB","516":"dB eB fB gB hB"},E:{"2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC ZC","4100":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB eC fC gC hC zB NC iC 0B","132":"MB NB","260":"OB PB","516":"QB RB SB TB UB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C","4100":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"8196":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","16":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"3076":"PD QD"}},B:1,C:"createImageBitmap",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/credential-management.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/credential-management.js index 4bdb11aba9c4da..a04c6cea986048 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/credential-management.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/credential-management.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","66":"XB YB ZB","129":"aB bB cB dB eB fB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB dC eC fC gC zB NC hC 0B"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"Credential Management API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","66":"XB YB ZB","129":"aB bB cB dB eB fB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB eC fC gC hC zB NC iC 0B"},G:{"1":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"Credential Management API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cryptography.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cryptography.js index 4f5adad2058773..447ebf3155c4df 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cryptography.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/cryptography.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F G A","164":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","513":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB RC SC","66":"HB IB"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I J E TC BC UC VC","289":"F G A WC XC CC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","8":"8 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC jC kC lC","289":"F mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","8":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"8":"E A"},K:{"1":"r","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A","164":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Web Cryptography",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F G A","164":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","513":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB SC TC","66":"HB IB"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I J E UC BC VC WC","289":"F G A XC YC CC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","8":"8 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC kC lC mC","289":"F nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","8":"4B I 6C 7C 8C 9C OC AD BD"},J:{"8":"E A"},K:{"1":"s","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A","164":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Web Cryptography",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-all.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-all.js index e97f1f5ff05e82..6610ac2bc1133a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-all.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-all.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB RC SC"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC"},H:{"2":"4C"},I:{"1":"D AD","2":"4B I 5C 6C 7C 8C OC 9C"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS all property",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB SC TC"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC"},H:{"2":"5C"},I:{"1":"D BD","2":"4B I 6C 7C 8C 9C OC AD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS all property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-anchor-positioning.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-anchor-positioning.js index e1c0dff15052fe..62f586b4ef3fcf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-anchor-positioning.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-anchor-positioning.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","194":"5 6 D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Anchor Positioning",D:false}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","194":"5 6 D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Anchor Positioning",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-animation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-animation.js index e2fce5a0816efe..6a76e3687e5e3e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-animation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-animation.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B I RC SC","33":"7 J E F G A B C K L H"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC","33":"J E F UC VC WC","292":"7 I"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC","33":"8 9 C H M N O n o p q AB BB CB DB EB"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"F kC lC mC","164":"BC iC OC jC"},H:{"2":"4C"},I:{"1":"D","33":"I 8C OC 9C AD","164":"4B 5C 6C 7C"},J:{"33":"E A"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"CSS Animation",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B I SC TC","33":"7 J E F G A B C K L H"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC","33":"J E F VC WC XC","292":"7 I"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC","33":"8 9 C H M N O o p q r AB BB CB DB EB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"F lC mC nC","164":"BC jC OC kC"},H:{"2":"5C"},I:{"1":"D","33":"I 9C OC AD BD","164":"4B 6C 7C 8C"},J:{"33":"E A"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"CSS Animation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-any-link.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-any-link.js index 26855268409d59..af0c4786395443 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-any-link.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-any-link.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC","33":"7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB RC SC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I J TC BC UC","33":"E F VC WC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC","33":"F kC lC mC"},H:{"2":"4C"},I:{"1":"D","16":"4B I 5C 6C 7C 8C OC","33":"9C AD"},J:{"16":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","16":"I","33":"BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","33":"OD"}},B:5,C:"CSS :any-link selector",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC","33":"7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB SC TC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I J UC BC VC","33":"E F WC XC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC","33":"F lC mC nC"},H:{"2":"5C"},I:{"1":"D","16":"4B I 6C 7C 8C 9C OC","33":"AD BD"},J:{"16":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","16":"I","33":"CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","33":"PD"}},B:5,C:"CSS :any-link selector",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-appearance.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-appearance.js index dd46bb3ce7670c..3715881ebd85d6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-appearance.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-appearance.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","33":"S","164":"P Q R","388":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","164":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","676":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB RC SC"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"S","164":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","164":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"rB sB tB","164":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","164":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","164":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"164":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","388":"B"},O:{"1":"1B"},P:{"164":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"164":"DC"},R:{"1":"ND"},S:{"1":"PD","164":"OD"}},B:5,C:"CSS Appearance",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","33":"S","164":"P Q R","388":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","164":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","676":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB SC TC"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"S","164":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","164":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"rB sB tB","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","164":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","164":"4B I 6C 7C 8C 9C OC AD BD"},J:{"164":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","388":"B"},O:{"1":"1B"},P:{"164":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"164":"DC"},R:{"1":"OD"},S:{"1":"QD","164":"PD"}},B:5,C:"CSS Appearance",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-at-counter-style.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-at-counter-style.js index 988c5b73ae0301..21d2ea70f5f154 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-at-counter-style.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-at-counter-style.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z","132":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC","132":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z","132":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC","4":"3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB dC eC fC gC zB NC hC 0B","132":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C","4":"3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","132":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"r"},L:{"132":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I BD CD DD ED FD CC GD HD ID JD KD","132":"n o p q 2B 3B LD MD"},Q:{"2":"DC"},R:{"132":"ND"},S:{"132":"OD PD"}},B:4,C:"CSS Counter Styles",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z","132":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC","132":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z","132":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC","4":"3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB eC fC gC hC zB NC iC 0B","132":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C","4":"3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","132":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"s"},L:{"132":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I CD DD ED FD GD CC HD ID JD KD LD","132":"o p q r 2B 3B MD ND"},Q:{"2":"DC"},R:{"132":"OD"},S:{"132":"PD QD"}},B:4,C:"CSS Counter Styles",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-autofill.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-autofill.js index 56e60797bb94c7..7c639fd9e399eb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-autofill.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-autofill.js @@ -1 +1 @@ -module.exports={A:{D:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},L:{"33":"D"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U RC SC"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},K:{"2":"A B C zB NC 0B","33":"r"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"cC","33":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC YC"},G:{"1":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},I:{"2":"4B I 5C 6C 7C 8C OC","33":"D 9C AD"}},B:6,C:":autofill CSS pseudo-class",D:undefined}; +module.exports={A:{D:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},L:{"33":"D"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U SC TC"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},K:{"2":"A B C zB NC 0B","33":"s"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"dC","33":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC ZC"},G:{"1":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C"},P:{"33":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},I:{"2":"4B I 6C 7C 8C 9C OC","33":"D AD BD"}},B:6,C:":autofill CSS pseudo-class",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backdrop-filter.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backdrop-filter.js index 4a758157e25f3f..9008a478a4d904 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backdrop-filter.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backdrop-filter.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M","257":"N O"},C:{"1":"0 1 2 3 4 5 6 m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB RC SC","578":"rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l"},D:{"1":"0 1 2 3 4 5 6 wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB","194":"WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB"},E:{"2":"7 I J E F TC BC UC VC WC","33":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB dC eC fC gC zB NC hC 0B","194":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"2":"F BC iC OC jC kC lC mC","33":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q HD ID JD KD 2B 3B LD MD","2":"I","194":"BD CD DD ED FD CC GD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS Backdrop Filter",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M","257":"N O"},C:{"1":"0 1 2 3 4 5 6 m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB SC TC","578":"rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l"},D:{"1":"0 1 2 3 4 5 6 wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB","194":"WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB"},E:{"2":"7 I J E F UC BC VC WC XC","33":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB eC fC gC hC zB NC iC 0B","194":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"2":"F BC jC OC kC lC mC nC","33":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ID JD KD LD 2B 3B MD ND","2":"I","194":"CD DD ED FD GD CC HD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS Backdrop Filter",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-background-offsets.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-background-offsets.js index ffc7c36cff1083..8f1c716e141076 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-background-offsets.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-background-offsets.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C RC SC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS background-position edge offsets",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C SC TC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS background-position edge offsets",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js index 870fd15af5df47..bdd9513aae267d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB RC SC"},D:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB","260":"VB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC","132":"F G A WC XC"},F:{"1":"9 p q AB BB CB DB EB FB GB HB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o dC eC fC gC zB NC hC 0B","260":"IB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","132":"F mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS background-blend-mode",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB SC TC"},D:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB","260":"VB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC","132":"F G A XC YC"},F:{"1":"9 q r AB BB CB DB EB FB GB HB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p eC fC gC hC zB NC iC 0B","260":"IB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","132":"F nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS background-blend-mode",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js index 49a9ae36a7e3ff..4e7f2da82e9bad 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","164":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB RC SC"},D:{"2":"7 8 I J E F G A B C K L H M N O n o","164":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J TC BC UC","164":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G dC eC fC gC","129":"B C zB NC hC 0B","164":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"BC iC OC jC kC","164":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"132":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","164":"D 9C AD"},J:{"2":"E","164":"A"},K:{"2":"A","129":"B C zB NC 0B","164":"r"},L:{"164":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"164":"DC"},R:{"164":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS box-decoration-break",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","164":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB SC TC"},D:{"2":"7 8 I J E F G A B C K L H M N O o p","164":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J UC BC VC","164":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G eC fC gC hC","129":"B C zB NC iC 0B","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"BC jC OC kC lC","164":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"132":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","164":"D AD BD"},J:{"2":"E","164":"A"},K:{"2":"A","129":"B C zB NC 0B","164":"s"},L:{"164":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"164":"DC"},R:{"164":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS box-decoration-break",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxshadow.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxshadow.js index 4a094514bbd61f..222d9e15fc7f52 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxshadow.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-boxshadow.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","33":"RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 I J E F G"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"7","164":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"iC OC","164":"BC"},H:{"2":"4C"},I:{"1":"I D 8C OC 9C AD","164":"4B 5C 6C 7C"},J:{"1":"A","33":"E"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 Box-shadow",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","33":"SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 I J E F G"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"7","164":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"jC OC","164":"BC"},H:{"2":"5C"},I:{"1":"I D 9C OC AD BD","164":"4B 6C 7C 8C"},J:{"1":"A","33":"E"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 Box-shadow",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-canvas.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-canvas.js index f2b8b084b1aa62..47add1562ce858 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-canvas.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-canvas.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"2":"TC BC","33":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB"},G:{"33":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"D","33":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","33":"I"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS Canvas Drawings",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"2":"UC BC","33":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB"},G:{"33":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"D","33":"4B I 6C 7C 8C 9C OC AD BD"},J:{"33":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","33":"I"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS Canvas Drawings",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-caret-color.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-caret-color.js index c2f22613c1d3f3..b0c74dc154680f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-caret-color.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-caret-color.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:2,C:"CSS caret-color",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:2,C:"CSS caret-color",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-layers.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-layers.js index b7e4e7bf9afaee..5b336bb9f1e4ff 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-layers.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-layers.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e","322":"f g h"},C:{"1":"0 1 2 3 4 5 6 g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c RC SC","194":"d e f"},D:{"1":"0 1 2 3 4 5 6 i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e","322":"f g h"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U dC eC fC gC zB NC hC 0B"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q LD MD","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:4,C:"CSS Cascade Layers",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e","322":"f g h"},C:{"1":"0 1 2 3 4 5 6 g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c SC TC","194":"d e f"},D:{"1":"0 1 2 3 4 5 6 i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e","322":"f g h"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U eC fC gC hC zB NC iC 0B"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r MD ND","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:4,C:"CSS Cascade Layers",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-scope.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-scope.js index 1ae551bd7c41e9..419408a6f9e509 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-scope.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cascade-scope.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"6 D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m","194":"0 1 2 3 4 5 s t u v w x y z"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"6 D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m","194":"0 1 2 3 4 5 s t u v w x y z"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y dC eC fC gC zB NC hC 0B","194":"Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Scoped Styles: the @scope rule",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"6 D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m","194":"0 1 2 3 4 5 n t u v w x y z"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"6 D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m","194":"0 1 2 3 4 5 n t u v w x y z"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y eC fC gC hC zB NC iC 0B","194":"Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Scoped Styles: the @scope rule",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-case-insensitive.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-case-insensitive.js index da51043fb4fe0e..52b72479f914e2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-case-insensitive.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-case-insensitive.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Case-insensitive CSS attribute selectors",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Case-insensitive CSS attribute selectors",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-clip-path.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-clip-path.js index 4d9a9888aa7dbe..b01851ba04c634 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-clip-path.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-clip-path.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N","260":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","3138":"O"},C:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC","644":"WB XB YB ZB aB bB cB"},D:{"2":"7 8 I J E F G A B C K L H M N O n o p q","260":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","292":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"2":"7 I J TC BC UC VC","260":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","292":"E F G A B C K WC XC CC zB 0B"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","260":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","292":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB"},G:{"2":"BC iC OC jC kC","260":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","292":"F lC mC nC oC pC qC rC sC tC uC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","260":"D","292":"9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","260":"r"},L:{"260":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"260":"1B"},P:{"292":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"260":"DC"},R:{"260":"ND"},S:{"1":"PD","644":"OD"}},B:4,C:"CSS clip-path property (for HTML)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N","260":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","3138":"O"},C:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC","644":"WB XB YB ZB aB bB cB"},D:{"2":"7 8 I J E F G A B C K L H M N O o p q r","260":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","292":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"2":"7 I J UC BC VC WC","260":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","292":"E F G A B C K XC YC CC zB 0B"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","260":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","292":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB"},G:{"2":"BC jC OC kC lC","260":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","292":"F mC nC oC pC qC rC sC tC uC vC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","260":"D","292":"AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","260":"s"},L:{"260":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"260":"1B"},P:{"292":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"260":"DC"},R:{"260":"OD"},S:{"1":"QD","644":"PD"}},B:4,C:"CSS clip-path property (for HTML)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-adjust.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-adjust.js index 8d90dab39d2fd7..a7faa38c800d92 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-adjust.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-adjust.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB RC SC"},D:{"16":"7 I J E F G A B C K L H M N O","33":"0 1 2 3 4 5 6 8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","33":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"16":"4B I 5C 6C 7C 8C OC 9C AD","33":"D"},J:{"16":"E A"},K:{"2":"A B C zB NC 0B","33":"r"},L:{"16":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"16":"1B"},P:{"16":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"33":"DC"},R:{"16":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS print-color-adjust",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB SC TC"},D:{"16":"7 I J E F G A B C K L H M N O","33":"0 1 2 3 4 5 6 8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","33":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"16":"4B I 6C 7C 8C 9C OC AD BD","33":"D"},J:{"16":"E A"},K:{"2":"A B C zB NC 0B","33":"s"},L:{"16":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"16":"1B"},P:{"16":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"33":"DC"},R:{"16":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS print-color-adjust",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-function.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-function.js index e6d7c243b26aab..685f01875390e0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-function.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-color-function.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v","322":"w x y"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y RC SC","578":"0 z"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v","322":"w x y"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC","132":"B C K L CC zB 0B DC YC"},F:{"1":"h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d dC eC fC gC zB NC hC 0B","322":"e f g"},G:{"1":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC","132":"qC rC sC tC uC vC wC xC yC zC 0C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"p q","2":"I n o BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:4,C:"CSS color() function",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v","322":"w x y"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y SC TC","578":"0 z"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v","322":"w x y"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC","132":"B C K L CC zB 0B DC ZC"},F:{"1":"h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d eC fC gC hC zB NC iC 0B","322":"e f g"},G:{"1":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC","132":"rC sC tC uC vC wC xC yC zC 0C 1C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"q r","2":"I o p CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:4,C:"CSS color() function",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-conic-gradients.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-conic-gradients.js index f98aa8454e190d..d43bec58933550 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-conic-gradients.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-conic-gradients.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB RC SC","578":"vB wB xB yB P Q R 7B"},D:{"1":"0 1 2 3 4 5 6 sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","257":"qB rB","450":"5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB"},F:{"1":"hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB dC eC fC gC zB NC hC 0B","257":"fB gB","450":"VB WB XB YB ZB aB bB cB dB eB"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"CSS Conical Gradients",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB SC TC","578":"vB wB xB yB P Q R 7B"},D:{"1":"0 1 2 3 4 5 6 sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","257":"qB rB","450":"5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB"},F:{"1":"hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB eC fC gC hC zB NC iC 0B","257":"fB gB","450":"VB WB XB YB ZB aB bB cB dB eB"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"CSS Conical Gradients",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries-style.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries-style.js index cee69580eb7a2e..7b0554fa843e5a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries-style.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries-style.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u","194":"v w x y","260":"0 1 2 3 4 5 6 z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u","194":"v w x y","260":"0 1 2 3 4 5 6 z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b dC eC fC gC zB NC hC 0B","194":"c d e f g","260":"h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","260":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","194":"r"},L:{"260":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","260":"p q"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Container Style Queries",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u","194":"v w x y","260":"0 1 2 3 4 5 6 z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u","194":"v w x y","260":"0 1 2 3 4 5 6 z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b eC fC gC hC zB NC iC 0B","194":"c d e f g","260":"h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","260":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","194":"s"},L:{"260":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","260":"q r"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Container Style Queries",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries.js index 9ef03d91e99f45..54e692f6be221c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-queries.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s","516":"t"},C:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x RC SC"},D:{"1":"0 1 2 3 4 5 6 u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a","194":"c d e f g h i j k l m s","450":"b","516":"t"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB dC eC fC gC zB NC hC 0B","194":"P Q R 7B S T U V W X Y Z","516":"a b c"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Container Queries (Size)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n","516":"t"},C:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x SC TC"},D:{"1":"0 1 2 3 4 5 6 u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a","194":"c d e f g h i j k l m n","450":"b","516":"t"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB eC fC gC hC zB NC iC 0B","194":"P Q R 7B S T U V W X Y Z","516":"a b c"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Container Queries (Size)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-query-units.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-query-units.js index 2f3923a59bed2a..f9341052d5cfb0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-query-units.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-container-query-units.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s"},C:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x RC SC"},D:{"1":"0 1 2 3 4 5 6 t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b","194":"k l m s","450":"c d e f g h i j"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB dC eC fC gC zB NC hC 0B","194":"P Q R 7B S T U V W X Y Z"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Container Query Units",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n"},C:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x SC TC"},D:{"1":"0 1 2 3 4 5 6 t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b","194":"k l m n","450":"c d e f g h i j"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB eC fC gC hC zB NC iC 0B","194":"P Q R 7B S T U V W X Y Z"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Container Query Units",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-containment.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-containment.js index a6415f046be81f..116d473e09850b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-containment.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-containment.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB RC SC","194":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},D:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","66":"aB"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB dC eC fC gC zB NC hC 0B","66":"NB OB"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","194":"OD"}},B:2,C:"CSS Containment",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB SC TC","194":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},D:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","66":"aB"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB eC fC gC hC zB NC iC 0B","66":"NB OB"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","194":"PD"}},B:2,C:"CSS Containment",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-content-visibility.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-content-visibility.js index 2d89032e401ff4..e9c1241447a342 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-content-visibility.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-content-visibility.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S T"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w RC SC","194":"0 1 2 3 4 5 6 x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T"},E:{"1":"cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC"},F:{"1":"sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS content-visibility",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S T"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w SC TC","194":"0 1 2 3 4 5 6 x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T"},E:{"1":"dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC"},F:{"1":"sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS content-visibility",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-counters.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-counters.js index 4442e95e9be3d6..b97c219ea72de4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-counters.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-counters.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS Counters",D:true}; +module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS Counters",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-crisp-edges.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-crisp-edges.js index 4d8b0d63869e2f..4ab7c0fd47f450 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-crisp-edges.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-crisp-edges.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J PC","2340":"E F G A B"},B:{"2":"C K L H M N O","1025":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC","513":"mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b","545":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","1025":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","164":"J","4644":"E F G VC WC XC"},F:{"2":"8 9 G B H M N O n o p q AB BB CB dC eC fC gC zB NC","545":"C hC 0B","1025":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","4260":"jC kC","4644":"F lC mC nC oC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","1025":"D"},J:{"2":"E","4260":"A"},K:{"2":"A B zB NC","545":"C 0B","1025":"r"},L:{"1025":"D"},M:{"1":"D"},N:{"2340":"A B"},O:{"1025":"1B"},P:{"1025":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1025":"DC"},R:{"1025":"ND"},S:{"1":"PD","4097":"OD"}},B:4,C:"Crisp edges/pixelated images",D:true}; +module.exports={A:{A:{"2":"J PC","2340":"E F G A B"},B:{"2":"C K L H M N O","1025":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC","513":"mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b","545":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","1025":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","164":"J","4644":"E F G WC XC YC"},F:{"2":"8 9 G B H M N O o p q r AB BB CB eC fC gC hC zB NC","545":"C iC 0B","1025":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","4260":"kC lC","4644":"F mC nC oC pC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","1025":"D"},J:{"2":"E","4260":"A"},K:{"2":"A B zB NC","545":"C 0B","1025":"s"},L:{"1025":"D"},M:{"1":"D"},N:{"2340":"A B"},O:{"1025":"1B"},P:{"1025":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1025":"DC"},R:{"1025":"OD"},S:{"1":"QD","4097":"PD"}},B:4,C:"Crisp edges/pixelated images",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cross-fade.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cross-fade.js index 7f3e5f83d3480e..8dfaad47b45c59 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cross-fade.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-cross-fade.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 I J E F G A B C K L H M","33":"0 1 2 3 4 5 6 8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC","33":"J E F G UC VC WC XC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","33":"F jC kC lC mC nC oC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","33":"D 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","33":"r"},L:{"33":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"33":"DC"},R:{"33":"ND"},S:{"2":"OD PD"}},B:4,C:"CSS Cross-Fade Function",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 I J E F G A B C K L H M","33":"0 1 2 3 4 5 6 8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC","33":"J E F G VC WC XC YC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","33":"F kC lC mC nC oC pC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","33":"D AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","33":"s"},L:{"33":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"33":"DC"},R:{"33":"OD"},S:{"2":"PD QD"}},B:4,C:"CSS Cross-Fade Function",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-default-pseudo.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-default-pseudo.js index 0e3e1e2dc65cd6..77fa1c6181fd4f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-default-pseudo.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-default-pseudo.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC","132":"J E F G A UC VC WC XC"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G B dC eC fC gC zB NC","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB","260":"C hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC kC","132":"F lC mC nC oC pC"},H:{"260":"4C"},I:{"1":"D","16":"4B 5C 6C 7C","132":"I 8C OC 9C AD"},J:{"16":"E","132":"A"},K:{"1":"r","16":"A B C zB NC","260":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","132":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:":default CSS pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC","132":"J E F G A VC WC XC YC"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G B eC fC gC hC zB NC","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB","260":"C iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC lC","132":"F mC nC oC pC qC"},H:{"260":"5C"},I:{"1":"D","16":"4B 6C 7C 8C","132":"I 9C OC AD BD"},J:{"16":"E","132":"A"},K:{"1":"s","16":"A B C zB NC","260":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","132":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:":default CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js index 7c584bba68b4e6..ee248c6641a978 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"B","2":"7 I J E F G A C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Explicit descendant combinator >>",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"B","2":"7 I J E F G A C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Explicit descendant combinator >>",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-deviceadaptation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-deviceadaptation.js index d2292e5801f3a0..a3d61ec23dcbb1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-deviceadaptation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-deviceadaptation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","164":"A B"},B:{"66":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","164":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB","66":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB dC eC fC gC zB NC hC 0B","66":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"292":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A r","292":"B C zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"164":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"66":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Device Adaptation",D:true}; +module.exports={A:{A:{"2":"J E F G PC","164":"A B"},B:{"66":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","164":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB","66":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB eC fC gC hC zB NC iC 0B","66":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"292":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A s","292":"B C zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"164":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"66":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Device Adaptation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-dir-pseudo.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-dir-pseudo.js index af36d5bb2ceeac..aa7d0e91ee4a22 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-dir-pseudo.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-dir-pseudo.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s","194":"0 1 2 3 4 5 6 t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M RC SC","33":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},D:{"1":"8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z","194":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z dC eC fC gC zB NC hC 0B","194":"a b c d e f g h i j k l m"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"PD","33":"OD"}},B:5,C:":dir() CSS pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n","194":"0 1 2 3 4 5 6 t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M SC TC","33":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},D:{"1":"8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z","194":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z eC fC gC hC zB NC iC 0B","194":"a b c d e f g h i j k l m n"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"QD","33":"PD"}},B:5,C:":dir() CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-display-contents.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-display-contents.js index 711c82fb888f9f..3cd803502db4a4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-display-contents.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-display-contents.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"P Q R S T U V W X","260":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB RC SC","132":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B","260":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","132":"mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X","194":"hB 5B iB 6B jB kB lB","260":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B TC BC UC VC WC XC CC","132":"C K L H zB 0B DC YC ZC EC FC 1B aC","260":"3B LC MC cC","772":"2B GC HC IC JC KC bC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB dC eC fC gC zB NC hC 0B","132":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB","260":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC","132":"sC tC uC vC wC xC","260":"yC zC 0C 1C EC FC 1B 2C","516":"GC HC IC JC KC 3C","772":"2B"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","260":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","260":"r"},L:{"260":"D"},M:{"260":"D"},N:{"2":"A B"},O:{"132":"1B"},P:{"2":"I BD CD DD ED","132":"FD CC GD HD ID JD","260":"n o p q KD 2B 3B LD MD"},Q:{"132":"DC"},R:{"260":"ND"},S:{"132":"OD","260":"PD"}},B:4,C:"CSS display: contents",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"P Q R S T U V W X","260":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB SC TC","132":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B","260":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","132":"mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X","194":"hB 5B iB 6B jB kB lB","260":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B UC BC VC WC XC YC CC","132":"C K L H zB 0B DC ZC aC EC FC 1B bC","260":"3B LC MC dC","772":"2B GC HC IC JC KC cC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB eC fC gC hC zB NC iC 0B","132":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB","260":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC","132":"tC uC vC wC xC yC","260":"zC 0C 1C 2C EC FC 1B 3C","516":"GC HC IC JC KC 4C","772":"2B"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","260":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","260":"s"},L:{"260":"D"},M:{"260":"D"},N:{"2":"A B"},O:{"132":"1B"},P:{"2":"I CD DD ED FD","132":"GD CC HD ID JD KD","260":"o p q r LD 2B 3B MD ND"},Q:{"132":"DC"},R:{"260":"OD"},S:{"132":"PD","260":"QD"}},B:4,C:"CSS display: contents",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-element-function.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-element-function.js index 8397f9f6a7db15..4d0f270eb4cf38 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-element-function.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-element-function.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","164":"QC 4B RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"33":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"33":"OD PD"}},B:5,C:"CSS element() function",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","164":"QC 4B SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"33":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"33":"PD QD"}},B:5,C:"CSS element() function",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-env-function.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-env-function.js index df3748aa0fdeb5..53b0ca83eb3b91 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-env-function.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-env-function.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB RC SC"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","132":"B"},F:{"1":"fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC","132":"rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:7,C:"CSS Environment Variables env()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB SC TC"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","132":"B"},F:{"1":"fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC","132":"sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:7,C:"CSS Environment Variables env()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-exclusions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-exclusions.js index 61750f59ed051e..6671d5c805598e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-exclusions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-exclusions.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","33":"A B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","33":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"33":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Exclusions Level 1",D:true}; +module.exports={A:{A:{"2":"J E F G PC","33":"A B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","33":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"33":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Exclusions Level 1",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-featurequeries.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-featurequeries.js index c75423340fea23..6d349e6b63e253 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-featurequeries.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-featurequeries.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B C dC eC fC gC zB NC hC"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS Feature Queries",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B C eC fC gC hC zB NC iC"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS Feature Queries",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-file-selector-button.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-file-selector-button.js index de4ecd38e71c94..3933c68860c3e8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-file-selector-button.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-file-selector-button.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D","33":"C K L H M N O P Q R S T U V W X"},C:{"1":"0 1 2 3 4 5 6 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R RC SC"},M:{"1":"D"},A:{"2":"J E F G PC","33":"A B"},F:{"1":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"cC","33":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC"},G:{"1":"0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},P:{"1":"n o p q KD 2B 3B LD MD","33":"I BD CD DD ED FD CC GD HD ID JD"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","33":"9C AD"}},B:6,C:"::file-selector-button CSS pseudo-element",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D","33":"C K L H M N O P Q R S T U V W X"},C:{"1":"0 1 2 3 4 5 6 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R SC TC"},M:{"1":"D"},A:{"2":"J E F G PC","33":"A B"},F:{"1":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"dC","33":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC"},G:{"1":"1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C"},P:{"1":"o p q r LD 2B 3B MD ND","33":"I CD DD ED FD GD CC HD ID JD KD"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","33":"AD BD"}},B:6,C:"::file-selector-button CSS pseudo-element",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filter-function.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filter-function.js index a8cda86beef69a..49696330e0f3d7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filter-function.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filter-function.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC","33":"G"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC","33":"nC oC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS filter() function",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC","33":"G"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC","33":"oC pC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS filter() function",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filters.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filters.js index 0dc5a73cea1095..6028363e783835 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filters.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-filters.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","1028":"K L H M N O","1346":"C"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC","196":"JB","516":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB SC"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N","33":"8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","33":"J E F G VC WC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"F kC lC mC nC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","33":"9C AD"},J:{"2":"E","33":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","33":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"CSS Filter Effects",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","1028":"K L H M N O","1346":"C"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC","196":"JB","516":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB TC"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N","33":"8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","33":"J E F G WC XC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"F lC mC nC oC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","33":"AD BD"},J:{"2":"E","33":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","33":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"CSS Filter Effects",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-letter.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-letter.js index c3e28c28ffe862..2d3aa5ae186546 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-letter.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-letter.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","16":"PC","516":"F","1540":"J E"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","132":"4B","260":"QC"},D:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 J E F","132":"I"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 TC","132":"I BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","16":"G dC","260":"B eC fC gC zB NC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"1":"4C"},I:{"1":"4B I D 8C OC 9C AD","16":"5C 6C","132":"7C"},J:{"1":"E A"},K:{"1":"C r 0B","260":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"::first-letter CSS pseudo-element selector",D:true}; +module.exports={A:{A:{"1":"G A B","16":"PC","516":"F","1540":"J E"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","132":"4B","260":"QC"},D:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 J E F","132":"I"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 UC","132":"I BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","16":"G eC","260":"B fC gC hC zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"1":"5C"},I:{"1":"4B I D 9C OC AD BD","16":"6C 7C","132":"8C"},J:{"1":"E A"},K:{"1":"C s 0B","260":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"::first-letter CSS pseudo-element selector",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-line.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-line.js index fe73252e220096..b3c95fbf67bd2d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-line.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-first-line.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS first-line pseudo-element",D:true}; +module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS first-line pseudo-element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-fixed.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-fixed.js index 6efb755e25e848..f9d48f4fc5a54c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-fixed.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-fixed.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"E F G A B","2":"PC","8":"J"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","1025":"XC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","132":"jC kC lC"},H:{"2":"4C"},I:{"1":"4B D 9C AD","260":"5C 6C 7C","513":"I 8C OC"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS position:fixed",D:true}; +module.exports={A:{A:{"1":"E F G A B","2":"PC","8":"J"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","1025":"YC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","132":"kC lC mC"},H:{"2":"5C"},I:{"1":"4B D AD BD","260":"6C 7C 8C","513":"I 9C OC"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS position:fixed",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-visible.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-visible.js index 2c6e563fc491de..8f584a089b32ee 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-visible.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-visible.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","328":"P Q R S T U"},C:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","161":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T"},D:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB","328":"oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC YC","578":"H ZC EC"},F:{"1":"tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB dC eC fC gC zB NC hC 0B","328":"nB oB pB qB rB sB"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C","578":"1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"161":"OD PD"}},B:5,C:":focus-visible CSS pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","328":"P Q R S T U"},C:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","161":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T"},D:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB","328":"oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC ZC","578":"H aC EC"},F:{"1":"tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB eC fC gC hC zB NC iC 0B","328":"nB oB pB qB rB sB"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C","578":"2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"161":"PD QD"}},B:5,C:":focus-visible CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-within.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-within.js index 1ef8044ac2a303..368ba71616a022 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-within.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-focus-within.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB RC SC"},D:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","194":"5B"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB dC eC fC gC zB NC hC 0B","194":"VB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:7,C:":focus-within CSS pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB SC TC"},D:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","194":"5B"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB eC fC gC hC zB NC iC 0B","194":"VB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:7,C:":focus-within CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-palette.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-palette.js index 864ee98c09add3..18330f70854ad4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-palette.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-palette.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s"},C:{"1":"0 1 2 3 4 5 6 v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u RC SC"},D:{"1":"0 1 2 3 4 5 6 k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V dC eC fC gC zB NC hC 0B"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q MD","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS font-palette",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n"},C:{"1":"0 1 2 3 4 5 6 v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u SC TC"},D:{"1":"0 1 2 3 4 5 6 k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V eC fC gC hC zB NC iC 0B"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r ND","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS font-palette",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js index cce601d1b75b02..8e68b143e9c18f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB RC SC","194":"VB WB XB YB ZB aB bB cB dB eB fB gB"},D:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","66":"YB ZB aB bB cB dB eB fB gB hB 5B"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B","66":"LB MB NB OB PB QB RB SB TB UB VB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","66":"BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","194":"OD"}},B:5,C:"CSS font-display",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB SC TC","194":"VB WB XB YB ZB aB bB cB dB eB fB gB"},D:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","66":"YB ZB aB bB cB dB eB fB gB hB 5B"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B","66":"LB MB NB OB PB QB RB SB TB UB VB"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","66":"CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","194":"PD"}},B:5,C:"CSS font-display",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-stretch.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-stretch.js index 2a9b51177683d0..7f91511b0c328b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-stretch.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-font-stretch.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F RC SC"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS font-stretch",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F SC TC"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS font-stretch",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gencontent.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gencontent.js index 5288c9da5914ed..c8b55e95c463cc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gencontent.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gencontent.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E PC","132":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS Generated content for pseudo-elements",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E PC","132":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS Generated content for pseudo-elements",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gradients.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gradients.js index ea70bbe51c8141..b453311aee2e77 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gradients.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-gradients.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC","260":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB","292":"7 I J E F G A B C K L H SC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"8 9 A B C K L H M N O n o p q AB","548":"7 I J E F G"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC","260":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC","292":"J UC","804":"7 I"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC","33":"C hC","164":"zB NC"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","260":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC","292":"jC kC","804":"BC iC OC"},H:{"2":"4C"},I:{"1":"D 9C AD","33":"I 8C OC","548":"4B 5C 6C 7C"},J:{"1":"A","548":"E"},K:{"1":"r 0B","2":"A B","33":"C","164":"zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS Gradients",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC","260":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB","292":"7 I J E F G A B C K L H TC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"8 9 A B C K L H M N O o p q r AB","548":"7 I J E F G"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC","260":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC","292":"J VC","804":"7 I"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC","33":"C iC","164":"zB NC"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","260":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC","292":"kC lC","804":"BC jC OC"},H:{"2":"5C"},I:{"1":"D AD BD","33":"I 9C OC","548":"4B 6C 7C 8C"},J:{"1":"A","548":"E"},K:{"1":"s 0B","2":"A B","33":"C","164":"zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS Gradients",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid-animation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid-animation.js index 25580fa3da1790..0d24cab2342499 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid-animation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid-animation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"CSS Grid animation",D:false}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"CSS Grid animation",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid.js index d75a0bcb037dc0..8f8c8511d90df7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-grid.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","8":"G","292":"A B"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","292":"C K L H"},C:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N O RC SC","8":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","584":"PB QB RB SB TB UB VB WB XB YB ZB aB","1025":"bB cB"},D:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q","8":"AB BB CB DB","200":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","1025":"gB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","8":"J E F G A VC WC XC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB dC eC fC gC zB NC hC 0B","200":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","8":"F kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C","8":"OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"292":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"BD","8":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS Grid Layout (level 1)",D:true}; +module.exports={A:{A:{"2":"J E F PC","8":"G","292":"A B"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","292":"C K L H"},C:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N O SC TC","8":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","584":"PB QB RB SB TB UB VB WB XB YB ZB aB","1025":"bB cB"},D:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r","8":"AB BB CB DB","200":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","1025":"gB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","8":"J E F G A WC XC YC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB eC fC gC hC zB NC iC 0B","200":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","8":"F lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C","8":"OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"292":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"CD","8":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS Grid Layout (level 1)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js index 91d106f5141138..36cf2ab8a16dd0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:4,C:"CSS hanging-punctuation",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:4,C:"CSS hanging-punctuation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-has.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-has.js index f633d6458f159a..f715862ab6e0b8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-has.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-has.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s"},C:{"1":"9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l RC SC","322":"0 1 2 3 4 5 6 m s t u v w x y z D 8B"},D:{"1":"0 1 2 3 4 5 6 t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j","194":"k l m s"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z dC eC fC gC zB NC hC 0B"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:":has() CSS relational pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n"},C:{"1":"9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l SC TC","322":"0 1 2 3 4 5 6 m n t u v w x y z D 8B"},D:{"1":"0 1 2 3 4 5 6 t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j","194":"k l m n"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z eC fC gC hC zB NC iC 0B"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:":has() CSS relational pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hyphens.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hyphens.js index e60aef764cd016..0ebb0f77ca7a7d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hyphens.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-hyphens.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","33":"A B"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","33":"C K L H M N O","132":"P Q R S T U V W","260":"X Y Z a b c d e f g h i j k l m s"},C:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC","33":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},D:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","132":"eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W"},E:{"1":"3B LC MC cC","2":"7 I TC BC","33":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC"},F:{"1":"a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB dC eC fC gC zB NC hC 0B","132":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z"},G:{"1":"3B LC MC","2":"BC iC","33":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","132":"BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS Hyphenation",D:true}; +module.exports={A:{A:{"2":"J E F G PC","33":"A B"},B:{"1":"0 1 2 3 4 5 6 t u v w x y z D","33":"C K L H M N O","132":"P Q R S T U V W","260":"X Y Z a b c d e f g h i j k l m n"},C:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC","33":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},D:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","132":"eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W"},E:{"1":"3B LC MC dC","2":"7 I UC BC","33":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC"},F:{"1":"a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB eC fC gC hC zB NC iC 0B","132":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z"},G:{"1":"3B LC MC","2":"BC jC","33":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","132":"CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS Hyphenation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-orientation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-orientation.js index f18278ff5f67a3..00f6b22330a3c4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-orientation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-orientation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q","257":"R S T U V W X"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB RC SC"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q","257":"R S T U V W X"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B"},F:{"1":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB dC eC fC gC zB NC hC 0B","257":"pB qB rB sB tB r uB vB wB"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD","257":"ID JD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 image-orientation",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q","257":"R S T U V W X"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB SC TC"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q","257":"R S T U V W X"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B"},F:{"1":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB eC fC gC hC zB NC iC 0B","257":"pB qB rB sB tB s uB vB wB"},G:{"1":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID","257":"JD KD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 image-orientation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-set.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-set.js index 6a3569439a71d2..cd02951cd73b57 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-set.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-image-set.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"2 3 4 5 6 D","2":"C K L H M N O","164":"0 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","2049":"1"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U RC SC","66":"V W","2305":"0 Y Z a b c d e f g h i j k l m s t u v w x y z","2820":"X"},D:{"1":"2 3 4 5 6 D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n","164":"0 9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","2049":"1"},E:{"1":"3B LC MC cC","2":"7 I TC BC UC","132":"A B C K CC zB 0B DC","164":"J E F G VC WC XC","1540":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC"},F:{"1":"j k l m","2":"G B C dC eC fC gC zB NC hC 0B","164":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h","2049":"i"},G:{"1":"3B LC MC","2":"BC iC OC jC","132":"pC qC rC sC tC uC vC wC xC yC","164":"F kC lC mC nC oC","1540":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","164":"9C AD"},J:{"2":"E","164":"A"},K:{"2":"A B C zB NC 0B","164":"r"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"164":"DC"},R:{"164":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS image-set",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"2 3 4 5 6 D","2":"C K L H M N O","164":"0 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","2049":"1"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U SC TC","66":"V W","2305":"0 Y Z a b c d e f g h i j k l m n t u v w x y z","2820":"X"},D:{"1":"2 3 4 5 6 D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o","164":"0 9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","2049":"1"},E:{"1":"3B LC MC dC","2":"7 I UC BC VC","132":"A B C K CC zB 0B DC","164":"J E F G WC XC YC","1540":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC"},F:{"1":"j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h","2049":"i"},G:{"1":"3B LC MC","2":"BC jC OC kC","132":"qC rC sC tC uC vC wC xC yC zC","164":"F lC mC nC oC pC","1540":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","164":"AD BD"},J:{"2":"E","164":"A"},K:{"2":"A B C zB NC 0B","164":"s"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"164":"DC"},R:{"164":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS image-set",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-in-out-of-range.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-in-out-of-range.js index b00c47afaaec71..efb3f26328957f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-in-out-of-range.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-in-out-of-range.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C","260":"K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC","516":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I","16":"7 J E F G A B C K L","260":"bB","772":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7","772":"J E F G A UC VC WC XC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G dC","260":"B C OB eC fC gC zB NC hC 0B","772":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","772":"F jC kC lC mC nC oC pC"},H:{"132":"4C"},I:{"1":"D","2":"4B 5C 6C 7C","260":"I 8C OC 9C AD"},J:{"2":"E","260":"A"},K:{"1":"r","260":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","260":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","516":"OD"}},B:5,C:":in-range and :out-of-range CSS pseudo-classes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C","260":"K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC","516":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I","16":"7 J E F G A B C K L","260":"bB","772":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7","772":"J E F G A VC WC XC YC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G eC","260":"B C OB fC gC hC zB NC iC 0B","772":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","772":"F kC lC mC nC oC pC qC"},H:{"132":"5C"},I:{"1":"D","2":"4B 6C 7C 8C","260":"I 9C OC AD BD"},J:{"2":"E","260":"A"},K:{"1":"s","260":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","260":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","516":"PD"}},B:5,C:":in-range and :out-of-range CSS pseudo-classes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js index b5c05f4d20354e..71e9bde180c59a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","132":"A B","388":"G"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC 4B RC SC","132":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","388":"7 I"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I J TC BC","132":"E F G A VC WC XC","388":"UC"},F:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G B dC eC fC gC zB NC","132":"8 9 H M N O n o p q AB","516":"C hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC kC","132":"F lC mC nC oC pC"},H:{"516":"4C"},I:{"1":"D","16":"4B 5C 6C 7C AD","132":"9C","388":"I 8C OC"},J:{"16":"E","132":"A"},K:{"1":"r","16":"A B C zB NC","516":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","132":"OD"}},B:5,C:":indeterminate CSS pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F PC","132":"A B","388":"G"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC 4B SC TC","132":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","388":"7 I"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I J UC BC","132":"E F G A WC XC YC","388":"VC"},F:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G B eC fC gC hC zB NC","132":"8 9 H M N O o p q r AB","516":"C iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC lC","132":"F mC nC oC pC qC"},H:{"516":"5C"},I:{"1":"D","16":"4B 6C 7C 8C BD","132":"AD","388":"I 9C OC"},J:{"16":"E","132":"A"},K:{"1":"s","16":"A B C zB NC","516":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","132":"PD"}},B:5,C:":indeterminate CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-letter.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-letter.js index 2bf90692492f3b..e54a85cd009977 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-letter.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-letter.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x","260":"0 1 2 3 4 5 6 y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x","260":"0 1 2 3 4 5 6 y z D 8B 9B AC"},E:{"2":"7 I J E F TC BC UC VC WC","4":"G","164":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g dC eC fC gC zB NC hC 0B","260":"h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC","164":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"260":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q","2":"I n BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Initial Letter",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x","260":"0 1 2 3 4 5 6 y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x","260":"0 1 2 3 4 5 6 y z D 8B 9B AC"},E:{"2":"7 I J E F UC BC VC WC XC","4":"G","164":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g eC fC gC hC zB NC iC 0B","260":"h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC","164":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"260":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"p q r","2":"I o CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Initial Letter",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-value.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-value.js index f4709ef35f7bc7..13a284901634e0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-value.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-initial-value.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 I J E F G A B C K L H M N O RC SC","164":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS initial value",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"7 I J E F G A B C K L H M N O SC TC","164":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS initial value",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-lch-lab.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-lch-lab.js index 9f17430e1f46f0..668c0347e5d48f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-lch-lab.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-lch-lab.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x","322":"y"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y RC SC","194":"0 z"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x","322":"y"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC YC"},F:{"1":"h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g dC eC fC gC zB NC hC 0B"},G:{"1":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"p q","2":"I n o BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:4,C:"LCH and Lab color values",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x","322":"y"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y SC TC","194":"0 z"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x","322":"y"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC ZC"},F:{"1":"h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g eC fC gC hC zB NC iC 0B"},G:{"1":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"q r","2":"I o p CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:4,C:"LCH and Lab color values",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-letter-spacing.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-letter-spacing.js index 64dcdfa6161e01..13d466068ffb9c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-letter-spacing.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-letter-spacing.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","16":"PC","132":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC","132":"7 I J BC UC"},F:{"1":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G dC","132":"B C H M eC fC gC zB NC hC 0B"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"2":"4C"},I:{"1":"D 9C AD","16":"5C 6C","132":"4B I 7C 8C OC"},J:{"132":"E A"},K:{"1":"r","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"letter-spacing CSS property",D:true}; +module.exports={A:{A:{"1":"G A B","16":"PC","132":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC","132":"7 I J BC VC"},F:{"1":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G eC","132":"B C H M fC gC hC zB NC iC 0B"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"2":"5C"},I:{"1":"D AD BD","16":"6C 7C","132":"4B I 8C 9C OC"},J:{"132":"E A"},K:{"1":"s","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"letter-spacing CSS property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-line-clamp.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-line-clamp.js index f2278dcee64c6c..63149c6649a764 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-line-clamp.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-line-clamp.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB RC SC","33":"0 1 2 3 4 5 6 pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"16":"7 I J E F G A B C K","33":"0 1 2 3 4 5 6 8 9 L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"I TC BC","33":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"BC iC OC","33":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"16":"5C 6C","33":"4B I D 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"2":"A B C zB NC 0B","33":"r"},L:{"33":"D"},M:{"33":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"33":"DC"},R:{"33":"ND"},S:{"2":"OD","33":"PD"}},B:5,C:"CSS line-clamp",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB SC TC","33":"0 1 2 3 4 5 6 pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"16":"7 I J E F G A B C K","33":"0 1 2 3 4 5 6 8 9 L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"I UC BC","33":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"BC jC OC","33":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"16":"6C 7C","33":"4B I D 8C 9C OC AD BD"},J:{"33":"E A"},K:{"2":"A B C zB NC 0B","33":"s"},L:{"33":"D"},M:{"33":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"33":"DC"},R:{"33":"OD"},S:{"2":"PD","33":"QD"}},B:5,C:"CSS line-clamp",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-logical-props.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-logical-props.js index 1d6198a05e38bd..019bef50d17f9f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-logical-props.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-logical-props.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","1028":"W X","1540":"P Q R S T U V"},C:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC","164":"7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB RC SC","1540":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","292":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB","1028":"W X","1540":"qB rB sB tB r uB vB wB xB yB P Q R S T U V"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","292":"7 I J E F G A B C TC BC UC VC WC XC CC zB","1540":"K L 0B DC","3076":"YC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","292":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB","1028":"uB vB","1540":"fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r"},G:{"1":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","292":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC","1540":"uC vC wC xC yC zC","3076":"0C"},H:{"2":"4C"},I:{"1":"D","292":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"292":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","292":"I BD CD DD ED FD","1540":"CC GD HD ID JD"},Q:{"1540":"DC"},R:{"1":"ND"},S:{"1":"PD","1540":"OD"}},B:5,C:"CSS Logical Properties",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","1028":"W X","1540":"P Q R S T U V"},C:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC","164":"7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB SC TC","1540":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","292":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB","1028":"W X","1540":"qB rB sB tB s uB vB wB xB yB P Q R S T U V"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","292":"7 I J E F G A B C UC BC VC WC XC YC CC zB","1540":"K L 0B DC","3076":"ZC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","292":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB","1028":"uB vB","1540":"fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s"},G:{"1":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","292":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC","1540":"vC wC xC yC zC 0C","3076":"1C"},H:{"2":"5C"},I:{"1":"D","292":"4B I 6C 7C 8C 9C OC AD BD"},J:{"292":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","292":"I CD DD ED FD GD","1540":"CC HD ID JD KD"},Q:{"1540":"DC"},R:{"1":"OD"},S:{"1":"QD","1540":"PD"}},B:5,C:"CSS Logical Properties",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-marker-pseudo.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-marker-pseudo.js index 746f80398cc469..df69fd21890814 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-marker-pseudo.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-marker-pseudo.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S T U"},C:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB RC SC"},D:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U"},E:{"1":"cC","2":"7 I J E F G A B TC BC UC VC WC XC CC","129":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC"},F:{"1":"tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"CSS ::marker pseudo-element",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S T U"},C:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB SC TC"},D:{"1":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U"},E:{"1":"dC","2":"7 I J E F G A B UC BC VC WC XC YC CC","129":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC"},F:{"1":"tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"CSS ::marker pseudo-element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-masks.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-masks.js index 1f4f813feeed37..c86ee556f1c9dc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-masks.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-masks.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M","164":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","3138":"N","12292":"O"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","260":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC"},D:{"1":"8B 9B AC","164":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC","164":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","164":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","164":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"164":"D 9C AD","676":"4B I 5C 6C 7C 8C OC"},J:{"164":"E A"},K:{"2":"A B C zB NC 0B","164":"r"},L:{"164":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"164":"DC"},R:{"164":"ND"},S:{"1":"PD","260":"OD"}},B:4,C:"CSS Masks",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M","164":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","3138":"N","12292":"O"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","260":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC"},D:{"1":"8B 9B AC","164":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC","164":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","164":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"164":"D AD BD","676":"4B I 6C 7C 8C 9C OC"},J:{"164":"E A"},K:{"2":"A B C zB NC 0B","164":"s"},L:{"164":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"164":"DC"},R:{"164":"OD"},S:{"1":"QD","260":"PD"}},B:4,C:"CSS Masks",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-matches-pseudo.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-matches-pseudo.js index 7e0567c42017db..20a00e86d6244b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-matches-pseudo.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-matches-pseudo.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","1220":"P Q R S T U V W"},C:{"1":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC 4B RC SC","548":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB"},D:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","164":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB","196":"mB nB oB","1220":"pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7","164":"J E F UC VC WC","260":"G A B C K XC CC zB 0B DC"},F:{"1":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","164":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","196":"bB cB dB","1220":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC kC","164":"F lC mC","260":"nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"4C"},I:{"1":"D","16":"4B 5C 6C 7C","164":"I 8C OC 9C AD"},J:{"16":"E","164":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","164":"I BD CD DD ED FD CC GD HD ID JD"},Q:{"1220":"DC"},R:{"1":"ND"},S:{"1":"PD","548":"OD"}},B:5,C:":is() CSS pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","1220":"P Q R S T U V W"},C:{"1":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC 4B SC TC","548":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB"},D:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB","196":"mB nB oB","1220":"pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W"},E:{"1":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7","164":"J E F VC WC XC","260":"G A B C K YC CC zB 0B DC"},F:{"1":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","196":"bB cB dB","1220":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB"},G:{"1":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC lC","164":"F mC nC","260":"oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"5C"},I:{"1":"D","16":"4B 6C 7C 8C","164":"I 9C OC AD BD"},J:{"16":"E","164":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","164":"I CD DD ED FD GD CC HD ID JD KD"},Q:{"1220":"DC"},R:{"1":"OD"},S:{"1":"QD","548":"PD"}},B:5,C:":is() CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-math-functions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-math-functions.js index 21686da5734dc6..962517f87a76e8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-math-functions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-math-functions.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB RC SC"},D:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC","132":"C K zB 0B"},F:{"1":"nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB dC eC fC gC zB NC hC 0B"},G:{"1":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC","132":"sC tC uC vC wC xC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"CSS math functions min(), max() and clamp()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB SC TC"},D:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC","132":"C K zB 0B"},F:{"1":"nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB eC fC gC hC zB NC iC 0B"},G:{"1":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC","132":"tC uC vC wC xC yC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"CSS math functions min(), max() and clamp()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-interaction.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-interaction.js index 2b432f264bf909..18bfd713958502 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-interaction.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-interaction.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB RC SC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"Media Queries: interaction media features",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB SC TC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"Media Queries: interaction media features",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-range-syntax.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-range-syntax.js index eeebe0963f2ea3..66dd33d83152a8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-range-syntax.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-range-syntax.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 s t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB RC SC"},D:{"1":"0 1 2 3 4 5 6 s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"1":"a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z dC eC fC gC zB NC hC 0B"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"Media Queries: Range Syntax",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 n t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB SC TC"},D:{"1":"0 1 2 3 4 5 6 n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"1":"a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z eC fC gC hC zB NC iC 0B"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"Media Queries: Range Syntax",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-resolution.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-resolution.js index 3fd493b0c395bd..c8e04215c9fc63 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-resolution.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-resolution.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","1028":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","260":"7 I J E F G A B C K L H RC SC","1028":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B"},D:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","548":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB","1028":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC","548":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G","548":"B C dC eC fC gC zB NC hC","1028":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","16":"BC","548":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"132":"4C"},I:{"1":"D","16":"5C 6C","548":"4B I 7C 8C OC","1028":"9C AD"},J:{"548":"E A"},K:{"1":"r 0B","548":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","1028":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Media Queries: resolution feature",D:true}; +module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","1028":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","260":"7 I J E F G A B C K L H SC TC","1028":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B"},D:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","548":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB","1028":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC","548":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G","548":"B C eC fC gC hC zB NC iC","1028":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","16":"BC","548":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"132":"5C"},I:{"1":"D","16":"6C 7C","548":"4B I 8C 9C OC","1028":"AD BD"},J:{"548":"E A"},K:{"1":"s 0B","548":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","1028":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Media Queries: resolution feature",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-scripting.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-scripting.js index 79a96e69ab6ed4..d6784ece498232 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-scripting.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-media-scripting.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"Media Queries: scripting media feature",D:false}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"Media Queries: scripting media feature",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mediaqueries.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mediaqueries.js index 1caf50df4c7733..bda01685d7d1b8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mediaqueries.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mediaqueries.js @@ -1 +1 @@ -module.exports={A:{A:{"8":"J E F PC","129":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","129":"7 8 9 I J E F G A B C K L H M N O n o p q AB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","129":"7 I J UC","388":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","129":"BC iC OC jC kC"},H:{"1":"4C"},I:{"1":"D 9C AD","129":"4B I 5C 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS3 Media Queries",D:true}; +module.exports={A:{A:{"8":"J E F PC","129":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","129":"7 8 9 I J E F G A B C K L H M N O o p q r AB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","129":"7 I J VC","388":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","129":"BC jC OC kC lC"},H:{"1":"5C"},I:{"1":"D AD BD","129":"4B I 6C 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS3 Media Queries",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mixblendmode.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mixblendmode.js index 094c5109cce001..a2519a9acb7fa6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mixblendmode.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-mixblendmode.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB RC SC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB","194":"EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"2":"7 I J E TC BC UC VC","260":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB dC eC fC gC zB NC hC 0B"},G:{"2":"BC iC OC jC kC lC","260":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Blending of HTML/SVG elements",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB SC TC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB","194":"EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"2":"7 I J E UC BC VC WC","260":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB eC fC gC hC zB NC iC 0B"},G:{"2":"BC jC OC kC lC mC","260":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Blending of HTML/SVG elements",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-motion-paths.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-motion-paths.js index b475e453b0f1d5..422d025dc90097 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-motion-paths.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-motion-paths.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB RC SC"},D:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","194":"SB TB UB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB dC eC fC gC zB NC hC 0B","194":"FB GB HB"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"CSS Motion Path",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB SC TC"},D:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","194":"SB TB UB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB eC fC gC hC zB NC iC 0B","194":"FB GB HB"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"CSS Motion Path",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-namespaces.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-namespaces.js index e6ac77460c0de0..6968d457c88c51 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-namespaces.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-namespaces.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS namespaces",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC BC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS namespaces",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nesting.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nesting.js index e3a8046f06f2f1..ce1e58103dcbfa 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nesting.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nesting.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w","194":"x y z","516":"0 1 2 3 4 5 6 D"},C:{"1":"5 6 D 8B 9B AC","2":"0 1 2 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z RC SC","322":"3 4"},D:{"1":"8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w","194":"x y z","516":"0 1 2 3 4 5 6 D"},E:{"1":"MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC","516":"KC bC 3B LC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d dC eC fC gC zB NC hC 0B","194":"e f g","516":"h i j k l m"},G:{"1":"MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC","516":"KC 3C 3B LC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","516":"D"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"516":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Nesting",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w","194":"x y z","516":"0 1 2 3 4 5 6 D"},C:{"1":"5 6 D 8B 9B AC RC","2":"0 1 2 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z SC TC","322":"3 4"},D:{"1":"8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w","194":"x y z","516":"0 1 2 3 4 5 6 D"},E:{"1":"MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC","516":"KC cC 3B LC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d eC fC gC hC zB NC iC 0B","194":"e f g","516":"h i j k l m n"},G:{"1":"MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC","516":"KC 4C 3B LC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","516":"D"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"516":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Nesting",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-not-sel-list.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-not-sel-list.js index 1bfd4dcc57f7ae..e362681e5b740b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-not-sel-list.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-not-sel-list.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O Q R S T U V W","16":"P"},C:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S RC SC"},D:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID JD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"selector list argument of :not()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O Q R S T U V W","16":"P"},C:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S SC TC"},D:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD KD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"selector list argument of :not()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nth-child-of.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nth-child-of.js index 28be7e70c28621..e23d0592bcbf0c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nth-child-of.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-nth-child-of.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC","2":"0 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z RC SC"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"p q","2":"I n o BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"selector list argument of :nth-child and :nth-last-child CSS pseudo-classes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y"},C:{"1":"1 2 3 4 5 6 D 8B 9B AC RC","2":"0 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z SC TC"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"q r","2":"I o p CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"selector list argument of :nth-child and :nth-last-child CSS pseudo-classes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-opacity.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-opacity.js index 81148c4d3e8014..135f3608d369af 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-opacity.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-opacity.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","4":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS3 Opacity",D:true}; +module.exports={A:{A:{"1":"G A B","4":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS3 Opacity",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-optional-pseudo.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-optional-pseudo.js index 6d9ccdd6c00c2d..71551674ead0f4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-optional-pseudo.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-optional-pseudo.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G dC","132":"B C eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"132":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"r","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:":optional CSS pseudo-class",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G eC","132":"B C fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"132":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"s","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:":optional CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-anchor.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-anchor.js index 6a7dd0215c9a12..9db1a06c126e31 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-anchor.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-anchor.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB RC SC"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"CSS overflow-anchor (Scroll Anchoring)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB SC TC"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"CSS overflow-anchor (Scroll Anchoring)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-overlay.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-overlay.js index 115f75079951a7..b8e04349a31101 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-overlay.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow-overlay.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","2":"C K L H M N O","130":"2 3 4 5 6 D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","16":"7 I J E F G A B C K L","130":"2 3 4 5 6 D 8B 9B AC"},E:{"1":"7 I J E F G A B UC VC WC XC CC zB","16":"TC BC","130":"C K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i","2":"G B C dC eC fC gC zB NC hC 0B","130":"j k l m"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC","16":"BC","130":"tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I 5C 6C 7C 8C OC 9C AD","130":"D"},J:{"16":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"130":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS overflow: overlay",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","2":"C K L H M N O","130":"2 3 4 5 6 D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","16":"7 I J E F G A B C K L","130":"2 3 4 5 6 D 8B 9B AC"},E:{"1":"7 I J E F G A B VC WC XC YC CC zB","16":"UC BC","130":"C K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i","2":"G B C eC fC gC hC zB NC iC 0B","130":"j k l m n"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC","16":"BC","130":"uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I 6C 7C 8C 9C OC AD BD","130":"D"},J:{"16":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"130":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS overflow: overlay",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow.js index 4c2c5135040a2e..6f41eec8716edf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overflow.js @@ -1 +1 @@ -module.exports={A:{A:{"388":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D","260":"P Q R S T U V W X Y","388":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","260":"6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q","388":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB RC SC"},D:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","260":"pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y","388":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","260":"L H DC YC ZC EC FC 1B aC","388":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","260":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB","388":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB dC eC fC gC zB NC hC 0B"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","260":"yC zC 0C 1C EC FC 1B 2C","388":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC"},H:{"388":"4C"},I:{"1":"D","388":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"388":"E A"},K:{"1":"r","388":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"388":"A B"},O:{"388":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","388":"I BD CD DD ED FD CC GD HD ID JD"},Q:{"388":"DC"},R:{"1":"ND"},S:{"1":"PD","388":"OD"}},B:5,C:"CSS overflow property",D:true}; +module.exports={A:{A:{"388":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D","260":"P Q R S T U V W X Y","388":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","260":"6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q","388":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB SC TC"},D:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","260":"pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y","388":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","260":"L H DC ZC aC EC FC 1B bC","388":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","260":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB","388":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eC fC gC hC zB NC iC 0B"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","260":"zC 0C 1C 2C EC FC 1B 3C","388":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"388":"5C"},I:{"1":"D","388":"4B I 6C 7C 8C 9C OC AD BD"},J:{"388":"E A"},K:{"1":"s","388":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"388":"A B"},O:{"388":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","388":"I CD DD ED FD GD CC HD ID JD KD"},Q:{"388":"DC"},R:{"1":"OD"},S:{"1":"QD","388":"PD"}},B:5,C:"CSS overflow property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js index 5a200d3ad63968..b8eaf9b464e2e9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N","516":"O"},C:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB RC SC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB","260":"kB lB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC","1090":"H YC ZC EC FC 1B aC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB dC eC fC gC zB NC hC 0B","260":"ZB aB"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC","1090":"0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"CSS overscroll-behavior",D:true}; +module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N","516":"O"},C:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB SC TC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB","260":"kB lB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC","1090":"H ZC aC EC FC 1B bC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB eC fC gC hC zB NC iC 0B","260":"ZB aB"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C","1090":"1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"CSS overscroll-behavior",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-page-break.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-page-break.js index f26a8d64d6f8e8..a9df4c0d367c21 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-page-break.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-page-break.js @@ -1 +1 @@ -module.exports={A:{A:{"388":"A B","900":"J E F G PC"},B:{"388":"C K L H M N O","900":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"772":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","900":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB RC SC"},D:{"900":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"772":"A","900":"7 I J E F G B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"16":"G dC","129":"B C eC fC gC zB NC hC 0B","900":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"900":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"129":"4C"},I:{"900":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"900":"E A"},K:{"129":"A B C zB NC 0B","900":"r"},L:{"900":"D"},M:{"772":"D"},N:{"388":"A B"},O:{"900":"1B"},P:{"900":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"900":"DC"},R:{"900":"ND"},S:{"772":"PD","900":"OD"}},B:2,C:"CSS page-break properties",D:true}; +module.exports={A:{A:{"388":"A B","900":"J E F G PC"},B:{"388":"C K L H M N O","900":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"772":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","900":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB SC TC"},D:{"900":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"772":"A","900":"7 I J E F G B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"16":"G eC","129":"B C fC gC hC zB NC iC 0B","900":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"900":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"129":"5C"},I:{"900":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"900":"E A"},K:{"129":"A B C zB NC 0B","900":"s"},L:{"900":"D"},M:{"772":"D"},N:{"388":"A B"},O:{"900":"1B"},P:{"900":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"900":"DC"},R:{"900":"OD"},S:{"772":"QD","900":"PD"}},B:2,C:"CSS page-break properties",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paged-media.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paged-media.js index d0cccebaef8895..f2dc9d05d380de 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paged-media.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paged-media.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E PC","132":"F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N O"},C:{"2":"7 QC 4B I J E F G A B C K L H M N O RC SC","132":"0 1 2 3 4 5 6 8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","132":"G B C dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"16":"4C"},I:{"16":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"1":"r","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"258":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"132":"OD PD"}},B:5,C:"CSS Paged Media (@page)",D:true}; +module.exports={A:{A:{"2":"J E PC","132":"F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N O"},C:{"2":"7 QC 4B I J E F G A B C K L H M N O SC TC","132":"0 1 2 3 4 5 6 8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","132":"G B C eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"16":"5C"},I:{"16":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"1":"s","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"258":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"132":"PD QD"}},B:5,C:"CSS Paged Media (@page)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paint-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paint-api.js index 2a164e251ff091..1262e9844ae2fc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paint-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-paint-api.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},E:{"2":"7 I J E F G A B C TC BC UC VC WC XC CC zB","194":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:4,C:"CSS Painting API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},E:{"2":"7 I J E F G A B C UC BC VC WC XC YC CC zB","194":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:4,C:"CSS Painting API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder-shown.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder-shown.js index 1cf5be8e0c5602..e8bbc348a86fd9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder-shown.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder-shown.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","292":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","164":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","164":"OD"}},B:5,C:":placeholder-shown CSS pseudo-class",D:true}; +module.exports={A:{A:{"2":"J E F G PC","292":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","164":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","164":"PD"}},B:5,C:":placeholder-shown CSS pseudo-class",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder.js index 693340f52dab83..02c16914abcad5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-placeholder.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","36":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","130":"7 QC 4B I J E F G A B C K L H M N O RC SC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","36":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","36":"7 J E F G A UC VC WC XC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","36":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC","36":"F OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","36":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"36":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"36":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","36":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","33":"OD"}},B:5,C:"::placeholder CSS pseudo-element",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","36":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","130":"7 QC 4B I J E F G A B C K L H M N O SC TC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","36":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","36":"7 J E F G A VC WC XC YC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","36":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC","36":"F OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","36":"4B I 6C 7C 8C 9C OC AD BD"},J:{"36":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"36":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","36":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","33":"PD"}},B:5,C:"::placeholder CSS pseudo-element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-print-color-adjust.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-print-color-adjust.js index 8f1a72b4f7bfaf..6e845e1196f3af 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-print-color-adjust.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-print-color-adjust.js @@ -1 +1 @@ -module.exports={A:{D:{"2":"7 I J E F G A B C K L H M","33":"0 1 2 3 4 5 6 8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},L:{"33":"D"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB RC SC","33":"XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},K:{"2":"A B C zB NC 0B","33":"r"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I TC BC UC cC","33":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},I:{"2":"4B I 5C 6C 7C 8C OC","33":"D 9C AD"}},B:6,C:"print-color-adjust property",D:undefined}; +module.exports={A:{D:{"2":"7 I J E F G A B C K L H M","33":"0 1 2 3 4 5 6 8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},L:{"33":"D"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB SC TC","33":"XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},K:{"2":"A B C zB NC 0B","33":"s"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I UC BC VC dC","33":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},P:{"33":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},I:{"2":"4B I 6C 7C 8C 9C OC","33":"D AD BD"}},B:6,C:"print-color-adjust property",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-read-only-write.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-read-only-write.js index 7c85bdf841c0e4..372243438d9582 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-read-only-write.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-read-only-write.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC","33":"7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB RC SC"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC","132":"7 I J E F UC VC WC"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G B dC eC fC gC zB","132":"8 C H M N O n o p NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC","132":"F OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","16":"5C 6C","132":"4B I 7C 8C OC 9C AD"},J:{"1":"A","132":"E"},K:{"1":"r","2":"A B zB","132":"C NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","33":"OD"}},B:1,C:"CSS :read-only and :read-write selectors",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC","33":"7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB SC TC"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC BC","132":"7 I J E F VC WC XC"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G B eC fC gC hC zB","132":"8 C H M N O o p q NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC","132":"F OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","16":"6C 7C","132":"4B I 8C 9C OC AD BD"},J:{"1":"A","132":"E"},K:{"1":"s","2":"A B zB","132":"C NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","33":"PD"}},B:1,C:"CSS :read-only and :read-write selectors",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rebeccapurple.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rebeccapurple.js index b1fdefe66f993c..63e48f52953de8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rebeccapurple.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rebeccapurple.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC","16":"VC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Rebeccapurple color",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC","16":"WC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Rebeccapurple color",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-reflections.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-reflections.js index f2ba937fdc55e3..d26b02c38b145b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-reflections.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-reflections.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"TC BC","33":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"33":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"33":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"2":"A B C zB NC 0B","33":"r"},L:{"33":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"33":"DC"},R:{"33":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS Reflections",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"UC BC","33":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"33":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"33":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"33":"E A"},K:{"2":"A B C zB NC 0B","33":"s"},L:{"33":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"33":"DC"},R:{"33":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS Reflections",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-regions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-regions.js index 4ed6e3f02033dc..150d10d33aabca 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-regions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-regions.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","420":"A B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","420":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 I J E F G A B C K L KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","36":"H M N O","66":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB"},E:{"2":"7 I J C K L H TC BC UC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"E F G A B VC WC XC CC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"BC iC OC jC kC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"F lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"420":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Regions",D:true}; +module.exports={A:{A:{"2":"J E F G PC","420":"A B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","420":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 I J E F G A B C K L KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","36":"H M N O","66":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB"},E:{"2":"7 I J C K L H UC BC VC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"E F G A B WC XC YC CC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"BC jC OC kC lC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"F mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"420":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Regions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-relative-colors.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-relative-colors.js index 07ab17ae160a19..b8755e65a8f9be 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-relative-colors.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-relative-colors.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"D","2":"0 1 2 3 4 5 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","194":"6"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"D 8B 9B AC","2":"0 1 2 3 4 5 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","194":"6"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Relative colors",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"D","2":"0 1 2 3 4 5 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","194":"6"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"D 8B 9B AC","2":"0 1 2 3 4 5 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","194":"6"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Relative colors",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-repeating-gradients.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-repeating-gradients.js index 7a67a29a29a8e7..fa27b54f0be0bd 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-repeating-gradients.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-repeating-gradients.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC","33":"7 I J E F G A B C K L H SC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G","33":"8 9 A B C K L H M N O n o p q AB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC","33":"J UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC","33":"C hC","36":"zB NC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","33":"jC kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B 5C 6C 7C","33":"I 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r 0B","2":"A B","33":"C","36":"zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS Repeating Gradients",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC","33":"7 I J E F G A B C K L H TC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G","33":"8 9 A B C K L H M N O o p q r AB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC","33":"J VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC","33":"C iC","36":"zB NC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","33":"kC lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B 6C 7C 8C","33":"I 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s 0B","2":"A B","33":"C","36":"zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS Repeating Gradients",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-resize.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-resize.js index 092b75d9c269ca..192448775057c9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-resize.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-resize.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","33":"I"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC","132":"0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:2,C:"CSS resize property",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","33":"I"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC","132":"0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:2,C:"CSS resize property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-revert-value.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-revert-value.js index cc8a6aca2df558..e4b05b10aed9ef 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-revert-value.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-revert-value.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB RC SC"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC"},F:{"1":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB dC eC fC gC zB NC hC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"CSS revert value",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB SC TC"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC"},F:{"1":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB eC fC gC hC zB NC iC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"CSS revert value",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rrggbbaa.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rrggbbaa.js index 056bb9d51dcd22..67f3a519586a43 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rrggbbaa.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-rrggbbaa.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB RC SC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","194":"bB cB dB eB fB gB hB 5B iB 6B"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB dC eC fC gC zB NC hC 0B","194":"OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","194":"BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"#rrggbbaa hex color notation",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC TC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","194":"bB cB dB eB fB gB hB 5B iB 6B"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB eC fC gC hC zB NC iC 0B","194":"OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","194":"CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"#rrggbbaa hex color notation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-behavior.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-behavior.js index 71adfef18607a0..4d4e3b68ba08ee 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-behavior.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-behavior.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","129":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","129":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","450":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B DC","578":"L H YC ZC EC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB dC eC fC gC zB NC hC 0B","129":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","450":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC","578":"0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"129":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"129":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"CSS Scroll-behavior",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","129":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","129":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","450":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B DC","578":"L H ZC aC EC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB eC fC gC hC zB NC iC 0B","129":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","450":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C","578":"1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"129":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"129":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"CSS Scroll-behavior",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-timeline.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-timeline.js index 45abee26b3002b..73f3c8c5e2085b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-timeline.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scroll-timeline.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y","194":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T","194":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","322":"U V W"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB dC eC fC gC zB NC hC 0B","194":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","322":"r uB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS @scroll-timeline",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T U V W X Y","194":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T","194":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","322":"U V W"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB eC fC gC hC zB NC iC 0B","194":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","322":"s uB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS @scroll-timeline",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scrollbar.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scrollbar.js index 3d84a385309b92..598e98c7f6f4fe 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scrollbar.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-scrollbar.js @@ -1 +1 @@ -module.exports={A:{A:{"132":"J E F G A B PC"},B:{"2":"C K L H M N O","292":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB RC SC","3138":"kB"},D:{"292":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"16":"7 I TC BC","292":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","292":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC kC","292":"lC","804":"F mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"4C"},I:{"16":"5C 6C","292":"4B I D 7C 8C OC 9C AD"},J:{"292":"E A"},K:{"2":"A B C zB NC 0B","292":"r"},L:{"292":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"292":"1B"},P:{"292":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"292":"DC"},R:{"292":"ND"},S:{"2":"OD PD"}},B:4,C:"CSS scrollbar styling",D:true}; +module.exports={A:{A:{"132":"J E F G A B PC"},B:{"2":"C K L H M N O","292":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB SC TC","3138":"kB"},D:{"292":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"16":"7 I UC BC","292":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","292":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC lC","292":"mC","804":"F nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"5C"},I:{"16":"6C 7C","292":"4B I D 8C 9C OC AD BD"},J:{"292":"E A"},K:{"2":"A B C zB NC 0B","292":"s"},L:{"292":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"292":"1B"},P:{"292":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"292":"DC"},R:{"292":"OD"},S:{"2":"PD QD"}},B:4,C:"CSS scrollbar styling",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel2.js index 8470bf905154f7..3496ddc7a922e6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel2.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"E F G A B","2":"PC","8":"J"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS 2.1 selectors",D:true}; +module.exports={A:{A:{"1":"E F G A B","2":"PC","8":"J"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS 2.1 selectors",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel3.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel3.js index 355e6d425a611d..e5455c039f2594 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel3.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sel3.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"PC","8":"J","132":"E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS3 selectors",D:true}; +module.exports={A:{A:{"1":"G A B","2":"PC","8":"J","132":"E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS3 selectors",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-selection.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-selection.js index 253f9dd90876a9..f7a3f92d0d2b37 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-selection.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-selection.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"C r NC 0B","16":"A B zB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","33":"OD"}},B:5,C:"::selection CSS pseudo-element",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"C s NC 0B","16":"A B zB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","33":"PD"}},B:5,C:"::selection CSS pseudo-element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-shapes.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-shapes.js index d49e6223d369ce..c08a1fe1641fa9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-shapes.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-shapes.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB RC SC","322":"aB bB cB dB eB fB gB hB 5B iB 6B"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB","194":"JB KB LB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC","33":"F G A WC XC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","33":"F mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"CSS Shapes Level 1",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB SC TC","322":"aB bB cB dB eB fB gB hB 5B iB 6B"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB","194":"JB KB LB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC","33":"F G A XC YC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","33":"F nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"CSS Shapes Level 1",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-snappoints.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-snappoints.js index b7a18275a8b0fe..a76b8de66435cf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-snappoints.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-snappoints.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","6308":"A","6436":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","6436":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB RC SC","2052":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB","8258":"nB oB pB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC","3108":"G A XC CC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B","8258":"dB eB fB gB hB iB jB kB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC","3108":"nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2052":"OD"}},B:4,C:"CSS Scroll Snap",D:true}; +module.exports={A:{A:{"2":"J E F G PC","6308":"A","6436":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","6436":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB SC TC","2052":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB","8258":"nB oB pB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC","3108":"G A YC CC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B","8258":"dB eB fB gB hB iB jB kB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC","3108":"oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2052":"PD"}},B:4,C:"CSS Scroll Snap",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sticky.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sticky.js index 36ec0fa0ef3395..7a16e9ca2e30f9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sticky.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-sticky.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H","1028":"P Q R S T U V W X Y Z","4100":"M N O"},C:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB RC SC","194":"BB CB DB EB FB GB","516":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},D:{"1":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o p MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","322":"9 q AB BB CB DB EB FB GB HB IB JB KB LB bB cB dB eB","1028":"fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC","33":"F G A B C WC XC CC zB 0B","2084":"E VC"},F:{"1":"yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB dC eC fC gC zB NC hC 0B","322":"OB PB QB","1028":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"F mC nC oC pC qC rC sC tC uC","2084":"kC lC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1028":"DC"},R:{"1":"ND"},S:{"1":"PD","516":"OD"}},B:5,C:"CSS position:sticky",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H","1028":"P Q R S T U V W X Y Z","4100":"M N O"},C:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB SC TC","194":"BB CB DB EB FB GB","516":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},D:{"1":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p q MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","322":"9 r AB BB CB DB EB FB GB HB IB JB KB LB bB cB dB eB","1028":"fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC","33":"F G A B C XC YC CC zB 0B","2084":"E WC"},F:{"1":"yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB eC fC gC hC zB NC iC 0B","322":"OB PB QB","1028":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"F nC oC pC qC rC sC tC uC vC","2084":"lC mC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1028":"DC"},R:{"1":"OD"},S:{"1":"QD","516":"PD"}},B:5,C:"CSS position:sticky",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-subgrid.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-subgrid.js index b66c0732654cae..366c68553e6d7e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-subgrid.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-subgrid.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"5 6 D","2":"0 1 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","194":"2 3 4"},C:{"1":"0 1 2 3 4 5 6 sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB RC SC"},D:{"1":"5 6 D 8B 9B AC","2":"0 1 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","194":"2 3 4"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i dC eC fC gC zB NC hC 0B","194":"j k l"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"CSS Subgrid",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"5 6 D","2":"0 1 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","194":"2 3 4"},C:{"1":"0 1 2 3 4 5 6 sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB SC TC"},D:{"1":"5 6 D 8B 9B AC","2":"0 1 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","194":"2 3 4"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i eC fC gC hC zB NC iC 0B","194":"j k l"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"CSS Subgrid",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-supports-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-supports-api.js index cd02500b58af18..beaf0b5ba0fcde 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-supports-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-supports-api.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O RC SC","66":"n o","260":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB","260":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC","132":"0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"132":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS.supports() API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O SC TC","66":"o p","260":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB","260":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC","132":"0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"132":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS.supports() API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-table.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-table.js index 556e9f9f38d1b2..4debdb2a371513 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-table.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-table.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","132":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS Table display",D:true}; +module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","132":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS Table display",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-align-last.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-align-last.js index 51752da7a2141f..787f4c1d1c18d6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-align-last.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-align-last.js @@ -1 +1 @@ -module.exports={A:{A:{"132":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","4":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B RC SC","33":"8 9 C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB","322":"KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o dC eC fC gC zB NC hC 0B","578":"9 p q AB BB CB DB EB FB GB HB IB"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","33":"OD"}},B:4,C:"CSS3 text-align-last",D:true}; +module.exports={A:{A:{"132":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","4":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B SC TC","33":"8 9 C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB","322":"KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p eC fC gC hC zB NC iC 0B","578":"9 q r AB BB CB DB EB FB GB HB IB"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","33":"PD"}},B:4,C:"CSS3 text-align-last",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-box-trim.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-box-trim.js index 680f797b72dc0e..20e8567ffa9796 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-box-trim.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-box-trim.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC","194":"JC KC bC 3B LC MC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC","194":"JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS text-box-trim & text-box-edge",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC","194":"JC KC cC 3B LC MC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC","194":"JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS text-box-trim & text-box-edge",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-indent.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-indent.js index c20402b2f49fc5..cd131c65842a19 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-indent.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-indent.js @@ -1 +1 @@ -module.exports={A:{A:{"132":"J E F G A B PC"},B:{"132":"C K L H M N O","388":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"9B AC","132":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B RC SC"},D:{"132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB","388":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","132":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"132":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B","388":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","132":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"132":"4C"},I:{"132":"4B I 5C 6C 7C 8C OC 9C AD","388":"D"},J:{"132":"E A"},K:{"132":"A B C zB NC 0B","388":"r"},L:{"388":"D"},M:{"132":"D"},N:{"132":"A B"},O:{"388":"1B"},P:{"132":"I","388":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"388":"DC"},R:{"388":"ND"},S:{"132":"OD PD"}},B:4,C:"CSS text-indent",D:true}; +module.exports={A:{A:{"132":"J E F G A B PC"},B:{"132":"C K L H M N O","388":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"9B AC RC","132":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B SC TC"},D:{"132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB","388":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","132":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"132":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B","388":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","132":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"132":"5C"},I:{"132":"4B I 6C 7C 8C 9C OC AD BD","388":"D"},J:{"132":"E A"},K:{"132":"A B C zB NC 0B","388":"s"},L:{"388":"D"},M:{"132":"D"},N:{"132":"A B"},O:{"388":"1B"},P:{"132":"I","388":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"388":"DC"},R:{"388":"OD"},S:{"132":"PD QD"}},B:4,C:"CSS text-indent",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-justify.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-justify.js index daa605ef25f320..39b947be05546e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-justify.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-justify.js @@ -1 +1 @@ -module.exports={A:{A:{"16":"J E PC","132":"F G A B"},B:{"132":"C K L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB RC SC","1025":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","1602":"dB"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","322":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB dC eC fC gC zB NC hC 0B","322":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","322":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","322":"r"},L:{"322":"D"},M:{"1025":"D"},N:{"132":"A B"},O:{"322":"1B"},P:{"2":"I","322":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"322":"DC"},R:{"322":"ND"},S:{"2":"OD","1025":"PD"}},B:4,C:"CSS text-justify",D:true}; +module.exports={A:{A:{"16":"J E PC","132":"F G A B"},B:{"132":"C K L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB SC TC","1025":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","1602":"dB"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","322":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB eC fC gC hC zB NC iC 0B","322":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","322":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","322":"s"},L:{"322":"D"},M:{"1025":"D"},N:{"132":"A B"},O:{"322":"1B"},P:{"2":"I","322":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"322":"DC"},R:{"322":"OD"},S:{"2":"PD","1025":"QD"}},B:4,C:"CSS text-justify",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-orientation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-orientation.js index 6bd2bf1c68b182..e197caf1a4ca2a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-orientation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-orientation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB RC SC","194":"NB OB PB"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC","16":"A","33":"B C K CC zB 0B DC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS text-orientation",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB SC TC","194":"NB OB PB"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"1":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC","16":"A","33":"B C K CC zB 0B DC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS text-orientation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-spacing.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-spacing.js index b4714db6fd5e01..c8c666df7b0d44 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-spacing.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-spacing.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E PC","161":"F G A B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","161":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"16":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS Text 4 text-spacing",D:false}; +module.exports={A:{A:{"2":"J E PC","161":"F G A B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","161":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"16":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS Text 4 text-spacing",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js index ac49eef836d447..24bbc22fc789d3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"2 3 4 5 6 D","2":"0 1 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z"},C:{"1":"9B AC","2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B RC SC"},D:{"1":"2 3 4 5 6 D 8B 9B AC","2":"0 1 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z"},E:{"1":"cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC"},F:{"1":"i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS text-wrap: balance",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"2 3 4 5 6 D","2":"0 1 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z"},C:{"1":"9B AC RC","2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B SC TC"},D:{"1":"2 3 4 5 6 D 8B 9B AC","2":"0 1 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z"},E:{"1":"dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC"},F:{"1":"i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS text-wrap: balance",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-textshadow.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-textshadow.js index 9560fe907e326b..6367a1614a67e8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-textshadow.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-textshadow.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","260":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"4":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"A","4":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 Text-shadow",D:true}; +module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","260":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"4":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"A","4":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 Text-shadow",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-touch-action.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-touch-action.js index f89d8cfa875a1c..7340375619c518 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-touch-action.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-touch-action.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G PC","289":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC","194":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","1025":"bB cB dB eB fB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p dC eC fC gC zB NC hC 0B"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC","516":"oC pC qC rC sC tC uC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","289":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","194":"OD"}},B:2,C:"CSS touch-action property",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G PC","289":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC","194":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","1025":"bB cB dB eB fB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q eC fC gC hC zB NC iC 0B"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC","516":"pC qC rC sC tC uC vC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","289":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","194":"PD"}},B:2,C:"CSS touch-action property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-transitions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-transitions.js index 4c31c962569bf0..6d9ccdcacb1295 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-transitions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-transitions.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","33":"7 J E F G A B C K L H","164":"I"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"J UC","164":"7 I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G dC eC","33":"C","164":"B fC gC zB NC hC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"kC","164":"BC iC OC jC"},H:{"2":"4C"},I:{"1":"D 9C AD","33":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","33":"E"},K:{"1":"r 0B","33":"C","164":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"CSS3 Transitions",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","33":"7 J E F G A B C K L H","164":"I"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"J VC","164":"7 I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G eC fC","33":"C","164":"B gC hC zB NC iC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"lC","164":"BC jC OC kC"},H:{"2":"5C"},I:{"1":"D AD BD","33":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","33":"E"},K:{"1":"s 0B","33":"C","164":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"CSS3 Transitions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unicode-bidi.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unicode-bidi.js index 0726b32122e5f1..9c8326410834e9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unicode-bidi.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unicode-bidi.js @@ -1 +1 @@ -module.exports={A:{A:{"132":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","132":"7 QC 4B I J E F G RC SC","292":"A B C K L H M"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 I J E F G A B C K L H M","548":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"132":"7 I J E F TC BC UC VC WC","548":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"132":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"132":"F BC iC OC jC kC lC mC","548":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"16":"4C"},I:{"1":"D","16":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"1":"r","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","16":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","33":"OD"}},B:4,C:"CSS unicode-bidi property",D:false}; +module.exports={A:{A:{"132":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","132":"7 QC 4B I J E F G SC TC","292":"A B C K L H M"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 I J E F G A B C K L H M","548":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"132":"7 I J E F UC BC VC WC XC","548":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"132":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"132":"F BC jC OC kC lC mC nC","548":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"16":"5C"},I:{"1":"D","16":"4B I 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"1":"s","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","16":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","33":"PD"}},B:4,C:"CSS unicode-bidi property",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unset-value.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unset-value.js index d0689803b43a01..965e018b71fac6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unset-value.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-unset-value.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB RC SC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB dC eC fC gC zB NC hC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS unset value",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB SC TC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB eC fC gC hC zB NC iC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS unset value",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-variables.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-variables.js index de100a322ea550..e6477e3ee78488 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-variables.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-variables.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L","260":"H"},C:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","194":"XB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC","260":"XC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB dC eC fC gC zB NC hC 0B","194":"KB"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC","260":"oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS Variables (Custom Properties)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L","260":"H"},C:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","194":"XB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC","260":"YC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB eC fC gC hC zB NC iC 0B","194":"KB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC","260":"pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS Variables (Custom Properties)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-when-else.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-when-else.js index 658a4c4c2b91a6..9c50f095ed1fed 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-when-else.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-when-else.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"CSS @when / @else conditional rules",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"CSS @when / @else conditional rules",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-widows-orphans.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-widows-orphans.js index f87bd0c62bdade..655d9649385bfc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-widows-orphans.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-widows-orphans.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E PC","129":"F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","129":"G B dC eC fC gC zB NC hC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:2,C:"CSS widows & orphans",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E PC","129":"F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","129":"G B eC fC gC hC zB NC iC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:2,C:"CSS widows & orphans",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-width-stretch.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-width-stretch.js index f1a042f8af90fe..ad01425766b69d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-width-stretch.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-width-stretch.js @@ -1 +1 @@ -module.exports={A:{D:{"2":"7 8 I J E F G A B C K L H M N O n o","33":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},L:{"33":"D"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"QC","33":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},M:{"33":"D"},A:{"2":"J E F G A B PC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},K:{"2":"A B C zB NC 0B","33":"r"},E:{"2":"7 I J TC BC UC VC cC","33":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC"},G:{"2":"BC iC OC jC kC","33":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},P:{"2":"I","33":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},I:{"2":"4B I 5C 6C 7C 8C OC","33":"D 9C AD"}},B:6,C:"width: stretch property",D:undefined}; +module.exports={A:{D:{"2":"7 8 I J E F G A B C K L H M N O o p","33":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},L:{"33":"D"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"QC","33":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},M:{"33":"D"},A:{"2":"J E F G A B PC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},K:{"2":"A B C zB NC 0B","33":"s"},E:{"2":"7 I J UC BC VC WC dC","33":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC"},G:{"2":"BC jC OC kC lC","33":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},P:{"2":"I","33":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},I:{"2":"4B I 6C 7C 8C 9C OC","33":"D AD BD"}},B:6,C:"width: stretch property",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-writing-mode.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-writing-mode.js index 2656b03cc36745..71e9b07998c95e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-writing-mode.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-writing-mode.js @@ -1 +1 @@ -module.exports={A:{A:{"132":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC","322":"LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J","16":"E","33":"8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7","33":"J E F G A UC VC WC XC CC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC","33":"F jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"5C 6C 7C","33":"4B I 8C OC 9C AD"},J:{"33":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"36":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","33":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS writing-mode property",D:true}; +module.exports={A:{A:{"132":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC","322":"LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J","16":"E","33":"8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7","33":"J E F G A VC WC XC YC CC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC","33":"F kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"6C 7C 8C","33":"4B I 9C OC AD BD"},J:{"33":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"36":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","33":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS writing-mode property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-zoom.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-zoom.js index 112c06fcbc2fb8..7d9ab3296c2909 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-zoom.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css-zoom.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E PC","129":"F G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS zoom",D:true}; +module.exports={A:{A:{"1":"J E PC","129":"F G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS zoom",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-attr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-attr.js index b8d0a88c3f94c7..40a8ffe5ce0dd2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-attr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-attr.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS3 attr() function for all properties",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS3 attr() function for all properties",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-boxsizing.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-boxsizing.js index c9def8286b6050..c18117cf979fb1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-boxsizing.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-boxsizing.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","8":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 I J E F G"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"7 I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"BC iC OC"},H:{"1":"4C"},I:{"1":"I D 8C OC 9C AD","33":"4B 5C 6C 7C"},J:{"1":"A","33":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"CSS3 Box-sizing",D:true}; +module.exports={A:{A:{"1":"F G A B","8":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 I J E F G"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"7 I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"BC jC OC"},H:{"1":"5C"},I:{"1":"I D 9C OC AD BD","33":"4B 6C 7C 8C"},J:{"1":"A","33":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"CSS3 Box-sizing",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-colors.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-colors.js index 29c2ad02d314de..b4481333f9f4e2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-colors.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-colors.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","4":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","2":"G","4":"dC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS3 Colors",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","4":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","2":"G","4":"eC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS3 Colors",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-grab.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-grab.js index 181f26ed9c2eb0..648da2ca9e8239 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-grab.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-grab.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB RC SC"},D:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"C eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:2,C:"CSS grab & grabbing cursors",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB SC TC"},D:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"C eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"33":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:2,C:"CSS grab & grabbing cursors",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-newer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-newer.js index 050a80397d3568..5578ec1148fd02 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-newer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors-newer.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 QC 4B I J E F G A B C K L H M N O n o p q RC SC"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"7 I J E F TC BC UC VC WC"},F:{"1":"9 C AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC","33":"8 H M N O n o p q"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:2,C:"CSS3 Cursors: zoom-in & zoom-out",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"7 8 QC 4B I J E F G A B C K L H M N O o p q r SC TC"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"7 I J E F UC BC VC WC XC"},F:{"1":"9 C AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC","33":"8 H M N O o p q r"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"33":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:2,C:"CSS3 Cursors: zoom-in & zoom-out",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors.js index ca87197995cd73..fb8216ed55946c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-cursors.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"I"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","4":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","260":"G B C dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","16":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:2,C:"CSS3 Cursors (original values)",D:true}; +module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","4":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"I"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","4":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","260":"G B C eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","16":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:2,C:"CSS3 Cursors (original values)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-tabsize.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-tabsize.js index 0e53f17f8c4aca..20a2ab83098128 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-tabsize.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/css3-tabsize.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","33":"cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z","164":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},D:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n","132":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC","132":"E F G A B C K VC WC XC CC zB 0B"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G dC eC fC","132":"8 9 H M N O n o p q AB BB CB DB","164":"B C gC zB NC hC 0B"},G:{"1":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC","132":"F lC mC nC oC pC qC rC sC tC uC vC wC xC"},H:{"164":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","132":"9C AD"},J:{"132":"E A"},K:{"1":"r","2":"A","164":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"164":"OD PD"}},B:4,C:"CSS3 tab-size",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","33":"cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z","164":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},D:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o","132":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC","132":"E F G A B C K WC XC YC CC zB 0B"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G eC fC gC","132":"8 9 H M N O o p q r AB BB CB DB","164":"B C hC zB NC iC 0B"},G:{"1":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC","132":"F mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"164":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","132":"AD BD"},J:{"132":"E A"},K:{"1":"s","2":"A","164":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"164":"PD QD"}},B:4,C:"CSS3 tab-size",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/currentcolor.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/currentcolor.js index 868feb56d495b1..9ff290a105eb28 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/currentcolor.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/currentcolor.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS currentColor value",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS currentColor value",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elements.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elements.js index e0f37b9bf8a509..4298975dd860ac 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elements.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elements.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"P","2":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","8":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 QC 4B I J E F G A B C K L H M N O n o p 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","66":"9 q AB BB CB DB EB","72":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},D:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","66":"CB DB EB FB GB HB"},E:{"2":"7 I TC BC UC","8":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","2":"G B C oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","66":"8 H M N O"},G:{"2":"BC iC OC jC kC","8":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"AD","2":"4B I D 5C 6C 7C 8C OC 9C"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I BD CD DD ED FD CC GD HD","2":"n o p q ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"2":"PD","72":"OD"}},B:7,C:"Custom Elements (deprecated V0 spec)",D:true}; +module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"P","2":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","8":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 QC 4B I J E F G A B C K L H M N O o p q 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","66":"9 r AB BB CB DB EB","72":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},D:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","66":"CB DB EB FB GB HB"},E:{"2":"7 I UC BC VC","8":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","2":"G B C oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","66":"8 H M N O"},G:{"2":"BC jC OC kC lC","8":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"BD","2":"4B I D 6C 7C 8C 9C OC AD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I CD DD ED FD GD CC HD ID","2":"o p q r JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"2":"QD","72":"PD"}},B:7,C:"Custom Elements (deprecated V0 spec)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elementsv1.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elementsv1.js index 415c5565a28655..ad0600f1e6ae1e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elementsv1.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/custom-elementsv1.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","8":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB RC SC","8":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","456":"ZB aB bB cB dB eB fB gB hB","712":"5B iB 6B jB"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","8":"bB cB","132":"dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E TC BC UC VC WC","8":"F G A XC","132":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB dC eC fC gC zB NC hC 0B","132":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC","132":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","132":"BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","8":"OD"}},B:1,C:"Custom Elements (V1)",D:true}; +module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","8":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB SC TC","8":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","456":"ZB aB bB cB dB eB fB gB hB","712":"5B iB 6B jB"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","8":"bB cB","132":"dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E UC BC VC WC XC","8":"F G A YC","132":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB eC fC gC hC zB NC iC 0B","132":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC","132":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","132":"CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","8":"PD"}},B:1,C:"Custom Elements (V1)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/customevent.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/customevent.js index 7801c61c041cf3..84fe6000abc8af 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/customevent.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/customevent.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC","132":"J E F G A"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I","16":"7 J E F K L","388":"G A B C"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7 J","388":"UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G dC eC fC gC","132":"B zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"iC","16":"BC OC","388":"jC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"5C 6C 7C","388":"4B I 8C OC"},J:{"1":"A","388":"E"},K:{"1":"C r 0B","2":"A","132":"B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"CustomEvent",D:true}; +module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC","132":"J E F G A"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I","16":"7 J E F K L","388":"G A B C"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7 J","388":"VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G eC fC gC hC","132":"B zB NC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"jC","16":"BC OC","388":"kC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"6C 7C 8C","388":"4B I 9C OC"},J:{"1":"A","388":"E"},K:{"1":"C s 0B","2":"A","132":"B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"CustomEvent",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datalist.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datalist.js index f91a2b373b1a1d..6b756888cca4c2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datalist.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datalist.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F G","260":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H","1284":"M N O"},C:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC","8":"QC 4B RC SC","516":"l m s t u v w x","4612":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 8 I J E F G A B C K L H M N O","132":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I J E F G A B C TC BC UC VC WC XC CC zB"},F:{"1":"G B C lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"8":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC","2049":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D AD","8":"4B I 5C 6C 7C 8C OC 9C"},J:{"1":"A","8":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:1,C:"Datalist element",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F G","260":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H","1284":"M N O"},C:{"1":"0 1 2 3 4 5 6 y z D 8B 9B AC RC","8":"QC 4B SC TC","516":"l m n t u v w x","4612":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"7 8 I J E F G A B C K L H M N O","132":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I J E F G A B C UC BC VC WC XC YC CC zB"},F:{"1":"G B C lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"8":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC","2049":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D BD","8":"4B I 6C 7C 8C 9C OC AD"},J:{"1":"A","8":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:1,C:"Datalist element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dataset.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dataset.js index 3a2b280b230ad5..36d3e5f8a70f4d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dataset.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dataset.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","4":"J E F G A PC"},B:{"1":"C K L H M","129":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","4":"7 QC 4B I RC SC","129":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"UB VB WB XB YB ZB aB bB cB dB","4":"7 I J","129":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"4":"7 I TC BC","129":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"C HB IB JB KB LB MB NB OB PB QB zB NC hC 0B","4":"G B dC eC fC gC","129":"8 9 H M N O n o p q AB BB CB DB EB FB GB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"4":"BC iC OC","129":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"4":"4C"},I:{"4":"5C 6C 7C","129":"4B I D 8C OC 9C AD"},J:{"129":"E A"},K:{"1":"C zB NC 0B","4":"A B","129":"r"},L:{"129":"D"},M:{"129":"D"},N:{"1":"B","4":"A"},O:{"129":"1B"},P:{"129":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"129":"DC"},R:{"129":"ND"},S:{"1":"OD","129":"PD"}},B:1,C:"dataset & data-* attributes",D:true}; +module.exports={A:{A:{"1":"B","4":"J E F G A PC"},B:{"1":"C K L H M","129":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","4":"7 QC 4B I SC TC","129":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"UB VB WB XB YB ZB aB bB cB dB","4":"7 I J","129":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"4":"7 I UC BC","129":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"C HB IB JB KB LB MB NB OB PB QB zB NC iC 0B","4":"G B eC fC gC hC","129":"8 9 H M N O o p q r AB BB CB DB EB FB GB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"4":"BC jC OC","129":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"4":"5C"},I:{"4":"6C 7C 8C","129":"4B I D 9C OC AD BD"},J:{"129":"E A"},K:{"1":"C zB NC 0B","4":"A B","129":"s"},L:{"129":"D"},M:{"129":"D"},N:{"1":"B","4":"A"},O:{"129":"1B"},P:{"129":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"129":"DC"},R:{"129":"OD"},S:{"1":"PD","129":"QD"}},B:1,C:"dataset & data-* attributes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datauri.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datauri.js index d276be3614fe0f..f57b5b5f7fd043 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datauri.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/datauri.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E PC","132":"F","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K H M N O","772":"L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Data URIs",D:true}; +module.exports={A:{A:{"2":"J E PC","132":"F","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K H M N O","772":"L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Data URIs",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js index 93be2d83b7c59d..06507f3cb5a8a5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js @@ -1 +1 @@ -module.exports={A:{A:{"16":"PC","132":"J E F G A B"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC","260":"bB cB dB eB","772":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},D:{"1":"0 1 2 3 4 5 6 rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 I J E F G A B C K L H M N O n o p q","260":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB","772":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"C K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC","132":"J E F G A UC VC WC XC","260":"B CC zB"},F:{"1":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G B C dC eC fC gC zB NC hC","132":"0B","260":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","772":"8 9 H M N O n o p q"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC","132":"F kC lC mC nC oC pC"},H:{"132":"4C"},I:{"1":"D","16":"4B 5C 6C 7C","132":"I 8C OC","772":"9C AD"},J:{"132":"E A"},K:{"1":"r","16":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","260":"I BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","132":"OD"}},B:6,C:"Date.prototype.toLocaleDateString",D:true}; +module.exports={A:{A:{"16":"PC","132":"J E F G A B"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC","260":"bB cB dB eB","772":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},D:{"1":"0 1 2 3 4 5 6 rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 8 I J E F G A B C K L H M N O o p q r","260":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB","772":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"C K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC","132":"J E F G A VC WC XC YC","260":"B CC zB"},F:{"1":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G B C eC fC gC hC zB NC iC","132":"0B","260":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","772":"8 9 H M N O o p q r"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC","132":"F lC mC nC oC pC qC"},H:{"132":"5C"},I:{"1":"D","16":"4B 6C 7C 8C","132":"I 9C OC","772":"AD BD"},J:{"132":"E A"},K:{"1":"s","16":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","260":"I CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","132":"PD"}},B:6,C:"Date.prototype.toLocaleDateString",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js index 2b507108260fec..dbfd94968c18a4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T","66":"U V W X Y"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"1":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB dC eC fC gC zB NC hC 0B"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID JD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Declarative Shadow DOM",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T","66":"U V W X Y"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"1":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB eC fC gC hC zB NC iC 0B"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD KD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Declarative Shadow DOM",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/decorators.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/decorators.js index 19693538e33008..2c930fd32425dd 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/decorators.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/decorators.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Decorators",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Decorators",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/details.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/details.js index d50ef71cd390e4..3e245d51e2ccbe 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/details.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/details.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"G A B PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC","8":"7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC","194":"WB XB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 I J E F G A B","257":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB","769":"C K L H M N O"},E:{"1":"C K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I TC BC UC","257":"J E F G A VC WC XC","1025":"B CC zB"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"C zB NC hC 0B","8":"G B dC eC fC gC"},G:{"1":"F kC lC mC nC oC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC jC","1025":"pC qC rC"},H:{"8":"4C"},I:{"1":"I D 8C OC 9C AD","8":"4B 5C 6C 7C"},J:{"1":"A","8":"E"},K:{"1":"r","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Details & Summary elements",D:true}; +module.exports={A:{A:{"2":"G A B PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC","8":"7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC","194":"WB XB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"7 I J E F G A B","257":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB","769":"C K L H M N O"},E:{"1":"C K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I UC BC VC","257":"J E F G A WC XC YC","1025":"B CC zB"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"C zB NC iC 0B","8":"G B eC fC gC hC"},G:{"1":"F lC mC nC oC pC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC kC","1025":"qC rC sC"},H:{"8":"5C"},I:{"1":"I D 9C OC AD BD","8":"4B 6C 7C 8C"},J:{"1":"A","8":"E"},K:{"1":"s","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Details & Summary elements",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/deviceorientation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/deviceorientation.js index 20b25a1f6ab97e..912adf8e6102c9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/deviceorientation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/deviceorientation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"C K L H M N O","4":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"QC 4B RC","4":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 I SC"},D:{"2":"7 I J","4":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","4":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"BC iC","4":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"5C 6C 7C","4":"4B I D 8C OC 9C AD"},J:{"2":"E","4":"A"},K:{"1":"C 0B","2":"A B zB NC","4":"r"},L:{"4":"D"},M:{"4":"D"},N:{"1":"B","2":"A"},O:{"4":"1B"},P:{"4":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"4":"DC"},R:{"4":"ND"},S:{"4":"OD PD"}},B:4,C:"DeviceOrientation & DeviceMotion events",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"C K L H M N O","4":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"QC 4B SC","4":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"7 I TC"},D:{"2":"7 I J","4":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","4":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"BC jC","4":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"6C 7C 8C","4":"4B I D 9C OC AD BD"},J:{"2":"E","4":"A"},K:{"1":"C 0B","2":"A B zB NC","4":"s"},L:{"4":"D"},M:{"4":"D"},N:{"1":"B","2":"A"},O:{"4":"1B"},P:{"4":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"4":"DC"},R:{"4":"OD"},S:{"4":"PD QD"}},B:4,C:"DeviceOrientation & DeviceMotion events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/devicepixelratio.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/devicepixelratio.js index 9f113348e63877..840f6ef41a7105 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/devicepixelratio.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/devicepixelratio.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"C r 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Window.devicePixelRatio",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"C s 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Window.devicePixelRatio",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dialog.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dialog.js index 16b178dae273e2..1ce04a4a92a8a3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dialog.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dialog.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC","194":"cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","1218":"Q R 7B S T U V W X Y Z a b c d e f g"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB","322":"HB IB JB KB LB"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H M N O dC eC fC gC zB NC hC 0B","578":"8 n o p q"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:1,C:"Dialog element",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC","194":"cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","1218":"Q R 7B S T U V W X Y Z a b c d e f g"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB","322":"HB IB JB KB LB"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H M N O eC fC gC hC zB NC iC 0B","578":"8 o p q r"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:1,C:"Dialog element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dispatchevent.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dispatchevent.js index e7c58084605c98..7e3eecb7604856 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dispatchevent.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dispatchevent.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","16":"PC","129":"G A","130":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","16":"G"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","129":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"EventTarget.dispatchEvent",D:true}; +module.exports={A:{A:{"1":"B","16":"PC","129":"G A","130":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","16":"G"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","129":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"EventTarget.dispatchEvent",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dnssec.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dnssec.js index f797e230524342..f05808cf8be274 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dnssec.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dnssec.js @@ -1 +1 @@ -module.exports={A:{A:{"132":"J E F G A B PC"},B:{"132":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"132":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"132":"0 1 2 3 4 5 6 7 I GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","388":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB"},E:{"132":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"132":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"132":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"132":"4C"},I:{"132":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"132":"E A"},K:{"132":"A B C r zB NC 0B"},L:{"132":"D"},M:{"132":"D"},N:{"132":"A B"},O:{"132":"1B"},P:{"132":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"132":"DC"},R:{"132":"ND"},S:{"132":"OD PD"}},B:6,C:"DNSSEC and DANE",D:true}; +module.exports={A:{A:{"132":"J E F G A B PC"},B:{"132":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"132":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"132":"0 1 2 3 4 5 6 7 I GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","388":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB"},E:{"132":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"132":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"132":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"132":"5C"},I:{"132":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"132":"E A"},K:{"132":"A B C s zB NC 0B"},L:{"132":"D"},M:{"132":"D"},N:{"132":"A B"},O:{"132":"1B"},P:{"132":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"132":"DC"},R:{"132":"OD"},S:{"132":"PD QD"}},B:6,C:"DNSSEC and DANE",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/do-not-track.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/do-not-track.js index 45eceb049a0310..34af44c6570f02 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/do-not-track.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/do-not-track.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","164":"G A","260":"B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F RC SC","516":"8 9 G A B C K L H M N O n o p q AB BB CB DB EB FB GB"},D:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o p"},E:{"1":"J A B C UC XC CC zB","2":"7 I K L H TC BC 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","1028":"E F G VC WC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC"},G:{"1":"nC oC pC qC rC sC tC","2":"BC iC OC jC kC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","1028":"F lC mC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"16":"E","1028":"A"},K:{"1":"r 0B","16":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"164":"A","260":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:7,C:"Do Not Track API",D:true}; +module.exports={A:{A:{"2":"J E F PC","164":"G A","260":"B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F SC TC","516":"8 9 G A B C K L H M N O o p q r AB BB CB DB EB FB GB"},D:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p q"},E:{"1":"J A B C VC YC CC zB","2":"7 I K L H UC BC 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","1028":"E F G WC XC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC"},G:{"1":"oC pC qC rC sC tC uC","2":"BC jC OC kC lC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","1028":"F mC nC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"16":"E","1028":"A"},K:{"1":"s 0B","16":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"164":"A","260":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:7,C:"Do Not Track API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-currentscript.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-currentscript.js index cf66f19b6ebc79..cef4ca84d77b72 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-currentscript.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-currentscript.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB"},E:{"1":"F G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC WC"},F:{"1":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H dC eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"document.currentScript",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB"},E:{"1":"F G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC XC"},F:{"1":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H eC fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"document.currentScript",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js index a2b85f0d146148..74f46f5fe9b7d6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","16":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","16":"G"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:7,C:"document.evaluate & XPath",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","16":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","16":"G"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:7,C:"document.evaluate & XPath",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-execcommand.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-execcommand.js index a100d56802d98d..32b2b858a1756f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-execcommand.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-execcommand.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC UC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","16":"G dC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC","16":"OC jC kC"},H:{"2":"4C"},I:{"1":"D 8C OC 9C AD","2":"4B I 5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:7,C:"Document.execCommand()",D:true}; +module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC VC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","16":"G eC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC","16":"OC kC lC"},H:{"2":"5C"},I:{"1":"D 9C OC AD BD","2":"4B I 6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:7,C:"Document.execCommand()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-policy.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-policy.js index f184b9b131b87a..c675d8e92d728a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-policy.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-policy.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T","132":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T","132":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB dC eC fC gC zB NC hC 0B","132":"sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","132":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"r"},L:{"132":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"132":"ND"},S:{"2":"OD PD"}},B:7,C:"Document Policy",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T","132":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T","132":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB eC fC gC hC zB NC iC 0B","132":"sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","132":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"s"},L:{"132":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"132":"OD"},S:{"2":"PD QD"}},B:7,C:"Document Policy",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-scrollingelement.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-scrollingelement.js index 4c43fb1861e9f6..91876994f276ba 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-scrollingelement.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/document-scrollingelement.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"C K"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB RC SC"},D:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"document.scrollingElement",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"C K"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB SC TC"},D:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"document.scrollingElement",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/documenthead.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/documenthead.js index 88b4f8e9e82b6e..cf4696aee9ec81 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/documenthead.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/documenthead.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G dC eC fC gC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"document.head",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G eC fC gC hC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"document.head",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-manip-convenience.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-manip-convenience.js index e8e0e29cb35639..7b5245739b2364 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-manip-convenience.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-manip-convenience.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB RC SC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","194":"bB cB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB dC eC fC gC zB NC hC 0B","194":"PB"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"DOM manipulation convenience methods",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC TC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","194":"bB cB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB eC fC gC hC zB NC iC 0B","194":"PB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"DOM manipulation convenience methods",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-range.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-range.js index 826f0b42a3e8c5..18e997e4dbf1b4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-range.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dom-range.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Document Object Model Range",D:true}; +module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Document Object Model Range",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/domcontentloaded.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/domcontentloaded.js index c197f3d23c00aa..778c69d1b61500 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/domcontentloaded.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/domcontentloaded.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"DOMContentLoaded",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"DOMContentLoaded",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dommatrix.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dommatrix.js index c37a2e5f207ac9..ae3a41a089381d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dommatrix.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dommatrix.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"132":"C K L H M N O","1028":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC","1028":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2564":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","3076":"YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},D:{"16":"7 I J E","132":"8 9 G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB","388":"F","1028":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"16":"I TC BC","132":"7 J E F G A UC VC WC XC CC","1028":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","1028":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"16":"BC iC OC","132":"F jC kC lC mC nC oC pC qC","1028":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"132":"I 8C OC 9C AD","292":"4B 5C 6C 7C","1028":"D"},J:{"16":"E","132":"A"},K:{"2":"A B C zB NC 0B","1028":"r"},L:{"1028":"D"},M:{"1028":"D"},N:{"132":"A B"},O:{"1028":"1B"},P:{"132":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1028":"DC"},R:{"1028":"ND"},S:{"1028":"PD","2564":"OD"}},B:4,C:"DOMMatrix",D:true}; +module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"132":"C K L H M N O","1028":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC","1028":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2564":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","3076":"YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB"},D:{"16":"7 I J E","132":"8 9 G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB","388":"F","1028":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"16":"I UC BC","132":"7 J E F G A VC WC XC YC CC","1028":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","1028":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"16":"BC jC OC","132":"F kC lC mC nC oC pC qC rC","1028":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"132":"I 9C OC AD BD","292":"4B 6C 7C 8C","1028":"D"},J:{"16":"E","132":"A"},K:{"2":"A B C zB NC 0B","1028":"s"},L:{"1028":"D"},M:{"1028":"D"},N:{"132":"A B"},O:{"1028":"1B"},P:{"132":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1028":"DC"},R:{"1028":"OD"},S:{"1028":"QD","2564":"PD"}},B:4,C:"DOMMatrix",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/download.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/download.js index 8a49fa8cb4248a..695d1c7ec18f95 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/download.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/download.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Download attribute",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Download attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dragndrop.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dragndrop.js index 7f8f95f00106e9..546fb32b26a71e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dragndrop.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/dragndrop.js @@ -1 +1 @@ -module.exports={A:{A:{"644":"J E F G PC","772":"A B"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","8":"G B dC eC fC gC zB NC hC"},G:{"1":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","1025":"D"},J:{"2":"E A"},K:{"1":"0B","8":"A B C zB NC","1025":"r"},L:{"1025":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"1025":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:1,C:"Drag and Drop",D:true}; +module.exports={A:{A:{"644":"J E F G PC","772":"A B"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","8":"G B eC fC gC hC zB NC iC"},G:{"1":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","1025":"D"},J:{"2":"E A"},K:{"1":"0B","8":"A B C zB NC","1025":"s"},L:{"1025":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"1025":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:1,C:"Drag and Drop",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-closest.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-closest.js index 01087e248cd02e..6226c876a1cacc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-closest.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-closest.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB RC SC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Element.closest()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB SC TC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Element.closest()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-from-point.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-from-point.js index b5c653a37c0e15..7eb78a29ba9420 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-from-point.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-from-point.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","16":"QC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","16":"G dC eC fC gC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"C r 0B","16":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"document.elementFromPoint()",D:true}; +module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","16":"QC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","16":"G eC fC gC hC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"C s 0B","16":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"document.elementFromPoint()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-scroll-methods.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-scroll-methods.js index 123eb9baf524f0..0528cb3551f692 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-scroll-methods.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/element-scroll-methods.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC","132":"A B C K CC zB 0B DC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB dC eC fC gC zB NC hC 0B"},G:{"1":"0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC","132":"pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Scroll methods on elements (scroll, scrollTo, scrollBy)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC","132":"A B C K CC zB 0B DC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB eC fC gC hC zB NC iC 0B"},G:{"1":"1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC","132":"qC rC sC tC uC vC wC xC yC zC 0C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Scroll methods on elements (scroll, scrollTo, scrollBy)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eme.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eme.js index ce68634613d17d..5e5bc9cc0a541d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eme.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eme.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","164":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB RC SC"},D:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB","132":"KB LB MB NB OB PB QB"},E:{"1":"C K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC","164":"E F G A B WC XC CC zB"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o dC eC fC gC zB NC hC 0B","132":"9 p q AB BB CB DB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Encrypted Media Extensions",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","164":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB SC TC"},D:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB","132":"KB LB MB NB OB PB QB"},E:{"1":"C K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC","164":"E F G A B XC YC CC zB"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p eC fC gC hC zB NC iC 0B","132":"9 q r AB BB CB DB"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Encrypted Media Extensions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eot.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eot.js index c559d2cbedeca4..cb78cb46673242 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eot.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eot.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","2":"PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"EOT - Embedded OpenType fonts",D:true}; +module.exports={A:{A:{"1":"J E F G A B","2":"PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"EOT - Embedded OpenType fonts",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es5.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es5.js index e4f42e319d7dea..32ab39fe9211a3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es5.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es5.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E PC","260":"G","1026":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"QC 4B RC SC","132":"7 8 I J E F G A B C K L H M N O n"},D:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"7 I J E F G A B C K L H M N O","132":"8 n o p"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","4":"7 I TC BC UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","4":"G B C dC eC fC gC zB NC hC","132":"0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","4":"BC iC OC jC"},H:{"132":"4C"},I:{"1":"D 9C AD","4":"4B 5C 6C 7C","132":"8C OC","900":"I"},J:{"1":"A","4":"E"},K:{"1":"r","4":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"ECMAScript 5",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E PC","260":"G","1026":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","4":"QC 4B SC TC","132":"7 8 I J E F G A B C K L H M N O o"},D:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"7 I J E F G A B C K L H M N O","132":"8 o p q"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","4":"7 I UC BC VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","4":"G B C eC fC gC hC zB NC iC","132":"0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","4":"BC jC OC kC"},H:{"132":"5C"},I:{"1":"D AD BD","4":"4B 6C 7C 8C","132":"9C OC","900":"I"},J:{"1":"A","4":"E"},K:{"1":"s","4":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"ECMAScript 5",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-class.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-class.js index 341f6ca2afdd1b..78182aea800658 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-class.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-class.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","132":"RB SB TB UB VB WB XB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB dC eC fC gC zB NC hC 0B","132":"EB FB GB HB IB JB KB"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"ES6 classes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","132":"RB SB TB UB VB WB XB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB eC fC gC hC zB NC iC 0B","132":"EB FB GB HB IB JB KB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"ES6 classes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-generators.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-generators.js index efb2befc7ef90f..964d2acf61ad8c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-generators.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-generators.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB RC SC"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"ES6 Generators",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB SC TC"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"ES6 Generators",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js index f2d61816ea7efd..4eb6848c773f39 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB RC SC","194":"nB"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"JavaScript modules: dynamic import()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB SC TC","194":"nB"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"JavaScript modules: dynamic import()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module.js index ece8b34de7e8fd..f1b81a28832baa 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-module.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L","2049":"M N O","2242":"H"},C:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB RC SC","322":"dB eB fB gB hB 5B"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","194":"iB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC","1540":"CC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB dC eC fC gC zB NC hC 0B","194":"WB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC","1540":"qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"JavaScript modules via script tag",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L","2049":"M N O","2242":"H"},C:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB SC TC","322":"dB eB fB gB hB 5B"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","194":"iB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC","1540":"CC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB eC fC gC hC zB NC iC 0B","194":"WB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC","1540":"rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"JavaScript modules via script tag",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-number.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-number.js index e9cbdf8733d0fe..944cc1e8682080 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-number.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-number.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H RC SC","132":"8 9 M N O n o p q","260":"AB BB CB DB EB FB","516":"GB"},D:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O","1028":"8 9 n o p q AB BB CB DB EB FB GB HB IB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","1028":"8 H M N O n"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C","1028":"8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"ES6 Number",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H SC TC","132":"8 9 M N O o p q r","260":"AB BB CB DB EB FB","516":"GB"},D:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O","1028":"8 9 o p q r AB BB CB DB EB FB GB HB IB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","1028":"8 H M N O o"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C","1028":"9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"ES6 Number",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-string-includes.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-string-includes.js index 65ce9b1a3b3a18..43648652c14941 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-string-includes.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6-string-includes.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB RC SC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"String.prototype.includes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB SC TC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"String.prototype.includes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6.js index d23aec4c1b3ca8..eab692e2c5a71a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/es6.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","388":"B"},B:{"257":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L","769":"H M N O"},C:{"2":"7 QC 4B I RC SC","4":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","257":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 I J E F G A B C K L H M N O n","4":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","257":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC","4":"F G WC XC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","4":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB","257":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC","4":"F lC mC nC oC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","4":"9C AD","257":"D"},J:{"2":"E","4":"A"},K:{"2":"A B C zB NC 0B","257":"r"},L:{"257":"D"},M:{"257":"D"},N:{"2":"A","388":"B"},O:{"257":"1B"},P:{"4":"I","257":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"257":"DC"},R:{"257":"ND"},S:{"4":"OD","257":"PD"}},B:6,C:"ECMAScript 2015 (ES6)",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","388":"B"},B:{"257":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L","769":"H M N O"},C:{"2":"7 QC 4B I SC TC","4":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","257":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 I J E F G A B C K L H M N O o","4":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","257":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC","4":"F G XC YC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","4":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB","257":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC","4":"F mC nC oC pC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","4":"AD BD","257":"D"},J:{"2":"E","4":"A"},K:{"2":"A B C zB NC 0B","257":"s"},L:{"257":"D"},M:{"257":"D"},N:{"2":"A","388":"B"},O:{"257":"1B"},P:{"4":"I","257":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"257":"DC"},R:{"257":"OD"},S:{"4":"PD","257":"QD"}},B:6,C:"ECMAScript 2015 (ES6)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eventsource.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eventsource.js index da57e3476c7d97..74f47daffbbad8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eventsource.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/eventsource.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","4":"G dC eC fC gC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"C r zB NC 0B","4":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Server-sent events",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","4":"G eC fC gC hC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"C s zB NC 0B","4":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Server-sent events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/extended-system-fonts.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/extended-system-fonts.js index ef65dbee6b3384..9cf1d9f92c51ab 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/extended-system-fonts.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/extended-system-fonts.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"ui-serif, ui-sans-serif, ui-monospace and ui-rounded values for font-family",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"ui-serif, ui-sans-serif, ui-monospace and ui-rounded values for font-family",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/feature-policy.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/feature-policy.js index c738c2dcb1ee01..8f4ba91c7e1e4e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/feature-policy.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/feature-policy.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P Q R S T U V W","2":"C K L H M N O","1025":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r RC SC","260":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"uB vB wB xB yB P Q R S T U V W","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","132":"iB 6B jB kB lB mB nB oB pB qB rB sB tB r","1025":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B TC BC UC VC WC XC CC","772":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"jB kB lB mB nB oB pB qB rB sB tB r uB","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB dC eC fC gC zB NC hC 0B","132":"WB XB YB ZB aB bB cB dB eB fB gB hB iB","1025":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC","772":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","1025":"r"},L:{"1025":"D"},M:{"260":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD","132":"ED FD CC"},Q:{"132":"DC"},R:{"1025":"ND"},S:{"2":"OD","260":"PD"}},B:7,C:"Feature Policy",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P Q R S T U V W","2":"C K L H M N O","1025":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s SC TC","260":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"uB vB wB xB yB P Q R S T U V W","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","132":"iB 6B jB kB lB mB nB oB pB qB rB sB tB s","1025":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B UC BC VC WC XC YC CC","772":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"jB kB lB mB nB oB pB qB rB sB tB s uB","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB eC fC gC hC zB NC iC 0B","132":"WB XB YB ZB aB bB cB dB eB fB gB hB iB","1025":"vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC","772":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","1025":"s"},L:{"1025":"D"},M:{"260":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED","132":"FD GD CC"},Q:{"132":"DC"},R:{"1025":"OD"},S:{"2":"PD","260":"QD"}},B:7,C:"Feature Policy",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fetch.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fetch.js index 09cd555c69d660..5dd694f2f55fd5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fetch.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fetch.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB RC SC","1025":"OB","1218":"JB KB LB MB NB"},D:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","260":"PB","772":"QB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB dC eC fC gC zB NC hC 0B","260":"CB","772":"DB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Fetch",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB SC TC","1025":"OB","1218":"JB KB LB MB NB"},D:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","260":"PB","772":"QB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB eC fC gC hC zB NC iC 0B","260":"CB","772":"DB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Fetch",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fieldset-disabled.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fieldset-disabled.js index 30e22513b00c9d..8cdbd68221c147 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fieldset-disabled.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fieldset-disabled.js @@ -1 +1 @@ -module.exports={A:{A:{"16":"PC","132":"F G","388":"J E A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","16":"8 M N O"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","16":"G dC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC"},H:{"388":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A","260":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"disabled attribute of the fieldset element",D:true}; +module.exports={A:{A:{"16":"PC","132":"F G","388":"J E A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","16":"8 M N O"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","16":"G eC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC"},H:{"388":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A","260":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"disabled attribute of the fieldset element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fileapi.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fileapi.js index 96a38e5a7fe277..a847abfa7ac7b0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fileapi.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fileapi.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","260":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC","260":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB SC"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I","260":"8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB","388":"J E F G A B C"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC","260":"J E F G VC WC XC","388":"UC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B dC eC fC gC","260":"8 9 C H M N O n o p q zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","260":"F kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D AD","2":"5C 6C 7C","260":"9C","388":"4B I 8C OC"},J:{"260":"A","388":"E"},K:{"1":"r","2":"A B","260":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","260":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"File API",D:true}; +module.exports={A:{A:{"2":"J E F G PC","260":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC","260":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB TC"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I","260":"8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB","388":"J E F G A B C"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC","260":"J E F G WC XC YC","388":"VC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B eC fC gC hC","260":"8 9 C H M N O o p q r zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","260":"F lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D BD","2":"6C 7C 8C","260":"AD","388":"4B I 9C OC"},J:{"260":"A","388":"E"},K:{"1":"s","2":"A B","260":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","260":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"File API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereader.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereader.js index a152789001747e..b5d14638a20adb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereader.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereader.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G B dC eC fC gC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"C r zB NC 0B","2":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"FileReader API",D:true}; +module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G B eC fC gC hC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"C s zB NC 0B","2":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"FileReader API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereadersync.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereadersync.js index 927ed2d925c1b2..83fa91f8019881 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereadersync.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filereadersync.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G dC eC","16":"B fC gC zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"C r NC 0B","2":"A","16":"B zB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"FileReaderSync",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G eC fC","16":"B gC hC zB NC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"C s NC 0B","2":"A","16":"B zB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"FileReaderSync",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filesystem.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filesystem.js index 33bd60a9a38fae..c59ab3f9f96bc7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filesystem.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/filesystem.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 I J E","33":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","36":"F G A B C"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","33":"A"},K:{"2":"A B C zB NC 0B","33":"r"},L:{"33":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"2":"I","33":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"33":"ND"},S:{"2":"OD PD"}},B:7,C:"Filesystem & FileWriter API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 I J E","33":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","36":"F G A B C"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E","33":"A"},K:{"2":"A B C zB NC 0B","33":"s"},L:{"33":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"2":"I","33":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"33":"OD"},S:{"2":"PD QD"}},B:7,C:"Filesystem & FileWriter API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flac.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flac.js index 1b96701a5fd9ed..2ec55fa359f219 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flac.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flac.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB RC SC"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB","16":"TB UB VB","388":"WB XB YB ZB aB bB cB dB eB"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","516":"B C zB 0B"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"5C 6C 7C","16":"4B I 8C OC 9C AD"},J:{"1":"A","2":"E"},K:{"1":"r 0B","16":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","129":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"FLAC audio format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB SC TC"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB","16":"TB UB VB","388":"WB XB YB ZB aB bB cB dB eB"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","516":"B C zB 0B"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"6C 7C 8C","16":"4B I 9C OC AD BD"},J:{"1":"A","2":"E"},K:{"1":"s 0B","16":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","129":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"FLAC audio format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox-gap.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox-gap.js index ef4dfb9c79af06..639fe5f51676d4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox-gap.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox-gap.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB RC SC"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S"},E:{"1":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC"},F:{"1":"rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB dC eC fC gC zB NC hC 0B"},G:{"1":"0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"gap property for Flexbox",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB SC TC"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S"},E:{"1":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC"},F:{"1":"rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB eC fC gC hC zB NC iC 0B"},G:{"1":"1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"gap property for Flexbox",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox.js index 261369dd604317..74584c9359acbe 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flexbox.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","1028":"B","1316":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","164":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC","516":"9 p q AB BB CB"},D:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"9 o p q AB BB CB DB","164":"7 8 I J E F G A B C K L H M N O n"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"E F VC WC","164":"7 I J TC BC UC"},F:{"1":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B C dC eC fC gC zB NC hC","33":"H M"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"F lC mC","164":"BC iC OC jC kC"},H:{"1":"4C"},I:{"1":"D 9C AD","164":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","164":"E"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","292":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS Flexible Box Layout Module",D:true}; +module.exports={A:{A:{"2":"J E F G PC","1028":"B","1316":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","164":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC","516":"9 q r AB BB CB"},D:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"9 p q r AB BB CB DB","164":"7 8 I J E F G A B C K L H M N O o"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"E F WC XC","164":"7 I J UC BC VC"},F:{"1":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B C eC fC gC hC zB NC iC","33":"H M"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"F mC nC","164":"BC jC OC kC lC"},H:{"1":"5C"},I:{"1":"D AD BD","164":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","164":"E"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","292":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS Flexible Box Layout Module",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flow-root.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flow-root.js index 262ed678940493..2bab86a16c1a03 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flow-root.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/flow-root.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC"},D:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB 0B"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB dC eC fC gC zB NC hC 0B"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"display: flow-root",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC"},D:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB 0B"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB eC fC gC hC zB NC iC 0B"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"display: flow-root",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/focusin-focusout-events.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/focusin-focusout-events.js index 22cd07b72d1cde..f968726d826d3e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/focusin-focusout-events.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/focusin-focusout-events.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","2":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G dC eC fC gC","16":"B zB NC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"I D 8C OC 9C AD","2":"5C 6C 7C","16":"4B"},J:{"1":"E A"},K:{"1":"C r 0B","2":"A","16":"B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"focusin & focusout events",D:true}; +module.exports={A:{A:{"1":"J E F G A B","2":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G eC fC gC hC","16":"B zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"I D 9C OC AD BD","2":"6C 7C 8C","16":"4B"},J:{"1":"E A"},K:{"1":"C s 0B","2":"A","16":"B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"focusin & focusout events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-family-system-ui.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-family-system-ui.js index 078a206364b064..93311522126976 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-family-system-ui.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-family-system-ui.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB RC SC","132":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","260":"cB dB eB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC","16":"G","132":"A XC CC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC","132":"nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"132":"OD PD"}},B:5,C:"system-ui value for font-family",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SC TC","132":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","260":"cB dB eB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC","16":"G","132":"A YC CC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC","132":"oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"132":"PD QD"}},B:5,C:"system-ui value for font-family",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-feature.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-feature.js index bb18afb62b9c2d..82f77c27db729e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-feature.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-feature.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB","164":"7 I J E F G A B C K L"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","33":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","292":"8 M N O n"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"E F G TC BC VC WC","4":"7 I J UC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F lC mC nC","4":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","33":"9C AD"},J:{"2":"E","33":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","33":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS font-feature-settings",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB","164":"7 I J E F G A B C K L"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","33":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","292":"8 M N O o"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"E F G UC BC WC XC","4":"7 I J VC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F mC nC oC","4":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","33":"AD BD"},J:{"2":"E","33":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","33":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS font-feature-settings",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-kerning.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-kerning.js index c453d25d761ea0..1ac843b34d6ce7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-kerning.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-kerning.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o p q RC SC","194":"9 AB BB CB DB EB FB GB HB IB"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB","33":"EB FB GB HB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC","33":"E F G WC"},F:{"1":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H dC eC fC gC zB NC hC 0B","33":"8 M N O"},G:{"1":"tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","33":"F mC nC oC pC qC rC sC"},H:{"2":"4C"},I:{"1":"D AD","2":"4B I 5C 6C 7C 8C OC","33":"9C"},J:{"2":"E","33":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 font-kerning",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p q r SC TC","194":"9 AB BB CB DB EB FB GB HB IB"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB","33":"EB FB GB HB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC","33":"E F G XC"},F:{"1":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H eC fC gC hC zB NC iC 0B","33":"8 M N O"},G:{"1":"uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","33":"F nC oC pC qC rC sC tC"},H:{"2":"5C"},I:{"1":"D BD","2":"4B I 6C 7C 8C 9C OC","33":"AD"},J:{"2":"E","33":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 font-kerning",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-loading.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-loading.js index b4f36bafcadfd1..3a8b261e02d238 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-loading.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-loading.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB RC SC","194":"KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"CSS Font Loading",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB SC TC","194":"KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"CSS Font Loading",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-size-adjust.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-size-adjust.js index d9038d277f22af..3221d160cc69d4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-size-adjust.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-size-adjust.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","194":"5 6 D","962":"0 1 2 3 4 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z"},C:{"1":"6 D 8B 9B AC","2":"QC","516":"0 1 2 3 4 5 b c d e f g h i j k l m s t u v w x y z","772":"7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","194":"8B 9B AC","962":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},E:{"1":"3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC","772":"JC KC bC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB dC eC fC gC zB NC hC 0B","194":"l m","962":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k"},G:{"1":"3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC","772":"JC KC 3C"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"194":"DC"},R:{"2":"ND"},S:{"2":"OD","516":"PD"}},B:2,C:"CSS font-size-adjust",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","194":"5 6 D","962":"0 1 2 3 4 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z"},C:{"1":"6 D 8B 9B AC RC","2":"QC","516":"0 1 2 3 4 5 b c d e f g h i j k l m n t u v w x y z","772":"7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","194":"8B 9B AC","962":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},E:{"1":"3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC","772":"JC KC cC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB eC fC gC hC zB NC iC 0B","194":"l m n","962":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k"},G:{"1":"3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC","772":"JC KC 4C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"194":"DC"},R:{"2":"OD"},S:{"2":"PD","516":"QD"}},B:2,C:"CSS font-size-adjust",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-smooth.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-smooth.js index e50c8a632d17d1..057397b95b09a5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-smooth.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-smooth.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","676":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q RC SC","804":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"I","676":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"TC BC","676":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","676":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"804":"OD PD"}},B:7,C:"CSS font-smooth",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","676":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r SC TC","804":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"I","676":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"UC BC","676":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","676":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"804":"PD QD"}},B:7,C:"CSS font-smooth",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-unicode-range.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-unicode-range.js index e428a2b203ee18..7f0ecd47024cd9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-unicode-range.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-unicode-range.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","4":"G A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","4":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC","194":"LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","4":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","4":"8 H M N O n o p"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","4":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","4":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","4":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","4":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Font unicode-range subsetting",D:true}; +module.exports={A:{A:{"2":"J E F PC","4":"G A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","4":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC","194":"LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","4":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","4":"8 H M N O o p q"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","4":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","4":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","4":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","4":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Font unicode-range subsetting",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-alternates.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-alternates.js index 2f4c67f8251153..e77bdeffa8c471 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-alternates.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-alternates.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","130":"A B"},B:{"1":"0 1 2 3 4 5 6 z D","130":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","130":"7 8 I J E F G A B C K L H M N O n o p q","322":"9 AB BB CB DB EB FB GB HB IB"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 I J E F G A B C K L H","130":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"E F G TC BC VC WC","130":"7 I J UC"},F:{"1":"h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","130":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC lC mC nC","130":"iC OC jC kC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","130":"9C AD"},J:{"2":"E","130":"A"},K:{"2":"A B C zB NC 0B","130":"r"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"130":"1B"},P:{"1":"p q","130":"I n o BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"130":"DC"},R:{"130":"ND"},S:{"1":"OD PD"}},B:5,C:"CSS font-variant-alternates",D:true}; +module.exports={A:{A:{"2":"J E F G PC","130":"A B"},B:{"1":"0 1 2 3 4 5 6 z D","130":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","130":"7 8 I J E F G A B C K L H M N O o p q r","322":"9 AB BB CB DB EB FB GB HB IB"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 I J E F G A B C K L H","130":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"E F G UC BC WC XC","130":"7 I J VC"},F:{"1":"h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","130":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC mC nC oC","130":"jC OC kC lC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","130":"AD BD"},J:{"2":"E","130":"A"},K:{"2":"A B C zB NC 0B","130":"s"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"130":"1B"},P:{"1":"q r","130":"I o p CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"130":"DC"},R:{"130":"OD"},S:{"1":"PD QD"}},B:5,C:"CSS font-variant-alternates",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-numeric.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-numeric.js index e7fb194553ae24..19051c9c2179d2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-numeric.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/font-variant-numeric.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB RC SC"},D:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC"},F:{"1":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB dC eC fC gC zB NC hC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","16":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS font-variant-numeric",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB SC TC"},D:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC"},F:{"1":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB eC fC gC hC zB NC iC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","16":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS font-variant-numeric",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fontface.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fontface.js index 15e974c5f61b0a..15ec93d243e77d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fontface.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fontface.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","2":"G dC"},G:{"1":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","260":"BC iC"},H:{"2":"4C"},I:{"1":"I D 8C OC 9C AD","2":"5C","4":"4B 6C 7C"},J:{"1":"A","4":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"@font-face Web fonts",D:true}; +module.exports={A:{A:{"1":"G A B","132":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","2":"G eC"},G:{"1":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","260":"BC jC"},H:{"2":"5C"},I:{"1":"I D 9C OC AD BD","2":"6C","4":"4B 7C 8C"},J:{"1":"A","4":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"@font-face Web fonts",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-attribute.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-attribute.js index fa335987115c10..40229341dd854f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-attribute.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-attribute.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"1":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Form attribute",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"1":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Form attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-submit-attributes.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-submit-attributes.js index 529761fd28d8ec..4d685941c5b816 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-submit-attributes.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-submit-attributes.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","2":"G dC","16":"eC fC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"1":"4C"},I:{"1":"I D 8C OC 9C AD","2":"5C 6C 7C","16":"4B"},J:{"1":"A","2":"E"},K:{"1":"B C r zB NC 0B","16":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Attributes for form submission",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","2":"G eC","16":"fC gC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"1":"5C"},I:{"1":"I D 9C OC AD BD","2":"6C 7C 8C","16":"4B"},J:{"1":"A","2":"E"},K:{"1":"B C s zB NC 0B","16":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Attributes for form submission",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-validation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-validation.js index 057beac8bad86b..8fab69c0a2397e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-validation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/form-validation.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","132":"7 J E F G A UC VC WC XC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","2":"G dC"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC","132":"F iC OC jC kC lC mC nC oC pC"},H:{"516":"4C"},I:{"1":"D AD","2":"4B 5C 6C 7C","132":"I 8C OC 9C"},J:{"1":"A","132":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","132":"OD"}},B:1,C:"Form validation",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","132":"7 J E F G A VC WC XC YC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","2":"G eC"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC","132":"F jC OC kC lC mC nC oC pC qC"},H:{"516":"5C"},I:{"1":"D BD","2":"4B 6C 7C 8C","132":"I 9C OC AD"},J:{"1":"A","132":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","132":"PD"}},B:1,C:"Form validation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/forms.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/forms.js index b7d4772484a247..dd50ea578d9e88 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/forms.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/forms.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","4":"A B","8":"J E F G"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","4":"C K L H"},C:{"4":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"4":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"TC BC"},F:{"1":"G B C bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","4":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"2":"BC","4":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","4":"9C AD"},J:{"2":"E","4":"A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"4":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","4":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"4":"OD PD"}},B:1,C:"HTML5 form features",D:false}; +module.exports={A:{A:{"2":"PC","4":"A B","8":"J E F G"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","4":"C K L H"},C:{"4":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"4":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"UC BC"},F:{"1":"G B C bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","4":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"2":"BC","4":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","4":"AD BD"},J:{"2":"E","4":"A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"4":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","4":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"4":"PD QD"}},B:1,C:"HTML5 form features",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fullscreen.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fullscreen.js index 640182705b0b0b..7a518fc2de17f8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fullscreen.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/fullscreen.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","548":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","516":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G RC SC","676":"8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB","1700":"WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB"},D:{"1":"0 1 2 3 4 5 6 sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L","676":"8 H M N O","804":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I TC BC","548":"FC 1B aC 2B GC HC IC","676":"UC","804":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B C dC eC fC gC zB NC hC","804":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"1":"MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC","2052":"tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","292":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","548":"B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","804":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Full Screen API",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","548":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","516":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G SC TC","676":"8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB","1700":"WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB"},D:{"1":"0 1 2 3 4 5 6 sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L","676":"8 H M N O","804":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I UC BC","548":"FC 1B bC 2B GC HC IC","676":"VC","804":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B C eC fC gC hC zB NC iC","804":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"1":"MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC","2052":"uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E","292":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","548":"B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","804":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Full Screen API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gamepad.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gamepad.js index 783f27fcefd8e3..c4ee983b58c43e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gamepad.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gamepad.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n","33":"9 o p q"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"Gamepad API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o","33":"9 p q r"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"Gamepad API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/geolocation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/geolocation.js index acf08a0881f025..00f006737a1c20 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/geolocation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/geolocation.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"C K L H M N O","129":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB RC SC","8":"QC 4B","129":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","4":"I","129":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"I TC BC","129":"A"},F:{"1":"8 9 B C M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB gC zB NC hC 0B","2":"G H dC","8":"eC fC","129":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"F BC iC OC jC kC lC mC nC oC","129":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I 5C 6C 7C 8C OC 9C AD","129":"D"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","8":"A","129":"r"},L:{"129":"D"},M:{"129":"D"},N:{"1":"A B"},O:{"129":"1B"},P:{"1":"I","129":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"129":"DC"},R:{"129":"ND"},S:{"1":"OD","129":"PD"}},B:2,C:"Geolocation",D:true}; +module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"C K L H M N O","129":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB SC TC","8":"QC 4B","129":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","4":"I","129":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"I UC BC","129":"A"},F:{"1":"8 9 B C M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB hC zB NC iC 0B","2":"G H eC","8":"fC gC","129":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"F BC jC OC kC lC mC nC oC pC","129":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I 6C 7C 8C 9C OC AD BD","129":"D"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","8":"A","129":"s"},L:{"129":"D"},M:{"129":"D"},N:{"1":"A B"},O:{"129":"1B"},P:{"1":"I","129":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"129":"DC"},R:{"129":"OD"},S:{"1":"PD","129":"QD"}},B:2,C:"Geolocation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getboundingclientrect.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getboundingclientrect.js index a11ec92104d72f..91f0021c7381f7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getboundingclientrect.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getboundingclientrect.js @@ -1 +1 @@ -module.exports={A:{A:{"644":"J E PC","2049":"G A B","2692":"F"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2049":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC","260":"7 I J E F G A B","1156":"4B","1284":"RC","1796":"SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","16":"G dC","132":"eC fC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","132":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2049":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Element.getBoundingClientRect()",D:true}; +module.exports={A:{A:{"644":"J E PC","2049":"G A B","2692":"F"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2049":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC","260":"7 I J E F G A B","1156":"4B","1284":"SC","1796":"TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","16":"G eC","132":"fC gC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","132":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2049":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Element.getBoundingClientRect()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getcomputedstyle.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getcomputedstyle.js index a8c5a77acde602..19f6b4516e0219 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getcomputedstyle.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getcomputedstyle.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC","132":"4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","260":"7 I J E F G A"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","260":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","260":"G dC eC fC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","260":"BC iC OC"},H:{"260":"4C"},I:{"1":"I D 8C OC 9C AD","260":"4B 5C 6C 7C"},J:{"1":"A","260":"E"},K:{"1":"B C r zB NC 0B","260":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"getComputedStyle",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC","132":"4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","260":"7 I J E F G A"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","260":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","260":"G eC fC gC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","260":"BC jC OC"},H:{"260":"5C"},I:{"1":"I D 9C OC AD BD","260":"4B 6C 7C 8C"},J:{"1":"A","260":"E"},K:{"1":"B C s zB NC 0B","260":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"getComputedStyle",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getelementsbyclassname.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getelementsbyclassname.js index c7010bb176c366..28f6a136ac5a26 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getelementsbyclassname.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getelementsbyclassname.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","8":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"getElementsByClassName",D:true}; +module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","8":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"getElementsByClassName",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getrandomvalues.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getrandomvalues.js index 86e74d7fc9992a..c05b84826c219a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getrandomvalues.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/getrandomvalues.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","33":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","33":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"crypto.getRandomValues()",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","33":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","33":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"crypto.getRandomValues()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gyroscope.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gyroscope.js index 5112d52350f40a..6f6b3b0ca773c3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gyroscope.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/gyroscope.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:4,C:"Gyroscope",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:4,C:"Gyroscope",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hardwareconcurrency.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hardwareconcurrency.js index a84de68e595655..c6b261b17ea45a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hardwareconcurrency.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hardwareconcurrency.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB RC SC"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"2":"7 I J E TC BC UC VC WC","129":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","194":"F G A XC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"2":"BC iC OC jC kC lC","129":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","194":"F mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"navigator.hardwareConcurrency",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB SC TC"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"2":"7 I J E UC BC VC WC XC","129":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","194":"F G A YC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"2":"BC jC OC kC lC mC","129":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","194":"F nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"navigator.hardwareConcurrency",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hashchange.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hashchange.js index 3cab2c8d5d0f10..561c0a9d3424a1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hashchange.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hashchange.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","8":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","8":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"I"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","8":"G dC eC fC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"2":"4C"},I:{"1":"4B I D 6C 7C 8C OC 9C AD","2":"5C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","8":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Hashchange event",D:true}; +module.exports={A:{A:{"1":"F G A B","8":"J E PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","8":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"I"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","8":"G eC fC gC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"2":"5C"},I:{"1":"4B I D 7C 8C 9C OC AD BD","2":"6C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","8":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Hashchange event",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/heif.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/heif.js index 720cc61e4100aa..3248b6cf4fa549 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/heif.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/heif.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","130":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC 3C","130":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"HEIF/HEIC image format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","130":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC 4C","130":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"HEIF/HEIC image format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hevc.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hevc.js index 48bb08058ac126..f0c8fcdb45dfbf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hevc.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hevc.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"132":"C K L H M N O","1028":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D RC SC","4162":"8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u","2052":"0 1 2 3 4 5 6 v w x y z D 8B 9B AC"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","516":"B C zB 0B"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c dC eC fC gC zB NC hC 0B","2052":"d e f g h i j k l m"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","2052":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","258":"r"},L:{"2052":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q","2":"I","258":"n BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:6,C:"HEVC/H.265 video format",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"132":"C K L H M N O","1028":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D SC TC","4162":"8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u","2052":"0 1 2 3 4 5 6 v w x y z D 8B 9B AC"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","516":"B C zB 0B"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c eC fC gC hC zB NC iC 0B","2052":"d e f g h i j k l m n"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","2052":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","258":"s"},L:{"2052":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"p q r","2":"I","258":"o CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:6,C:"HEVC/H.265 video format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hidden.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hidden.js index ccd92efbf294d1..3e714c8132a596 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hidden.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/hidden.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G B dC eC fC gC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"1":"4C"},I:{"1":"I D 8C OC 9C AD","2":"4B 5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"C r zB NC 0B","2":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"hidden attribute",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G B eC fC gC hC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"1":"5C"},I:{"1":"I D 9C OC AD BD","2":"4B 6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"C s zB NC 0B","2":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"hidden attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/high-resolution-time.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/high-resolution-time.js index 017676e678f564..e21c3a8061eda1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/high-resolution-time.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/high-resolution-time.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","2":"7 QC 4B I J E F G A B C K L RC SC","129":"eB fB gB","769":"hB 5B","1281":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O","33":"n o p q"},E:{"1":"F G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC WC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"High Resolution Time API",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","2":"7 QC 4B I J E F G A B C K L SC TC","129":"eB fB gB","769":"hB 5B","1281":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O","33":"o p q r"},E:{"1":"F G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC XC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"High Resolution Time API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/history.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/history.js index a3e1eea44d3ffc..d2cc7d99d06e52 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/history.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/history.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","4":"7 UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m NC hC 0B","2":"G B dC eC fC gC zB"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC","4":"OC"},H:{"2":"4C"},I:{"1":"D 6C 7C OC 9C AD","2":"4B I 5C 8C"},J:{"1":"E A"},K:{"1":"C r zB NC 0B","2":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Session history management",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","4":"7 VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n NC iC 0B","2":"G B eC fC gC hC zB"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC","4":"OC"},H:{"2":"5C"},I:{"1":"D 7C 8C OC AD BD","2":"4B I 6C 9C"},J:{"1":"E A"},K:{"1":"C s zB NC 0B","2":"A B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Session history management",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html-media-capture.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html-media-capture.js index ba5d19f5d19fc2..8fd5e032fca31c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html-media-capture.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html-media-capture.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"BC iC OC jC","129":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C","257":"6C 7C"},J:{"1":"A","16":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"516":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"16":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:2,C:"HTML Media Capture",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"BC jC OC kC","129":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C","257":"7C 8C"},J:{"1":"A","16":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"516":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"16":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:2,C:"HTML Media Capture",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html5semantic.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html5semantic.js index 085f063bc7204f..ed3d3c691d7e44 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html5semantic.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/html5semantic.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC","132":"4B RC SC","260":"7 8 I J E F G A B C K L H M N O n"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 I","260":"8 9 J E F G A B C K L H M N O n o p q AB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","132":"I TC BC","260":"7 J UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","132":"G B dC eC fC gC","260":"C zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"BC","260":"iC OC jC kC"},H:{"132":"4C"},I:{"1":"D 9C AD","132":"5C","260":"4B I 6C 7C 8C OC"},J:{"260":"E A"},K:{"1":"r","132":"A","260":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"HTML5 semantic elements",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC","132":"4B SC TC","260":"7 8 I J E F G A B C K L H M N O o"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 I","260":"8 9 J E F G A B C K L H M N O o p q r AB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","132":"I UC BC","260":"7 J VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","132":"G B eC fC gC hC","260":"C zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"BC","260":"jC OC kC lC"},H:{"132":"5C"},I:{"1":"D AD BD","132":"6C","260":"4B I 7C 8C 9C OC"},J:{"260":"E A"},K:{"1":"s","132":"A","260":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"HTML5 semantic elements",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http-live-streaming.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http-live-streaming.js index 1cfe25c6a468bf..6eb3bdf79e087d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http-live-streaming.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http-live-streaming.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"HTTP Live Streaming (HLS)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"HTTP Live Streaming (HLS)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http2.js index 5a637dfbc6671d..dcfa40ad2e5c91 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http2.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"C K L H M N O","513":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC","513":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"QB RB SB TB UB VB WB XB YB ZB","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","513":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC","260":"G A XC CC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB","2":"8 9 G B C H M N O n o p q AB BB CB dC eC fC gC zB NC hC 0B","513":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","513":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"r"},L:{"513":"D"},M:{"513":"D"},N:{"2":"A B"},O:{"513":"1B"},P:{"1":"I","513":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"513":"DC"},R:{"513":"ND"},S:{"1":"OD","513":"PD"}},B:6,C:"HTTP/2 protocol",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"C K L H M N O","513":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC","513":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"QB RB SB TB UB VB WB XB YB ZB","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","513":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC","260":"G A YC CC"},F:{"1":"DB EB FB GB HB IB JB KB LB MB","2":"8 9 G B C H M N O o p q r AB BB CB eC fC gC hC zB NC iC 0B","513":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","513":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"s"},L:{"513":"D"},M:{"513":"D"},N:{"2":"A B"},O:{"513":"1B"},P:{"1":"I","513":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"513":"DC"},R:{"513":"OD"},S:{"1":"PD","513":"QD"}},B:6,C:"HTTP/2 protocol",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http3.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http3.js index a29291a6aa6647..baa6a31d0a1faf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http3.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/http3.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","322":"P Q R S T","578":"U V"},C:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB RC SC","194":"tB r uB vB wB xB yB P Q R 7B S T U V W"},D:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB","322":"P Q R S T","578":"U V"},E:{"2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B DC","2052":"JC KC bC 3B LC MC cC","2116":"2B GC HC IC","3140":"L H YC ZC EC FC 1B aC"},F:{"1":"uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB dC eC fC gC zB NC hC 0B","578":"r"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC","2052":"JC KC 3C 3B LC MC","2116":"zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:6,C:"HTTP/3 protocol",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","322":"P Q R S T","578":"U V"},C:{"1":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB SC TC","194":"tB s uB vB wB xB yB P Q R 7B S T U V W"},D:{"1":"0 1 2 3 4 5 6 W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB","322":"P Q R S T","578":"U V"},E:{"2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B DC","2052":"JC KC cC 3B LC MC dC","2116":"2B GC HC IC","3140":"L H ZC aC EC FC 1B bC"},F:{"1":"uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB eC fC gC hC zB NC iC 0B","578":"s"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC","2052":"JC KC 4C 3B LC MC","2116":"0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:6,C:"HTTP/3 protocol",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-sandbox.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-sandbox.js index d3a9c8a67d91d2..d786cef2723c10 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-sandbox.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-sandbox.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M RC SC","4":"8 9 N O n o p q AB BB CB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC"},H:{"2":"4C"},I:{"1":"4B I D 6C 7C 8C OC 9C AD","2":"5C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"sandbox attribute for iframes",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M SC TC","4":"8 9 N O o p q r AB BB CB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC"},H:{"2":"5C"},I:{"1":"4B I D 7C 8C 9C OC AD BD","2":"6C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"sandbox attribute for iframes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-seamless.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-seamless.js index 1627d09f2c8b7f..9aa9e4704682d8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-seamless.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-seamless.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 I J E F G A B C K L H M N O CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","66":"9 n o p q AB BB"},E:{"2":"7 I J F G A B C K L H TC BC UC VC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","130":"E WC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","130":"lC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"seamless attribute for iframes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 I J E F G A B C K L H M N O CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","66":"9 o p q r AB BB"},E:{"2":"7 I J F G A B C K L H UC BC VC WC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","130":"E XC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","130":"mC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"seamless attribute for iframes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-srcdoc.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-srcdoc.js index e8fb18c6aa1b81..8f4a05e6866b17 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-srcdoc.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/iframe-srcdoc.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","8":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC","8":"7 8 9 4B I J E F G A B C K L H M N O n o p q RC SC"},D:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","8":"8 L H M N O"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC","8":"7 I UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B dC eC fC gC","8":"C zB NC hC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC","8":"iC OC jC"},H:{"2":"4C"},I:{"1":"D 9C AD","8":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","8":"E"},K:{"1":"r","2":"A B","8":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"srcdoc attribute for iframes",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","8":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC","8":"7 8 9 4B I J E F G A B C K L H M N O o p q r SC TC"},D:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","8":"8 L H M N O"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC","8":"7 I VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B eC fC gC hC","8":"C zB NC iC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC","8":"jC OC kC"},H:{"2":"5C"},I:{"1":"D AD BD","8":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","8":"E"},K:{"1":"s","2":"A B","8":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"srcdoc attribute for iframes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imagecapture.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imagecapture.js index 0de73d580cd951..b25f6f604a03ad 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imagecapture.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imagecapture.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB RC SC","194":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","322":"cB dB eB fB gB hB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB dC eC fC gC zB NC hC 0B","322":"PB QB RB SB TB UB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"194":"OD PD"}},B:5,C:"ImageCapture API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB SC TC","194":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","322":"cB dB eB fB gB hB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB eC fC gC hC zB NC iC 0B","322":"PB QB RB SB TB UB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"194":"PD QD"}},B:5,C:"ImageCapture API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ime.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ime.js index bddf7d07d767e9..8249cca441d9ed 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ime.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ime.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","161":"B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","161":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A","161":"B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Input Method Editor API",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","161":"B"},B:{"2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","161":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A","161":"B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Input Method Editor API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js index 77622a7aa24344..3d1d300b26ce82 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"naturalWidth & naturalHeight image properties",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"naturalWidth & naturalHeight image properties",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/import-maps.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/import-maps.js index f9ac7c4ddb255e..7f6f93de6c2586 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/import-maps.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/import-maps.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","194":"P Q R S T U V W X"},C:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k RC SC","322":"l m s t u v"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r","194":"uB vB wB xB yB P Q R S T U V W X"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB dC eC fC gC zB NC hC 0B","194":"jB kB lB mB nB oB pB qB rB sB tB r uB vB"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID JD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Import maps",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","194":"P Q R S T U V W X"},C:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k SC TC","322":"l m n t u v"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s","194":"uB vB wB xB yB P Q R S T U V W X"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB eC fC gC hC zB NC iC 0B","194":"jB kB lB mB nB oB pB qB rB sB tB s uB vB"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD KD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Import maps",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imports.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imports.js index b49f3094ce466e..064a6fdef4dae5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imports.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/imports.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"P","2":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","8":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB RC SC","8":"0 1 2 3 4 5 6 FB GB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","72":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB"},D:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","66":"FB GB HB IB JB","72":"KB"},E:{"2":"7 I TC BC UC","8":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","2":"G B C H M oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","66":"8 N O n o","72":"p"},G:{"2":"BC iC OC jC kC","8":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"8":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I BD CD DD ED FD CC GD HD","2":"n o p q ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"1":"OD","8":"PD"}},B:5,C:"HTML Imports",D:true}; +module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"P","2":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","8":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB SC TC","8":"0 1 2 3 4 5 6 FB GB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","72":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB"},D:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","66":"FB GB HB IB JB","72":"KB"},E:{"2":"7 I UC BC VC","8":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","2":"G B C H M oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","66":"8 N O o p","72":"q"},G:{"2":"BC jC OC kC lC","8":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"8":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I CD DD ED FD GD CC HD ID","2":"o p q r JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"1":"PD","8":"QD"}},B:5,C:"HTML Imports",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js index 3bb57de3107296..ed154130df9648 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B","16":"RC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"indeterminate checkbox",D:true}; +module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B","16":"SC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"indeterminate checkbox",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb.js index f68dea7ff33760..e7bcf18f394c75 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","33":"A B C K L H","36":"7 I J E F G"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"A","8":"7 I J E F G","33":"q","36":"8 B C K L H M N O n o p"},E:{"1":"A B C K L H CC zB 0B DC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I J E TC BC UC VC","260":"F G WC XC","516":"YC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G dC eC","8":"B C fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC jC kC lC","260":"F mC nC oC","516":"0C"},H:{"2":"4C"},I:{"1":"D 9C AD","8":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","8":"E"},K:{"1":"r","2":"A","8":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"IndexedDB",D:true}; +module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","33":"A B C K L H","36":"7 I J E F G"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"A","8":"7 I J E F G","33":"r","36":"8 B C K L H M N O o p q"},E:{"1":"A B C K L H CC zB 0B DC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I J E UC BC VC WC","260":"F G XC YC","516":"ZC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G eC fC","8":"B C gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC kC lC mC","260":"F nC oC pC","516":"1C"},H:{"2":"5C"},I:{"1":"D AD BD","8":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","8":"E"},K:{"1":"s","2":"A","8":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"IndexedDB",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb2.js index 0a85110fe95703..40a3af7312222d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/indexeddb2.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB RC SC","132":"TB UB VB","260":"WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","132":"XB YB ZB aB","260":"bB cB dB eB fB gB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB dC eC fC gC zB NC hC 0B","132":"KB LB MB NB","260":"OB PB QB RB SB TB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC","16":"pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","260":"BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","260":"OD"}},B:2,C:"IndexedDB 2.0",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB SC TC","132":"TB UB VB","260":"WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB","132":"XB YB ZB aB","260":"bB cB dB eB fB gB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB eC fC gC hC zB NC iC 0B","132":"KB LB MB NB","260":"OB PB QB RB SB TB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC","16":"qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","260":"CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","260":"PD"}},B:2,C:"IndexedDB 2.0",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/inline-block.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/inline-block.js index 841f7e75bd377d..244212890465b5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/inline-block.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/inline-block.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","4":"PC","132":"J E"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","36":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS inline-block",D:true}; +module.exports={A:{A:{"1":"F G A B","4":"PC","132":"J E"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","36":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS inline-block",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/innertext.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/innertext.js index 71c942b63b6371..eac0e8ed8351a1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/innertext.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/innertext.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","16":"G"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"HTMLElement.innerText",D:true}; +module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","16":"G"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"HTMLElement.innerText",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js index 0dcc1451758fab..562162071c5c93 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A PC","132":"B"},B:{"132":"C K L H M N O","260":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB RC SC","516":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"8 9 N O n o p q AB BB","2":"7 I J E F G A B C K L H M","132":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB","260":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"J UC VC","2":"7 I TC BC","2052":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"BC iC OC","1025":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1025":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2052":"A B"},O:{"1025":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"260":"DC"},R:{"1":"ND"},S:{"516":"OD PD"}},B:1,C:"autocomplete attribute: on & off values",D:true}; +module.exports={A:{A:{"1":"J E F G A PC","132":"B"},B:{"132":"C K L H M N O","260":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB SC TC","516":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"8 9 N O o p q r AB BB","2":"7 I J E F G A B C K L H M","132":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB","260":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"J VC WC","2":"7 I UC BC","2052":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"BC jC OC","1025":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1025":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2052":"A B"},O:{"1025":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"260":"DC"},R:{"1":"OD"},S:{"516":"PD QD"}},B:1,C:"autocomplete attribute: on & off values",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-color.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-color.js index 47e3482f49e4ef..516006c535d465 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-color.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-color.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC"},D:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB"},F:{"1":"8 9 B C N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G H M dC eC fC gC"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC","129":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"Color input type",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC"},D:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB"},F:{"1":"8 9 B C N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G H M eC fC gC hC"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC","129":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"Color input type",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-datetime.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-datetime.js index 31dfe7ab11eb06..4e13774db66f45 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-datetime.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-datetime.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC","1090":"cB dB eB fB","2052":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b","4100":"0 1 2 3 4 5 6 c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O","2052":"9 n o p q"},E:{"2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC","4100":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"BC iC OC","260":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B 5C 6C 7C","514":"I 8C OC"},J:{"1":"A","2":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"4100":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2052":"OD PD"}},B:1,C:"Date and time input types",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC","1090":"cB dB eB fB","2052":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b","4100":"0 1 2 3 4 5 6 c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O","2052":"9 o p q r"},E:{"2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC","4100":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"BC jC OC","260":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B 6C 7C 8C","514":"I 9C OC"},J:{"1":"A","2":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"4100":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2052":"PD QD"}},B:1,C:"Date and time input types",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-email-tel-url.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-email-tel-url.js index 9735b4a6862241..378e037a7b2110 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-email-tel-url.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-email-tel-url.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","132":"5C 6C 7C"},J:{"1":"A","132":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Email, telephone & URL input types",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","132":"6C 7C 8C"},J:{"1":"A","132":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Email, telephone & URL input types",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-event.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-event.js index 0b2b92c77ac083..850b8fdc696faf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-event.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-event.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","2561":"A B","2692":"G"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2561":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC","1537":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC","1796":"4B RC"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","1025":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB","1537":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I J TC BC","1025":"E F G A B C VC WC XC CC zB","1537":"UC","4097":"K 0B"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","16":"G B C dC eC fC gC zB NC","260":"hC","1025":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","1537":"8 H M N O n o"},G:{"1":"wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC","1025":"F mC nC oC pC qC rC sC tC","1537":"jC kC lC","4097":"uC vC"},H:{"2":"4C"},I:{"16":"5C 6C","1025":"D AD","1537":"4B I 7C 8C OC 9C"},J:{"1025":"A","1537":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2561":"A B"},O:{"1":"1B"},P:{"1025":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","1537":"OD"}},B:1,C:"input event",D:true}; +module.exports={A:{A:{"2":"J E F PC","2561":"A B","2692":"G"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2561":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC","1537":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB TC","1796":"4B SC"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L","1025":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB","1537":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I J UC BC","1025":"E F G A B C WC XC YC CC zB","1537":"VC","4097":"K 0B"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","16":"G B C eC fC gC hC zB NC","260":"iC","1025":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","1537":"8 H M N O o p"},G:{"1":"xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC","1025":"F nC oC pC qC rC sC tC uC","1537":"kC lC mC","4097":"vC wC"},H:{"2":"5C"},I:{"16":"6C 7C","1025":"D BD","1537":"4B I 8C 9C OC AD"},J:{"1025":"A","1537":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2561":"A B"},O:{"1":"1B"},P:{"1025":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","1537":"PD"}},B:1,C:"input event",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-accept.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-accept.js index d6935589b99d44..a88f9965fbae68 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-accept.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-accept.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I","16":"7 9 J E F o p q AB","132":"8 G A B C K L H M N O n"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","132":"J E F G A B VC WC XC CC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"2":"kC lC","132":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","514":"BC iC OC jC"},H:{"2":"4C"},I:{"2":"5C 6C 7C","260":"4B I 8C OC","514":"D 9C AD"},J:{"132":"A","260":"E"},K:{"2":"A B C zB NC 0B","514":"r"},L:{"260":"D"},M:{"2":"D"},N:{"514":"A","1028":"B"},O:{"2":"1B"},P:{"260":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"260":"DC"},R:{"260":"ND"},S:{"1":"OD PD"}},B:1,C:"accept attribute for file input",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I","16":"7 9 J E F p q r AB","132":"8 G A B C K L H M N O o"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","132":"J E F G A B WC XC YC CC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"2":"lC mC","132":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","514":"BC jC OC kC"},H:{"2":"5C"},I:{"2":"6C 7C 8C","260":"4B I 9C OC","514":"D AD BD"},J:{"132":"A","260":"E"},K:{"2":"A B C zB NC 0B","514":"s"},L:{"260":"D"},M:{"2":"D"},N:{"514":"A","1028":"B"},O:{"2":"1B"},P:{"260":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"260":"DC"},R:{"260":"OD"},S:{"1":"PD QD"}},B:1,C:"accept attribute for file input",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-directory.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-directory.js index c645276e7a6009..785737a1c5f3a4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-directory.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-directory.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB RC SC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H M dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Directory selection from file input",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB SC TC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H M eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Directory selection from file input",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-multiple.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-multiple.js index d79df26c1052c8..4b0137b7f0a0f3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-multiple.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-file-multiple.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","2":"G dC eC fC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC"},H:{"130":"4C"},I:{"130":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"130":"A B C r zB NC 0B"},L:{"132":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"130":"1B"},P:{"130":"I","132":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"132":"DC"},R:{"132":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"Multiple file selection",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","2":"G eC fC gC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC"},H:{"130":"5C"},I:{"130":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"130":"A B C s zB NC 0B"},L:{"132":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"130":"1B"},P:{"130":"I","132":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"132":"DC"},R:{"132":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"Multiple file selection",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-inputmode.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-inputmode.js index 7407816e1f4548..1da36b7a9790c7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-inputmode.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-inputmode.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M RC SC","4":"8 N O n","194":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB","66":"fB gB hB 5B iB 6B jB kB lB mB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB dC eC fC gC zB NC hC 0B","66":"SB TB UB VB WB XB YB ZB aB bB"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"194":"OD PD"}},B:1,C:"inputmode attribute",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M SC TC","4":"8 N O o","194":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB","66":"fB gB hB 5B iB 6B jB kB lB mB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB eC fC gC hC zB NC iC 0B","66":"SB TB UB VB WB XB YB ZB aB bB"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"194":"PD QD"}},B:1,C:"inputmode attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-minlength.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-minlength.js index 05216c61ecb43f..da9217644f1804 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-minlength.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-minlength.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB RC SC"},D:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"Minimum length attribute for input fields",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB SC TC"},D:{"1":"0 1 2 3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"Minimum length attribute for input fields",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-number.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-number.js index 4e276d2c5d8be5..4a82b8eb203bf3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-number.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-number.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K","1025":"L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC","513":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"388":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B 5C 6C 7C","388":"I D 8C OC 9C AD"},J:{"2":"E","388":"A"},K:{"1":"A B C zB NC 0B","388":"r"},L:{"388":"D"},M:{"641":"D"},N:{"388":"A B"},O:{"388":"1B"},P:{"388":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"388":"DC"},R:{"388":"ND"},S:{"513":"OD PD"}},B:1,C:"Number input type",D:true}; +module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K","1025":"L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC","513":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"388":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B 6C 7C 8C","388":"I D 9C OC AD BD"},J:{"2":"E","388":"A"},K:{"1":"A B C zB NC 0B","388":"s"},L:{"388":"D"},M:{"641":"D"},N:{"388":"A B"},O:{"388":"1B"},P:{"388":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"388":"DC"},R:{"388":"OD"},S:{"513":"PD QD"}},B:1,C:"Number input type",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-pattern.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-pattern.js index 055f617a0fef71..c0d9fbab49831b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-pattern.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-pattern.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7","388":"J E F G A UC VC WC XC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC","388":"F jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D AD","2":"4B I 5C 6C 7C 8C OC 9C"},J:{"1":"A","2":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Pattern attribute for input fields",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7","388":"J E F G A VC WC XC YC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC","388":"F kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D BD","2":"4B I 6C 7C 8C 9C OC AD"},J:{"1":"A","2":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Pattern attribute for input fields",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-placeholder.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-placeholder.js index 6c9ba7797c7031..96abced3ef0026 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-placeholder.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-placeholder.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","132":"I TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m NC hC 0B","2":"G dC eC fC gC","132":"B zB"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B D 5C 6C 7C OC 9C AD","4":"I 8C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"input placeholder attribute",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","132":"I UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n NC iC 0B","2":"G eC fC gC hC","132":"B zB"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B D 6C 7C 8C OC AD BD","4":"I 9C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"input placeholder attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-range.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-range.js index 17f4c378257b6f..2d1f4d8b7576e6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-range.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-range.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o p RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"D OC 9C AD","4":"4B I 5C 6C 7C 8C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Range input type",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p q SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"D OC AD BD","4":"4B I 6C 7C 8C 9C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Range input type",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-search.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-search.js index ea1c400c44d8c2..d103e2f8d67b04 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-search.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-search.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K L H M N O"},C:{"2":"QC 4B RC SC","129":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 9 I J E F G A B C K L o p q AB","129":"8 H M N O n"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G dC eC fC gC","16":"B zB NC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"129":"4C"},I:{"1":"D 9C AD","16":"5C 6C","129":"4B I 7C 8C OC"},J:{"1":"E","129":"A"},K:{"1":"C r","2":"A","16":"B zB NC","129":"0B"},L:{"1":"D"},M:{"129":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"129":"OD PD"}},B:1,C:"Search input type",D:true}; +module.exports={A:{A:{"2":"J E F G PC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K L H M N O"},C:{"2":"QC 4B SC TC","129":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 9 I J E F G A B C K L p q r AB","129":"8 H M N O o"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G eC fC gC hC","16":"B zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"129":"5C"},I:{"1":"D AD BD","16":"6C 7C","129":"4B I 8C 9C OC"},J:{"1":"E","129":"A"},K:{"1":"C s","2":"A","16":"B zB NC","129":"0B"},L:{"1":"D"},M:{"129":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"129":"PD QD"}},B:1,C:"Search input type",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-selection.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-selection.js index ea6693b9bdb7e6..be7c3af783b14f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-selection.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/input-selection.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","16":"G dC eC fC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Selection controls for input & textarea",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","16":"G eC fC gC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Selection controls for input & textarea",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insert-adjacent.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insert-adjacent.js index f7962136e74d9d..b35014d0ca2870 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insert-adjacent.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insert-adjacent.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","16":"G"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Element.insertAdjacentElement() & Element.insertAdjacentText()",D:true}; +module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","16":"G"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Element.insertAdjacentElement() & Element.insertAdjacentText()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insertadjacenthtml.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insertadjacenthtml.js index a1380522d02aad..da0841abd1271d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insertadjacenthtml.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/insertadjacenthtml.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","16":"PC","132":"J E F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","16":"G dC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Element.insertAdjacentHTML()",D:true}; +module.exports={A:{A:{"1":"A B","16":"PC","132":"J E F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","16":"G eC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Element.insertAdjacentHTML()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/internationalization.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/internationalization.js index 8d8dbd27f3d6fb..b87b1f3e1dfc82 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/internationalization.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/internationalization.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o p q"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"Internationalization API",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p q r"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"Internationalization API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js index cc80bb86d9ee83..5e15f1898de0e1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"IntersectionObserver V2",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"IntersectionObserver V2",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver.js index dadcf83cf41d18..c9ede2df7a6e91 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intersectionobserver.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"M N O","2":"C K L","260":"H","513":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB RC SC","194":"bB cB dB"},D:{"1":"hB 5B iB 6B jB kB lB","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","260":"aB bB cB dB eB fB gB","513":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB dC eC fC gC zB NC hC 0B","260":"NB OB PB QB RB SB TB","513":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","513":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"r"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","260":"BD CD"},Q:{"513":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"IntersectionObserver",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"M N O","2":"C K L","260":"H","513":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB SC TC","194":"bB cB dB"},D:{"1":"hB 5B iB 6B jB kB lB","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","260":"aB bB cB dB eB fB gB","513":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB"},F:{"1":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB eC fC gC hC zB NC iC 0B","260":"NB OB PB QB RB SB TB","513":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","513":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"s"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","260":"CD DD"},Q:{"513":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"IntersectionObserver",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intl-pluralrules.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intl-pluralrules.js index ef84c13c982244..5233938445d4e2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intl-pluralrules.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intl-pluralrules.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N","130":"O"},C:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB RC SC"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB 0B"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB dC eC fC gC zB NC hC 0B"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"Intl.PluralRules API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N","130":"O"},C:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB SC TC"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB 0B"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB eC fC gC hC zB NC iC 0B"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"Intl.PluralRules API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intrinsic-width.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intrinsic-width.js index 64e8567ac81767..a08b4b655efea9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intrinsic-width.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/intrinsic-width.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","1025":"0 1 2 3 4 5 6 d e f g h i j k l m s t u v w x y z D","1537":"P Q R S T U V W X Y Z a b c"},C:{"2":"QC","932":"7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB RC SC","2308":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 I J E F G A B C K L H M N O n o","545":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB","1025":"0 1 2 3 4 5 6 d e f g h i j k l m s t u v w x y z D 8B 9B AC","1537":"VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC","516":"B C K L H zB 0B DC YC ZC EC FC 1B aC","548":"G A XC CC","676":"E F VC WC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","513":"JB","545":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB","1025":"e f g h i j k l m","1537":"IB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC","516":"zC 0C 1C EC FC 1B 2C","548":"nC oC pC qC rC sC tC uC vC wC xC yC","676":"F lC mC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","545":"9C AD","1025":"D"},J:{"2":"E","545":"A"},K:{"2":"A B C zB NC 0B","1025":"r"},L:{"1025":"D"},M:{"2308":"D"},N:{"2":"A B"},O:{"1537":"1B"},P:{"545":"I","1025":"n o p q 3B LD MD","1537":"BD CD DD ED FD CC GD HD ID JD KD 2B"},Q:{"1537":"DC"},R:{"1537":"ND"},S:{"932":"OD","2308":"PD"}},B:5,C:"Intrinsic & Extrinsic Sizing",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","1025":"0 1 2 3 4 5 6 d e f g h i j k l m n t u v w x y z D","1537":"P Q R S T U V W X Y Z a b c"},C:{"2":"QC","932":"7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB SC TC","2308":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 I J E F G A B C K L H M N O o p","545":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB","1025":"0 1 2 3 4 5 6 d e f g h i j k l m n t u v w x y z D 8B 9B AC","1537":"VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC","516":"B C K L H zB 0B DC ZC aC EC FC 1B bC","548":"G A YC CC","676":"E F WC XC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","513":"JB","545":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB","1025":"e f g h i j k l m n","1537":"IB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC","516":"0C 1C 2C EC FC 1B 3C","548":"oC pC qC rC sC tC uC vC wC xC yC zC","676":"F mC nC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","545":"AD BD","1025":"D"},J:{"2":"E","545":"A"},K:{"2":"A B C zB NC 0B","1025":"s"},L:{"1025":"D"},M:{"2308":"D"},N:{"2":"A B"},O:{"1537":"1B"},P:{"545":"I","1025":"o p q r 3B MD ND","1537":"CD DD ED FD GD CC HD ID JD KD LD 2B"},Q:{"1537":"DC"},R:{"1537":"OD"},S:{"932":"PD","2308":"QD"}},B:5,C:"Intrinsic & Extrinsic Sizing",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpeg2000.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpeg2000.js index c7736a4ceb4489..7fc937c946eac2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpeg2000.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpeg2000.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","129":"7 UC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"JPEG 2000 image format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","129":"7 VC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"JPEG 2000 image format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxl.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxl.js index 09cc57070c3899..582cc28ba35c43 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxl.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxl.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z y z D","578":"a b c d e f g h i j k l m s t u v w x"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y RC SC","322":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z y z D 8B 9B AC","194":"a b c d e f g h i j k l m s t u v w x"},E:{"1":"3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB dC eC fC gC zB NC hC 0B","194":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"JPEG XL image format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z y z D","578":"a b c d e f g h i j k l m n t u v w x"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y SC TC","322":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z y z D 8B 9B AC","194":"a b c d e f g h i j k l m n t u v w x"},E:{"1":"3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB eC fC gC hC zB NC iC 0B","194":"xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"JPEG XL image format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxr.js index a18eae82948e7d..925c0eed2a8f7e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/jpegxr.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"JPEG XR image format",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"JPEG XR image format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js index 4d668764f03c35..a83c8285b190fb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB RC SC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"1":"YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB dC eC fC gC zB NC hC 0B"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"Lookbehind in JS regular expressions",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB SC TC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"1":"YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB eC fC gC hC zB NC iC 0B"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"Lookbehind in JS regular expressions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/json.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/json.js index 8ac301c54245c4..94655fa51670d4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/json.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/json.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E PC","129":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"JSON parsing",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E PC","129":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"JSON parsing",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js index df4dc45b7f02c2..66ccf48cf0600b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H","132":"M N O"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB RC SC"},D:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","132":"gB hB 5B"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC","132":"CC"},F:{"1":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dC eC fC gC zB NC hC 0B","132":"TB UB VB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC","132":"qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD","132":"DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","132":"OD"}},B:5,C:"CSS justify-content: space-evenly",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H","132":"M N O"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB SC TC"},D:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","132":"gB hB 5B"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC","132":"CC"},F:{"1":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB eC fC gC hC zB NC iC 0B","132":"TB UB VB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC","132":"rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD","132":"ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","132":"PD"}},B:5,C:"CSS justify-content: space-evenly",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js index c2cbee99f6e6ac..f4cbe21269ee7b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"5C 6C 7C","132":"4B I 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:7,C:"High-quality kerning pairs & ligatures",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"6C 7C 8C","132":"4B I 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:7,C:"High-quality kerning pairs & ligatures",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js index ce66ad77aa4cd3..0833fa58041c0b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","16":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC","16":"C"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"r 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"130":"D"},N:{"130":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:7,C:"KeyboardEvent.charCode",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","16":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC","16":"C"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"s 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"130":"D"},N:{"130":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:7,C:"KeyboardEvent.charCode",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-code.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-code.js index 6dead60c153c8f..8410111405788a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-code.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-code.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB RC SC"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","194":"RB SB TB UB VB WB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB dC eC fC gC zB NC hC 0B","194":"EB FB GB HB IB JB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"194":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I","194":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"194":"ND"},S:{"1":"OD PD"}},B:5,C:"KeyboardEvent.code",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB SC TC"},D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","194":"RB SB TB UB VB WB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB eC fC gC hC zB NC iC 0B","194":"EB FB GB HB IB JB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"194":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I","194":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"194":"OD"},S:{"1":"PD QD"}},B:5,C:"KeyboardEvent.code",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js index 95fe43935c6230..a752229e632665 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B H M dC eC fC gC zB NC hC","16":"C"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"KeyboardEvent.getModifierState()",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B H M eC fC gC hC zB NC iC","16":"C"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"KeyboardEvent.getModifierState()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-key.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-key.js index 27edcb4a883f36..a5df2f8402db60 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-key.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-key.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o p RC SC","132":"9 q AB BB CB DB"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"8 9 G B H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB dC eC fC gC zB NC hC","16":"C"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"1":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"KeyboardEvent.key",D:true}; +module.exports={A:{A:{"2":"J E F PC","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p q SC TC","132":"9 r AB BB CB DB"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"8 9 G B H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB eC fC gC hC zB NC iC","16":"C"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"1":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"KeyboardEvent.key",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-location.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-location.js index 49e2ddfcb69aaa..5793356da71133 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-location.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-location.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"J TC BC","132":"7 I UC"},F:{"1":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC","16":"C","132":"H M"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC","132":"jC kC lC"},H:{"2":"4C"},I:{"1":"D 9C AD","16":"5C 6C","132":"4B I 7C 8C OC"},J:{"132":"E A"},K:{"1":"r 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"KeyboardEvent.location",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"J UC BC","132":"7 I VC"},F:{"1":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC","16":"C","132":"H M"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC","132":"kC lC mC"},H:{"2":"5C"},I:{"1":"D AD BD","16":"6C 7C","132":"4B I 8C 9C OC"},J:{"132":"E A"},K:{"1":"s 0B","2":"A B zB NC","16":"C"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"KeyboardEvent.location",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-which.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-which.js index c53c432bd1de95..0fa6802b679f74 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-which.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/keyboardevent-which.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","16":"7"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","16":"G dC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC","16":"5C 6C","132":"9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"132":"D"},M:{"132":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"2":"I","132":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"132":"ND"},S:{"1":"OD PD"}},B:7,C:"KeyboardEvent.which",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","16":"7"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","16":"G eC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC","16":"6C 7C","132":"AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"132":"D"},M:{"132":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"2":"I","132":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"132":"OD"},S:{"1":"PD QD"}},B:7,C:"KeyboardEvent.which",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/lazyload.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/lazyload.js index 01448a2b2823d5..af6da99a375ed2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/lazyload.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/lazyload.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"1":"B","2":"A"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Resource Hints: Lazyload",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"1":"B","2":"A"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Resource Hints: Lazyload",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/let.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/let.js index ff41ff6e4acb67..cedf8e8389bff8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/let.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/let.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","2052":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","194":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O","322":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","516":"QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC","1028":"A CC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","322":"8 9 H M N O n o p q AB BB CB","516":"DB EB FB GB HB IB JB KB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC","1028":"pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","516":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"let",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","2052":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","194":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O","322":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","516":"QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC","1028":"A CC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","322":"8 9 H M N O o p q r AB BB CB","516":"DB EB FB GB HB IB JB KB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC","1028":"qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","516":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"let",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-png.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-png.js index 849b452f8764f4..ca914f810be74e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-png.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-png.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","130":"F BC iC OC jC kC lC mC nC oC pC qC rC sC"},H:{"130":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E","130":"A"},K:{"1":"r","130":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"130":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"PNG favicons",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","130":"F BC jC OC kC lC mC nC oC pC qC rC sC tC"},H:{"130":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E","130":"A"},K:{"1":"s","130":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"130":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"PNG favicons",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-svg.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-svg.js index 623e05be4b33c0..da7403ba42d461 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-svg.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-icon-svg.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P","1537":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"QC 4B RC SC","260":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","513":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","1537":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dB eB fB gB hB iB jB kB lB mB nB dC eC fC gC zB NC hC 0B","1537":"oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","130":"F BC iC OC jC kC lC mC nC oC pC qC rC sC"},H:{"130":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","130":"A"},K:{"130":"A B C zB NC 0B","1537":"r"},L:{"1537":"D"},M:{"2":"D"},N:{"130":"A B"},O:{"2":"1B"},P:{"2":"I BD CD DD ED FD CC GD HD","1537":"n o p q ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"1537":"ND"},S:{"513":"OD PD"}},B:1,C:"SVG favicons",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P","1537":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"QC 4B SC TC","260":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","513":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","1537":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dB eB fB gB hB iB jB kB lB mB nB eC fC gC hC zB NC iC 0B","1537":"oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","130":"F BC jC OC kC lC mC nC oC pC qC rC sC tC"},H:{"130":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E","130":"A"},K:{"130":"A B C zB NC 0B","1537":"s"},L:{"1537":"D"},M:{"2":"D"},N:{"130":"A B"},O:{"2":"1B"},P:{"2":"I CD DD ED FD GD CC HD ID","1537":"o p q r JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"1537":"OD"},S:{"513":"PD QD"}},B:1,C:"SVG favicons",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js index 3203c63534a00d..a6cab0029a32f1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F PC","132":"G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"QC 4B","260":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"16":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"16":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"1":"r","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","16":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Resource Hints: dns-prefetch",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F PC","132":"G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"QC 4B","260":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"16":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"16":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"1":"s","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","16":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Resource Hints: dns-prefetch",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js index fcc68c6b867252..8b25a07e3c7f6f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"3 4 5 6 D 8B 9B AC","2":"0 1 2 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z RC SC"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB"},E:{"1":"3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC"},F:{"1":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB dC eC fC gC zB NC hC 0B"},G:{"1":"3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:1,C:"Resource Hints: modulepreload",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"3 4 5 6 D 8B 9B AC RC","2":"0 1 2 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z SC TC"},D:{"1":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB"},E:{"1":"3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC"},F:{"1":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB eC fC gC hC zB NC iC 0B"},G:{"1":"3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:1,C:"Resource Hints: modulepreload",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preconnect.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preconnect.js index 1b90c60f783f70..1411370ba04837 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preconnect.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preconnect.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L","260":"H M N O"},C:{"1":"3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB RC SC","129":"OB","514":"0 1 2 sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z"},D:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Resource Hints: preconnect",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L","260":"H M N O"},C:{"1":"3 4 5 6 PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB SC TC","129":"OB","514":"0 1 2 sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z"},D:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Resource Hints: preconnect",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prefetch.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prefetch.js index 4e3eb5f821dc41..e567be425cbb47 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prefetch.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prefetch.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B","194":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC","194":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"I D 9C AD","2":"4B 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Resource Hints: prefetch",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B","194":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC","194":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"I D AD BD","2":"4B 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Resource Hints: prefetch",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preload.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preload.js index dc54921b9fd7b1..2825355fb0c028 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preload.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-preload.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M","1028":"N O"},C:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB RC SC","132":"fB","578":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T"},D:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","322":"B"},F:{"1":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC","322":"rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:4,C:"Resource Hints: preload",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M","1028":"N O"},C:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB SC TC","132":"fB","578":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T"},D:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","322":"B"},F:{"1":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC","322":"sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:4,C:"Resource Hints: preload",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prerender.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prerender.js index 2d81b651022c92..cfced115fd7449 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prerender.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/link-rel-prerender.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"Resource Hints: prerender",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"Resource Hints: prerender",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/loading-lazy-attr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/loading-lazy-attr.js index 88a9e27e5ba2a0..f147f6cc6dd0e3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/loading-lazy-attr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/loading-lazy-attr.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB RC SC","132":"0 1 2 3 4 5 6 vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B"},D:{"1":"0 1 2 3 4 5 6 xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB","66":"vB wB"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B","322":"L H DC YC ZC EC","580":"FC 1B aC 2B GC HC IC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB dC eC fC gC zB NC hC 0B","66":"jB kB"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC","322":"yC zC 0C 1C EC","580":"FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD","132":"PD"}},B:1,C:"Lazy loading via attribute for images & iframes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB SC TC","132":"0 1 2 3 4 5 6 vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B"},D:{"1":"0 1 2 3 4 5 6 xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB","66":"vB wB"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B","322":"L H DC ZC aC EC","580":"FC 1B bC 2B GC HC IC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB eC fC gC hC zB NC iC 0B","66":"jB kB"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC","322":"zC 0C 1C 2C EC","580":"FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD","132":"QD"}},B:1,C:"Lazy loading via attribute for images & iframes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/localecompare.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/localecompare.js index c2c1654b3bc4ef..3155da1f6686bb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/localecompare.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/localecompare.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","16":"PC","132":"J E F G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 I J E F G A B C K L H M N O n o p q"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","132":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G B C dC eC fC gC zB NC hC","132":"0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"F BC iC OC jC kC lC mC nC oC"},H:{"132":"4C"},I:{"1":"D 9C AD","132":"4B I 5C 6C 7C 8C OC"},J:{"132":"E A"},K:{"1":"r","16":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","132":"A"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","132":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","4":"OD"}},B:6,C:"localeCompare()",D:true}; +module.exports={A:{A:{"1":"B","16":"PC","132":"J E F G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 8 I J E F G A B C K L H M N O o p q r"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","132":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G B C eC fC gC hC zB NC iC","132":"0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"F BC jC OC kC lC mC nC oC pC"},H:{"132":"5C"},I:{"1":"D AD BD","132":"4B I 6C 7C 8C 9C OC"},J:{"132":"E A"},K:{"1":"s","16":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","132":"A"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","132":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","4":"PD"}},B:6,C:"localeCompare()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/magnetometer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/magnetometer.js index 1d9c5bed4f6510..4c476b8fc49fef 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/magnetometer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/magnetometer.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"194":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:4,C:"Magnetometer",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"194":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:4,C:"Magnetometer",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchesselector.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchesselector.js index ce5e51a9430f54..c5557c5df76c17 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchesselector.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchesselector.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","36":"G A B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","36":"C K L"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC","36":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB SC"},D:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","36":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","36":"7 J E UC VC"},F:{"1":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B dC eC fC gC zB","36":"8 C H M N O n NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC","36":"iC OC jC kC lC"},H:{"2":"4C"},I:{"1":"D","2":"5C","36":"4B I 6C 7C 8C OC 9C AD"},J:{"36":"E A"},K:{"1":"r","2":"A B","36":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"36":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","36":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"matches() DOM method",D:true}; +module.exports={A:{A:{"2":"J E F PC","36":"G A B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","36":"C K L"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC","36":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB TC"},D:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","36":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","36":"7 J E VC WC"},F:{"1":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B eC fC gC hC zB","36":"8 C H M N O o NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC","36":"jC OC kC lC mC"},H:{"2":"5C"},I:{"1":"D","2":"6C","36":"4B I 7C 8C 9C OC AD BD"},J:{"36":"E A"},K:{"1":"s","2":"A B","36":"C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"36":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","36":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"matches() DOM method",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchmedia.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchmedia.js index 6f0a7cae7708ec..00ef6329745853 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchmedia.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/matchmedia.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B C dC eC fC gC zB NC hC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"1":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"matchMedia",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B C eC fC gC hC zB NC iC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"1":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"matchMedia",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mathml.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mathml.js index 98e03b7ac39eb6..49dbf36575a560 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mathml.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mathml.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"G A B PC","8":"J E F"},B:{"2":"C K L H M N O","8":"P Q R S T U V W X Y Z a b c d e f","584":"g h i j k l m s t u v w","1025":"0 1 2 3 4 5 6 x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","129":"QC 4B RC SC"},D:{"1":"9","8":"7 8 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f","584":"g h i j k l m s t u v w","1025":"0 1 2 3 4 5 6 x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","260":"7 I J E F G TC BC UC VC WC XC"},F:{"2":"G","8":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B","584":"S T U V W X Y Z a b c d","1025":"e f g h i j k l m","2052":"B C dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC"},H:{"8":"4C"},I:{"8":"4B I 5C 6C 7C 8C OC 9C AD","1025":"D"},J:{"1":"A","8":"E"},K:{"8":"A B C r zB NC 0B"},L:{"1025":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"8":"1B"},P:{"1":"o p q","8":"I n BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"8":"DC"},R:{"8":"ND"},S:{"1":"OD PD"}},B:2,C:"MathML",D:true}; +module.exports={A:{A:{"2":"G A B PC","8":"J E F"},B:{"2":"C K L H M N O","8":"P Q R S T U V W X Y Z a b c d e f","584":"g h i j k l m n t u v w","1025":"0 1 2 3 4 5 6 x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","129":"QC 4B SC TC"},D:{"1":"9","8":"7 8 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f","584":"g h i j k l m n t u v w","1025":"0 1 2 3 4 5 6 x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","260":"7 I J E F G UC BC VC WC XC YC"},F:{"2":"G","8":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B","584":"S T U V W X Y Z a b c d","1025":"e f g h i j k l m n","2052":"B C eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC"},H:{"8":"5C"},I:{"8":"4B I 6C 7C 8C 9C OC AD BD","1025":"D"},J:{"1":"A","8":"E"},K:{"8":"A B C s zB NC 0B"},L:{"1025":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"8":"1B"},P:{"1":"p q r","8":"I o CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"8":"DC"},R:{"8":"OD"},S:{"1":"PD QD"}},B:2,C:"MathML",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/maxlength.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/maxlength.js index 3ab5793c5bdd48..c07347c216e8d8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/maxlength.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/maxlength.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","16":"PC","900":"J E F G"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","1025":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","900":"QC 4B RC SC","1025":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 TC","900":"I BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G","132":"B C dC eC fC gC zB NC hC 0B"},G:{"1":"iC OC jC kC lC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC","2052":"F mC"},H:{"132":"4C"},I:{"1":"4B I 7C 8C OC 9C AD","16":"5C 6C","4097":"D"},J:{"1":"E A"},K:{"132":"A B C zB NC 0B","4097":"r"},L:{"4097":"D"},M:{"4097":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"4097":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1025":"OD PD"}},B:1,C:"maxlength attribute for input and textarea elements",D:true}; +module.exports={A:{A:{"1":"A B","16":"PC","900":"J E F G"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","1025":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","900":"QC 4B SC TC","1025":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 UC","900":"I BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G","132":"B C eC fC gC hC zB NC iC 0B"},G:{"1":"jC OC kC lC mC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC","2052":"F nC"},H:{"132":"5C"},I:{"1":"4B I 8C 9C OC AD BD","16":"6C 7C","4097":"D"},J:{"1":"E A"},K:{"132":"A B C zB NC 0B","4097":"s"},L:{"4097":"D"},M:{"4097":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"4097":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1025":"PD QD"}},B:1,C:"maxlength attribute for input and textarea elements",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js index a61982dd5316a7..d140e844270cd8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB","33":"HB IB JB KB LB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","33":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC"},M:{"1":"D"},A:{"2":"J E F G A PC","33":"B"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H M N O dC eC fC gC zB NC hC 0B","33":"8 n o p q"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC cC"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","33":"9C AD"}},B:6,C:"CSS ::backdrop pseudo-element",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB","33":"HB IB JB KB LB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","33":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC"},M:{"1":"D"},A:{"2":"J E F G A PC","33":"B"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H M N O eC fC gC hC zB NC iC 0B","33":"8 o p q r"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC dC"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","33":"AD BD"}},B:6,C:"CSS ::backdrop pseudo-element",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js index 766f96bd873b9b..a19651f0dc1898 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M RC SC","33":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB dC eC fC gC zB NC hC 0B"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I J TC BC UC VC cC","33":"E F G A WC XC CC"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC","33":"F lC mC nC oC pC qC"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"}},B:6,C:"isolate-override from unicode-bidi",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M SC TC","33":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB eC fC gC hC zB NC iC 0B"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I J UC BC VC WC dC","33":"E F G A XC YC CC"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC","33":"F mC nC oC pC qC rC"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"}},B:6,C:"isolate-override from unicode-bidi",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js index b91296e366b49c..7ee372591dd104 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","33":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G RC SC","33":"8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I TC BC UC cC","33":"J E F G A VC WC XC CC"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"F kC lC mC nC oC pC qC"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"}},B:6,C:"isolate from unicode-bidi",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","33":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G SC TC","33":"8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I UC BC VC dC","33":"J E F G A WC XC YC CC"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"F lC mC nC oC pC qC rC"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"}},B:6,C:"isolate from unicode-bidi",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js index c3da233486efd0..3847fc5350a3b2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G RC SC","33":"8 9 A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB dC eC fC gC zB NC hC 0B"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I TC BC UC cC","33":"J E F G A VC WC XC CC"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"F kC lC mC nC oC pC qC"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"}},B:6,C:"plaintext from unicode-bidi",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G SC TC","33":"8 9 A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB eC fC gC hC zB NC iC 0B"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I UC BC VC dC","33":"J E F G A WC XC YC CC"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"F lC mC nC oC pC qC rC"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"}},B:6,C:"plaintext from unicode-bidi",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js index c128f0c371f9b8..bd74e366078a9e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC","33":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dC eC fC gC zB NC hC 0B"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I J E TC BC UC VC WC cC","33":"F G A B C XC CC zB"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","33":"F mC nC oC pC qC rC sC tC"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"}},B:6,C:"text-decoration-color property",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC","33":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB eC fC gC hC zB NC iC 0B"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I J E UC BC VC WC XC dC","33":"F G A B C YC CC zB"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","33":"F nC oC pC qC rC sC tC uC"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"}},B:6,C:"text-decoration-color property",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js index 51f928ed837e7f..b7f162a3f6426c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC","33":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dC eC fC gC zB NC hC 0B"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I J E TC BC UC VC WC cC","33":"F G A B C XC CC zB"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","33":"F mC nC oC pC qC rC sC tC"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"}},B:6,C:"text-decoration-line property",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC","33":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB eC fC gC hC zB NC iC 0B"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I J E UC BC VC WC XC dC","33":"F G A B C YC CC zB"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","33":"F nC oC pC qC rC sC tC uC"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"}},B:6,C:"text-decoration-line property",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js index 68504b6aa01e57..6df345cbe7267b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dC eC fC gC zB NC hC 0B"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"2":"7 I J E TC BC UC VC WC cC","33":"F G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC"},G:{"2":"BC iC OC jC kC lC","33":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"}},B:6,C:"text-decoration shorthand property",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB eC fC gC hC zB NC iC 0B"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"2":"7 I J E UC BC VC WC XC dC","33":"F G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC"},G:{"2":"BC jC OC kC lC mC","33":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"}},B:6,C:"text-decoration shorthand property",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js index 119edbe5f373de..59c560a826989a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js @@ -1 +1 @@ -module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC","33":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dC eC fC gC zB NC hC 0B"},K:{"1":"r","2":"A B C zB NC 0B"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC","2":"7 I J E TC BC UC VC WC cC","33":"F G A B C XC CC zB"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","33":"F mC nC oC pC qC rC sC tC"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"}},B:6,C:"text-decoration-style property",D:undefined}; +module.exports={A:{D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},L:{"1":"D"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC","33":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},M:{"1":"D"},A:{"2":"J E F G A B PC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB eC fC gC hC zB NC iC 0B"},K:{"1":"s","2":"A B C zB NC 0B"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC","2":"7 I J E UC BC VC WC XC dC","33":"F G A B C YC CC zB"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","33":"F nC oC pC qC rC sC tC uC"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"}},B:6,C:"text-decoration-style property",D:undefined}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/media-fragments.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/media-fragments.js index ae7b755ef7417c..6ee4b4fe5bd1e8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/media-fragments.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/media-fragments.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB RC SC","132":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 I J E F G A B C K L H M N","132":"0 1 2 3 4 5 6 8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I TC BC UC","132":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"BC iC OC jC kC lC","132":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","132":"D 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"r"},L:{"132":"D"},M:{"132":"D"},N:{"132":"A B"},O:{"132":"1B"},P:{"2":"I BD","132":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"132":"DC"},R:{"132":"ND"},S:{"132":"OD PD"}},B:2,C:"Media Fragments",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB SC TC","132":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 I J E F G A B C K L H M N","132":"0 1 2 3 4 5 6 8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I UC BC VC","132":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"BC jC OC kC lC mC","132":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","132":"D AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"s"},L:{"132":"D"},M:{"132":"D"},N:{"132":"A B"},O:{"132":"1B"},P:{"2":"I CD","132":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"132":"DC"},R:{"132":"OD"},S:{"132":"PD QD"}},B:2,C:"Media Fragments",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js index 1ed383a0698bc8..d55964c305ca50 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB RC SC","260":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","324":"aB bB cB dB eB fB gB hB 5B iB 6B"},E:{"2":"7 I J E F G A TC BC UC VC WC XC CC","132":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B","324":"LB MB NB OB PB QB RB SB TB UB VB WB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"260":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","132":"BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"260":"OD PD"}},B:5,C:"Media Capture from DOM Elements API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SC TC","260":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","324":"aB bB cB dB eB fB gB hB 5B iB 6B"},E:{"2":"7 I J E F G A UC BC VC WC XC YC CC","132":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B","324":"LB MB NB OB PB QB RB SB TB UB VB WB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"260":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","132":"CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"260":"PD QD"}},B:5,C:"Media Capture from DOM Elements API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediarecorder.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediarecorder.js index 451cf591725089..808efbcad269c4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediarecorder.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediarecorder.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB","194":"WB XB"},E:{"1":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB","322":"K L 0B DC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB dC eC fC gC zB NC hC 0B","194":"JB KB"},G:{"1":"0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC","578":"tC uC vC wC xC yC zC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"MediaRecorder API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB","194":"WB XB"},E:{"1":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB","322":"K L 0B DC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB eC fC gC hC zB NC iC 0B","194":"JB KB"},G:{"1":"1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC","578":"uC vC wC xC yC zC 0C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"MediaRecorder API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediasource.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediasource.js index 4b486bec354571..285fe89b2a938e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediasource.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mediasource.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q RC SC","66":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB"},D:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M","33":"9 q AB BB CB DB EB FB","66":"8 N O n o p"},E:{"1":"F G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC WC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC","260":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D AD","2":"4B I 5C 6C 7C 8C OC 9C"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Media Source Extensions",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r SC TC","66":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB"},D:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M","33":"9 r AB BB CB DB EB FB","66":"8 N O o p q"},E:{"1":"F G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC XC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC","260":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D BD","2":"4B I 6C 7C 8C 9C OC AD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Media Source Extensions",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/menu.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/menu.js index d72cdb527b70f3..3ca5c0407fa672 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/menu.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/menu.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 QC 4B I J E RC SC","132":"8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T","450":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","66":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","66":"KB LB MB NB OB PB QB RB SB TB UB VB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"450":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Context menu item (menuitem element)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 QC 4B I J E SC TC","132":"8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T","450":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","66":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","66":"KB LB MB NB OB PB QB RB SB TB UB VB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"450":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Context menu item (menuitem element)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meta-theme-color.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meta-theme-color.js index cf259368a225f8..4d9925149c938e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meta-theme-color.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meta-theme-color.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB","132":"0 1 2 3 4 5 6 r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","258":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC YC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"513":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","16":"BD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:1,C:"theme-color Meta Tag",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB","132":"0 1 2 3 4 5 6 s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","258":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC ZC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"513":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","16":"CD"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:1,C:"theme-color Meta Tag",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meter.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meter.js index 9f3878ea33fac0..c714d68a7cb42e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meter.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/meter.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G dC eC fC gC"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"meter element",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G eC fC gC hC"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"meter element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/midi.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/midi.js index 51fd5948f5204b..c6ab08774251ed 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/midi.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/midi.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v RC SC"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"Web MIDI API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v SC TC"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"Web MIDI API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/minmaxwh.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/minmaxwh.js index 1768969f5b3676..397d75641d465a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/minmaxwh.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/minmaxwh.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","8":"J PC","129":"E","257":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS min/max-width/height",D:true}; +module.exports={A:{A:{"1":"G A B","8":"J PC","129":"E","257":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS min/max-width/height",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mp3.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mp3.js index 64a3049045e114..1998ae62809a39 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mp3.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mp3.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","132":"7 8 I J E F G A B C K L H M N O n o RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","2":"5C 6C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"MP3 audio format",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","132":"7 8 I J E F G A B C K L H M N O o p SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","2":"6C 7C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"MP3 audio format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg-dash.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg-dash.js index 1455efa728e3a3..01c199662d85c8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg-dash.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg-dash.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","386":"o p"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"Dynamic Adaptive Streaming over HTTP (MPEG-DASH)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","386":"p q"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"Dynamic Adaptive Streaming over HTTP (MPEG-DASH)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg4.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg4.js index 481e2314326b53..62380d99f2b7eb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg4.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mpeg4.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n RC SC","4":"9 o p q AB BB CB DB EB FB GB HB IB JB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D 9C AD","4":"4B I 5C 6C 8C OC","132":"7C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"260":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"MPEG-4/H.264 video format",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o SC TC","4":"9 p q r AB BB CB DB EB FB GB HB IB JB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D AD BD","4":"4B I 6C 7C 9C OC","132":"8C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"260":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"MPEG-4/H.264 video format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multibackgrounds.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multibackgrounds.js index ec329648bd4537..61e2ebb342b53e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multibackgrounds.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multibackgrounds.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 Multiple backgrounds",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 Multiple backgrounds",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multicolumn.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multicolumn.js index 2bcd16390dab7b..bbe9774a6ad5bf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multicolumn.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/multicolumn.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"C K L H M N O","516":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"132":"bB cB dB eB fB gB hB 5B iB 6B jB kB lB","164":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB RC SC","516":"mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a","1028":"0 1 2 3 4 5 6 b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"420":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","516":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","132":"G XC","164":"E F WC","420":"7 I J TC BC UC VC"},F:{"1":"C zB NC hC 0B","2":"G B dC eC fC gC","420":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB","516":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"nC oC","164":"F lC mC","420":"BC iC OC jC kC"},H:{"1":"4C"},I:{"420":"4B I 5C 6C 7C 8C OC 9C AD","516":"D"},J:{"420":"E A"},K:{"1":"C zB NC 0B","2":"A B","516":"r"},L:{"516":"D"},M:{"1028":"D"},N:{"1":"A B"},O:{"516":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","420":"I"},Q:{"516":"DC"},R:{"516":"ND"},S:{"164":"OD PD"}},B:4,C:"CSS3 Multiple column layout",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"C K L H M N O","516":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"132":"bB cB dB eB fB gB hB 5B iB 6B jB kB lB","164":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB SC TC","516":"mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a","1028":"0 1 2 3 4 5 6 b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"420":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","516":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","132":"G YC","164":"E F XC","420":"7 I J UC BC VC WC"},F:{"1":"C zB NC iC 0B","2":"G B eC fC gC hC","420":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB","516":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"oC pC","164":"F mC nC","420":"BC jC OC kC lC"},H:{"1":"5C"},I:{"420":"4B I 6C 7C 8C 9C OC AD BD","516":"D"},J:{"420":"E A"},K:{"1":"C zB NC 0B","2":"A B","516":"s"},L:{"516":"D"},M:{"1028":"D"},N:{"1":"A B"},O:{"516":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","420":"I"},Q:{"516":"DC"},R:{"516":"OD"},S:{"164":"PD QD"}},B:4,C:"CSS3 Multiple column layout",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutation-events.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutation-events.js index c251bc18149914..032de210ec828e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutation-events.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutation-events.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","260":"G A B"},B:{"132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H M N O"},C:{"2":"7 QC 4B I RC SC","260":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"16":"7 I J E F G A B C K L","132":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"16":"TC BC","132":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"C hC 0B","2":"G dC eC fC gC","16":"B zB NC","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"16":"BC iC","132":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"16":"5C 6C","132":"4B I D 7C 8C OC 9C AD"},J:{"132":"E A"},K:{"1":"C 0B","2":"A","16":"B zB NC","132":"r"},L:{"132":"D"},M:{"260":"D"},N:{"260":"A B"},O:{"132":"1B"},P:{"132":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"132":"DC"},R:{"132":"ND"},S:{"260":"OD PD"}},B:5,C:"Mutation events",D:true}; +module.exports={A:{A:{"2":"J E F PC","260":"G A B"},B:{"132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H M N O"},C:{"2":"7 QC 4B I SC TC","260":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"16":"7 I J E F G A B C K L","132":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"16":"UC BC","132":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"C iC 0B","2":"G eC fC gC hC","16":"B zB NC","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"16":"BC jC","132":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"16":"6C 7C","132":"4B I D 8C 9C OC AD BD"},J:{"132":"E A"},K:{"1":"C 0B","2":"A","16":"B zB NC","132":"s"},L:{"132":"D"},M:{"260":"D"},N:{"260":"A B"},O:{"132":"1B"},P:{"132":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"132":"DC"},R:{"132":"OD"},S:{"260":"PD QD"}},B:5,C:"Mutation events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutationobserver.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutationobserver.js index cd141491b0357c..e2615d47c6b876 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutationobserver.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/mutationobserver.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F PC","8":"G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K RC SC"},D:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N","33":"8 9 O n o p q AB BB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","33":"J"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B 5C 6C 7C","8":"I 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","8":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Mutation Observer",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F PC","8":"G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K SC TC"},D:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N","33":"8 9 O o p q r AB BB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","33":"J"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B 6C 7C 8C","8":"I 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","8":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Mutation Observer",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/namevalue-storage.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/namevalue-storage.js index 905825f32ce6a4..933f1b5dd92a13 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/namevalue-storage.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/namevalue-storage.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","2":"PC","8":"J E"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","4":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Web Storage - name/value pairs",D:true}; +module.exports={A:{A:{"1":"F G A B","2":"PC","8":"J E"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","4":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Web Storage - name/value pairs",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/native-filesystem-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/native-filesystem-api.js index d1807e9e129203..fa6f42b73e58cd 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/native-filesystem-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/native-filesystem-api.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","194":"P Q R S T U","260":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y RC SC","516":"0 1 2 3 4 5 6 z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r","194":"uB vB wB xB yB P Q R S T U","260":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC","516":"EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB dC eC fC gC zB NC hC 0B","194":"jB kB lB mB nB oB pB qB rB sB","260":"tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C","516":"EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","516":"D"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"516":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"File System Access API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","194":"P Q R S T U","260":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y SC TC","516":"0 1 2 3 4 5 6 z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s","194":"uB vB wB xB yB P Q R S T U","260":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC","516":"EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB eC fC gC hC zB NC iC 0B","194":"jB kB lB mB nB oB pB qB rB sB","260":"tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C","516":"EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","516":"D"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"516":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"File System Access API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/nav-timing.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/nav-timing.js index e8f1029b5ca6ad..55dc486d7ee1d1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/nav-timing.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/nav-timing.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I","33":"J E F G A B C"},E:{"1":"F G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC WC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"I D 8C OC 9C AD","2":"4B 5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Navigation Timing API",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I","33":"J E F G A B C"},E:{"1":"F G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC XC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"I D 9C OC AD BD","2":"4B 6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Navigation Timing API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/netinfo.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/netinfo.js index 2a736b21f0dea1..fe332acaf0a952 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/netinfo.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/netinfo.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","1028":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB","1028":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB dC eC fC gC zB NC hC 0B","1028":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"5C 9C AD","132":"4B I 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","132":"I","516":"BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"PD","260":"OD"}},B:7,C:"Network Information API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","1028":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB","1028":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB eC fC gC hC zB NC iC 0B","1028":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"6C AD BD","132":"4B I 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","132":"I","516":"CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"QD","260":"PD"}},B:7,C:"Network Information API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/notifications.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/notifications.js index 78d5a4a4402f81..17d4332fe51cf7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/notifications.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/notifications.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC"},D:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I","36":"7 8 J E F G A B C K L H M N O n o"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC","516":"JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","36":"D 9C AD"},J:{"1":"A","2":"E"},K:{"2":"A B C zB NC 0B","36":"r"},L:{"257":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"36":"I","130":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"130":"ND"},S:{"1":"OD PD"}},B:1,C:"Web Notifications",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC"},D:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I","36":"7 8 J E F G A B C K L H M N O o p"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC","516":"JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","36":"D AD BD"},J:{"1":"A","2":"E"},K:{"2":"A B C zB NC 0B","36":"s"},L:{"257":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"36":"I","130":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"130":"OD"},S:{"1":"PD QD"}},B:1,C:"Web Notifications",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-entries.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-entries.js index cb0dfec10e188d..fcb3939e9bca91 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-entries.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-entries.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","16":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Object.entries",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","16":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Object.entries",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-fit.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-fit.js index 655f3f1ece6efc..75c5db694a12a1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-fit.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-fit.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H","260":"M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC","132":"F G WC XC"},F:{"1":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G H M N O dC eC fC","33":"B C gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","132":"F mC nC oC"},H:{"33":"4C"},I:{"1":"D AD","2":"4B I 5C 6C 7C 8C OC 9C"},J:{"2":"E A"},K:{"1":"r","2":"A","33":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 object-fit/object-position",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H","260":"M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC","132":"F G XC YC"},F:{"1":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G H M N O eC fC gC","33":"B C hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","132":"F nC oC pC"},H:{"33":"5C"},I:{"1":"D BD","2":"4B I 6C 7C 8C 9C OC AD"},J:{"2":"E A"},K:{"1":"s","2":"A","33":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 object-fit/object-position",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-observe.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-observe.js index e2b0fee749d198..137a931109b91b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-observe.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-observe.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB","2":"8 G B C H M N O n o p MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I","2":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Object.observe data binding",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB","2":"8 G B C H M N O o p q MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I","2":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Object.observe data binding",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-values.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-values.js index 57c4a19b858c86..4452ec4a4df4db 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-values.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/object-values.js @@ -1 +1 @@ -module.exports={A:{A:{"8":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","8":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"F BC iC OC jC kC lC mC nC oC pC"},H:{"8":"4C"},I:{"1":"D","8":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"8":"E A"},K:{"1":"r","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","8":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Object.values method",D:true}; +module.exports={A:{A:{"8":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","8":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"F BC jC OC kC lC mC nC oC pC qC"},H:{"8":"5C"},I:{"1":"D","8":"4B I 6C 7C 8C 9C OC AD BD"},J:{"8":"E A"},K:{"1":"s","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","8":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Object.values method",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/objectrtc.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/objectrtc.js index 8c29ad5386031d..4614df817ff770 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/objectrtc.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/objectrtc.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"K L H M N O","2":"0 1 2 3 4 5 6 C P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"Object RTC (ORTC) API for WebRTC",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"K L H M N O","2":"0 1 2 3 4 5 6 C P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"Object RTC (ORTC) API for WebRTC",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offline-apps.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offline-apps.js index 0692ac938d443e..fc496eca27c571 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offline-apps.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offline-apps.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"G PC","8":"J E F"},B:{"1":"C K L H M N O P Q R S T","2":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S RC SC","2":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"4B","8":"QC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T","2":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB gC zB NC hC 0B","2":"G r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC","8":"eC fC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I 5C 6C 7C 8C OC 9C AD","2":"D"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","2":"A r"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"1":"OD","2":"PD"}},B:7,C:"Offline web applications",D:true}; +module.exports={A:{A:{"1":"A B","2":"G PC","8":"J E F"},B:{"1":"C K L H M N O P Q R S T","2":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S SC TC","2":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","4":"4B","8":"QC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T","2":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB hC zB NC iC 0B","2":"G s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC","8":"fC gC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I 6C 7C 8C 9C OC AD BD","2":"D"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","2":"A s"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"1":"PD","2":"QD"}},B:7,C:"Offline web applications",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offscreencanvas.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offscreencanvas.js index e85bdff0338cd2..2e239d1aa0840b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offscreencanvas.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/offscreencanvas.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB RC SC","194":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","322":"hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC","516":"HC IC JC KC bC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB dC eC fC gC zB NC hC 0B","322":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"1":"3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC","516":"HC IC JC KC 3C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"194":"OD PD"}},B:1,C:"OffscreenCanvas",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB SC TC","194":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},D:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","322":"hB 5B iB 6B jB kB lB mB nB oB pB"},E:{"1":"3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC","516":"HC IC JC KC cC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB eC fC gC hC zB NC iC 0B","322":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"1":"3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC","516":"HC IC JC KC 4C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"194":"PD QD"}},B:1,C:"OffscreenCanvas",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogg-vorbis.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogg-vorbis.js index d899cff16a8ccd..2e736bcae86bc4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogg-vorbis.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogg-vorbis.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC","132":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"A","2":"E"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Ogg Vorbis audio format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC","132":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"A","2":"E"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Ogg Vorbis audio format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogv.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogv.js index fc99f4fc25c0e3..3c5cf23d44b1c4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogv.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ogv.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","8":"G A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","8":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","194":"8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"1":"OD PD"}},B:6,C:"Ogg/Theora video format",D:true}; +module.exports={A:{A:{"2":"J E F PC","8":"G A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","8":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","194":"8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"1":"PD QD"}},B:6,C:"Ogg/Theora video format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ol-reversed.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ol-reversed.js index 63bfc470b090bf..7a5baf1ebcd9c8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ol-reversed.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ol-reversed.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N RC SC"},D:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","16":"8 M N O"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","16":"J"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC","16":"C"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Reversed attribute of ordered lists",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N SC TC"},D:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","16":"8 M N O"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","16":"J"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC","16":"C"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Reversed attribute of ordered lists",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/once-event-listener.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/once-event-listener.js index c310241a9fa150..8db2feca734562 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/once-event-listener.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/once-event-listener.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB RC SC"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"\"once\" event listener option",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB SC TC"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"\"once\" event listener option",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/online-status.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/online-status.js index 35e4b1c8775eda..bfca34aee4da64 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/online-status.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/online-status.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E PC","260":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B","516":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 8 9 L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K"},E:{"1":"7 J F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","1025":"E"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC","4":"0B"},G:{"1":"F OC jC kC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC","1025":"lC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"A","132":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Online/offline status",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E PC","260":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B","516":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 8 9 L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K"},E:{"1":"7 J F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","1025":"E"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC","4":"0B"},G:{"1":"F OC kC lC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC","1025":"mC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"A","132":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Online/offline status",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/opus.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/opus.js index 7fd74f125430de..4f8655ba832dae 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/opus.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/opus.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB"},E:{"2":"7 I J E F G A TC BC UC VC WC XC CC","132":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC","132":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Opus audio format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB"},E:{"2":"7 I J E F G A UC BC VC WC XC YC CC","132":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC","132":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Opus audio format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/orientation-sensor.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/orientation-sensor.js index be202e917affa4..ff673c9bed2e75 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/orientation-sensor.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/orientation-sensor.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:4,C:"Orientation Sensor",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB","194":"hB 5B iB 6B jB kB lB mB nB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:4,C:"Orientation Sensor",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/outline.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/outline.js index 7efacfb4455626..1f16529a43db5f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/outline.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/outline.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E PC","260":"F","388":"G A B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","388":"C K L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC","129":"0B","260":"G B dC eC fC gC zB NC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"C r 0B","260":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"388":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS outline properties",D:true}; +module.exports={A:{A:{"2":"J E PC","260":"F","388":"G A B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","388":"C K L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC","129":"0B","260":"G B eC fC gC hC zB NC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"C s 0B","260":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"388":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS outline properties",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pad-start-end.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pad-start-end.js index 2588aef06832f6..5e4fcb0a46bde6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pad-start-end.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pad-start-end.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB RC SC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"String.prototype.padStart(), String.prototype.padEnd()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB SC TC"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"String.prototype.padStart(), String.prototype.padEnd()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/page-transition-events.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/page-transition-events.js index 85e5ca08497f7a..aaea440c4faaf3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/page-transition-events.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/page-transition-events.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"PageTransitionEvent",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"PageTransitionEvent",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pagevisibility.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pagevisibility.js index d10d89ab6a459f..f527926d7b0788 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pagevisibility.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pagevisibility.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G RC SC","33":"A B C K L H M N"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","33":"8 9 L H M N O n o p q AB BB CB DB EB FB GB HB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC"},F:{"1":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B C dC eC fC gC zB NC hC","33":"8 H M N O"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","33":"9C AD"},J:{"1":"A","2":"E"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","33":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Page Visibility",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G SC TC","33":"A B C K L H M N"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K","33":"8 9 L H M N O o p q r AB BB CB DB EB FB GB HB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC"},F:{"1":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B C eC fC gC hC zB NC iC","33":"8 H M N O"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","33":"AD BD"},J:{"1":"A","2":"E"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","33":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Page Visibility",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passive-event-listener.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passive-event-listener.js index 6c6bf5256ff255..fcf09debf03fe3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passive-event-listener.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passive-event-listener.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB RC SC"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"Passive event listeners",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC TC"},D:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"Passive event listeners",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passkeys.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passkeys.js index 552238deea6f40..d4ab05e00fbc57 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passkeys.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passkeys.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v"},E:{"1":"GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B"},F:{"1":"g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f dC eC fC gC zB NC hC 0B"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","16":"n"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"Passkeys",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v"},E:{"1":"GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B"},F:{"1":"g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f eC fC gC hC zB NC iC 0B"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"p q r","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","16":"o"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"Passkeys",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passwordrules.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passwordrules.js index e9d50a3839eaec..d10b485c274d77 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passwordrules.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/passwordrules.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","16":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D RC SC","16":"8B 9B AC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"8B 9B AC"},E:{"1":"C K 0B","2":"7 I J E F G A B TC BC UC VC WC XC CC zB","16":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB dC eC fC gC zB NC hC 0B","16":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"16":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","16":"D"},J:{"2":"E","16":"A"},K:{"2":"A B C zB NC 0B","16":"r"},L:{"16":"D"},M:{"16":"D"},N:{"2":"A","16":"B"},O:{"16":"1B"},P:{"2":"I BD CD","16":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"16":"DC"},R:{"16":"ND"},S:{"2":"OD PD"}},B:1,C:"Password Rules",D:false}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","16":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B SC TC","16":"9B AC RC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"8B 9B AC"},E:{"1":"C K 0B","2":"7 I J E F G A B UC BC VC WC XC YC CC zB","16":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB eC fC gC hC zB NC iC 0B","16":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"16":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","16":"D"},J:{"2":"E","16":"A"},K:{"2":"A B C zB NC 0B","16":"s"},L:{"16":"D"},M:{"16":"D"},N:{"2":"A","16":"B"},O:{"16":"1B"},P:{"2":"I CD DD","16":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"16":"DC"},R:{"16":"OD"},S:{"2":"PD QD"}},B:1,C:"Password Rules",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/path2d.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/path2d.js index a5d616e51114a5..53517d1dc2b0ae 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/path2d.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/path2d.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K","132":"L H M N O"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB RC SC","132":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},D:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB","132":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC VC","132":"F G WC"},F:{"1":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p dC eC fC gC zB NC hC 0B","132":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","16":"F","132":"mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","132":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Path2D",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K","132":"L H M N O"},C:{"1":"0 1 2 3 4 5 6 XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB SC TC","132":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},D:{"1":"0 1 2 3 4 5 6 pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB","132":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC WC","132":"F G XC"},F:{"1":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q eC fC gC hC zB NC iC 0B","132":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","16":"F","132":"nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","132":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Path2D",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/payment-request.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/payment-request.js index 87e98542dfac85..ff6ac4ab4d7ecc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/payment-request.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/payment-request.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K","322":"L","8196":"H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB RC SC","4162":"eB fB gB hB 5B iB 6B jB kB lB mB","16452":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","194":"cB dB eB fB gB hB","1090":"5B iB","8196":"6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC","514":"A B CC","8196":"C zB"},F:{"1":"nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB dC eC fC gC zB NC hC 0B","194":"PB QB RB SB TB UB VB WB","8196":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC","514":"pC qC rC","8196":"sC tC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"2049":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q HD ID JD KD 2B 3B LD MD","2":"I","8196":"BD CD DD ED FD CC GD"},Q:{"8196":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:2,C:"Payment Request API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K","322":"L","8196":"H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB SC TC","4162":"eB fB gB hB 5B iB 6B jB kB lB mB","16452":"0 1 2 3 4 5 6 nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","194":"cB dB eB fB gB hB","1090":"5B iB","8196":"6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC","514":"A B CC","8196":"C zB"},F:{"1":"nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB eC fC gC hC zB NC iC 0B","194":"PB QB RB SB TB UB VB WB","8196":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC","514":"qC rC sC","8196":"tC uC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"2049":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r ID JD KD LD 2B 3B MD ND","2":"I","8196":"CD DD ED FD GD CC HD"},Q:{"8196":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:2,C:"Payment Request API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pdf-viewer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pdf-viewer.js index 3753e9ffb7e06d..a0ccaa5b042a08 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pdf-viewer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pdf-viewer.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"C K L"},C:{"1":"0 1 2 3 4 5 6 8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N O RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"16":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"Built-in PDF viewer",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"C K L"},C:{"1":"0 1 2 3 4 5 6 8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N O SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"16":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"Built-in PDF viewer",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-api.js index b6f93ab8f5be9f..5c4ae388598b55 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-api.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB RC SC"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB dC eC fC gC zB NC hC 0B"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Permissions API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB SC TC"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB eC fC gC hC zB NC iC 0B"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Permissions API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-policy.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-policy.js index 145932f4c5d858..21c213ff8d7781 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-policy.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/permissions-policy.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","258":"P Q R S T U","322":"V W","388":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r RC SC","258":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","258":"iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U","322":"V W","388":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B TC BC UC VC WC XC CC","258":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB dC eC fC gC zB NC hC 0B","258":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB","322":"tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d","388":"e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC","258":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","258":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","388":"r"},L:{"388":"D"},M:{"258":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I BD CD DD","258":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"258":"DC"},R:{"388":"ND"},S:{"2":"OD","258":"PD"}},B:5,C:"Permissions Policy",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","258":"P Q R S T U","322":"V W","388":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s SC TC","258":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","258":"iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U","322":"V W","388":"0 1 2 3 4 5 6 X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B UC BC VC WC XC YC CC","258":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB eC fC gC hC zB NC iC 0B","258":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB","322":"tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d","388":"e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC","258":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","258":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","388":"s"},L:{"388":"D"},M:{"258":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I CD DD ED","258":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"258":"DC"},R:{"388":"OD"},S:{"2":"PD","258":"QD"}},B:5,C:"Permissions Policy",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture-in-picture.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture-in-picture.js index 145ab0296e478b..daa91ee92c5af9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture-in-picture.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture-in-picture.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB RC SC","132":"0 1 2 3 4 5 6 tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","1090":"oB","1412":"sB","1668":"pB qB rB"},D:{"1":"0 1 2 3 4 5 6 rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB","2114":"qB"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC","4100":"A B C K CC zB 0B"},F:{"1":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB dC eC fC gC zB NC hC 0B","8196":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC","4100":"nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"16388":"D"},M:{"16388":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"Picture-in-Picture",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB SC TC","132":"0 1 2 3 4 5 6 tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","1090":"oB","1412":"sB","1668":"pB qB rB"},D:{"1":"0 1 2 3 4 5 6 rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB","2114":"qB"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC","4100":"A B C K CC zB 0B"},F:{"1":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB eC fC gC hC zB NC iC 0B","8196":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},G:{"1":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC","4100":"oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"16388":"D"},M:{"16388":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"Picture-in-Picture",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture.js index 9b8ef064b74152..1b95c6a4a2859b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/picture.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB RC SC","578":"JB KB LB MB"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB","194":"MB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p q dC eC fC gC zB NC hC 0B","322":"9"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Picture element",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB SC TC","578":"JB KB LB MB"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB","194":"MB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q r eC fC gC hC zB NC iC 0B","322":"9"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Picture element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ping.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ping.js index 8f217d295d9af6..3a773ae5cb0fbc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ping.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ping.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"2":"QC","194":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"194":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"194":"OD PD"}},B:1,C:"Ping attribute",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"2":"QC","194":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"194":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"194":"PD QD"}},B:1,C:"Ping attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/png-alpha.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/png-alpha.js index 3e3de680a4860a..f9507157a761b5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/png-alpha.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/png-alpha.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"E F G A B","2":"PC","8":"J"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"PNG alpha transparency",D:true}; +module.exports={A:{A:{"1":"E F G A B","2":"PC","8":"J"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"PNG alpha transparency",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer-events.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer-events.js index 501a290213d9b5..7472a03fa2efc0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer-events.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer-events.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:7,C:"CSS pointer-events (for HTML)",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:7,C:"CSS pointer-events (for HTML)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer.js index 2fca5620f8ebd7..ad5bf175df8e4a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointer.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G PC","164":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC","8":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","328":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o","8":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","584":"bB cB dB"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC","8":"E F G A B C VC WC XC CC zB","1096":"0B"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","8":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB","584":"OB PB QB"},G:{"1":"wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC","6148":"vC"},H:{"2":"4C"},I:{"1":"D","8":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"8":"E A"},K:{"1":"r","2":"A","8":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","36":"A"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"BD","8":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","328":"OD"}},B:2,C:"Pointer events",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G PC","164":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC","8":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","328":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB"},D:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p","8":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","584":"bB cB dB"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC","8":"E F G A B C WC XC YC CC zB","1096":"0B"},F:{"1":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","8":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB","584":"OB PB QB"},G:{"1":"xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC","6148":"wC"},H:{"2":"5C"},I:{"1":"D","8":"4B I 6C 7C 8C 9C OC AD BD"},J:{"8":"E A"},K:{"1":"s","2":"A","8":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","36":"A"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"CD","8":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","328":"PD"}},B:2,C:"Pointer events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointerlock.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointerlock.js index d4a081f22e30a0..9b36fe18d48b8e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointerlock.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/pointerlock.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K RC SC","33":"8 9 L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","33":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB","66":"8 M N O n o"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 H M N O n o p q"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Pointer Lock API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C"},C:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K SC TC","33":"8 9 L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},D:{"1":"0 1 2 3 4 5 6 MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H","33":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB","66":"8 M N O o p"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 H M N O o p q r"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Pointer Lock API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/portals.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/portals.js index 14fa5f2061042e..f90be9be0fea2f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/portals.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/portals.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T","322":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D","450":"U V W X Y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB","194":"vB wB xB yB P Q R S T","322":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","450":"U"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB dC eC fC gC zB NC hC 0B","194":"jB kB lB mB nB oB pB qB rB sB tB","322":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"450":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Portals",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O P Q R S T","322":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D","450":"U V W X Y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB","194":"vB wB xB yB P Q R S T","322":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","450":"U"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB eC fC gC hC zB NC iC 0B","194":"jB kB lB mB nB oB pB qB rB sB tB","322":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"450":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Portals",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-color-scheme.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-color-scheme.js index 58e69850ee6db4..fa11ee7987cfd2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-color-scheme.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-color-scheme.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB RC SC"},D:{"1":"0 1 2 3 4 5 6 wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB"},E:{"1":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB"},F:{"1":"jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB dC eC fC gC zB NC hC 0B"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"prefers-color-scheme media query",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB SC TC"},D:{"1":"0 1 2 3 4 5 6 wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB"},E:{"1":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB"},F:{"1":"jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB eC fC gC hC zB NC iC 0B"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"prefers-color-scheme media query",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js index 49a2467e653e71..f36be179874138 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB RC SC"},D:{"1":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"prefers-reduced-motion media query",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB SC TC"},D:{"1":"0 1 2 3 4 5 6 uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"prefers-reduced-motion media query",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/progress.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/progress.js index 187f98cb287dbe..ef08a49db60c0f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/progress.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/progress.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G dC eC fC gC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC","132":"lC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"progress element",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G eC fC gC hC"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC","132":"mC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"progress element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promise-finally.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promise-finally.js index 57bc567d83d165..09da103a76bb3d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promise-finally.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promise-finally.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB RC SC"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"Promise.prototype.finally",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB SC TC"},D:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"Promise.prototype.finally",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promises.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promises.js index 2f80aac2e9c24f..62fa0e6182916d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promises.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/promises.js @@ -1 +1 @@ -module.exports={A:{A:{"8":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"CB DB","8":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB RC SC"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"HB","8":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I J E TC BC UC VC"},F:{"1":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","4":"8","8":"G B C H M N O dC eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC jC kC lC"},H:{"8":"4C"},I:{"1":"D AD","8":"4B I 5C 6C 7C 8C OC 9C"},J:{"8":"E A"},K:{"1":"r","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Promises",D:true}; +module.exports={A:{A:{"8":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","4":"CB DB","8":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB SC TC"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"HB","8":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I J E UC BC VC WC"},F:{"1":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","4":"8","8":"G B C H M N O eC fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC kC lC mC"},H:{"8":"5C"},I:{"1":"D BD","8":"4B I 6C 7C 8C 9C OC AD"},J:{"8":"E A"},K:{"1":"s","8":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Promises",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proximity.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proximity.js index 6f9dedf712ad10..c193d5765a46f7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proximity.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proximity.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"OD PD"}},B:4,C:"Proximity API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"PD QD"}},B:4,C:"Proximity API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proxy.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proxy.js index 5fa8cb467c47db..e63d0fbce3c3bd 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proxy.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/proxy.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O NB OB PB QB RB SB TB UB VB WB XB","66":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B","66":"8 9 H M N O n o p q"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Proxy object",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N O NB OB PB QB RB SB TB UB VB WB XB","66":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B","66":"8 9 H M N O o p q r"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Proxy object",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/publickeypinning.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/publickeypinning.js index 1074f44de4c268..399f53cbf21997 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/publickeypinning.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/publickeypinning.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB","2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB","2":"8 G B C H M N O nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","4":"q","16":"9 n o p"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I BD CD DD ED FD CC","2":"n o p q GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"OD","2":"PD"}},B:6,C:"HTTP Public Key Pinning",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB","2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB","2":"8 G B C H M N O nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","4":"r","16":"9 o p q"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I CD DD ED FD GD CC","2":"o p q r HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"PD","2":"QD"}},B:6,C:"HTTP Public Key Pinning",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/push-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/push-api.js index 52a60019c77dd2..1a0d4f6d403521 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/push-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/push-api.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"N O","2":"C K L H M","257":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB RC SC","257":"0 1 2 3 4 5 6 TB VB WB XB YB ZB aB cB dB eB fB gB hB 5B 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","1281":"UB bB iB"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB","257":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","388":"TB UB VB WB XB YB"},E:{"2":"7 I J TC BC UC VC","514":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B","2564":"GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB dC eC fC gC zB NC hC 0B","16":"MB NB OB PB QB","257":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC","4100":"JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"2":"ND"},S:{"257":"OD PD"}},B:5,C:"Push API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"N O","2":"C K L H M","257":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB SC TC","257":"0 1 2 3 4 5 6 TB VB WB XB YB ZB aB cB dB eB fB gB hB 5B 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","1281":"UB bB iB"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB","257":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","388":"TB UB VB WB XB YB"},E:{"2":"7 I J UC BC VC WC","514":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B","2564":"GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB eC fC gC hC zB NC iC 0B","16":"MB NB OB PB QB","257":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC","4100":"JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"2":"OD"},S:{"257":"PD QD"}},B:5,C:"Push API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/queryselector.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/queryselector.js index f82151f575faed..4ae410b6c55034 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/queryselector.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/queryselector.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E","132":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","8":"G dC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"querySelector/querySelectorAll",D:true}; +module.exports={A:{A:{"1":"G A B","2":"PC","8":"J E","132":"F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","8":"G eC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"querySelector/querySelectorAll",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/readonly-attr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/readonly-attr.js index 16315bef1ea15d..2b77cc9d783695 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/readonly-attr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/readonly-attr.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 8 9 I J E F G A B C K L H M N O n o p q AB"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G dC","132":"B C eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC kC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"r","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"257":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"readonly attribute of input and textarea elements",D:true}; +module.exports={A:{A:{"1":"J E F G A B","16":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 8 9 I J E F G A B C K L H M N O o p q r AB"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G eC","132":"B C fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC lC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"s","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"257":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"readonly attribute of input and textarea elements",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/referrer-policy.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/referrer-policy.js index bb22cd72b08081..c42f5542f8dea9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/referrer-policy.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/referrer-policy.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N O","516":"P Q R S T"},C:{"1":"W X Y Z a","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC","516":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V","2049":"0 1 2 3 4 5 6 b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n","260":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB","516":"6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T"},E:{"2":"7 I J E TC BC UC VC","132":"F G A B WC XC CC","516":"C zB 0B","1025":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","1540":"K L DC YC"},F:{"1":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","516":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},G:{"2":"BC iC OC jC kC lC","132":"F mC nC oC pC qC rC sC","516":"tC uC vC wC","1025":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","1540":"xC yC zC 0C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2049":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I","516":"BD CD DD ED FD CC GD HD ID"},Q:{"1":"DC"},R:{"1":"ND"},S:{"516":"OD PD"}},B:4,C:"Referrer Policy",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N O","516":"P Q R S T"},C:{"1":"W X Y Z a","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC","516":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V","2049":"0 1 2 3 4 5 6 b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o","260":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB","516":"6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T"},E:{"2":"7 I J E UC BC VC WC","132":"F G A B XC YC CC","516":"C zB 0B","1025":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","1540":"K L DC ZC"},F:{"1":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","516":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},G:{"2":"BC jC OC kC lC mC","132":"F nC oC pC qC rC sC tC","516":"uC vC wC xC","1025":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","1540":"yC zC 0C 1C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2049":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I","516":"CD DD ED FD GD CC HD ID JD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"516":"PD QD"}},B:4,C:"Referrer Policy",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/registerprotocolhandler.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/registerprotocolhandler.js index 0942cb84534229..85217b3a30edf4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/registerprotocolhandler.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/registerprotocolhandler.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","129":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC"},D:{"2":"7 I J E F G A B C","129":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B dC eC fC gC zB NC","129":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","129":"A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:1,C:"Custom protocol handling",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","129":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC"},D:{"2":"7 I J E F G A B C","129":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B eC fC gC hC zB NC","129":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E","129":"A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:1,C:"Custom protocol handling",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noopener.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noopener.js index 04710dab625b72..cf3a17a97cc728 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noopener.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noopener.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"rel=noopener",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"rel=noopener",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noreferrer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noreferrer.js index 21f068098ed011..6518fea88967c1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noreferrer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rel-noreferrer.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"C"},C:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L H"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Link type \"noreferrer\"",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","132":"B"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"C"},C:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L H"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Link type \"noreferrer\"",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rellist.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rellist.js index 4a7ce12af3270c..34153a4d749a9d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rellist.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rellist.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M","132":"N"},C:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB RC SC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","132":"ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F TC BC UC VC WC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB dC eC fC gC zB NC hC 0B","132":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","132":"BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"relList (DOMTokenList)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M","132":"N"},C:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB SC TC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","132":"ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F UC BC VC WC XC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB eC fC gC hC zB NC iC 0B","132":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","132":"CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"relList (DOMTokenList)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rem.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rem.js index fec75b3546bd2f..fb1990917586f2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rem.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rem.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F PC","132":"G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC"},G:{"1":"F iC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC","260":"jC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"C r 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"rem (root em) units",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F PC","132":"G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC"},G:{"1":"F jC OC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC","260":"kC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"C s 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"rem (root em) units",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestanimationframe.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestanimationframe.js index 3e3ff5c07548f5..56120d98066afe 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestanimationframe.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestanimationframe.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","33":"8 B C K L H M N O n o p","164":"7 I J E F G A"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G","33":"p q","164":"8 O n o","420":"A B C K L H M N"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","33":"J"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","33":"kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"requestAnimationFrame",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","33":"8 B C K L H M N O o p q","164":"7 I J E F G A"},D:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G","33":"q r","164":"8 O o p","420":"A B C K L H M N"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","33":"J"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","33":"lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"requestAnimationFrame",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestidlecallback.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestidlecallback.js index d4059ce196b1ff..ab2f71ffda4a57 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestidlecallback.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/requestidlecallback.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC","194":"cB dB"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B","322":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC","322":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"requestIdleCallback",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC","194":"cB dB"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB"},E:{"1":"dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B","322":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC","322":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"requestIdleCallback",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resizeobserver.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resizeobserver.js index a8cc5a71404cfc..04717a518693cc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resizeobserver.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resizeobserver.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB RC SC"},D:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","194":"dB eB fB gB hB 5B iB 6B jB kB"},E:{"1":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB 0B","66":"K"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB dC eC fC gC zB NC hC 0B","194":"QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"Resize Observer",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB SC TC"},D:{"1":"0 1 2 3 4 5 6 lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","194":"dB eB fB gB hB 5B iB 6B jB kB"},E:{"1":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB 0B","66":"K"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB eC fC gC hC zB NC iC 0B","194":"QB RB SB TB UB VB WB XB YB ZB aB"},G:{"1":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"Resize Observer",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resource-timing.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resource-timing.js index 39e95339b5bafc..613532fb98a2a9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resource-timing.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/resource-timing.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB RC SC","194":"GB HB IB JB"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","260":"B"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Resource Timing",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB SC TC","194":"GB HB IB JB"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","260":"B"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Resource Timing",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rest-parameters.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rest-parameters.js index 208fa9bcebf1b5..3ab2f04d6e4078 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rest-parameters.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rest-parameters.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB","194":"TB UB VB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB dC eC fC gC zB NC hC 0B","194":"GB HB IB"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Rest parameters",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB","194":"TB UB VB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB eC fC gC hC zB NC iC 0B","194":"GB HB IB"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Rest parameters",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rtcpeerconnection.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rtcpeerconnection.js index 1bc00fb74114f8..764c7ae8e037e0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rtcpeerconnection.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/rtcpeerconnection.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L","260":"H M N O"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC","33":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o p","33":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H M N dC eC fC gC zB NC hC 0B","33":"8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","130":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"WebRTC Peer-to-peer connections",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L","260":"H M N O"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC","33":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p q","33":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H M N eC fC gC hC zB NC iC 0B","33":"8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","130":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"33":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"WebRTC Peer-to-peer connections",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ruby.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ruby.js index 9754b2e3188647..458616fce929b3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ruby.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ruby.js @@ -1 +1 @@ -module.exports={A:{A:{"4":"J E F PC","132":"G A B"},B:{"4":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB RC SC"},D:{"4":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"I"},E:{"4":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"I TC BC"},F:{"4":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","8":"G B C dC eC fC gC zB NC hC 0B"},G:{"4":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC"},H:{"8":"4C"},I:{"4":"4B I D 8C OC 9C AD","8":"5C 6C 7C"},J:{"4":"A","8":"E"},K:{"4":"r","8":"A B C zB NC 0B"},L:{"4":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"4":"1B"},P:{"4":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"4":"DC"},R:{"4":"ND"},S:{"1":"OD PD"}},B:1,C:"Ruby annotation",D:true}; +module.exports={A:{A:{"4":"J E F PC","132":"G A B"},B:{"4":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB SC TC"},D:{"4":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"I"},E:{"4":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"I UC BC"},F:{"4":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","8":"G B C eC fC gC hC zB NC iC 0B"},G:{"4":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC"},H:{"8":"5C"},I:{"4":"4B I D 9C OC AD BD","8":"6C 7C 8C"},J:{"4":"A","8":"E"},K:{"4":"s","8":"A B C zB NC 0B"},L:{"4":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"4":"1B"},P:{"4":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"4":"DC"},R:{"4":"OD"},S:{"1":"PD QD"}},B:1,C:"Ruby annotation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/run-in.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/run-in.js index 8a7ba3b218e9e7..55cc7b84f46f90 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/run-in.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/run-in.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB","2":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J UC","2":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"VC","129":"I TC BC"},F:{"1":"G B C H M N O dC eC fC gC zB NC hC 0B","2":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"iC OC jC kC lC","2":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","129":"BC"},H:{"1":"4C"},I:{"1":"4B I 5C 6C 7C 8C OC 9C","2":"D AD"},J:{"1":"E A"},K:{"1":"A B C zB NC 0B","2":"r"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:4,C:"display: run-in",D:true}; +module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB","2":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J VC","2":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"WC","129":"I UC BC"},F:{"1":"G B C H M N O eC fC gC hC zB NC iC 0B","2":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"jC OC kC lC mC","2":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","129":"BC"},H:{"1":"5C"},I:{"1":"4B I 6C 7C 8C 9C OC AD","2":"D BD"},J:{"1":"E A"},K:{"1":"A B C zB NC 0B","2":"s"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:4,C:"display: run-in",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js index c1ba948746c5af..3c73e6a01e8714 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","388":"B"},B:{"1":"O P Q R S T U","2":"C K L H","129":"M N","513":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B RC SC"},D:{"1":"aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","513":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC zB","2052":"L YC","3076":"C K 0B DC"},F:{"1":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB dC eC fC gC zB NC hC 0B","513":"sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC","2052":"tC uC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"r"},L:{"513":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"16":"DC"},R:{"513":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"'SameSite' cookie attribute",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","388":"B"},B:{"1":"O P Q R S T U","2":"C K L H","129":"M N","513":"0 1 2 3 4 5 6 V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B SC TC"},D:{"1":"aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","513":"0 1 2 3 4 5 6 Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC zB","2052":"L ZC","3076":"C K 0B DC"},F:{"1":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB eC fC gC hC zB NC iC 0B","513":"sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC","2052":"uC vC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"s"},L:{"513":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"16":"DC"},R:{"513":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"'SameSite' cookie attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/screen-orientation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/screen-orientation.js index b182b63ff2b858..7d65105f7532a5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/screen-orientation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/screen-orientation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","164":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","36":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N RC SC","36":"8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","36":"B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","16":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"Screen Orientation",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","164":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","36":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N SC TC","36":"8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A","36":"B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","16":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"Screen Orientation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-async.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-async.js index 50d98de29c3152..8c74e4f290fa23 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-async.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-async.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","132":"7"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"async attribute for external scripts",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","132":"7"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"async attribute for external scripts",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-defer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-defer.js index bf5afc3a2c5a90..a9a03dc490dbdf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-defer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/script-defer.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","132":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","257":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"defer attribute for external scripts",D:true}; +module.exports={A:{A:{"1":"A B","132":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","257":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"defer attribute for external scripts",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoview.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoview.js index 4449c75d840969..3233c41a4011ab 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoview.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoview.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E PC","132":"F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB RC SC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC","132":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G dC eC fC gC","16":"B zB NC","132":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB hC 0B"},G:{"1":"2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC","132":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"1":"D","16":"5C 6C","132":"4B I 7C 8C OC 9C AD"},J:{"132":"E A"},K:{"1":"r","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"132":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"scrollIntoView",D:true}; +module.exports={A:{A:{"2":"J E PC","132":"F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","132":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB SC TC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC","132":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G eC fC gC hC","16":"B zB NC","132":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB iC 0B"},G:{"1":"2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC","132":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"1":"D","16":"6C 7C","132":"4B I 8C 9C OC AD BD"},J:{"132":"E A"},K:{"1":"s","132":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"132":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"scrollIntoView",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js index 0648aae1338fab..ac5233cf55ed2d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Element.scrollIntoViewIfNeeded()",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Element.scrollIntoViewIfNeeded()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sdch.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sdch.js index 842b09df1fdc9c..b7c1e377b0eb02 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sdch.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sdch.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","2":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB","2":"G B C r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"SDCH Accept-Encoding/Content-Encoding",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","2":"0 1 2 3 4 5 6 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB","2":"G B C s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"SDCH Accept-Encoding/Content-Encoding",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/selection-api.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/selection-api.js index f76c753a0b8fc7..a758a0fc611df5 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/selection-api.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/selection-api.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","16":"PC","260":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB RC SC","2180":"SB TB UB VB WB XB YB ZB aB"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","132":"G B C dC eC fC gC zB NC hC 0B"},G:{"16":"OC","132":"BC iC","516":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D 9C AD","16":"4B I 5C 6C 7C 8C","1025":"OC"},J:{"1":"A","16":"E"},K:{"1":"r","16":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","16":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2180":"OD"}},B:5,C:"Selection API",D:true}; +module.exports={A:{A:{"1":"G A B","16":"PC","260":"J E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","132":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SC TC","2180":"SB TB UB VB WB XB YB ZB aB"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","132":"G B C eC fC gC hC zB NC iC 0B"},G:{"16":"OC","132":"BC jC","516":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D AD BD","16":"4B I 6C 7C 8C 9C","1025":"OC"},J:{"1":"A","16":"E"},K:{"1":"s","16":"A B C zB NC","132":"0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","16":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2180":"PD"}},B:5,C:"Selection API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/server-timing.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/server-timing.js index 5e7a1b871c619c..bc9d2b31fadcc4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/server-timing.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/server-timing.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB RC SC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","196":"iB 6B jB kB","324":"lB"},E:{"2":"7 I J E F G A B C TC BC UC VC WC XC CC zB","516":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"Server Timing",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB SC TC"},D:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","196":"iB 6B jB kB","324":"lB"},E:{"2":"7 I J E F G A B C UC BC VC WC XC YC CC zB","516":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"Server Timing",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/serviceworkers.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/serviceworkers.js index 36f0bd8651d12b..0864495c9a0192 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/serviceworkers.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/serviceworkers.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L","322":"H M"},C:{"1":"0 1 2 3 4 5 6 TB VB WB XB YB ZB aB cB dB eB fB gB hB 5B 6B jB kB lB mB nB oB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC","194":"IB JB KB LB MB NB OB PB QB RB SB","513":"UB bB iB pB"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","4":"PB QB RB SB TB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B TC BC UC VC WC XC CC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB dC eC fC gC zB NC hC 0B","4":"CB DB EB FB GB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","4":"D"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"Service Workers",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L","322":"H M"},C:{"1":"0 1 2 3 4 5 6 TB VB WB XB YB ZB aB cB dB eB fB gB hB 5B 6B jB kB lB mB nB oB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC","194":"IB JB KB LB MB NB OB PB QB RB SB","513":"UB bB iB pB"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB","4":"PB QB RB SB TB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B UC BC VC WC XC YC CC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB eC fC gC hC zB NC iC 0B","4":"CB DB EB FB GB"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","4":"D"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"Service Workers",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/setimmediate.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/setimmediate.js index 7b8bbc95e75f2e..1b657fc2ade1f3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/setimmediate.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/setimmediate.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Efficient Script Yielding: setImmediate()",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"C K L H M N O","2":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"1":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Efficient Script Yielding: setImmediate()",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdom.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdom.js index 3bc0bbdddcb75b..aa62c3fa75dbdb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdom.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdom.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P","2":"0 1 2 3 4 5 6 C K L H M N O Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","66":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},D:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"AB BB CB DB EB FB GB HB IB JB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","2":"G B C oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","33":"8 H M N O n o"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC","33":"9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"BD CD DD ED FD CC GD HD","2":"n o p q ID JD KD 2B 3B LD MD","33":"I"},Q:{"1":"DC"},R:{"2":"ND"},S:{"1":"OD","2":"PD"}},B:7,C:"Shadow DOM (deprecated V0 spec)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P","2":"0 1 2 3 4 5 6 C K L H M N O Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","66":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB"},D:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"AB BB CB DB EB FB GB HB IB JB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","2":"G B C oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","33":"8 H M N O o p"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC","33":"AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"CD DD ED FD GD CC HD ID","2":"o p q r JD KD LD 2B 3B MD ND","33":"I"},Q:{"1":"DC"},R:{"2":"OD"},S:{"1":"PD","2":"QD"}},B:7,C:"Shadow DOM (deprecated V0 spec)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdomv1.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdomv1.js index 94c90b7c78f244..e65c4585b27b49 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdomv1.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/shadowdomv1.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB RC SC","322":"hB","578":"5B iB 6B jB"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},E:{"1":"A B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC","132":"pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","4":"BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"Shadow DOM (V1)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB SC TC","322":"hB","578":"5B iB 6B jB"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},E:{"1":"A B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC","132":"qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","4":"CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"Shadow DOM (V1)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedarraybuffer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedarraybuffer.js index 46e870d790d0d2..91a944a5d41b42 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedarraybuffer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedarraybuffer.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P Q R S T U V W X Y Z","2":"C K L H","194":"M N O","513":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB RC SC","194":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r","450":"uB vB wB xB yB","513":"0 1 2 3 4 5 6 P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","194":"iB 6B jB kB lB mB nB oB","513":"0 1 2 3 4 5 6 a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A TC BC UC VC WC XC","194":"B C K L H CC zB 0B DC YC ZC","513":"EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB dC eC fC gC zB NC hC 0B","194":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB","513":"yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC","194":"qC rC sC tC uC vC wC xC yC zC 0C 1C","513":"EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"r"},L:{"513":"D"},M:{"513":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I BD CD DD ED FD CC GD HD ID JD","513":"n o p q KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"513":"ND"},S:{"2":"OD","513":"PD"}},B:6,C:"Shared Array Buffer",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P Q R S T U V W X Y Z","2":"C K L H","194":"M N O","513":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB SC TC","194":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s","450":"uB vB wB xB yB","513":"0 1 2 3 4 5 6 P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B","194":"iB 6B jB kB lB mB nB oB","513":"0 1 2 3 4 5 6 a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A UC BC VC WC XC YC","194":"B C K L H CC zB 0B DC ZC aC","513":"EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB eC fC gC hC zB NC iC 0B","194":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB","513":"yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC","194":"rC sC tC uC vC wC xC yC zC 0C 1C 2C","513":"EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","513":"s"},L:{"513":"D"},M:{"513":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I CD DD ED FD GD CC HD ID JD KD","513":"o p q r LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"513":"OD"},S:{"2":"PD","513":"QD"}},B:6,C:"Shared Array Buffer",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedworkers.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedworkers.js index 5a56c8cbb4273d..999b8f7b0d4640 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedworkers.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sharedworkers.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 J UC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I E F G A B C K L H TC BC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","2":"G dC eC fC"},G:{"1":"jC kC 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","2":"r","16":"A"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I","2":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"OD PD"}},B:1,C:"Shared Web Workers",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 J VC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I E F G A B C K L H UC BC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","2":"G eC fC gC"},G:{"1":"kC lC 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","2":"s","16":"A"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I","2":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"PD QD"}},B:1,C:"Shared Web Workers",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sni.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sni.js index 0d7e8cfa81db26..5883e6ef6c5fbf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sni.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sni.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J PC","132":"E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC"},H:{"1":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Server Name Indication",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J PC","132":"E F"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC"},H:{"1":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Server Name Indication",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spdy.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spdy.js index 4270f2afd49947..5a0035d5c1ef05 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spdy.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spdy.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","2":"0 1 2 3 4 5 6 7 QC 4B I J E F G A B C aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","2":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"F G A B C XC CC zB","2":"7 I J E TC BC UC VC WC","129":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB RB TB 0B","2":"G B C PB QB SB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC"},G:{"1":"F mC nC oC pC qC rC sC tC","2":"BC iC OC jC kC lC","257":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I 8C OC 9C AD","2":"D 5C 6C 7C"},J:{"2":"E A"},K:{"1":"0B","2":"A B C r zB NC"},L:{"2":"D"},M:{"2":"D"},N:{"1":"B","2":"A"},O:{"2":"1B"},P:{"1":"I","2":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"OD","2":"PD"}},B:7,C:"SPDY protocol",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G A PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","2":"0 1 2 3 4 5 6 7 QC 4B I J E F G A B C aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","2":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"F G A B C YC CC zB","2":"7 I J E UC BC VC WC XC","129":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB RB TB 0B","2":"G B C PB QB SB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC"},G:{"1":"F nC oC pC qC rC sC tC uC","2":"BC jC OC kC lC mC","257":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I 9C OC AD BD","2":"D 6C 7C 8C"},J:{"2":"E A"},K:{"1":"0B","2":"A B C s zB NC"},L:{"2":"D"},M:{"2":"D"},N:{"1":"B","2":"A"},O:{"2":"1B"},P:{"1":"I","2":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"PD","2":"QD"}},B:7,C:"SPDY protocol",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-recognition.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-recognition.js index 4ff391e3d589c3..60590021a1fc75 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-recognition.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-recognition.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","514":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC","322":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q","164":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L TC BC UC VC WC XC CC zB 0B DC","1060":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB dC eC fC gC zB NC hC 0B","514":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC","1060":"0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","164":"r"},L:{"164":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"164":"DC"},R:{"164":"ND"},S:{"322":"OD PD"}},B:7,C:"Speech Recognition API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","514":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC","322":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r","164":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L UC BC VC WC XC YC CC zB 0B DC","1060":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB eC fC gC hC zB NC iC 0B","514":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C","1060":"1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","164":"s"},L:{"164":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"164":"1B"},P:{"164":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"164":"DC"},R:{"164":"OD"},S:{"322":"PD QD"}},B:7,C:"Speech Recognition API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-synthesis.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-synthesis.js index 617634a693ee67..44ff9c5ea13abb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-synthesis.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/speech-synthesis.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"L H M N O","2":"C K","257":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB RC SC","194":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},D:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB","257":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB","2":"8 9 G B C H M N O n o p q AB BB dC eC fC gC zB NC hC 0B","257":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"2":"ND"},S:{"1":"OD PD"}},B:7,C:"Speech Synthesis API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"L H M N O","2":"C K","257":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB SC TC","194":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},D:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB","257":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC"},F:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB","2":"8 9 G B C H M N O o p q r AB BB eC fC gC hC zB NC iC 0B","257":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"2":"OD"},S:{"1":"PD QD"}},B:7,C:"Speech Synthesis API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spellcheck-attribute.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spellcheck-attribute.js index be12f3cf572550..1e2a2baf5630a2 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spellcheck-attribute.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/spellcheck-attribute.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"4":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"4":"4C"},I:{"4":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"A","4":"E"},K:{"4":"A B C r zB NC 0B"},L:{"4":"D"},M:{"4":"D"},N:{"4":"A B"},O:{"4":"1B"},P:{"4":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"4":"ND"},S:{"2":"OD PD"}},B:1,C:"Spellcheck attribute",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"4":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"4":"5C"},I:{"4":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"A","4":"E"},K:{"4":"A B C s zB NC 0B"},L:{"4":"D"},M:{"4":"D"},N:{"4":"A B"},O:{"4":"1B"},P:{"4":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"4":"OD"},S:{"2":"PD QD"}},B:1,C:"Spellcheck attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sql-storage.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sql-storage.js index 3d4fdad668b32c..571c26fa4adb17 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sql-storage.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sql-storage.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P Q R S T U V W X Y Z a b c d e f g h i j","2":"C K L H M N O","129":"k l m s t u v w x","385":"0 1 2 3 4 5 6 y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j","129":"k l m s t u v w x","385":"0 1 2 3 4 5 6 y z","897":"D 8B 9B AC"},E:{"1":"7 I J E F G A B C TC BC UC VC WC XC CC zB 0B","2":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z fC gC zB NC hC 0B","2":"G dC eC","257":"a b c d e f g h i j k l m"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC","2":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I 5C 6C 7C 8C OC 9C AD","257":"D"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","2":"A","257":"r"},L:{"257":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Web SQL Database",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"P Q R S T U V W X Y Z a b c d e f g h i j","2":"C K L H M N O","129":"k l m n t u v w x","385":"0 1 2 3 4 5 6 y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j","129":"k l m n t u v w x","385":"0 1 2 3 4 5 6 y z","897":"D 8B 9B AC"},E:{"1":"7 I J E F G A B C UC BC VC WC XC YC CC zB 0B","2":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z gC hC zB NC iC 0B","2":"G eC fC","257":"a b c d e f g h i j k l m n"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC","2":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I 6C 7C 8C 9C OC AD BD","257":"D"},J:{"1":"E A"},K:{"1":"B C zB NC 0B","2":"A","257":"s"},L:{"257":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Web SQL Database",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/srcset.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/srcset.js index 10b9eae7aa288c..e7be449a3e55b0 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/srcset.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/srcset.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C","514":"K L H"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB RC SC","194":"HB IB JB KB LB MB"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB","260":"JB KB LB MB"},E:{"2":"7 I J E TC BC UC VC","260":"F WC","1028":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n dC eC fC gC zB NC hC 0B","260":"9 o p q"},G:{"2":"BC iC OC jC kC lC","260":"F mC","1028":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Srcset and sizes attributes",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C","514":"K L H"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB SC TC","194":"HB IB JB KB LB MB"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB","260":"JB KB LB MB"},E:{"2":"7 I J E UC BC VC WC","260":"F XC","1028":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o eC fC gC hC zB NC iC 0B","260":"9 p q r"},G:{"2":"BC jC OC kC lC mC","260":"F nC","1028":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Srcset and sizes attributes",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stream.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stream.js index c48f6edef2315b..4e1e8963cf39b8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stream.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stream.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M RC SC","129":"LB MB NB OB PB QB","420":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n","420":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B H M N dC eC fC gC zB NC hC","420":"8 9 C O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC","513":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","1537":"rC sC tC uC vC wC xC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","420":"A"},K:{"1":"r","2":"A B zB NC","420":"C 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","420":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:4,C:"getUserMedia/Stream API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M SC TC","129":"LB MB NB OB PB QB","420":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},D:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o","420":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B H M N eC fC gC hC zB NC iC","420":"8 9 C O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC","513":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","1537":"sC tC uC vC wC xC yC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","420":"A"},K:{"1":"s","2":"A B zB NC","420":"C 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","420":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:4,C:"getUserMedia/Stream API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/streams.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/streams.js index 099f15b5b3d19d..48f06ff622b2c8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/streams.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/streams.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","130":"B"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"C K","260":"L H","1028":"P Q R S T U V W X","5124":"M N O"},C:{"1":"0 1 2 3 4 5 6 l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB RC SC","5124":"j k","7172":"mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i","7746":"gB hB 5B iB 6B jB kB lB"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","260":"bB cB dB eB fB gB hB","1028":"5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X"},E:{"2":"7 I J E F G TC BC UC VC WC XC","1028":"H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","3076":"A B C K L CC zB 0B DC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB dC eC fC gC zB NC hC 0B","260":"OB PB QB RB SB TB UB","1028":"VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB"},G:{"2":"F BC iC OC jC kC lC mC nC oC","16":"pC","1028":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q KD 2B 3B LD MD","2":"I BD CD","1028":"DD ED FD CC GD HD ID JD"},Q:{"1028":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:1,C:"Streams",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","130":"B"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"C K","260":"L H","1028":"P Q R S T U V W X","5124":"M N O"},C:{"1":"0 1 2 3 4 5 6 l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB SC TC","5124":"j k","7172":"mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i","7746":"gB hB 5B iB 6B jB kB lB"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB","260":"bB cB dB eB fB gB hB","1028":"5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X"},E:{"2":"7 I J E F G UC BC VC WC XC YC","1028":"H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","3076":"A B C K L CC zB 0B DC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB eC fC gC hC zB NC iC 0B","260":"OB PB QB RB SB TB UB","1028":"VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB"},G:{"2":"F BC jC OC kC lC mC nC oC pC","16":"qC","1028":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r LD 2B 3B MD ND","2":"I CD DD","1028":"ED FD GD CC HD ID JD KD"},Q:{"1028":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:1,C:"Streams",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stricttransportsecurity.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stricttransportsecurity.js index fa9be068684bdb..32d16d67f9ee59 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stricttransportsecurity.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/stricttransportsecurity.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A PC","129":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Strict Transport Security",D:true}; +module.exports={A:{A:{"2":"J E F G A PC","129":"B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Strict Transport Security",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/style-scoped.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/style-scoped.js index f304a1caa38dc0..9df756932f6768 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/style-scoped.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/style-scoped.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"9 o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","2":"0 1 2 3 4 5 6 7 8 QC 4B I J E F G A B C K L H M N O n 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","322":"eB fB gB hB 5B iB"},D:{"2":"0 1 2 3 4 5 6 7 8 I J E F G A B C K L H M N O MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","194":"9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"OD","2":"PD"}},B:7,C:"Scoped CSS",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"9 p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","2":"0 1 2 3 4 5 6 7 8 QC 4B I J E F G A B C K L H M N O o 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","322":"eB fB gB hB 5B iB"},D:{"2":"0 1 2 3 4 5 6 7 8 I J E F G A B C K L H M N O MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","194":"9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"PD","2":"QD"}},B:7,C:"Scoped CSS",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-bundling.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-bundling.js index a879b7356f4817..58b7773ff46033 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-bundling.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-bundling.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 s t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Subresource Loading with Web Bundles",D:false}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 n t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Subresource Loading with Web Bundles",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-integrity.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-integrity.js index 11583ba3e4dc43..460880fdc4810a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-integrity.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/subresource-integrity.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB RC SC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC","194":"rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Subresource Integrity",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SC TC"},D:{"1":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC","194":"sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Subresource Integrity",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-css.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-css.js index 1feb99b6a26eb6..f0ef1d74eaa923 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-css.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-css.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","516":"C K L H"},C:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","260":"7 8 I J E F G A B C K L H M N O n o p q"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"I"},E:{"1":"7 J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC","132":"I BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"BC iC"},H:{"260":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"r","260":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"SVG in CSS backgrounds",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","516":"C K L H"},C:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","260":"7 8 I J E F G A B C K L H M N O o p q r"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"I"},E:{"1":"7 J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC","132":"I BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"BC jC"},H:{"260":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"s","260":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"SVG in CSS backgrounds",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-filters.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-filters.js index 55592acbc5b847..8063cdcfdac3a9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-filters.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-filters.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I","4":"7 J E"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"SVG filters",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I","4":"7 J E"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"SVG filters",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fonts.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fonts.js index 38ea3783ef3e65..80b039a9a61524 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fonts.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fonts.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"G A B PC","8":"J E F"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB","2":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","130":"NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC"},F:{"1":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B","2":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","130":"AB BB CB DB EB FB GB HB IB JB KB LB"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"258":"4C"},I:{"1":"4B I 8C OC 9C AD","2":"D 5C 6C 7C"},J:{"1":"E A"},K:{"1":"A B C zB NC 0B","2":"r"},L:{"130":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I","130":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"130":"ND"},S:{"2":"OD PD"}},B:2,C:"SVG fonts",D:true}; +module.exports={A:{A:{"2":"G A B PC","8":"J E F"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB","2":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","130":"NB OB PB QB RB SB TB UB VB WB XB YB ZB"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC"},F:{"1":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B","2":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","130":"AB BB CB DB EB FB GB HB IB JB KB LB"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"258":"5C"},I:{"1":"4B I 9C OC AD BD","2":"D 6C 7C 8C"},J:{"1":"E A"},K:{"1":"A B C zB NC 0B","2":"s"},L:{"130":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"I","130":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"130":"OD"},S:{"2":"PD QD"}},B:2,C:"SVG fonts",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fragment.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fragment.js index d0f816b4ecef06..7412cd7bf88aab 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fragment.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-fragment.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB","132":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},E:{"1":"C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E G A B TC BC UC VC XC CC","132":"F WC"},F:{"1":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"8 H M N O n o p","4":"B C eC fC gC zB NC hC","16":"G dC","132":"9 q AB BB CB DB EB FB GB HB IB JB KB LB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC nC oC pC qC rC","132":"F mC"},H:{"1":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E","132":"A"},K:{"1":"r 0B","4":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","132":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"SVG fragment identifiers",D:true}; +module.exports={A:{A:{"2":"J E F PC","260":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB","132":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB"},E:{"1":"C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E G A B UC BC VC WC YC CC","132":"F XC"},F:{"1":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"8 H M N O o p q","4":"B C fC gC hC zB NC iC","16":"G eC","132":"9 r AB BB CB DB EB FB GB HB IB JB KB LB"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC oC pC qC rC sC","132":"F nC"},H:{"1":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E","132":"A"},K:{"1":"s 0B","4":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","132":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"SVG fragment identifiers",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html.js index 747b646d7d0314..888878a2ec25dd 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","388":"G A B"},B:{"4":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC","4":"4B"},D:{"4":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"TC BC","4":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"4":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"4":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","4":"D 9C AD"},J:{"1":"A","2":"E"},K:{"4":"A B C r zB NC 0B"},L:{"4":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"4":"1B"},P:{"4":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"4":"DC"},R:{"4":"ND"},S:{"1":"OD PD"}},B:2,C:"SVG effects for HTML",D:true}; +module.exports={A:{A:{"2":"J E F PC","388":"G A B"},B:{"4":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC","4":"4B"},D:{"4":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"UC BC","4":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"4":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"4":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","4":"D AD BD"},J:{"1":"A","2":"E"},K:{"4":"A B C s zB NC 0B"},L:{"4":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"4":"1B"},P:{"4":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"4":"DC"},R:{"4":"OD"},S:{"1":"PD QD"}},B:2,C:"SVG effects for HTML",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html5.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html5.js index 44615d3be5e9d0..28ba6ae94b15f4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html5.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-html5.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F","129":"G A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 I J"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"7 I TC BC","129":"J E F UC VC WC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"B gC zB NC","8":"G dC eC fC"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","8":"BC iC OC","129":"F jC kC lC mC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"5C 6C 7C","129":"4B I 8C OC"},J:{"1":"A","129":"E"},K:{"1":"C r 0B","8":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Inline SVG in HTML5",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F","129":"G A B"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","8":"7 I J"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"7 I UC BC","129":"J E F VC WC XC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"B hC zB NC","8":"G eC fC gC"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","8":"BC jC OC","129":"F kC lC mC nC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"6C 7C 8C","129":"4B I 9C OC"},J:{"1":"A","129":"E"},K:{"1":"C s 0B","8":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"129":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Inline SVG in HTML5",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-img.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-img.js index bf543fcf0b0f1a..c0245e59ccb0cf 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-img.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-img.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC","4":"BC","132":"7 I J E F UC VC WC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"F BC iC OC jC kC lC mC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"5C 6C 7C","132":"4B I 8C OC"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"SVG in HTML img element",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC","4":"BC","132":"7 I J E F VC WC XC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"F BC jC OC kC lC mC nC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"6C 7C 8C","132":"4B I 9C OC"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"SVG in HTML img element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-smil.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-smil.js index df4a86ec0625cc..68faee9f00d5e3 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-smil.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg-smil.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","8":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"I"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"TC BC","132":"7 I UC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"BC iC OC jC"},H:{"2":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"SVG SMIL animation",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","8":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"I"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"UC BC","132":"7 I VC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"BC jC OC kC"},H:{"2":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"SVG SMIL animation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg.js index b390d9c12c1243..f019b5b1d60688 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/svg.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F","772":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","513":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","4":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","4":"TC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"D 9C AD","2":"5C 6C 7C","132":"4B I 8C OC"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"257":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"SVG (basic support)",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F","772":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","513":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","4":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","4":"UC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"D AD BD","2":"6C 7C 8C","132":"4B I 9C OC"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"257":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"SVG (basic support)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sxg.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sxg.js index 66f82555bdd467..3558384bfe49ec 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sxg.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/sxg.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB","132":"sB tB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:6,C:"Signed HTTP Exchanges (SXG)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB","132":"sB tB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:6,C:"Signed HTTP Exchanges (SXG)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tabindex-attr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tabindex-attr.js index 7fd7ae7038805d..5599c186659156 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tabindex-attr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tabindex-attr.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"E F G A B","16":"J PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"16":"QC 4B RC SC","129":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"16":"7 I TC BC","257":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","16":"G"},G:{"769":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"16":"4C"},I:{"16":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"16":"E A"},K:{"1":"r","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"16":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"129":"OD PD"}},B:1,C:"tabindex global attribute",D:true}; +module.exports={A:{A:{"1":"E F G A B","16":"J PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"16":"QC 4B SC TC","129":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"16":"7 I UC BC","257":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","16":"G"},G:{"769":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"16":"5C"},I:{"16":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"16":"E A"},K:{"1":"s","16":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"16":"A B"},O:{"1":"1B"},P:{"16":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"129":"PD QD"}},B:1,C:"tabindex global attribute",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template-literals.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template-literals.js index 0030212778a698..a0812f0d5c02d9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template-literals.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template-literals.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","16":"C"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB RC SC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"A B K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC","129":"C"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB dC eC fC gC zB NC hC 0B"},G:{"1":"nC oC pC qC rC sC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC","129":"tC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"ES6 Template Literals (Template Strings)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","16":"C"},C:{"1":"0 1 2 3 4 5 6 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB SC TC"},D:{"1":"0 1 2 3 4 5 6 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},E:{"1":"A B K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC","129":"C"},F:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB eC fC gC hC zB NC iC 0B"},G:{"1":"oC pC qC rC sC tC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC","129":"uC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"ES6 Template Literals (Template Strings)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template.js index f4457e1d67d53b..a6f0ccd0039e24 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/template.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C","388":"K L"},C:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o RC SC"},D:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB","132":"BB CB DB EB FB GB HB IB JB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E TC BC UC","388":"F WC","514":"VC"},F:{"1":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","132":"8 H M N O n o"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC","388":"F mC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"HTML templates",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C","388":"K L"},C:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p SC TC"},D:{"1":"0 1 2 3 4 5 6 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB","132":"BB CB DB EB FB GB HB IB JB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E UC BC VC","388":"F XC","514":"WC"},F:{"1":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","132":"8 H M N O o p"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC","388":"F nC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"HTML templates",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/temporal.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/temporal.js index 64cdd8e8e9ff34..26def8b7fa6738 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/temporal.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/temporal.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"Temporal",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"Temporal",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/testfeat.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/testfeat.js index a7fb292c2690e4..df071de6509574 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/testfeat.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/testfeat.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F A B PC","16":"G"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 8 9 QC 4B J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","16":"7 I"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"B C"},E:{"2":"I J TC BC UC","16":"7 E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC NC hC 0B","16":"zB"},G:{"2":"BC iC OC jC kC","16":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 8C OC 9C AD","16":"7C"},J:{"2":"A","16":"E"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Test feature - updated",D:false}; +module.exports={A:{A:{"2":"J E F A B PC","16":"G"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 8 9 QC 4B J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","16":"7 I"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"B C"},E:{"2":"I J UC BC VC","16":"7 E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC NC iC 0B","16":"zB"},G:{"2":"BC jC OC kC lC","16":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 9C OC AD BD","16":"8C"},J:{"2":"A","16":"E"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Test feature - updated",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-decoration.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-decoration.js index 00db24ba61884e..dbc024c0fbd7cb 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-decoration.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-decoration.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","2052":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 QC 4B I RC SC","1028":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","1060":"8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB","226":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","2052":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E TC BC UC VC","772":"K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","804":"F G A B C XC CC zB","1316":"WC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB dC eC fC gC zB NC hC 0B","226":"KB LB MB NB OB PB QB RB SB","2052":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"BC iC OC jC kC lC","292":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","2052":"r"},L:{"2052":"D"},M:{"1028":"D"},N:{"2":"A B"},O:{"2052":"1B"},P:{"2":"I BD CD","2052":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2052":"DC"},R:{"2052":"ND"},S:{"1028":"OD PD"}},B:4,C:"text-decoration styling",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","2052":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 QC 4B I SC TC","1028":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","1060":"8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB","226":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB","2052":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E UC BC VC WC","772":"K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","804":"F G A B C YC CC zB","1316":"XC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB eC fC gC hC zB NC iC 0B","226":"KB LB MB NB OB PB QB RB SB","2052":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"BC jC OC kC lC mC","292":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","2052":"s"},L:{"2052":"D"},M:{"1028":"D"},N:{"2":"A B"},O:{"2052":"1B"},P:{"2":"I CD DD","2052":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2052":"DC"},R:{"2052":"OD"},S:{"1028":"PD QD"}},B:4,C:"text-decoration styling",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-emphasis.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-emphasis.js index 933139bdb1a6ee..3c3b438da0463b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-emphasis.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-emphasis.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 i j k l m s t u v w x y z D","2":"C K L H M N O","164":"P Q R S T U V W X Y Z a b c d e f g h"},C:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB RC SC","322":"UB"},D:{"1":"0 1 2 3 4 5 6 i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q","164":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC","164":"E VC"},F:{"1":"V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","164":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC","164":"9C AD"},J:{"2":"E","164":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q LD MD","164":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B"},Q:{"164":"DC"},R:{"164":"ND"},S:{"1":"OD PD"}},B:4,C:"text-emphasis styling",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 i j k l m n t u v w x y z D","2":"C K L H M N O","164":"P Q R S T U V W X Y Z a b c d e f g h"},C:{"1":"0 1 2 3 4 5 6 VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB SC TC","322":"UB"},D:{"1":"0 1 2 3 4 5 6 i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r","164":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC","164":"E WC"},F:{"1":"V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","164":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC","164":"AD BD"},J:{"2":"E","164":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r MD ND","164":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B"},Q:{"164":"DC"},R:{"164":"OD"},S:{"1":"PD QD"}},B:4,C:"text-emphasis styling",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-overflow.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-overflow.js index 0bc107c6590bd1..322187b5d5fb6a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-overflow.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-overflow.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B","2":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","8":"7 QC 4B I J RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","33":"G dC eC fC gC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"r 0B","33":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"CSS3 Text-overflow",D:true}; +module.exports={A:{A:{"1":"J E F G A B","2":"PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","8":"7 QC 4B I J SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","33":"G eC fC gC hC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"s 0B","33":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"CSS3 Text-overflow",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-size-adjust.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-size-adjust.js index 505c7baec8ce15..ec6bfff4f15938 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-size-adjust.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-size-adjust.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","33":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","258":"BB"},E:{"2":"7 I J E F G A B C K L H TC BC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","258":"UC"},F:{"1":"SB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB TB dC eC fC gC zB NC hC 0B"},G:{"2":"BC iC OC","33":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"33":"D"},N:{"161":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS text-size-adjust",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","33":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","258":"BB"},E:{"2":"7 I J E F G A B C K L H UC BC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","258":"VC"},F:{"1":"SB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB TB eC fC gC hC zB NC iC 0B"},G:{"2":"BC jC OC","33":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"33":"D"},N:{"161":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS text-size-adjust",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-stroke.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-stroke.js index 277245764d14dc..98d73bdaeb3408 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-stroke.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/text-stroke.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","161":"H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB RC SC","161":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","450":"XB"},D:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"33":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"33":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","36":"BC"},H:{"2":"4C"},I:{"2":"4B","33":"I D 5C 6C 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"2":"A B C zB NC 0B","33":"r"},L:{"33":"D"},M:{"161":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"33":"DC"},R:{"33":"ND"},S:{"161":"OD PD"}},B:7,C:"CSS text-stroke and text-fill",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L","33":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","161":"H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB SC TC","161":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","450":"XB"},D:{"33":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"33":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"33":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","36":"BC"},H:{"2":"5C"},I:{"2":"4B","33":"I D 6C 7C 8C 9C OC AD BD"},J:{"33":"E A"},K:{"2":"A B C zB NC 0B","33":"s"},L:{"33":"D"},M:{"161":"D"},N:{"2":"A B"},O:{"33":"1B"},P:{"33":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"33":"DC"},R:{"33":"OD"},S:{"161":"PD QD"}},B:7,C:"CSS text-stroke and text-fill",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textcontent.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textcontent.js index 0e618613e81de6..a74c6690670e0b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textcontent.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textcontent.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","16":"G"},G:{"1":"F iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Node.textContent",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","16":"G"},G:{"1":"F jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Node.textContent",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textencoder.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textencoder.js index 7b4acee43e462c..12968326d3f340 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textencoder.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/textencoder.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N O RC SC","132":"8"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"TextEncoder & TextDecoder",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N O SC TC","132":"8"},D:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"TextEncoder & TextDecoder",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-1.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-1.js index 6116afaabdc7d5..fbb21d8b8e6702 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-1.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-1.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E PC","66":"F G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB","2":"7 8 QC 4B I J E F G A B C K L H M N O n o p RC SC","66":"q","129":"pB qB rB sB tB r uB vB wB xB","388":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T","2":"7 8 I J E F G A B C K L H M N O n o","1540":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K WC XC CC zB 0B","2":"7 I J TC BC UC VC","513":"L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB 0B","2":"G B C dC eC fC gC zB NC hC","1540":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"1":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"1":"A","2":"E"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"129":"D"},N:{"1":"B","66":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"TLS 1.1",D:true}; +module.exports={A:{A:{"1":"B","2":"J E PC","66":"F G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB","2":"7 8 QC 4B I J E F G A B C K L H M N O o p q SC TC","66":"r","129":"pB qB rB sB tB s uB vB wB xB","388":"0 1 2 3 4 5 6 yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T","2":"7 8 I J E F G A B C K L H M N O o p","1540":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K XC YC CC zB 0B","2":"7 I J UC BC VC WC","513":"L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB 0B","2":"G B C eC fC gC hC zB NC iC","1540":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"1":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"1":"A","2":"E"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"129":"D"},N:{"1":"B","66":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"TLS 1.1",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-2.js index a36c849614d95b..940b4304d13717 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-2.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E PC","66":"F G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 QC 4B I J E F G A B C K L H M N O n o p q RC SC","66":"9 AB BB"},D:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC"},F:{"1":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G H dC","66":"B C eC fC gC zB NC hC 0B"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"1":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"1":"A","2":"E"},K:{"1":"r 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","66":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"TLS 1.2",D:true}; +module.exports={A:{A:{"1":"B","2":"J E PC","66":"F G A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 QC 4B I J E F G A B C K L H M N O o p q r SC TC","66":"9 AB BB"},D:{"1":"0 1 2 3 4 5 6 EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC"},F:{"1":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G H eC","66":"B C fC gC hC zB NC iC 0B"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"1":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"1":"A","2":"E"},K:{"1":"s 0B","2":"A B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","66":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"TLS 1.2",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-3.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-3.js index e9cefb7f1163fd..055d3ee812ae6b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-3.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/tls1-3.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB RC SC","132":"iB 6B jB","450":"aB bB cB dB eB fB gB hB 5B"},D:{"1":"0 1 2 3 4 5 6 rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","706":"dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB","1028":"K 0B DC"},F:{"1":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B","706":"dB eB fB"},G:{"1":"uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:6,C:"TLS 1.3",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB SC TC","132":"iB 6B jB","450":"aB bB cB dB eB fB gB hB 5B"},D:{"1":"0 1 2 3 4 5 6 rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","706":"dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB"},E:{"1":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB","1028":"K 0B DC"},F:{"1":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B","706":"dB eB fB"},G:{"1":"vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:6,C:"TLS 1.3",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/touch.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/touch.js index c7147169b5696b..66e2d38debd039 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/touch.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/touch.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","578":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 O n o p q bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","4":"7 I J E F G A B C K L H M N","194":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},D:{"1":"0 1 2 3 4 5 6 9 p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A","260":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:2,C:"Touch events",D:true}; +module.exports={A:{A:{"2":"J E F G PC","8":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","578":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 O o p q r bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","4":"7 I J E F G A B C K L H M N","194":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB"},D:{"1":"0 1 2 3 4 5 6 9 q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A","260":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:2,C:"Touch events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms2d.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms2d.js index 942402fa27f027..591a72f1b3737e 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms2d.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms2d.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F","129":"A B","161":"G"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","33":"7 I J E F G A B C K L H RC SC"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","33":"7 I J E F TC BC UC VC WC"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G dC eC","33":"8 B C H M N O n o p fC gC zB NC hC"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","33":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 2D Transforms",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F","129":"A B","161":"G"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","33":"7 I J E F G A B C K L H SC TC"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","33":"7 I J E F UC BC VC WC XC"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G eC fC","33":"8 B C H M N O o p q gC hC zB NC iC"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","33":"4B I 6C 7C 8C 9C OC AD BD"},J:{"33":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 2D Transforms",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms3d.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms3d.js index 0bc735f7509d23..403a50e4febc73 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms3d.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/transforms3d.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G RC SC","33":"A B C K L H"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B","33":"8 9 C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC","33":"7 I J E F UC VC WC","257":"G A B C K L H XC CC zB 0B DC YC ZC EC"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 H M N O n o p"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","33":"F BC iC OC jC kC lC mC","257":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"5C 6C 7C","33":"4B I 8C OC 9C AD"},J:{"33":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:5,C:"CSS3 3D Transforms",D:true}; +module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G SC TC","33":"A B C K L H"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B","33":"8 9 C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC","33":"7 I J E F VC WC XC","257":"G A B C K L H YC CC zB 0B DC ZC aC EC"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 H M N O o p q"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","33":"F BC jC OC kC lC mC nC","257":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"6C 7C 8C","33":"4B I 9C OC AD BD"},J:{"33":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:5,C:"CSS3 3D Transforms",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/trusted-types.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/trusted-types.js index 0ebd9d9a03425e..f795cbfa3a7f34 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/trusted-types.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/trusted-types.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Trusted Types for DOM manipulation",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Trusted Types for DOM manipulation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ttf.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ttf.js index 124a8c99430e79..337f7feb7faa61 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ttf.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ttf.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m eC fC gC zB NC hC 0B","2":"G dC"},G:{"1":"F OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC"},H:{"2":"4C"},I:{"1":"4B I D 6C 7C 8C OC 9C AD","2":"5C"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"TTF/OTF - TrueType and OpenType font support",D:true}; +module.exports={A:{A:{"2":"J E F PC","132":"G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n fC gC hC zB NC iC 0B","2":"G eC"},G:{"1":"F OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC"},H:{"2":"5C"},I:{"1":"4B I D 7C 8C 9C OC AD BD","2":"6C"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"TTF/OTF - TrueType and OpenType font support",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/typedarrays.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/typedarrays.js index 537d5fb51dcaea..d6f5f2a0235057 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/typedarrays.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/typedarrays.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"B","2":"J E F G PC","132":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC","260":"UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC","260":"OC"},H:{"1":"4C"},I:{"1":"I D 8C OC 9C AD","2":"4B 5C 6C 7C"},J:{"1":"A","2":"E"},K:{"1":"C r 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Typed Arrays",D:true}; +module.exports={A:{A:{"1":"B","2":"J E F G PC","132":"A"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC","260":"VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC","260":"OC"},H:{"1":"5C"},I:{"1":"I D 9C OC AD BD","2":"4B 6C 7C 8C"},J:{"1":"A","2":"E"},K:{"1":"C s 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Typed Arrays",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/u2f.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/u2f.js index c14c91a16567b3..cb3e5065bed24a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/u2f.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/u2f.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O u v w x y z D","513":"P Q R S T U V W X Y Z a b c d e f g h i j k l m s t"},C:{"1":"oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","2":"2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB D 8B 9B AC RC SC","322":"0 1 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB u v w x y z D 8B 9B AC","130":"NB OB PB","513":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g","578":"h i j k l m s t"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB 0B"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB QB dC eC fC gC zB NC hC 0B","513":"PB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"1":"PD","322":"OD"}},B:7,C:"FIDO U2F API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O u v w x y z D","513":"P Q R S T U V W X Y Z a b c d e f g h i j k l m n t"},C:{"1":"oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","2":"2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB D 8B 9B AC RC SC TC","322":"0 1 WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB u v w x y z D 8B 9B AC","130":"NB OB PB","513":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g","578":"h i j k l m n t"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB 0B"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB QB eC fC gC hC zB NC iC 0B","513":"PB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"1":"QD","322":"PD"}},B:7,C:"FIDO U2F API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/unhandledrejection.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/unhandledrejection.js index c0c58b9af59c00..7edde838c93508 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/unhandledrejection.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/unhandledrejection.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB RC SC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC","16":"rC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:1,C:"unhandledrejection/rejectionhandled events",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB SC TC"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B"},G:{"1":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC","16":"sC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:1,C:"unhandledrejection/rejectionhandled events",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js index d91328d4c302b0..f64a23996a3049 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RC SC"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Upgrade Insecure Requests",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB SC TC"},D:{"1":"0 1 2 3 4 5 6 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Upgrade Insecure Requests",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js index 8f37a8d1a53c48..184a97e6a11dae 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","66":"P Q R"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r","66":"uB vB wB xB yB P Q"},E:{"1":"GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B"},F:{"1":"pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB dC eC fC gC zB NC hC 0B","66":"nB oB"},G:{"1":"GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q ID JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"URL Scroll-To-Text Fragment",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","66":"P Q R"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s","66":"uB vB wB xB yB P Q"},E:{"1":"GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B"},F:{"1":"pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB eC fC gC hC zB NC iC 0B","66":"nB oB"},G:{"1":"GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r JD KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"URL Scroll-To-Text Fragment",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url.js index ea1f4c9773b3b2..e1268b6afbca5d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/url.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB RC SC"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O n o p","130":"9 q AB BB CB DB EB FB GB"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC VC","130":"E"},F:{"1":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","130":"H M N O"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC","130":"lC"},H:{"2":"4C"},I:{"1":"D AD","2":"4B I 5C 6C 7C 8C OC","130":"9C"},J:{"2":"E","130":"A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"URL API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB SC TC"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O o p q","130":"9 r AB BB CB DB EB FB GB"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC WC","130":"E"},F:{"1":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","130":"H M N O"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC","130":"mC"},H:{"2":"5C"},I:{"1":"D BD","2":"4B I 6C 7C 8C 9C OC","130":"AD"},J:{"2":"E","130":"A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"URL API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/urlsearchparams.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/urlsearchparams.js index 56f335eef0e170..055884f85d3181 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/urlsearchparams.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/urlsearchparams.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC","132":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"URLSearchParams",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC","132":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},D:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"B C K L H CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"URLSearchParams",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/use-strict.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/use-strict.js index e30aacb20521af..76d05f2b8991bc 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/use-strict.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/use-strict.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","132":"7 UC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"1":"4C"},I:{"1":"4B I D 8C OC 9C AD","2":"5C 6C 7C"},J:{"1":"E A"},K:{"1":"C r NC 0B","2":"A B zB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"ECMAScript 5 Strict Mode",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","132":"7 VC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"1":"5C"},I:{"1":"4B I D 9C OC AD BD","2":"6C 7C 8C"},J:{"1":"E A"},K:{"1":"C s NC 0B","2":"A B zB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"ECMAScript 5 Strict Mode",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-select-none.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-select-none.js index 6463a297853a6d..bd1e59e3577237 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-select-none.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-select-none.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","33":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","33":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB RC SC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"cC","33":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","33":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},G:{"33":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","33":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"33":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"33":"A B"},O:{"1":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","33":"I BD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","33":"OD"}},B:5,C:"CSS user-select: none",D:true}; +module.exports={A:{A:{"2":"J E F G PC","33":"A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","33":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","33":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB SC TC"},D:{"1":"0 1 2 3 4 5 6 dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","33":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"dC","33":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC"},F:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","33":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB"},G:{"33":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","33":"4B I 6C 7C 8C 9C OC AD BD"},J:{"33":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"33":"A B"},O:{"1":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","33":"I CD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","33":"PD"}},B:5,C:"CSS user-select: none",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-timing.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-timing.js index 31ada559dc6f64..c53a535a6b9ee6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-timing.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/user-timing.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB RC SC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"User Timing API",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB SC TC"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"User Timing API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/variable-fonts.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/variable-fonts.js index 668b5fa863e88b..4983ba87f8a186 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/variable-fonts.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/variable-fonts.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB RC SC","4609":"jB kB lB mB nB oB pB qB rB","4674":"6B","5698":"iB","7490":"cB dB eB fB gB","7746":"hB 5B","8705":"0 1 2 3 4 5 6 sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","4097":"nB","4290":"5B iB 6B","6148":"jB kB lB mB"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","4609":"B C zB 0B","8193":"K L DC YC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB dC eC fC gC zB NC hC 0B","4097":"cB","6148":"YB ZB aB bB"},G:{"1":"vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC","4097":"rC sC tC uC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"4097":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I BD CD DD","4097":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:5,C:"Variable fonts",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB SC TC","4609":"jB kB lB mB nB oB pB qB rB","4674":"6B","5698":"iB","7490":"cB dB eB fB gB","7746":"hB 5B","8705":"0 1 2 3 4 5 6 sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB","4097":"nB","4290":"5B iB 6B","6148":"jB kB lB mB"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","4609":"B C zB 0B","8193":"K L DC ZC"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB eC fC gC hC zB NC iC 0B","4097":"cB","6148":"YB ZB aB bB"},G:{"1":"wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC","4097":"sC tC uC vC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"4097":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"2":"I CD DD ED","4097":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:5,C:"Variable fonts",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vector-effect.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vector-effect.js index d24350261b4d01..c15fdf8b905854 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vector-effect.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vector-effect.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","2":"G B dC eC fC gC zB NC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"1":"4C"},I:{"1":"D 9C AD","16":"4B I 5C 6C 7C 8C OC"},J:{"16":"E A"},K:{"1":"C r 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"SVG vector-effect: non-scaling-stroke",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J E F G A B C K L"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","2":"G B eC fC gC hC zB NC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"1":"5C"},I:{"1":"D AD BD","16":"4B I 6C 7C 8C 9C OC"},J:{"16":"E A"},K:{"1":"C s 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"SVG vector-effect: non-scaling-stroke",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vibration.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vibration.js index 10965fff07fac8..64183e19296960 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vibration.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/vibration.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A RC SC","33":"B C K L H"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C H M dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"Vibration API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A SC TC","33":"B C K L H"},D:{"1":"0 1 2 3 4 5 6 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C H M eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"Vibration API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/video.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/video.js index 3d6ac53fda513e..acfea940406024 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/video.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/video.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","260":"7 8 I J E F G A B C K L H M N O RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A UC VC WC XC CC","2":"TC BC","513":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC","513":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","132":"5C 6C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Video element",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","260":"7 8 I J E F G A B C K L H M N O SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A VC WC XC YC CC","2":"UC BC","513":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC","513":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","132":"6C 7C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Video element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/videotracks.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/videotracks.js index ebf247d454cccf..51b2ecb80f0184 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/videotracks.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/videotracks.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC","194":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB","322":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J TC BC UC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB dC eC fC gC zB NC hC 0B","322":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","322":"r"},L:{"322":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"322":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"322":"DC"},R:{"322":"ND"},S:{"194":"OD PD"}},B:1,C:"Video Tracks",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"C K L H M N O","322":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC","194":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB","322":"0 1 2 3 4 5 6 UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J UC BC VC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB eC fC gC hC zB NC iC 0B","322":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","322":"s"},L:{"322":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"322":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"322":"DC"},R:{"322":"OD"},S:{"194":"PD QD"}},B:1,C:"Video Tracks",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/view-transitions.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/view-transitions.js index a2b59f83e8e36f..246dda16a46524 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/view-transitions.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/view-transitions.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"q","2":"I n o p BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"View Transitions API (single-document)",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"r","2":"I o p q CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"View Transitions API (single-document)",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-unit-variants.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-unit-variants.js index 8e2ed04e1246fb..1f8a2f9b03cb56 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-unit-variants.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-unit-variants.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s","194":"t u v"},C:{"1":"0 1 2 3 4 5 6 k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j RC SC"},D:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i","194":"j k l m s t u v"},E:{"1":"FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC"},F:{"1":"d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z dC eC fC gC zB NC hC 0B","194":"a b c"},G:{"1":"FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q","2":"I n BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:5,C:"Small, Large, and Dynamic viewport units",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n","194":"t u v"},C:{"1":"0 1 2 3 4 5 6 k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j SC TC"},D:{"1":"0 1 2 3 4 5 6 w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i","194":"j k l m n t u v"},E:{"1":"FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC"},F:{"1":"d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z eC fC gC hC zB NC iC 0B","194":"a b c"},G:{"1":"FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"p q r","2":"I o CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:5,C:"Small, Large, and Dynamic viewport units",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-units.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-units.js index 407a7a8641523a..01b26d3a9cb8e7 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-units.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/viewport-units.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","132":"G","260":"A B"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","260":"C K L H"},C:{"1":"0 1 2 3 4 5 6 8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L H M N O RC SC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O","260":"9 n o p q AB"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC","260":"J"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC","516":"lC","772":"kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"Viewport units: vw, vh, vmin, vmax",D:true}; +module.exports={A:{A:{"2":"J E F PC","132":"G","260":"A B"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","260":"C K L H"},C:{"1":"0 1 2 3 4 5 6 8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L H M N O SC TC"},D:{"1":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 I J E F G A B C K L H M N O","260":"9 o p q r AB"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC","260":"J"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC","516":"mC","772":"lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"Viewport units: vw, vh, vmin, vmax",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wai-aria.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wai-aria.js index f0e43a138c2b2b..0b35d1b83b59e9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wai-aria.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wai-aria.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E PC","4":"F G A B"},B:{"4":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"4":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"4":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"TC BC","4":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G","4":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"4":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"4":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC","4":"D 9C AD"},J:{"2":"E A"},K:{"4":"A B C r zB NC 0B"},L:{"4":"D"},M:{"4":"D"},N:{"4":"A B"},O:{"4":"1B"},P:{"4":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"4":"DC"},R:{"4":"ND"},S:{"4":"OD PD"}},B:2,C:"WAI-ARIA Accessibility features",D:true}; +module.exports={A:{A:{"2":"J E PC","4":"F G A B"},B:{"4":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"4":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"4":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"UC BC","4":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G","4":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"4":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"4":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC","4":"D AD BD"},J:{"2":"E A"},K:{"4":"A B C s zB NC 0B"},L:{"4":"D"},M:{"4":"D"},N:{"4":"A B"},O:{"4":"1B"},P:{"4":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"4":"DC"},R:{"4":"OD"},S:{"4":"PD QD"}},B:2,C:"WAI-ARIA Accessibility features",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wake-lock.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wake-lock.js index 899855f9c3ccad..9f6db618a96b37 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wake-lock.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wake-lock.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","194":"P Q R S T U V W X Y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB","194":"sB tB r uB vB wB xB yB P Q R S T"},E:{"1":"JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC"},F:{"1":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB dC eC fC gC zB NC hC 0B","194":"hB iB jB kB lB mB nB oB pB qB rB sB tB"},G:{"1":"JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q JD KD 2B 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:4,C:"Screen Wake Lock API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","194":"P Q R S T U V W X Y"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB","194":"sB tB s uB vB wB xB yB P Q R S T"},E:{"1":"JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC"},F:{"1":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB eC fC gC hC zB NC iC 0B","194":"hB iB jB kB lB mB nB oB pB qB rB sB tB"},G:{"1":"JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r KD LD 2B 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:4,C:"Screen Wake Lock API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wasm.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wasm.js index 24ec7ba590741f..c27aaf23e67028 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wasm.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wasm.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L","578":"H"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB RC SC","194":"WB XB YB ZB aB","1025":"bB"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","322":"aB bB cB dB eB fB"},E:{"1":"B C K L H zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB dC eC fC gC zB NC hC 0B","322":"NB OB PB QB RB SB"},G:{"1":"rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","194":"OD"}},B:6,C:"WebAssembly",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L","578":"H"},C:{"1":"0 1 2 3 4 5 6 cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB SC TC","194":"WB XB YB ZB aB","1025":"bB"},D:{"1":"0 1 2 3 4 5 6 gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB","322":"aB bB cB dB eB fB"},E:{"1":"B C K L H zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC"},F:{"1":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB eC fC gC hC zB NC iC 0B","322":"NB OB PB QB RB SB"},G:{"1":"sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","194":"PD"}},B:6,C:"WebAssembly",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wav.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wav.js index e2eb44195f2e09..42616a9cbeafac 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wav.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wav.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m fC gC zB NC hC 0B","2":"G dC eC"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","16":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"Wav audio format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n gC hC zB NC iC 0B","2":"G eC fC"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","16":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"Wav audio format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wbr-element.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wbr-element.js index 87bc34b62f7127..a662547dce13ed 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wbr-element.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wbr-element.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E PC","2":"F G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"TC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","16":"G"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC"},H:{"1":"4C"},I:{"1":"4B I D 7C 8C OC 9C AD","16":"5C 6C"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"wbr (word break opportunity) element",D:true}; +module.exports={A:{A:{"1":"J E PC","2":"F G A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"UC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","16":"G"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC"},H:{"1":"5C"},I:{"1":"4B I D 8C 9C OC AD BD","16":"6C 7C"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"wbr (word break opportunity) element",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-animation.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-animation.js index c3f9e4ce63fdf9..77cde6fac09cff 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-animation.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-animation.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","260":"P Q R S"},C:{"1":"0 1 2 3 4 5 6 R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB RC SC","260":"5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB","516":"WB XB YB ZB aB bB cB dB eB fB gB hB","580":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB","2049":"vB wB xB yB P Q"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB","132":"LB MB NB","260":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC CC","1090":"B C K zB 0B","2049":"L DC YC"},F:{"1":"sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p dC eC fC gC zB NC hC 0B","132":"9 q AB","260":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC","1090":"rC sC tC uC vC wC xC","2049":"yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"260":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"260":"DC"},R:{"1":"ND"},S:{"1":"PD","516":"OD"}},B:5,C:"Web Animations API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","260":"P Q R S"},C:{"1":"0 1 2 3 4 5 6 R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB SC TC","260":"5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB","516":"WB XB YB ZB aB bB cB dB eB fB gB hB","580":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB","2049":"vB wB xB yB P Q"},D:{"1":"0 1 2 3 4 5 6 T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB","132":"LB MB NB","260":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC CC","1090":"B C K zB 0B","2049":"L DC ZC"},F:{"1":"sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q eC fC gC hC zB NC iC 0B","132":"9 r AB","260":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC","1090":"sC tC uC vC wC xC yC","2049":"zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"260":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"260":"DC"},R:{"1":"OD"},S:{"1":"QD","516":"PD"}},B:5,C:"Web Animations API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-app-manifest.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-app-manifest.js index db5d170a78029e..577d9496621b49 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-app-manifest.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-app-manifest.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M","130":"N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","578":"wB xB yB P Q R 7B S T U"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC","4":"3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC","4":"JC KC 3C 3B LC MC","260":"sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"Add to home screen (A2HS)",D:false}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M","130":"N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","578":"wB xB yB P Q R 7B S T U"},D:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC","4":"3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC","4":"JC KC 4C 3B LC MC","260":"tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"Add to home screen (A2HS)",D:false}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-bluetooth.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-bluetooth.js index 031da2cf2cca7a..d157d20cddcbb4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-bluetooth.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-bluetooth.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","1025":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB","194":"UB VB WB XB YB ZB aB bB","706":"cB dB eB","1025":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB dC eC fC gC zB NC hC 0B","450":"LB MB NB OB","706":"PB QB RB","1025":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C AD","1025":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","1025":"r"},L:{"1025":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1025":"1B"},P:{"1":"n o p q CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD"},Q:{"2":"DC"},R:{"1025":"ND"},S:{"2":"OD PD"}},B:7,C:"Web Bluetooth",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","1025":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB","194":"UB VB WB XB YB ZB aB bB","706":"cB dB eB","1025":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB eC fC gC hC zB NC iC 0B","450":"LB MB NB OB","706":"PB QB RB","1025":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD BD","1025":"D"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","1025":"s"},L:{"1025":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1025":"1B"},P:{"1":"o p q r DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD"},Q:{"2":"DC"},R:{"1025":"OD"},S:{"2":"PD QD"}},B:7,C:"Web Bluetooth",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-serial.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-serial.js index 1f3880a68e5ece..aa3ba4f0aa1177 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-serial.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-serial.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","66":"P Q R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB","66":"yB P Q R S T U V W X"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB dC eC fC gC zB NC hC 0B","66":"mB nB oB pB qB rB sB tB r uB vB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"Web Serial API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","66":"P Q R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB","66":"yB P Q R S T U V W X"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB eC fC gC hC zB NC iC 0B","66":"mB nB oB pB qB rB sB tB s uB vB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"Web Serial API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-share.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-share.js index ad10ebdd1c6db4..1848a1abf15f7a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-share.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/web-share.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q","516":"R S T U V W X Y Z a b c d"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"7 I J E F G A B C K L H M N AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X","130":"8 9 O n o p q","1028":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"L H YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB","2049":"K 0B DC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC","2049":"uC vC wC xC yC"},H:{"2":"4C"},I:{"2":"4B I 5C 6C 7C 8C OC 9C","258":"D AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I","258":"BD CD DD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:4,C:"Web Share API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q","516":"R S T U V W X Y Z a b c d"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"7 I J E F G A B C K L H M N AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X","130":"8 9 O o p q r","1028":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"L H ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB","2049":"K 0B DC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC","2049":"vC wC xC yC zC"},H:{"2":"5C"},I:{"2":"4B I 6C 7C 8C 9C OC AD","258":"D BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I","258":"CD DD ED"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:4,C:"Web Share API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webauthn.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webauthn.js index bff06b14b2606d..127d869dd0eafa 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webauthn.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webauthn.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C","226":"K L H M N"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B RC SC","4100":"2 3 4 5 6 D 8B 9B AC","5124":"0 1 iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},E:{"1":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C TC BC UC VC WC XC CC zB","322":"0B"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dC eC fC gC zB NC hC 0B"},G:{"1":"0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC","578":"wC","2052":"zC","3076":"xC yC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1028":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2":"OD"}},B:2,C:"Web Authentication API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C","226":"K L H M N"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B SC TC","4100":"2 3 4 5 6 D 8B 9B AC RC","5124":"0 1 iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z"},D:{"1":"0 1 2 3 4 5 6 oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB"},E:{"1":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C UC BC VC WC XC YC CC zB","322":"0B"},F:{"1":"dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB eC fC gC hC zB NC iC 0B"},G:{"1":"1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC","578":"xC","2052":"0C","3076":"yC zC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1028":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2":"PD"}},B:2,C:"Web Authentication API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webcodecs.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webcodecs.js index de61033378ed1a..611bfea949ff0d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webcodecs.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webcodecs.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC","132":"JC KC bC 3B LC MC cC"},F:{"1":"Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC","132":"JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q 3B LD MD","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"WebCodecs API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC","132":"JC KC cC 3B LC MC dC"},F:{"1":"Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC","132":"JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r 3B MD ND","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"WebCodecs API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl.js index b070fe1a1f8a65..55a5fb147c771a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"PC","8":"J E F G A","129":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","129":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","129":"7 8 I J E F G A B C K L H M N O n o p q"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E","129":"8 9 F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB"},E:{"1":"F G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC","129":"J E UC VC WC"},F:{"1":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B dC eC fC gC zB NC hC","129":"C H M N O 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC lC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"1":"A","2":"E"},K:{"1":"C r 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A","129":"B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","129":"OD"}},B:6,C:"WebGL - 3D Canvas graphics",D:true}; +module.exports={A:{A:{"2":"PC","8":"J E F G A","129":"B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","129":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","129":"7 8 I J E F G A B C K L H M N O o p q r"},D:{"1":"0 1 2 3 4 5 6 IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E","129":"8 9 F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB"},E:{"1":"F G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC","129":"J E VC WC XC"},F:{"1":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B eC fC gC hC zB NC iC","129":"C H M N O 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC mC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"1":"A","2":"E"},K:{"1":"C s 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A","129":"B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","129":"PD"}},B:6,C:"WebGL - 3D Canvas graphics",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl2.js index f52187bebe6e29..b9dce560287c69 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgl2.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q RC SC","194":"RB SB TB","450":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","2242":"UB VB WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","578":"SB TB UB VB WB XB YB ZB aB bB cB dB eB"},E:{"1":"H ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A TC BC UC VC WC XC","1090":"B C K L CC zB 0B DC YC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB dC eC fC gC zB NC hC 0B"},G:{"1":"1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC","1090":"tC uC vC wC xC yC zC 0C"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q DD ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","2242":"OD"}},B:6,C:"WebGL 2.0",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r SC TC","194":"RB SB TB","450":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","2242":"UB VB WB XB YB ZB"},D:{"1":"0 1 2 3 4 5 6 fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","578":"SB TB UB VB WB XB YB ZB aB bB cB dB eB"},E:{"1":"H aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A UC BC VC WC XC YC","1090":"B C K L CC zB 0B DC ZC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB eC fC gC hC zB NC iC 0B"},G:{"1":"2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC","1090":"uC vC wC xC yC zC 0C 1C"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r ED FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","2242":"PD"}},B:6,C:"WebGL 2.0",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgpu.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgpu.js index 1ba1d38a312aea..b574055e01e020 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgpu.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webgpu.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"1 2 3 4 5 6 D","2":"C K L H M N O P","578":"Q R S T U V W X Y Z a b c","1602":"0 d e f g h i j k l m s t u v w x y z"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB RC SC","194":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P","578":"Q R S T U V W X Y Z a b c","1602":"0 d e f g h i j k l m s t u v w x y z","2049":"1 2 3 4 5 6 D 8B 9B AC"},E:{"2":"7 I J E F G A B H TC BC UC VC WC XC CC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","322":"C K L zB 0B DC YC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB dC eC fC gC zB NC hC 0B","578":"r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h","2049":"i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"194":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD","194":"PD"}},B:5,C:"WebGPU",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"1 2 3 4 5 6 D","2":"C K L H M N O P","578":"Q R S T U V W X Y Z a b c","1602":"0 d e f g h i j k l m n t u v w x y z"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB SC TC","194":"0 1 2 3 4 5 6 kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P","578":"Q R S T U V W X Y Z a b c","1602":"0 d e f g h i j k l m n t u v w x y z","2049":"1 2 3 4 5 6 D 8B 9B AC"},E:{"2":"7 I J E F G A B H UC BC VC WC XC YC CC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","322":"C K L zB 0B DC ZC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB eC fC gC hC zB NC iC 0B","578":"s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h","2049":"i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"194":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD","194":"QD"}},B:5,C:"WebGPU",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webhid.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webhid.js index 88c4f135b3c1b3..457995af90f8f1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webhid.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webhid.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O","66":"P Q R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB","66":"yB P Q R S T U V W X"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB dC eC fC gC zB NC hC 0B","66":"nB oB pB qB rB sB tB r uB vB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"WebHID API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O","66":"P Q R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB","66":"yB P Q R S T U V W X"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB eC fC gC hC zB NC iC 0B","66":"nB oB pB qB rB sB tB s uB vB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"WebHID API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webkit-user-drag.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webkit-user-drag.js index b41fb381c819ca..ad4c20765a67ca 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webkit-user-drag.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webkit-user-drag.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"16":"7 I J E F G A B C K L H","132":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"G B C dC eC fC gC zB NC hC 0B","132":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"CSS -webkit-user-drag property",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"16":"7 I J E F G A B C K L H","132":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"G B C eC fC gC hC zB NC iC 0B","132":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"CSS -webkit-user-drag property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webm.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webm.js index 43d54e912c532a..b01b80444ac8b6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webm.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webm.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F PC","520":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","8":"C K","388":"L H M N O"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I","132":"8 9 J E F G A B C K L H M N O n o p q"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"TC","8":"7 I BC UC","520":"J E F G A B C VC WC XC CC zB","1028":"K 0B DC","7172":"L","8196":"H YC ZC EC FC 1B aC"},F:{"1":"8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G dC eC fC","132":"B C H gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC","1028":"uC vC wC xC yC","3076":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"5C 6C","132":"4B I 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD","132":"I"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:6,C:"WebM video format",D:true}; +module.exports={A:{A:{"2":"J E F PC","520":"G A B"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","8":"C K","388":"L H M N O"},C:{"1":"0 1 2 3 4 5 6 DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB"},D:{"1":"0 1 2 3 4 5 6 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I","132":"8 9 J E F G A B C K L H M N O o p q r"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"UC","8":"7 I BC VC","520":"J E F G A B C WC XC YC CC zB","1028":"K 0B DC","7172":"L","8196":"H ZC aC EC FC 1B bC"},F:{"1":"8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G eC fC gC","132":"B C H hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC","1028":"vC wC xC yC zC","3076":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"6C 7C","132":"4B I 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A B"},O:{"1":"1B"},P:{"1":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND","132":"I"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:6,C:"WebM video format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webnfc.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webnfc.js index eb6651a538ab8d..edac030a203fa8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webnfc.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webnfc.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Y Z a b c d e f g h i j k l m s t u v w x y z D","450":"Q R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","450":"Q R S T U V W X"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","450":"oB pB qB rB sB tB r uB vB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"257":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"Web NFC",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L H M N O P Y Z a b c d e f g h i j k l m n t u v w x y z D","450":"Q R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","450":"Q R S T U V W X"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","450":"oB pB qB rB sB tB s uB vB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"257":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"Web NFC",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webp.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webp.js index ccf754dec12c63..99f57e5e934212 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webp.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webp.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","8":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I","8":"J E F","132":"8 G A B C K L H M N O n o p","260":"9 q AB BB CB DB EB FB GB"},E:{"1":"2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G A B C K TC BC UC VC WC XC CC zB 0B DC","516":"L H YC ZC EC FC 1B aC"},F:{"1":"8 9 n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G dC eC fC","8":"B gC","132":"zB NC hC","260":"C H M N O 0B"},G:{"1":"zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC"},H:{"1":"4C"},I:{"1":"D OC 9C AD","2":"4B 5C 6C 7C","132":"I 8C"},J:{"2":"E A"},K:{"1":"C r zB NC 0B","2":"A","132":"B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","8":"OD"}},B:6,C:"WebP image format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","8":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB"},D:{"1":"0 1 2 3 4 5 6 HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I","8":"J E F","132":"8 G A B C K L H M N O o p q","260":"9 r AB BB CB DB EB FB GB"},E:{"1":"2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G A B C K UC BC VC WC XC YC CC zB 0B DC","516":"L H ZC aC EC FC 1B bC"},F:{"1":"8 9 o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G eC fC gC","8":"B hC","132":"zB NC iC","260":"C H M N O 0B"},G:{"1":"0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC"},H:{"1":"5C"},I:{"1":"D OC AD BD","2":"4B 6C 7C 8C","132":"I 9C"},J:{"2":"E A"},K:{"1":"C s zB NC 0B","2":"A","132":"B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","8":"PD"}},B:6,C:"WebP image format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/websockets.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/websockets.js index e63b3f9e803b71..19e5661bdcabb6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/websockets.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/websockets.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B RC SC","132":"7 I","292":"J E F G A"},D:{"1":"0 1 2 3 4 5 6 8 9 M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 I J E F G A B C K L","260":"H"},E:{"1":"E F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","132":"7 UC","260":"J VC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G dC eC fC gC","132":"B C zB NC hC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC","132":"OC jC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","129":"E"},K:{"1":"r 0B","2":"A","132":"B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Web Sockets",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B SC TC","132":"7 I","292":"J E F G A"},D:{"1":"0 1 2 3 4 5 6 8 9 M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 I J E F G A B C K L","260":"H"},E:{"1":"E F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","132":"7 VC","260":"J WC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G eC fC gC hC","132":"B C zB NC iC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC","132":"OC kC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","129":"E"},K:{"1":"s 0B","2":"A","132":"B C zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Web Sockets",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webtransport.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webtransport.js index e9ed8cff25631f..f6fa4c845e4bc9 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webtransport.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webtransport.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 h i j k l m s t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g"},C:{"1":"2 3 4 5 6 D 8B 9B AC","2":"0 1 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z RC SC"},D:{"1":"0 1 2 3 4 5 6 g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z e f","66":"a b c d"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q LD MD","2":"I BD CD DD ED FD CC GD HD ID JD KD 2B 3B"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:5,C:"WebTransport",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 h i j k l m n t u v w x y z D","2":"C K L H M N O P Q R S T U V W X Y Z a b c d e f g"},C:{"1":"2 3 4 5 6 D 8B 9B AC RC","2":"0 1 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z SC TC"},D:{"1":"0 1 2 3 4 5 6 g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z e f","66":"a b c d"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r MD ND","2":"I CD DD ED FD GD CC HD ID JD KD LD 2B 3B"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:5,C:"WebTransport",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webusb.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webusb.js index 95bc1255c001e2..3a0b75bfb2b48b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webusb.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webusb.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","66":"dB eB fB gB hB 5B iB"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB dC eC fC gC zB NC hC 0B","66":"QB RB SB TB UB VB WB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"n o p q ED FD CC GD HD ID JD KD 2B 3B LD MD","2":"I BD CD DD"},Q:{"2":"DC"},R:{"1":"ND"},S:{"2":"OD PD"}},B:7,C:"WebUSB",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB","66":"dB eB fB gB hB 5B iB"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB eC fC gC hC zB NC iC 0B","66":"QB RB SB TB UB VB WB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"o p q r FD GD CC HD ID JD KD LD 2B 3B MD ND","2":"I CD DD ED"},Q:{"2":"DC"},R:{"1":"OD"},S:{"2":"PD QD"}},B:7,C:"WebUSB",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvr.js index 9c74edd15b45c6..84be87fcf48ab6 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvr.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","66":"P","257":"H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB RC SC","129":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","194":"dB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","66":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","66":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"513":"I","516":"n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:7,C:"WebVR API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 6 C K L Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","66":"P","257":"H M N O"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB SC TC","129":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","194":"dB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","66":"gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","66":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"513":"I","516":"o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:7,C:"WebVR API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvtt.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvtt.js index 222820ee50a487..023ba5efb4e00f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvtt.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webvtt.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O n o p q RC SC","66":"9 AB BB CB DB EB FB","129":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","257":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"1":"0 1 2 3 4 5 6 8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N"},E:{"1":"J E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC jC kC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","2":"E"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"129":"OD PD"}},B:4,C:"WebVTT - Web Video Text Tracks",D:true}; +module.exports={A:{A:{"1":"A B","2":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 QC 4B I J E F G A B C K L H M N O o p q r SC TC","66":"9 AB BB CB DB EB FB","129":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","257":"0 1 2 3 4 5 6 eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"1":"0 1 2 3 4 5 6 8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 I J E F G A B C K L H M N"},E:{"1":"J E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC kC lC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","2":"E"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"129":"PD QD"}},B:4,C:"WebVTT - Web Video Text Tracks",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webworkers.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webworkers.js index 31a12432eedf72..9c54587d5e442d 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webworkers.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webworkers.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","2":"PC","8":"J E F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","8":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m gC zB NC hC 0B","2":"G dC","8":"eC fC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"D 5C 9C AD","2":"4B I 6C 7C 8C OC"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","8":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Web Workers",D:true}; +module.exports={A:{A:{"1":"A B","2":"PC","8":"J E F G"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","8":"QC 4B"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","8":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n hC zB NC iC 0B","2":"G eC","8":"fC gC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"D 6C AD BD","2":"4B I 7C 8C 9C OC"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","8":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Web Workers",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webxr.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webxr.js index d2c7c70b276f5f..da3e1ebb8f53b1 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webxr.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/webxr.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB RC SC","322":"0 1 2 3 4 5 6 xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB","66":"mB nB oB pB qB rB sB tB r uB vB wB xB yB","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C TC BC UC VC WC XC CC zB 0B","578":"K L H DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB dC eC fC gC zB NC hC 0B","66":"bB cB dB eB fB gB hB iB jB kB lB mB","132":"nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"r"},L:{"132":"D"},M:{"322":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I BD CD DD ED FD CC GD","132":"n o p q HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD","322":"PD"}},B:4,C:"WebXR Device API",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"C K L H M N O","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB SC TC","322":"0 1 2 3 4 5 6 xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC"},D:{"2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB","66":"mB nB oB pB qB rB sB tB s uB vB wB xB yB","132":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"2":"7 I J E F G A B C UC BC VC WC XC YC CC zB 0B","578":"K L H DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB eC fC gC hC zB NC iC 0B","66":"bB cB dB eB fB gB hB iB jB kB lB mB","132":"nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C zB NC 0B","132":"s"},L:{"132":"D"},M:{"322":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I CD DD ED FD GD CC HD","132":"o p q r ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD","322":"QD"}},B:4,C:"WebXR Device API",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/will-change.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/will-change.js index 7911ddca63889e..d1e8ea5d17e3fe 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/will-change.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/will-change.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB RC SC","194":"EB FB GB HB IB JB KB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p q dC eC fC gC zB NC hC 0B"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS will-change property",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K L H M N O"},C:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB SC TC","194":"EB FB GB HB IB JB KB"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q r eC fC gC hC zB NC iC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS will-change property",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff.js index e961c954d2ee60..88bf815251777f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC SC","2":"QC 4B RC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I TC BC"},F:{"1":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m zB NC hC 0B","2":"G B dC eC fC gC"},G:{"1":"F jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC"},H:{"2":"4C"},I:{"1":"D 9C AD","2":"4B 5C 6C 7C 8C OC","130":"I"},J:{"1":"E A"},K:{"1":"B C r zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"WOFF - Web Open Font Format",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC TC","2":"QC 4B SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"I"},E:{"1":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I UC BC"},F:{"1":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n zB NC iC 0B","2":"G B eC fC gC hC"},G:{"1":"F kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC"},H:{"2":"5C"},I:{"1":"D AD BD","2":"4B 6C 7C 8C 9C OC","130":"I"},J:{"1":"E A"},K:{"1":"B C s zB NC 0B","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"WOFF - Web Open Font Format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff2.js index 98a56aea0d5206..981074d3affc24 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/woff2.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB RC SC"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"C K L H 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"7 I J E F G TC BC UC VC WC XC","132":"A B CC zB"},F:{"1":"9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"8 G B C H M N O n o p dC eC fC gC zB NC hC 0B"},G:{"1":"pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"F BC iC OC jC kC lC mC nC oC"},H:{"2":"4C"},I:{"1":"D","2":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:2,C:"WOFF 2.0 - Web Open Font Format",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","2":"C K"},C:{"1":"0 1 2 3 4 5 6 OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB SC TC"},D:{"1":"0 1 2 3 4 5 6 LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","2":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"C K L H 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"7 I J E F G UC BC VC WC XC YC","132":"A B CC zB"},F:{"1":"9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"8 G B C H M N O o p q eC fC gC hC zB NC iC 0B"},G:{"1":"qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"F BC jC OC kC lC mC nC oC pC"},H:{"2":"5C"},I:{"1":"D","2":"4B I 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:2,C:"WOFF 2.0 - Web Open Font Format",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/word-break.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/word-break.js index 437c2e2b1ca59c..c0ade2930d9f3f 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/word-break.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/word-break.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"7 QC 4B I J E F G A B C K L RC SC"},D:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},E:{"1":"G A B C K L H XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","4":"7 I J E F TC BC UC VC WC"},F:{"1":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","2":"G B C dC eC fC gC zB NC hC 0B","4":"8 9 H M N O n o p q AB BB CB DB EB FB"},G:{"1":"nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","4":"F BC iC OC jC kC lC mC"},H:{"2":"4C"},I:{"1":"D","4":"4B I 5C 6C 7C 8C OC 9C AD"},J:{"4":"E A"},K:{"1":"r","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"CSS3 word-break",D:true}; +module.exports={A:{A:{"1":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"7 QC 4B I J E F G A B C K L SC TC"},D:{"1":"0 1 2 3 4 5 6 TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB"},E:{"1":"G A B C K L H YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","4":"7 I J E F UC BC VC WC XC"},F:{"1":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","2":"G B C eC fC gC hC zB NC iC 0B","4":"8 9 H M N O o p q r AB BB CB DB EB FB"},G:{"1":"oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","4":"F BC jC OC kC lC mC nC"},H:{"2":"5C"},I:{"1":"D","4":"4B I 6C 7C 8C 9C OC AD BD"},J:{"4":"E A"},K:{"1":"s","2":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"CSS3 word-break",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wordwrap.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wordwrap.js index df4fb212575def..74730b75228571 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wordwrap.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/wordwrap.js @@ -1 +1 @@ -module.exports={A:{A:{"4":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D","4":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","4":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB RC SC"},D:{"1":"0 1 2 3 4 5 6 9 q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","4":"7 8 I J E F G A B C K L H M N O n o p"},E:{"1":"E F G A B C K L H VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","4":"7 I J TC BC UC"},F:{"1":"8 9 H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G dC eC","4":"B C fC gC zB NC hC"},G:{"1":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","4":"BC iC OC jC kC"},H:{"4":"4C"},I:{"1":"D 9C AD","4":"4B I 5C 6C 7C 8C OC"},J:{"1":"A","4":"E"},K:{"1":"r","4":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"PD","4":"OD"}},B:4,C:"CSS3 Overflow-wrap",D:true}; +module.exports={A:{A:{"4":"J E F G A B PC"},B:{"1":"0 1 2 3 4 5 6 O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D","4":"C K L H M N"},C:{"1":"0 1 2 3 4 5 6 YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","4":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB SC TC"},D:{"1":"0 1 2 3 4 5 6 9 r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","4":"7 8 I J E F G A B C K L H M N O o p q"},E:{"1":"E F G A B C K L H WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","4":"7 I J UC BC VC"},F:{"1":"8 9 H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G eC fC","4":"B C gC hC zB NC iC"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","4":"BC jC OC kC lC"},H:{"4":"5C"},I:{"1":"D AD BD","4":"4B I 6C 7C 8C 9C OC"},J:{"1":"A","4":"E"},K:{"1":"s","4":"A B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"QD","4":"PD"}},B:4,C:"CSS3 Overflow-wrap",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-doc-messaging.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-doc-messaging.js index 8a571ede2ce0f1..aed7275884df3c 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-doc-messaging.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-doc-messaging.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E PC","132":"F G","260":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"TC BC"},F:{"1":"8 9 B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B","2":"G"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"Cross-document messaging",D:true}; +module.exports={A:{A:{"2":"J E PC","132":"F G","260":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC","2":"QC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"UC BC"},F:{"1":"8 9 B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B","2":"G"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"4":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"Cross-document messaging",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-frame-options.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-frame-options.js index db5a0e78a20789..5c6192869bfbf8 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-frame-options.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/x-frame-options.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"1":"C K L H M N O","4":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB","4":"0 1 2 3 4 5 6 7 I J E F G A B C K L H M N rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"QC 4B RC SC"},D:{"4":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 8 9 I J E F G A B C K L H M N O n o p q AB"},E:{"4":"J E F G A B C K L H UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","16":"7 I TC BC"},F:{"4":"8 9 C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m hC 0B","16":"G B dC eC fC gC zB NC"},G:{"4":"F lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","16":"BC iC OC jC kC"},H:{"2":"4C"},I:{"4":"I D 8C OC 9C AD","16":"4B 5C 6C 7C"},J:{"4":"E A"},K:{"4":"r 0B","16":"A B C zB NC"},L:{"4":"D"},M:{"4":"D"},N:{"1":"A B"},O:{"4":"1B"},P:{"4":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"4":"DC"},R:{"4":"ND"},S:{"1":"OD","4":"PD"}},B:6,C:"X-Frame-Options HTTP header",D:true}; +module.exports={A:{A:{"1":"F G A B","2":"J E PC"},B:{"1":"C K L H M N O","4":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB","4":"0 1 2 3 4 5 6 7 I J E F G A B C K L H M N rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","16":"QC 4B SC TC"},D:{"4":"0 1 2 3 4 5 6 BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 8 9 I J E F G A B C K L H M N O o p q r AB"},E:{"4":"J E F G A B C K L H VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","16":"7 I UC BC"},F:{"4":"8 9 C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n iC 0B","16":"G B eC fC gC hC zB NC"},G:{"4":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","16":"BC jC OC kC lC"},H:{"2":"5C"},I:{"4":"I D 9C OC AD BD","16":"4B 6C 7C 8C"},J:{"4":"E A"},K:{"4":"s 0B","16":"A B C zB NC"},L:{"4":"D"},M:{"4":"D"},N:{"1":"A B"},O:{"4":"1B"},P:{"4":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"4":"DC"},R:{"4":"OD"},S:{"1":"PD","4":"QD"}},B:6,C:"X-Frame-Options HTTP header",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhr2.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhr2.js index 37b97b88e7cb67..496c92e3d9b816 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhr2.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhr2.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","2":"QC 4B","260":"A B","388":"J E F G","900":"7 I RC SC"},D:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","16":"7 I J","132":"EB FB","388":"8 9 E F G A B C K L H M N O n o p q AB BB CB DB"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","2":"I TC BC","132":"E VC","388":"7 J UC"},F:{"1":"8 9 C O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m 0B","2":"G B dC eC fC gC zB NC hC","132":"H M N"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","2":"BC iC OC","132":"lC","388":"jC kC"},H:{"2":"4C"},I:{"1":"D AD","2":"5C 6C 7C","388":"9C","900":"4B I 8C OC"},J:{"132":"A","388":"E"},K:{"1":"C r 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"XMLHttpRequest advanced features",D:true}; +module.exports={A:{A:{"2":"J E F G PC","132":"A B"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","2":"QC 4B","260":"A B","388":"J E F G","900":"7 I SC TC"},D:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","16":"7 I J","132":"EB FB","388":"8 9 E F G A B C K L H M N O o p q r AB BB CB DB"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","2":"I UC BC","132":"E WC","388":"7 J VC"},F:{"1":"8 9 C O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n 0B","2":"G B eC fC gC hC zB NC iC","132":"H M N"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","2":"BC jC OC","132":"mC","388":"kC lC"},H:{"2":"5C"},I:{"1":"D BD","2":"6C 7C 8C","388":"AD","900":"4B I 9C OC"},J:{"132":"A","388":"E"},K:{"1":"C s 0B","2":"A B zB NC"},L:{"1":"D"},M:{"1":"D"},N:{"132":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"XMLHttpRequest advanced features",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtml.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtml.js index 484a4a57e6a8ac..14afcd48971137 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtml.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtml.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"1":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"1":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"1":"4C"},I:{"1":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"1":"E A"},K:{"1":"A B C r zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:1,C:"XHTML served as application/xhtml+xml",D:true}; +module.exports={A:{A:{"1":"G A B","2":"J E F PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"1":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"1":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"1":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"1":"5C"},I:{"1":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"1":"E A"},K:{"1":"A B C s zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:1,C:"XHTML served as application/xhtml+xml",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtmlsmil.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtmlsmil.js index 339db9f810992a..f86129536531c4 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtmlsmil.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xhtmlsmil.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"G A B PC","4":"J E F"},B:{"2":"C K L H M N O","8":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"8":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"8":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC"},E:{"8":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"8":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"8":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"8":"4C"},I:{"8":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"8":"E A"},K:{"8":"A B C r zB NC 0B"},L:{"8":"D"},M:{"8":"D"},N:{"2":"A B"},O:{"8":"1B"},P:{"8":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"8":"DC"},R:{"8":"ND"},S:{"8":"OD PD"}},B:7,C:"XHTML+SMIL animation",D:true}; +module.exports={A:{A:{"2":"G A B PC","4":"J E F"},B:{"2":"C K L H M N O","8":"0 1 2 3 4 5 6 P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"8":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"8":"0 1 2 3 4 5 6 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC"},E:{"8":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"8":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"8":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"8":"5C"},I:{"8":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"8":"E A"},K:{"8":"A B C s zB NC 0B"},L:{"8":"D"},M:{"8":"D"},N:{"2":"A B"},O:{"8":"1B"},P:{"8":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"8":"DC"},R:{"8":"OD"},S:{"8":"PD QD"}},B:7,C:"XHTML+SMIL animation",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xml-serializer.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xml-serializer.js index 844088a19f2b4d..92c7b6fb828d1a 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xml-serializer.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/xml-serializer.js @@ -1 +1 @@ -module.exports={A:{A:{"1":"A B","260":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"B","260":"7 QC 4B I J E RC SC","516":"F G A"},D:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB"},E:{"1":"F G A B C K L H WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC","132":"7 I J E TC BC UC VC"},F:{"1":"8 9 O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m","16":"G dC","132":"B C H M N eC fC gC zB NC hC 0B"},G:{"1":"F mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC","132":"BC iC OC jC kC lC"},H:{"132":"4C"},I:{"1":"D 9C AD","132":"4B I 5C 6C 7C 8C OC"},J:{"132":"E A"},K:{"1":"r","16":"A","132":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"1":"DC"},R:{"1":"ND"},S:{"1":"OD PD"}},B:4,C:"DOM Parsing and Serialization",D:true}; +module.exports={A:{A:{"1":"A B","260":"J E F G PC"},B:{"1":"0 1 2 3 4 5 6 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D"},C:{"1":"0 1 2 3 4 5 6 8 9 C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC","132":"B","260":"7 QC 4B I J E SC TC","516":"F G A"},D:{"1":"0 1 2 3 4 5 6 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC","132":"7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB"},E:{"1":"F G A B C K L H XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC","132":"7 I J E UC BC VC WC"},F:{"1":"8 9 O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n","16":"G eC","132":"B C H M N fC gC hC zB NC iC 0B"},G:{"1":"F nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC","132":"BC jC OC kC lC mC"},H:{"132":"5C"},I:{"1":"D AD BD","132":"4B I 6C 7C 8C 9C OC"},J:{"132":"E A"},K:{"1":"s","16":"A","132":"B C zB NC 0B"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"1B"},P:{"1":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"1":"DC"},R:{"1":"OD"},S:{"1":"PD QD"}},B:4,C:"DOM Parsing and Serialization",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/zstd.js b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/zstd.js index 920a5ca2a90f3f..e9ad2a66b8c62b 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/zstd.js +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/data/features/zstd.js @@ -1 +1 @@ -module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","194":"6 D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z D 8B 9B AC RC SC"},D:{"2":"0 1 2 3 4 5 7 8 9 I J E F G A B C K L H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m s t u v w x y z","194":"6 D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H TC BC UC VC WC XC CC zB 0B DC YC ZC EC FC 1B aC 2B GC HC IC JC KC bC 3B LC MC cC"},F:{"2":"8 9 G B C H M N O n o p q AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB r uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m dC eC fC gC zB NC hC 0B"},G:{"2":"F BC iC OC jC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C EC FC 1B 2C 2B GC HC IC JC KC 3C 3B LC MC"},H:{"2":"4C"},I:{"2":"4B I D 5C 6C 7C 8C OC 9C AD"},J:{"2":"E A"},K:{"2":"A B C r zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I n o p q BD CD DD ED FD CC GD HD ID JD KD 2B 3B LD MD"},Q:{"2":"DC"},R:{"2":"ND"},S:{"2":"OD PD"}},B:6,C:"zstd (Zstandard) content-encoding",D:true}; +module.exports={A:{A:{"2":"J E F G A B PC"},B:{"2":"0 1 2 3 4 5 C K L H M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","194":"6 D"},C:{"2":"0 1 2 3 4 5 6 7 8 9 QC 4B I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z D 8B 9B AC RC SC TC"},D:{"2":"0 1 2 3 4 5 7 8 9 I J E F G A B C K L H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB 5B iB 6B jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R S T U V W X Y Z a b c d e f g h i j k l m n t u v w x y z","194":"6 D 8B 9B AC"},E:{"2":"7 I J E F G A B C K L H UC BC VC WC XC YC CC zB 0B DC ZC aC EC FC 1B bC 2B GC HC IC JC KC cC 3B LC MC dC"},F:{"2":"8 9 G B C H M N O o p q r AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB s uB vB wB xB yB P Q R 7B S T U V W X Y Z a b c d e f g h i j k l m n eC fC gC hC zB NC iC 0B"},G:{"2":"F BC jC OC kC lC mC nC oC pC qC rC sC tC uC vC wC xC yC zC 0C 1C 2C EC FC 1B 3C 2B GC HC IC JC KC 4C 3B LC MC"},H:{"2":"5C"},I:{"2":"4B I D 6C 7C 8C 9C OC AD BD"},J:{"2":"E A"},K:{"2":"A B C s zB NC 0B"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"1B"},P:{"2":"I o p q r CD DD ED FD GD CC HD ID JD KD LD 2B 3B MD ND"},Q:{"2":"DC"},R:{"2":"OD"},S:{"2":"PD QD"}},B:6,C:"zstd (Zstandard) content-encoding",D:true}; diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/package.json b/tools/node_modules/eslint/node_modules/caniuse-lite/package.json index e14288fe0ac52b..c7d08b6197b210 100644 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/package.json +++ b/tools/node_modules/eslint/node_modules/caniuse-lite/package.json @@ -1,6 +1,6 @@ { "name": "caniuse-lite", - "version": "1.0.30001563", + "version": "1.0.30001565", "description": "A smaller version of caniuse-db, with only the essentials!", "main": "dist/unpacker/index.js", "files": [ diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js index 835a1a4d57abf1..61dead4237d0b8 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js @@ -2634,7 +2634,9 @@ module.exports = { "25.9.2", "25.9.3", "25.9.4", - "25.9.5" + "25.9.5", + "25.9.6", + "25.9.7" ], "116.0.5791.0": [ "26.0.0-alpha.1", @@ -2739,7 +2741,9 @@ module.exports = { "26.4.2", "26.4.3", "26.5.0", - "26.6.0" + "26.6.0", + "26.6.1", + "26.6.2" ], "118.0.5949.0": [ "27.0.0-alpha.1", @@ -2840,7 +2844,11 @@ module.exports = { "27.0.4" ], "118.0.5993.144": [ - "27.1.0" + "27.1.0", + "27.1.2" + ], + "118.0.5993.159": [ + "27.1.3" ], "119.0.6045.0": [ "28.0.0-alpha.1", @@ -2879,7 +2887,13 @@ module.exports = { "120.0.6099.18": [ "28.0.0-beta.5", "28.0.0-beta.6", - "28.0.0-beta.7" + "28.0.0-beta.7", + "28.0.0-beta.8", + "28.0.0-beta.9", + "28.0.0-beta.10" + ], + "120.0.6099.35": [ + "28.0.0-beta.11" ], "118.0.5991.0": [ "28.0.0-nightly.20230906" @@ -2941,6 +2955,18 @@ module.exports = { "121.0.6116.0": [ "29.0.0-nightly.20231115", "29.0.0-nightly.20231116", - "29.0.0-nightly.20231117" + "29.0.0-nightly.20231117", + "29.0.0-nightly.20231120", + "29.0.0-nightly.20231121", + "29.0.0-nightly.20231122", + "29.0.0-nightly.20231123", + "29.0.0-nightly.20231124", + "29.0.0-nightly.20231127", + "29.0.0-nightly.20231128" + ], + "121.0.6147.0": [ + "29.0.0-nightly.20231129", + "29.0.0-nightly.20231130", + "29.0.0-nightly.20231201" ] }; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json index dc0018eaef621c..18389293fc9667 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json @@ -1 +1 @@ -{"39.0.2171.65":["0.20.0","0.20.1","0.20.2","0.20.3","0.20.4","0.20.5","0.20.6","0.20.7","0.20.8"],"40.0.2214.91":["0.21.0","0.21.1","0.21.2"],"41.0.2272.76":["0.21.3","0.22.1","0.22.2","0.22.3","0.23.0","0.24.0"],"42.0.2311.107":["0.25.0","0.25.1","0.25.2","0.25.3","0.26.0","0.26.1","0.27.0","0.27.1"],"43.0.2357.65":["0.27.2","0.27.3","0.28.0","0.28.1","0.28.2","0.28.3","0.29.1","0.29.2"],"44.0.2403.125":["0.30.4","0.31.0"],"45.0.2454.85":["0.31.2","0.32.2","0.32.3","0.33.0","0.33.1","0.33.2","0.33.3","0.33.4","0.33.6","0.33.7","0.33.8","0.33.9","0.34.0","0.34.1","0.34.2","0.34.3","0.34.4","0.35.1","0.35.2","0.35.3","0.35.4","0.35.5"],"47.0.2526.73":["0.36.0","0.36.2","0.36.3","0.36.4"],"47.0.2526.110":["0.36.5","0.36.6","0.36.7","0.36.8","0.36.9","0.36.10","0.36.11","0.36.12"],"49.0.2623.75":["0.37.0","0.37.1","0.37.3","0.37.4","0.37.5","0.37.6","0.37.7","0.37.8","1.0.0","1.0.1","1.0.2"],"50.0.2661.102":["1.1.0","1.1.1","1.1.2","1.1.3"],"51.0.2704.63":["1.2.0","1.2.1"],"51.0.2704.84":["1.2.2","1.2.3"],"51.0.2704.103":["1.2.4","1.2.5"],"51.0.2704.106":["1.2.6","1.2.7","1.2.8"],"52.0.2743.82":["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.9","1.3.10","1.3.13","1.3.14","1.3.15"],"53.0.2785.113":["1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5"],"53.0.2785.143":["1.4.6","1.4.7","1.4.8","1.4.10","1.4.11","1.4.13","1.4.14","1.4.15","1.4.16"],"54.0.2840.51":["1.4.12"],"54.0.2840.101":["1.5.0","1.5.1"],"56.0.2924.87":["1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","1.6.10","1.6.11","1.6.12","1.6.13","1.6.14","1.6.15","1.6.16","1.6.17","1.6.18"],"58.0.3029.110":["1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16"],"59.0.3071.115":["1.8.0","1.8.1","1.8.2-beta.1","1.8.2-beta.2","1.8.2-beta.3","1.8.2-beta.4","1.8.2-beta.5","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8"],"61.0.3163.100":["2.0.0-beta.1","2.0.0-beta.2","2.0.0-beta.3","2.0.0-beta.4","2.0.0-beta.5","2.0.0-beta.6","2.0.0-beta.7","2.0.0-beta.8","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8-nightly.20180819","2.0.8-nightly.20180820","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.1.0-unsupported.20180809"],"66.0.3359.181":["3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0-beta.6","3.0.0-beta.7","3.0.0-beta.8","3.0.0-beta.9","3.0.0-beta.10","3.0.0-beta.11","3.0.0-beta.12","3.0.0-beta.13","3.0.0-nightly.20180818","3.0.0-nightly.20180821","3.0.0-nightly.20180823","3.0.0-nightly.20180904","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.1.0-beta.1","3.1.0-beta.2","3.1.0-beta.3","3.1.0-beta.4","3.1.0-beta.5","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13","4.0.0-nightly.20180817","4.0.0-nightly.20180819","4.0.0-nightly.20180821"],"69.0.3497.106":["4.0.0-beta.1","4.0.0-beta.2","4.0.0-beta.3","4.0.0-beta.4","4.0.0-beta.5","4.0.0-beta.6","4.0.0-beta.7","4.0.0-beta.8","4.0.0-beta.9","4.0.0-beta.10","4.0.0-beta.11","4.0.0-nightly.20181010","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"67.0.3396.99":["4.0.0-nightly.20180929"],"68.0.3440.128":["4.0.0-nightly.20181006"],"69.0.3497.128":["4.0.7","4.0.8","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.2.0","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.2.11","4.2.12"],"72.0.3626.52":["5.0.0-beta.1","5.0.0-beta.2","6.0.0-nightly.20190123"],"73.0.3683.27":["5.0.0-beta.3"],"73.0.3683.54":["5.0.0-beta.4"],"73.0.3683.61":["5.0.0-beta.5"],"73.0.3683.84":["5.0.0-beta.6"],"73.0.3683.94":["5.0.0-beta.7"],"73.0.3683.104":["5.0.0-beta.8"],"73.0.3683.117":["5.0.0-beta.9"],"70.0.3538.110":["5.0.0-nightly.20190107"],"71.0.3578.98":["5.0.0-nightly.20190121","5.0.0-nightly.20190122"],"73.0.3683.119":["5.0.0"],"73.0.3683.121":["5.0.1","5.0.2","5.0.3","5.0.4","5.0.5","5.0.6","5.0.7","5.0.8","5.0.9","5.0.10","5.0.11","5.0.12","5.0.13"],"76.0.3774.1":["6.0.0-beta.1"],"76.0.3783.1":["6.0.0-beta.2","6.0.0-beta.3","6.0.0-beta.4"],"76.0.3805.4":["6.0.0-beta.5"],"76.0.3809.3":["6.0.0-beta.6"],"76.0.3809.22":["6.0.0-beta.7"],"76.0.3809.26":["6.0.0-beta.8","6.0.0-beta.9"],"76.0.3809.37":["6.0.0-beta.10"],"76.0.3809.42":["6.0.0-beta.11"],"76.0.3809.54":["6.0.0-beta.12"],"76.0.3809.60":["6.0.0-beta.13"],"76.0.3809.68":["6.0.0-beta.14"],"76.0.3809.74":["6.0.0-beta.15"],"72.0.3626.107":["6.0.0-nightly.20190212"],"72.0.3626.110":["6.0.0-nightly.20190213"],"74.0.3724.8":["6.0.0-nightly.20190311"],"76.0.3809.88":["6.0.0"],"76.0.3809.102":["6.0.1"],"76.0.3809.110":["6.0.2"],"76.0.3809.126":["6.0.3"],"76.0.3809.131":["6.0.4"],"76.0.3809.136":["6.0.5"],"76.0.3809.138":["6.0.6"],"76.0.3809.139":["6.0.7"],"76.0.3809.146":["6.0.8","6.0.9","6.0.10","6.0.11","6.0.12","6.1.0","6.1.1","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","6.1.7","6.1.8","6.1.9","6.1.10","6.1.11","6.1.12"],"78.0.3866.0":["7.0.0-beta.1","7.0.0-beta.2","7.0.0-beta.3","7.0.0-nightly.20190727","7.0.0-nightly.20190728","7.0.0-nightly.20190729","7.0.0-nightly.20190730","7.0.0-nightly.20190731","8.0.0-nightly.20190801","8.0.0-nightly.20190802"],"78.0.3896.6":["7.0.0-beta.4"],"78.0.3905.1":["7.0.0-beta.5","7.0.0-beta.6","7.0.0-beta.7","7.0.0"],"76.0.3784.0":["7.0.0-nightly.20190521"],"76.0.3806.0":["7.0.0-nightly.20190529","7.0.0-nightly.20190530","7.0.0-nightly.20190531","7.0.0-nightly.20190602","7.0.0-nightly.20190603"],"77.0.3814.0":["7.0.0-nightly.20190604"],"77.0.3815.0":["7.0.0-nightly.20190605","7.0.0-nightly.20190606","7.0.0-nightly.20190607","7.0.0-nightly.20190608","7.0.0-nightly.20190609","7.0.0-nightly.20190611","7.0.0-nightly.20190612","7.0.0-nightly.20190613","7.0.0-nightly.20190615","7.0.0-nightly.20190616","7.0.0-nightly.20190618","7.0.0-nightly.20190619","7.0.0-nightly.20190622","7.0.0-nightly.20190623","7.0.0-nightly.20190624","7.0.0-nightly.20190627","7.0.0-nightly.20190629","7.0.0-nightly.20190630","7.0.0-nightly.20190701","7.0.0-nightly.20190702"],"77.0.3843.0":["7.0.0-nightly.20190704","7.0.0-nightly.20190705"],"77.0.3848.0":["7.0.0-nightly.20190719","7.0.0-nightly.20190720","7.0.0-nightly.20190721"],"77.0.3864.0":["7.0.0-nightly.20190726"],"78.0.3904.92":["7.0.1"],"78.0.3904.94":["7.1.0"],"78.0.3904.99":["7.1.1"],"78.0.3904.113":["7.1.2"],"78.0.3904.126":["7.1.3"],"78.0.3904.130":["7.1.4","7.1.5","7.1.6","7.1.7","7.1.8","7.1.9","7.1.10","7.1.11","7.1.12","7.1.13","7.1.14","7.2.0","7.2.1","7.2.2","7.2.3","7.2.4","7.3.0","7.3.1","7.3.2","7.3.3"],"79.0.3931.0":["8.0.0-beta.1","8.0.0-beta.2","8.0.0-nightly.20191019","8.0.0-nightly.20191020","8.0.0-nightly.20191021","8.0.0-nightly.20191023"],"80.0.3955.0":["8.0.0-beta.3","8.0.0-beta.4"],"80.0.3987.14":["8.0.0-beta.5"],"80.0.3987.51":["8.0.0-beta.6"],"80.0.3987.59":["8.0.0-beta.7"],"80.0.3987.75":["8.0.0-beta.8","8.0.0-beta.9"],"78.0.3871.0":["8.0.0-nightly.20190803","8.0.0-nightly.20190806","8.0.0-nightly.20190807","8.0.0-nightly.20190808","8.0.0-nightly.20190809","8.0.0-nightly.20190810","8.0.0-nightly.20190811","8.0.0-nightly.20190812","8.0.0-nightly.20190813","8.0.0-nightly.20190814","8.0.0-nightly.20190815"],"78.0.3881.0":["8.0.0-nightly.20190816","8.0.0-nightly.20190817","8.0.0-nightly.20190818","8.0.0-nightly.20190819","8.0.0-nightly.20190820"],"78.0.3892.0":["8.0.0-nightly.20190824","8.0.0-nightly.20190825","8.0.0-nightly.20190827","8.0.0-nightly.20190828","8.0.0-nightly.20190830","8.0.0-nightly.20190901","8.0.0-nightly.20190902","8.0.0-nightly.20190907","8.0.0-nightly.20190909","8.0.0-nightly.20190910","8.0.0-nightly.20190911","8.0.0-nightly.20190912","8.0.0-nightly.20190913","8.0.0-nightly.20190914","8.0.0-nightly.20190915","8.0.0-nightly.20190917"],"79.0.3915.0":["8.0.0-nightly.20190919","8.0.0-nightly.20190920"],"79.0.3919.0":["8.0.0-nightly.20190922","8.0.0-nightly.20190923","8.0.0-nightly.20190924","8.0.0-nightly.20190926","8.0.0-nightly.20190928","8.0.0-nightly.20190929","8.0.0-nightly.20190930","8.0.0-nightly.20191001","8.0.0-nightly.20191004","8.0.0-nightly.20191005","8.0.0-nightly.20191006","8.0.0-nightly.20191009","8.0.0-nightly.20191011","8.0.0-nightly.20191012","8.0.0-nightly.20191017"],"80.0.3952.0":["8.0.0-nightly.20191101","8.0.0-nightly.20191103","8.0.0-nightly.20191105"],"80.0.3987.86":["8.0.0","8.0.1","8.0.2"],"80.0.3987.134":["8.0.3"],"80.0.3987.137":["8.1.0"],"80.0.3987.141":["8.1.1"],"80.0.3987.158":["8.2.0"],"80.0.3987.163":["8.2.1","8.2.2","8.2.3","8.5.3","8.5.4","8.5.5"],"80.0.3987.165":["8.2.4","8.2.5","8.3.0","8.3.1","8.3.2","8.3.3","8.3.4","8.4.0","8.4.1","8.5.0","8.5.1","8.5.2"],"82.0.4048.0":["9.0.0-beta.1","9.0.0-beta.2","9.0.0-beta.3","9.0.0-beta.4","9.0.0-beta.5"],"82.0.4058.2":["9.0.0-beta.6","9.0.0-beta.7","9.0.0-beta.9"],"82.0.4085.10":["9.0.0-beta.10"],"82.0.4085.14":["9.0.0-beta.11","9.0.0-beta.12","9.0.0-beta.13"],"82.0.4085.27":["9.0.0-beta.14"],"83.0.4102.3":["9.0.0-beta.15","9.0.0-beta.16"],"83.0.4103.14":["9.0.0-beta.17"],"83.0.4103.16":["9.0.0-beta.18"],"83.0.4103.24":["9.0.0-beta.19"],"83.0.4103.26":["9.0.0-beta.20","9.0.0-beta.21"],"83.0.4103.34":["9.0.0-beta.22"],"83.0.4103.44":["9.0.0-beta.23"],"83.0.4103.45":["9.0.0-beta.24"],"80.0.3954.0":["9.0.0-nightly.20191121","9.0.0-nightly.20191122","9.0.0-nightly.20191123","9.0.0-nightly.20191124","9.0.0-nightly.20191126","9.0.0-nightly.20191128","9.0.0-nightly.20191129","9.0.0-nightly.20191130","9.0.0-nightly.20191201","9.0.0-nightly.20191202","9.0.0-nightly.20191203","9.0.0-nightly.20191204","9.0.0-nightly.20191205","9.0.0-nightly.20191210"],"81.0.3994.0":["9.0.0-nightly.20191220","9.0.0-nightly.20191221","9.0.0-nightly.20191222","9.0.0-nightly.20191223","9.0.0-nightly.20191224","9.0.0-nightly.20191225","9.0.0-nightly.20191226","9.0.0-nightly.20191228","9.0.0-nightly.20191229","9.0.0-nightly.20191230","9.0.0-nightly.20191231","9.0.0-nightly.20200101","9.0.0-nightly.20200103","9.0.0-nightly.20200104","9.0.0-nightly.20200105","9.0.0-nightly.20200106","9.0.0-nightly.20200108","9.0.0-nightly.20200109","9.0.0-nightly.20200110","9.0.0-nightly.20200111","9.0.0-nightly.20200113","9.0.0-nightly.20200115","9.0.0-nightly.20200116","9.0.0-nightly.20200117"],"81.0.4030.0":["9.0.0-nightly.20200119","9.0.0-nightly.20200121"],"83.0.4103.64":["9.0.0"],"83.0.4103.94":["9.0.1","9.0.2"],"83.0.4103.100":["9.0.3"],"83.0.4103.104":["9.0.4"],"83.0.4103.119":["9.0.5"],"83.0.4103.122":["9.1.0","9.1.1","9.1.2","9.2.0","9.2.1","9.3.0","9.3.1","9.3.2","9.3.3","9.3.4","9.3.5","9.4.0","9.4.1","9.4.2","9.4.3","9.4.4"],"84.0.4129.0":["10.0.0-beta.1","10.0.0-beta.2","10.0.0-nightly.20200501","10.0.0-nightly.20200504","10.0.0-nightly.20200505","10.0.0-nightly.20200506","10.0.0-nightly.20200507","10.0.0-nightly.20200508","10.0.0-nightly.20200511","10.0.0-nightly.20200512","10.0.0-nightly.20200513","10.0.0-nightly.20200514","10.0.0-nightly.20200515","10.0.0-nightly.20200518","10.0.0-nightly.20200519","10.0.0-nightly.20200520","10.0.0-nightly.20200521","11.0.0-nightly.20200525","11.0.0-nightly.20200526"],"85.0.4161.2":["10.0.0-beta.3","10.0.0-beta.4"],"85.0.4181.1":["10.0.0-beta.8","10.0.0-beta.9"],"85.0.4183.19":["10.0.0-beta.10"],"85.0.4183.20":["10.0.0-beta.11"],"85.0.4183.26":["10.0.0-beta.12"],"85.0.4183.39":["10.0.0-beta.13","10.0.0-beta.14","10.0.0-beta.15","10.0.0-beta.17","10.0.0-beta.19","10.0.0-beta.20","10.0.0-beta.21"],"85.0.4183.70":["10.0.0-beta.23"],"85.0.4183.78":["10.0.0-beta.24"],"85.0.4183.80":["10.0.0-beta.25"],"82.0.4050.0":["10.0.0-nightly.20200209","10.0.0-nightly.20200210","10.0.0-nightly.20200211","10.0.0-nightly.20200216","10.0.0-nightly.20200217","10.0.0-nightly.20200218","10.0.0-nightly.20200221","10.0.0-nightly.20200222","10.0.0-nightly.20200223","10.0.0-nightly.20200226","10.0.0-nightly.20200303"],"82.0.4076.0":["10.0.0-nightly.20200304","10.0.0-nightly.20200305","10.0.0-nightly.20200306","10.0.0-nightly.20200309","10.0.0-nightly.20200310"],"82.0.4083.0":["10.0.0-nightly.20200311"],"83.0.4086.0":["10.0.0-nightly.20200316"],"83.0.4087.0":["10.0.0-nightly.20200317","10.0.0-nightly.20200318","10.0.0-nightly.20200320","10.0.0-nightly.20200323","10.0.0-nightly.20200324","10.0.0-nightly.20200325","10.0.0-nightly.20200326","10.0.0-nightly.20200327","10.0.0-nightly.20200330","10.0.0-nightly.20200331","10.0.0-nightly.20200401","10.0.0-nightly.20200402","10.0.0-nightly.20200403","10.0.0-nightly.20200406"],"83.0.4095.0":["10.0.0-nightly.20200408","10.0.0-nightly.20200410","10.0.0-nightly.20200413"],"84.0.4114.0":["10.0.0-nightly.20200414"],"84.0.4115.0":["10.0.0-nightly.20200415","10.0.0-nightly.20200416","10.0.0-nightly.20200417"],"84.0.4121.0":["10.0.0-nightly.20200422","10.0.0-nightly.20200423"],"84.0.4125.0":["10.0.0-nightly.20200427","10.0.0-nightly.20200428","10.0.0-nightly.20200429","10.0.0-nightly.20200430"],"85.0.4183.84":["10.0.0"],"85.0.4183.86":["10.0.1"],"85.0.4183.87":["10.1.0"],"85.0.4183.93":["10.1.1"],"85.0.4183.98":["10.1.2"],"85.0.4183.121":["10.1.3","10.1.4","10.1.5","10.1.6","10.1.7","10.2.0","10.3.0","10.3.1","10.3.2","10.4.0","10.4.1","10.4.2","10.4.3","10.4.4","10.4.5","10.4.6","10.4.7"],"86.0.4234.0":["11.0.0-beta.1","11.0.0-beta.3","11.0.0-beta.4","11.0.0-beta.5","11.0.0-beta.6","11.0.0-beta.7","11.0.0-nightly.20200822","11.0.0-nightly.20200824","11.0.0-nightly.20200825","11.0.0-nightly.20200826","12.0.0-nightly.20200827","12.0.0-nightly.20200831","12.0.0-nightly.20200902","12.0.0-nightly.20200903","12.0.0-nightly.20200907","12.0.0-nightly.20200910","12.0.0-nightly.20200911","12.0.0-nightly.20200914"],"87.0.4251.1":["11.0.0-beta.8","11.0.0-beta.9","11.0.0-beta.11"],"87.0.4280.11":["11.0.0-beta.12","11.0.0-beta.13"],"87.0.4280.27":["11.0.0-beta.16","11.0.0-beta.17","11.0.0-beta.18","11.0.0-beta.19"],"87.0.4280.40":["11.0.0-beta.20"],"87.0.4280.47":["11.0.0-beta.22","11.0.0-beta.23"],"85.0.4156.0":["11.0.0-nightly.20200529"],"85.0.4162.0":["11.0.0-nightly.20200602","11.0.0-nightly.20200603","11.0.0-nightly.20200604","11.0.0-nightly.20200609","11.0.0-nightly.20200610","11.0.0-nightly.20200611","11.0.0-nightly.20200615","11.0.0-nightly.20200616","11.0.0-nightly.20200617","11.0.0-nightly.20200618","11.0.0-nightly.20200619"],"85.0.4179.0":["11.0.0-nightly.20200701","11.0.0-nightly.20200702","11.0.0-nightly.20200703","11.0.0-nightly.20200706","11.0.0-nightly.20200707","11.0.0-nightly.20200708","11.0.0-nightly.20200709"],"86.0.4203.0":["11.0.0-nightly.20200716","11.0.0-nightly.20200717","11.0.0-nightly.20200720","11.0.0-nightly.20200721"],"86.0.4209.0":["11.0.0-nightly.20200723","11.0.0-nightly.20200724","11.0.0-nightly.20200729","11.0.0-nightly.20200730","11.0.0-nightly.20200731","11.0.0-nightly.20200803","11.0.0-nightly.20200804","11.0.0-nightly.20200805","11.0.0-nightly.20200811","11.0.0-nightly.20200812"],"87.0.4280.60":["11.0.0","11.0.1"],"87.0.4280.67":["11.0.2","11.0.3","11.0.4"],"87.0.4280.88":["11.0.5","11.1.0","11.1.1"],"87.0.4280.141":["11.2.0","11.2.1","11.2.2","11.2.3","11.3.0","11.4.0","11.4.1","11.4.2","11.4.3","11.4.4","11.4.5","11.4.6","11.4.7","11.4.8","11.4.9","11.4.10","11.4.11","11.4.12","11.5.0"],"89.0.4328.0":["12.0.0-beta.1","12.0.0-beta.3","12.0.0-beta.4","12.0.0-beta.5","12.0.0-beta.6","12.0.0-beta.7","12.0.0-beta.8","12.0.0-beta.9","12.0.0-beta.10","12.0.0-beta.11","12.0.0-beta.12","12.0.0-beta.14","13.0.0-nightly.20201119","13.0.0-nightly.20201123","13.0.0-nightly.20201124","13.0.0-nightly.20201126","13.0.0-nightly.20201127","13.0.0-nightly.20201130","13.0.0-nightly.20201201","13.0.0-nightly.20201202","13.0.0-nightly.20201203","13.0.0-nightly.20201204","13.0.0-nightly.20201207","13.0.0-nightly.20201208","13.0.0-nightly.20201209","13.0.0-nightly.20201210","13.0.0-nightly.20201211","13.0.0-nightly.20201214"],"89.0.4348.1":["12.0.0-beta.16","12.0.0-beta.18","12.0.0-beta.19","12.0.0-beta.20"],"89.0.4388.2":["12.0.0-beta.21","12.0.0-beta.22","12.0.0-beta.23","12.0.0-beta.24","12.0.0-beta.25","12.0.0-beta.26"],"89.0.4389.23":["12.0.0-beta.27","12.0.0-beta.28","12.0.0-beta.29"],"89.0.4389.58":["12.0.0-beta.30","12.0.0-beta.31"],"87.0.4268.0":["12.0.0-nightly.20201002","12.0.0-nightly.20201007","12.0.0-nightly.20201009","12.0.0-nightly.20201012","12.0.0-nightly.20201013","12.0.0-nightly.20201014","12.0.0-nightly.20201015"],"88.0.4292.0":["12.0.0-nightly.20201023","12.0.0-nightly.20201026"],"88.0.4306.0":["12.0.0-nightly.20201030","12.0.0-nightly.20201102","12.0.0-nightly.20201103","12.0.0-nightly.20201104","12.0.0-nightly.20201105","12.0.0-nightly.20201106","12.0.0-nightly.20201111","12.0.0-nightly.20201112"],"88.0.4324.0":["12.0.0-nightly.20201116"],"89.0.4389.69":["12.0.0"],"89.0.4389.82":["12.0.1"],"89.0.4389.90":["12.0.2"],"89.0.4389.114":["12.0.3","12.0.4"],"89.0.4389.128":["12.0.5","12.0.6","12.0.7","12.0.8","12.0.9","12.0.10","12.0.11","12.0.12","12.0.13","12.0.14","12.0.15","12.0.16","12.0.17","12.0.18","12.1.0","12.1.1","12.1.2","12.2.0","12.2.1","12.2.2","12.2.3"],"90.0.4402.0":["13.0.0-beta.2","13.0.0-beta.3","13.0.0-nightly.20210210","13.0.0-nightly.20210211","13.0.0-nightly.20210212","13.0.0-nightly.20210216","13.0.0-nightly.20210217","13.0.0-nightly.20210218","13.0.0-nightly.20210219","13.0.0-nightly.20210222","13.0.0-nightly.20210225","13.0.0-nightly.20210226","13.0.0-nightly.20210301","13.0.0-nightly.20210302","13.0.0-nightly.20210303","14.0.0-nightly.20210304"],"90.0.4415.0":["13.0.0-beta.4","13.0.0-beta.5","13.0.0-beta.6","13.0.0-beta.7","13.0.0-beta.8","13.0.0-beta.9","13.0.0-beta.10","13.0.0-beta.11","13.0.0-beta.12","13.0.0-beta.13","14.0.0-nightly.20210305","14.0.0-nightly.20210308","14.0.0-nightly.20210309","14.0.0-nightly.20210311","14.0.0-nightly.20210315","14.0.0-nightly.20210316","14.0.0-nightly.20210317","14.0.0-nightly.20210318","14.0.0-nightly.20210319","14.0.0-nightly.20210323","14.0.0-nightly.20210324","14.0.0-nightly.20210325","14.0.0-nightly.20210326","14.0.0-nightly.20210329","14.0.0-nightly.20210330"],"91.0.4448.0":["13.0.0-beta.14","13.0.0-beta.16","13.0.0-beta.17","13.0.0-beta.18","13.0.0-beta.20","14.0.0-nightly.20210331","14.0.0-nightly.20210401","14.0.0-nightly.20210402","14.0.0-nightly.20210406","14.0.0-nightly.20210407","14.0.0-nightly.20210408","14.0.0-nightly.20210409","14.0.0-nightly.20210413"],"91.0.4472.33":["13.0.0-beta.21","13.0.0-beta.22","13.0.0-beta.23"],"91.0.4472.38":["13.0.0-beta.24","13.0.0-beta.25","13.0.0-beta.26","13.0.0-beta.27","13.0.0-beta.28"],"89.0.4349.0":["13.0.0-nightly.20201215","13.0.0-nightly.20201216","13.0.0-nightly.20201221","13.0.0-nightly.20201222"],"89.0.4359.0":["13.0.0-nightly.20201223","13.0.0-nightly.20210104","13.0.0-nightly.20210108","13.0.0-nightly.20210111"],"89.0.4386.0":["13.0.0-nightly.20210113","13.0.0-nightly.20210114","13.0.0-nightly.20210118","13.0.0-nightly.20210122","13.0.0-nightly.20210125"],"89.0.4389.0":["13.0.0-nightly.20210127","13.0.0-nightly.20210128","13.0.0-nightly.20210129","13.0.0-nightly.20210201","13.0.0-nightly.20210202","13.0.0-nightly.20210203","13.0.0-nightly.20210205","13.0.0-nightly.20210208","13.0.0-nightly.20210209"],"91.0.4472.69":["13.0.0","13.0.1"],"91.0.4472.77":["13.1.0","13.1.1","13.1.2"],"91.0.4472.106":["13.1.3","13.1.4"],"91.0.4472.124":["13.1.5","13.1.6","13.1.7"],"91.0.4472.164":["13.1.8","13.1.9","13.2.0","13.2.1","13.2.2","13.2.3","13.3.0","13.4.0","13.5.0","13.5.1","13.5.2","13.6.0","13.6.1","13.6.2","13.6.3","13.6.6","13.6.7","13.6.8","13.6.9"],"92.0.4511.0":["14.0.0-beta.1","14.0.0-beta.2","14.0.0-beta.3","14.0.0-nightly.20210520","14.0.0-nightly.20210523","14.0.0-nightly.20210524","15.0.0-nightly.20210527","15.0.0-nightly.20210528","15.0.0-nightly.20210531","15.0.0-nightly.20210601","15.0.0-nightly.20210602"],"93.0.4536.0":["14.0.0-beta.5","14.0.0-beta.6","14.0.0-beta.7","14.0.0-beta.8","15.0.0-nightly.20210609","15.0.0-nightly.20210610","15.0.0-nightly.20210611","15.0.0-nightly.20210614","15.0.0-nightly.20210615","15.0.0-nightly.20210616"],"93.0.4539.0":["14.0.0-beta.9","14.0.0-beta.10","15.0.0-nightly.20210617","15.0.0-nightly.20210618","15.0.0-nightly.20210621","15.0.0-nightly.20210622"],"93.0.4557.4":["14.0.0-beta.11","14.0.0-beta.12"],"93.0.4566.0":["14.0.0-beta.13","14.0.0-beta.14","14.0.0-beta.15","14.0.0-beta.16","14.0.0-beta.17","15.0.0-alpha.1","15.0.0-alpha.2","15.0.0-nightly.20210706","15.0.0-nightly.20210707","15.0.0-nightly.20210708","15.0.0-nightly.20210709","15.0.0-nightly.20210712","15.0.0-nightly.20210713","15.0.0-nightly.20210714","15.0.0-nightly.20210715","15.0.0-nightly.20210716","15.0.0-nightly.20210719","15.0.0-nightly.20210720","15.0.0-nightly.20210721","16.0.0-nightly.20210722","16.0.0-nightly.20210723","16.0.0-nightly.20210726"],"93.0.4577.15":["14.0.0-beta.18","14.0.0-beta.19","14.0.0-beta.20","14.0.0-beta.21"],"93.0.4577.25":["14.0.0-beta.22","14.0.0-beta.23"],"93.0.4577.51":["14.0.0-beta.24","14.0.0-beta.25"],"92.0.4475.0":["14.0.0-nightly.20210426","14.0.0-nightly.20210427"],"92.0.4488.0":["14.0.0-nightly.20210430","14.0.0-nightly.20210503"],"92.0.4496.0":["14.0.0-nightly.20210505"],"92.0.4498.0":["14.0.0-nightly.20210506"],"92.0.4499.0":["14.0.0-nightly.20210507","14.0.0-nightly.20210510","14.0.0-nightly.20210511","14.0.0-nightly.20210512","14.0.0-nightly.20210513"],"92.0.4505.0":["14.0.0-nightly.20210514","14.0.0-nightly.20210517","14.0.0-nightly.20210518","14.0.0-nightly.20210519"],"93.0.4577.58":["14.0.0"],"93.0.4577.63":["14.0.1"],"93.0.4577.82":["14.0.2","14.1.0","14.1.1","14.2.0","14.2.1","14.2.2","14.2.3","14.2.4","14.2.5","14.2.6","14.2.7","14.2.8","14.2.9"],"94.0.4584.0":["15.0.0-alpha.3","15.0.0-alpha.4","15.0.0-alpha.5","15.0.0-alpha.6","16.0.0-nightly.20210727","16.0.0-nightly.20210728","16.0.0-nightly.20210729","16.0.0-nightly.20210730","16.0.0-nightly.20210802","16.0.0-nightly.20210803","16.0.0-nightly.20210804","16.0.0-nightly.20210805","16.0.0-nightly.20210806","16.0.0-nightly.20210809","16.0.0-nightly.20210810","16.0.0-nightly.20210811"],"94.0.4590.2":["15.0.0-alpha.7","15.0.0-alpha.8","15.0.0-alpha.9","16.0.0-nightly.20210812","16.0.0-nightly.20210813","16.0.0-nightly.20210816","16.0.0-nightly.20210817","16.0.0-nightly.20210818","16.0.0-nightly.20210819","16.0.0-nightly.20210820","16.0.0-nightly.20210823"],"94.0.4606.12":["15.0.0-alpha.10"],"94.0.4606.20":["15.0.0-beta.1","15.0.0-beta.2"],"94.0.4606.31":["15.0.0-beta.3","15.0.0-beta.4","15.0.0-beta.5","15.0.0-beta.6","15.0.0-beta.7"],"93.0.4530.0":["15.0.0-nightly.20210603","15.0.0-nightly.20210604"],"93.0.4535.0":["15.0.0-nightly.20210608"],"93.0.4550.0":["15.0.0-nightly.20210623","15.0.0-nightly.20210624"],"93.0.4552.0":["15.0.0-nightly.20210625","15.0.0-nightly.20210628","15.0.0-nightly.20210629"],"93.0.4558.0":["15.0.0-nightly.20210630","15.0.0-nightly.20210701","15.0.0-nightly.20210702","15.0.0-nightly.20210705"],"94.0.4606.51":["15.0.0"],"94.0.4606.61":["15.1.0","15.1.1"],"94.0.4606.71":["15.1.2"],"94.0.4606.81":["15.2.0","15.3.0","15.3.1","15.3.2","15.3.3","15.3.4","15.3.5","15.3.6","15.3.7","15.4.0","15.4.1","15.4.2","15.5.0","15.5.1","15.5.2","15.5.3","15.5.4","15.5.5","15.5.6","15.5.7"],"95.0.4629.0":["16.0.0-alpha.1","16.0.0-alpha.2","16.0.0-alpha.3","16.0.0-alpha.4","16.0.0-alpha.5","16.0.0-alpha.6","16.0.0-alpha.7","16.0.0-nightly.20210902","16.0.0-nightly.20210903","16.0.0-nightly.20210906","16.0.0-nightly.20210907","16.0.0-nightly.20210908","16.0.0-nightly.20210909","16.0.0-nightly.20210910","16.0.0-nightly.20210913","16.0.0-nightly.20210914","16.0.0-nightly.20210915","16.0.0-nightly.20210916","16.0.0-nightly.20210917","16.0.0-nightly.20210920","16.0.0-nightly.20210921","16.0.0-nightly.20210922","17.0.0-nightly.20210923","17.0.0-nightly.20210924","17.0.0-nightly.20210927","17.0.0-nightly.20210928","17.0.0-nightly.20210929","17.0.0-nightly.20210930","17.0.0-nightly.20211001","17.0.0-nightly.20211004","17.0.0-nightly.20211005"],"96.0.4647.0":["16.0.0-alpha.8","16.0.0-alpha.9","16.0.0-beta.1","16.0.0-beta.2","16.0.0-beta.3","17.0.0-nightly.20211006","17.0.0-nightly.20211007","17.0.0-nightly.20211008","17.0.0-nightly.20211011","17.0.0-nightly.20211012","17.0.0-nightly.20211013","17.0.0-nightly.20211014","17.0.0-nightly.20211015","17.0.0-nightly.20211018","17.0.0-nightly.20211019","17.0.0-nightly.20211020","17.0.0-nightly.20211021"],"96.0.4664.18":["16.0.0-beta.4","16.0.0-beta.5"],"96.0.4664.27":["16.0.0-beta.6","16.0.0-beta.7"],"96.0.4664.35":["16.0.0-beta.8","16.0.0-beta.9"],"95.0.4612.5":["16.0.0-nightly.20210824","16.0.0-nightly.20210825","16.0.0-nightly.20210826","16.0.0-nightly.20210827","16.0.0-nightly.20210830","16.0.0-nightly.20210831","16.0.0-nightly.20210901"],"96.0.4664.45":["16.0.0","16.0.1"],"96.0.4664.55":["16.0.2","16.0.3","16.0.4","16.0.5"],"96.0.4664.110":["16.0.6","16.0.7","16.0.8"],"96.0.4664.174":["16.0.9","16.0.10","16.1.0","16.1.1","16.2.0","16.2.1","16.2.2","16.2.3","16.2.4","16.2.5","16.2.6","16.2.7","16.2.8"],"96.0.4664.4":["17.0.0-alpha.1","17.0.0-alpha.2","17.0.0-alpha.3","17.0.0-nightly.20211022","17.0.0-nightly.20211025","17.0.0-nightly.20211026","17.0.0-nightly.20211027","17.0.0-nightly.20211028","17.0.0-nightly.20211029","17.0.0-nightly.20211101","17.0.0-nightly.20211102","17.0.0-nightly.20211103","17.0.0-nightly.20211104","17.0.0-nightly.20211105","17.0.0-nightly.20211108","17.0.0-nightly.20211109","17.0.0-nightly.20211110","17.0.0-nightly.20211111","17.0.0-nightly.20211112","17.0.0-nightly.20211115","17.0.0-nightly.20211116","17.0.0-nightly.20211117","18.0.0-nightly.20211118","18.0.0-nightly.20211119","18.0.0-nightly.20211122","18.0.0-nightly.20211123"],"98.0.4706.0":["17.0.0-alpha.4","17.0.0-alpha.5","17.0.0-alpha.6","17.0.0-beta.1","17.0.0-beta.2","18.0.0-nightly.20211124","18.0.0-nightly.20211125","18.0.0-nightly.20211126","18.0.0-nightly.20211129","18.0.0-nightly.20211130","18.0.0-nightly.20211201","18.0.0-nightly.20211202","18.0.0-nightly.20211203","18.0.0-nightly.20211206","18.0.0-nightly.20211207","18.0.0-nightly.20211208","18.0.0-nightly.20211209","18.0.0-nightly.20211210","18.0.0-nightly.20211213","18.0.0-nightly.20211214","18.0.0-nightly.20211215","18.0.0-nightly.20211216","18.0.0-nightly.20211217","18.0.0-nightly.20211220","18.0.0-nightly.20211221","18.0.0-nightly.20211222","18.0.0-nightly.20211223","18.0.0-nightly.20211228","18.0.0-nightly.20211229","18.0.0-nightly.20211231","18.0.0-nightly.20220103","18.0.0-nightly.20220104","18.0.0-nightly.20220105","18.0.0-nightly.20220106","18.0.0-nightly.20220107","18.0.0-nightly.20220110"],"98.0.4758.9":["17.0.0-beta.3"],"98.0.4758.11":["17.0.0-beta.4","17.0.0-beta.5","17.0.0-beta.6","17.0.0-beta.7","17.0.0-beta.8","17.0.0-beta.9"],"98.0.4758.74":["17.0.0"],"98.0.4758.82":["17.0.1"],"98.0.4758.102":["17.1.0"],"98.0.4758.109":["17.1.1","17.1.2","17.2.0"],"98.0.4758.141":["17.3.0","17.3.1","17.4.0","17.4.1","17.4.2","17.4.3","17.4.4","17.4.5","17.4.6","17.4.7","17.4.8","17.4.9","17.4.10","17.4.11"],"99.0.4767.0":["18.0.0-alpha.1","18.0.0-alpha.2","18.0.0-alpha.3","18.0.0-alpha.4","18.0.0-alpha.5","18.0.0-nightly.20220111","18.0.0-nightly.20220112","18.0.0-nightly.20220113","18.0.0-nightly.20220114","18.0.0-nightly.20220117","18.0.0-nightly.20220118","18.0.0-nightly.20220119","18.0.0-nightly.20220121","18.0.0-nightly.20220124","18.0.0-nightly.20220125","18.0.0-nightly.20220127","18.0.0-nightly.20220128","18.0.0-nightly.20220131","18.0.0-nightly.20220201","19.0.0-nightly.20220202","19.0.0-nightly.20220203","19.0.0-nightly.20220204","19.0.0-nightly.20220207","19.0.0-nightly.20220208","19.0.0-nightly.20220209"],"100.0.4894.0":["18.0.0-beta.1","18.0.0-beta.2","18.0.0-beta.3","18.0.0-beta.4","18.0.0-beta.5","18.0.0-beta.6","19.0.0-nightly.20220308","19.0.0-nightly.20220309","19.0.0-nightly.20220310","19.0.0-nightly.20220311","19.0.0-nightly.20220314","19.0.0-nightly.20220315","19.0.0-nightly.20220316","19.0.0-nightly.20220317","19.0.0-nightly.20220318","19.0.0-nightly.20220321","19.0.0-nightly.20220322","19.0.0-nightly.20220323","19.0.0-nightly.20220324"],"100.0.4896.56":["18.0.0"],"100.0.4896.60":["18.0.1","18.0.2"],"100.0.4896.75":["18.0.3","18.0.4"],"100.0.4896.127":["18.1.0"],"100.0.4896.143":["18.2.0","18.2.1","18.2.2","18.2.3"],"100.0.4896.160":["18.2.4","18.3.0","18.3.1","18.3.2","18.3.3","18.3.4","18.3.5","18.3.6","18.3.7","18.3.8","18.3.9","18.3.11","18.3.12","18.3.13","18.3.14","18.3.15"],"102.0.4962.3":["19.0.0-alpha.1","19.0.0-nightly.20220328","19.0.0-nightly.20220329","20.0.0-nightly.20220330"],"102.0.4971.0":["19.0.0-alpha.2","19.0.0-alpha.3","20.0.0-nightly.20220411"],"102.0.4989.0":["19.0.0-alpha.4","19.0.0-alpha.5","20.0.0-nightly.20220414","20.0.0-nightly.20220415","20.0.0-nightly.20220418","20.0.0-nightly.20220419","20.0.0-nightly.20220420","20.0.0-nightly.20220421"],"102.0.4999.0":["19.0.0-beta.1","19.0.0-beta.2","19.0.0-beta.3","20.0.0-nightly.20220425","20.0.0-nightly.20220426","20.0.0-nightly.20220427","20.0.0-nightly.20220428","20.0.0-nightly.20220429","20.0.0-nightly.20220502","20.0.0-nightly.20220503","20.0.0-nightly.20220504","20.0.0-nightly.20220505","20.0.0-nightly.20220506","20.0.0-nightly.20220509","20.0.0-nightly.20220511","20.0.0-nightly.20220512","20.0.0-nightly.20220513","20.0.0-nightly.20220516","20.0.0-nightly.20220517"],"102.0.5005.27":["19.0.0-beta.4"],"102.0.5005.40":["19.0.0-beta.5","19.0.0-beta.6","19.0.0-beta.7"],"102.0.5005.49":["19.0.0-beta.8"],"102.0.4961.0":["19.0.0-nightly.20220325"],"102.0.5005.61":["19.0.0","19.0.1"],"102.0.5005.63":["19.0.2","19.0.3","19.0.4"],"102.0.5005.115":["19.0.5","19.0.6"],"102.0.5005.134":["19.0.7"],"102.0.5005.148":["19.0.8"],"102.0.5005.167":["19.0.9","19.0.10","19.0.11","19.0.12","19.0.13","19.0.14","19.0.15","19.0.16","19.0.17","19.1.0","19.1.1","19.1.2","19.1.3","19.1.4","19.1.5","19.1.6","19.1.7","19.1.8","19.1.9"],"103.0.5044.0":["20.0.0-alpha.1","20.0.0-nightly.20220518","20.0.0-nightly.20220519","20.0.0-nightly.20220520","20.0.0-nightly.20220523","20.0.0-nightly.20220524","21.0.0-nightly.20220526","21.0.0-nightly.20220527","21.0.0-nightly.20220530","21.0.0-nightly.20220531"],"104.0.5073.0":["20.0.0-alpha.2","20.0.0-alpha.3","20.0.0-alpha.4","20.0.0-alpha.5","20.0.0-alpha.6","20.0.0-alpha.7","20.0.0-beta.1","20.0.0-beta.2","20.0.0-beta.3","20.0.0-beta.4","20.0.0-beta.5","20.0.0-beta.6","20.0.0-beta.7","20.0.0-beta.8","21.0.0-nightly.20220602","21.0.0-nightly.20220603","21.0.0-nightly.20220606","21.0.0-nightly.20220607","21.0.0-nightly.20220608","21.0.0-nightly.20220609","21.0.0-nightly.20220610","21.0.0-nightly.20220613","21.0.0-nightly.20220614","21.0.0-nightly.20220615","21.0.0-nightly.20220616","21.0.0-nightly.20220617","21.0.0-nightly.20220620","21.0.0-nightly.20220621","21.0.0-nightly.20220622","21.0.0-nightly.20220623","21.0.0-nightly.20220624","21.0.0-nightly.20220627"],"104.0.5112.39":["20.0.0-beta.9"],"104.0.5112.48":["20.0.0-beta.10","20.0.0-beta.11","20.0.0-beta.12"],"104.0.5112.57":["20.0.0-beta.13"],"104.0.5112.65":["20.0.0"],"104.0.5112.81":["20.0.1","20.0.2","20.0.3"],"104.0.5112.102":["20.1.0","20.1.1"],"104.0.5112.114":["20.1.2","20.1.3","20.1.4"],"104.0.5112.124":["20.2.0","20.3.0","20.3.1","20.3.2","20.3.3","20.3.4","20.3.5","20.3.6","20.3.7","20.3.8","20.3.9","20.3.10","20.3.11","20.3.12"],"105.0.5187.0":["21.0.0-alpha.1","21.0.0-alpha.2","21.0.0-alpha.3","21.0.0-alpha.4","21.0.0-alpha.5","21.0.0-nightly.20220720","21.0.0-nightly.20220721","21.0.0-nightly.20220722","21.0.0-nightly.20220725","21.0.0-nightly.20220726","21.0.0-nightly.20220727","21.0.0-nightly.20220728","21.0.0-nightly.20220801","21.0.0-nightly.20220802","22.0.0-nightly.20220808","22.0.0-nightly.20220809","22.0.0-nightly.20220810","22.0.0-nightly.20220811","22.0.0-nightly.20220812","22.0.0-nightly.20220815","22.0.0-nightly.20220816","22.0.0-nightly.20220817"],"106.0.5216.0":["21.0.0-alpha.6","21.0.0-beta.1","21.0.0-beta.2","21.0.0-beta.3","21.0.0-beta.4","21.0.0-beta.5","22.0.0-nightly.20220822","22.0.0-nightly.20220823","22.0.0-nightly.20220824","22.0.0-nightly.20220825","22.0.0-nightly.20220829","22.0.0-nightly.20220830","22.0.0-nightly.20220831","22.0.0-nightly.20220901","22.0.0-nightly.20220902","22.0.0-nightly.20220905"],"106.0.5249.40":["21.0.0-beta.6","21.0.0-beta.7","21.0.0-beta.8"],"105.0.5129.0":["21.0.0-nightly.20220628","21.0.0-nightly.20220629","21.0.0-nightly.20220630","21.0.0-nightly.20220701","21.0.0-nightly.20220704","21.0.0-nightly.20220705","21.0.0-nightly.20220706","21.0.0-nightly.20220707","21.0.0-nightly.20220708","21.0.0-nightly.20220711","21.0.0-nightly.20220712","21.0.0-nightly.20220713"],"105.0.5173.0":["21.0.0-nightly.20220715","21.0.0-nightly.20220718","21.0.0-nightly.20220719"],"106.0.5249.51":["21.0.0"],"106.0.5249.61":["21.0.1"],"106.0.5249.91":["21.1.0"],"106.0.5249.103":["21.1.1"],"106.0.5249.119":["21.2.0"],"106.0.5249.165":["21.2.1"],"106.0.5249.168":["21.2.2","21.2.3"],"106.0.5249.181":["21.3.0","21.3.1"],"106.0.5249.199":["21.3.3","21.3.4","21.3.5","21.4.0","21.4.1","21.4.2","21.4.3","21.4.4"],"107.0.5286.0":["22.0.0-alpha.1","22.0.0-nightly.20220909","22.0.0-nightly.20220912","22.0.0-nightly.20220913","22.0.0-nightly.20220914","22.0.0-nightly.20220915","22.0.0-nightly.20220916","22.0.0-nightly.20220919","22.0.0-nightly.20220920","22.0.0-nightly.20220921","22.0.0-nightly.20220922","22.0.0-nightly.20220923","22.0.0-nightly.20220926","22.0.0-nightly.20220927","22.0.0-nightly.20220928","23.0.0-nightly.20220929","23.0.0-nightly.20220930","23.0.0-nightly.20221003"],"108.0.5329.0":["22.0.0-alpha.3","22.0.0-alpha.4","22.0.0-alpha.5","22.0.0-alpha.6","23.0.0-nightly.20221004","23.0.0-nightly.20221005","23.0.0-nightly.20221006","23.0.0-nightly.20221007","23.0.0-nightly.20221010","23.0.0-nightly.20221011","23.0.0-nightly.20221012","23.0.0-nightly.20221013","23.0.0-nightly.20221014","23.0.0-nightly.20221017"],"108.0.5355.0":["22.0.0-alpha.7","23.0.0-nightly.20221018","23.0.0-nightly.20221019","23.0.0-nightly.20221020","23.0.0-nightly.20221021","23.0.0-nightly.20221024","23.0.0-nightly.20221026"],"108.0.5359.10":["22.0.0-alpha.8","22.0.0-beta.1","22.0.0-beta.2","22.0.0-beta.3"],"108.0.5359.29":["22.0.0-beta.4"],"108.0.5359.40":["22.0.0-beta.5","22.0.0-beta.6"],"108.0.5359.48":["22.0.0-beta.7","22.0.0-beta.8"],"107.0.5274.0":["22.0.0-nightly.20220908"],"108.0.5359.62":["22.0.0"],"108.0.5359.125":["22.0.1"],"108.0.5359.179":["22.0.2","22.0.3","22.1.0"],"108.0.5359.215":["22.2.0","22.2.1","22.3.0","22.3.1","22.3.2","22.3.3","22.3.4","22.3.5","22.3.6","22.3.7","22.3.8","22.3.9","22.3.10","22.3.11","22.3.12","22.3.13","22.3.14","22.3.15","22.3.16","22.3.17","22.3.18","22.3.20","22.3.21","22.3.22","22.3.23","22.3.24","22.3.25","22.3.26","22.3.27"],"110.0.5415.0":["23.0.0-alpha.1","23.0.0-nightly.20221118","23.0.0-nightly.20221121","23.0.0-nightly.20221122","23.0.0-nightly.20221123","23.0.0-nightly.20221124","23.0.0-nightly.20221125","23.0.0-nightly.20221128","23.0.0-nightly.20221129","23.0.0-nightly.20221130","24.0.0-nightly.20221201","24.0.0-nightly.20221202","24.0.0-nightly.20221205"],"110.0.5451.0":["23.0.0-alpha.2","23.0.0-alpha.3","24.0.0-nightly.20221206","24.0.0-nightly.20221207","24.0.0-nightly.20221208","24.0.0-nightly.20221213","24.0.0-nightly.20221214","24.0.0-nightly.20221215","24.0.0-nightly.20221216"],"110.0.5478.5":["23.0.0-beta.1","23.0.0-beta.2","23.0.0-beta.3"],"110.0.5481.30":["23.0.0-beta.4"],"110.0.5481.38":["23.0.0-beta.5"],"110.0.5481.52":["23.0.0-beta.6","23.0.0-beta.8"],"109.0.5382.0":["23.0.0-nightly.20221027","23.0.0-nightly.20221028","23.0.0-nightly.20221031","23.0.0-nightly.20221101","23.0.0-nightly.20221102","23.0.0-nightly.20221103","23.0.0-nightly.20221104","23.0.0-nightly.20221107","23.0.0-nightly.20221108","23.0.0-nightly.20221109","23.0.0-nightly.20221110","23.0.0-nightly.20221111","23.0.0-nightly.20221114","23.0.0-nightly.20221115","23.0.0-nightly.20221116","23.0.0-nightly.20221117"],"110.0.5481.77":["23.0.0"],"110.0.5481.100":["23.1.0"],"110.0.5481.104":["23.1.1"],"110.0.5481.177":["23.1.2"],"110.0.5481.179":["23.1.3"],"110.0.5481.192":["23.1.4","23.2.0"],"110.0.5481.208":["23.2.1","23.2.2","23.2.3","23.2.4","23.3.0","23.3.1","23.3.2","23.3.3","23.3.4","23.3.5","23.3.6","23.3.7","23.3.8","23.3.9","23.3.10","23.3.11","23.3.12","23.3.13"],"111.0.5560.0":["24.0.0-alpha.1","24.0.0-alpha.2","24.0.0-alpha.3","24.0.0-alpha.4","24.0.0-alpha.5","24.0.0-alpha.6","24.0.0-alpha.7","24.0.0-nightly.20230203","24.0.0-nightly.20230206","24.0.0-nightly.20230207","24.0.0-nightly.20230208","24.0.0-nightly.20230209","25.0.0-nightly.20230210","25.0.0-nightly.20230214","25.0.0-nightly.20230215","25.0.0-nightly.20230216","25.0.0-nightly.20230217","25.0.0-nightly.20230220","25.0.0-nightly.20230221","25.0.0-nightly.20230222","25.0.0-nightly.20230223","25.0.0-nightly.20230224","25.0.0-nightly.20230227","25.0.0-nightly.20230228","25.0.0-nightly.20230301","25.0.0-nightly.20230302","25.0.0-nightly.20230303","25.0.0-nightly.20230306","25.0.0-nightly.20230307","25.0.0-nightly.20230308","25.0.0-nightly.20230309","25.0.0-nightly.20230310"],"111.0.5563.50":["24.0.0-beta.1","24.0.0-beta.2"],"112.0.5615.20":["24.0.0-beta.3","24.0.0-beta.4"],"112.0.5615.29":["24.0.0-beta.5"],"112.0.5615.39":["24.0.0-beta.6","24.0.0-beta.7"],"111.0.5518.0":["24.0.0-nightly.20230109","24.0.0-nightly.20230110","24.0.0-nightly.20230111","24.0.0-nightly.20230112","24.0.0-nightly.20230113","24.0.0-nightly.20230116","24.0.0-nightly.20230117","24.0.0-nightly.20230118","24.0.0-nightly.20230119","24.0.0-nightly.20230120","24.0.0-nightly.20230123","24.0.0-nightly.20230124","24.0.0-nightly.20230125","24.0.0-nightly.20230126","24.0.0-nightly.20230127","24.0.0-nightly.20230131","24.0.0-nightly.20230201","24.0.0-nightly.20230202"],"112.0.5615.49":["24.0.0"],"112.0.5615.50":["24.1.0","24.1.1"],"112.0.5615.87":["24.1.2"],"112.0.5615.165":["24.1.3","24.2.0","24.3.0"],"112.0.5615.183":["24.3.1"],"112.0.5615.204":["24.4.0","24.4.1","24.5.0","24.5.1","24.6.0","24.6.1","24.6.2","24.6.3","24.6.4","24.6.5","24.7.0","24.7.1","24.8.0","24.8.1","24.8.2","24.8.3","24.8.4","24.8.5","24.8.6","24.8.7","24.8.8"],"114.0.5694.0":["25.0.0-alpha.1","25.0.0-alpha.2","25.0.0-nightly.20230405","26.0.0-nightly.20230406","26.0.0-nightly.20230407","26.0.0-nightly.20230410","26.0.0-nightly.20230411"],"114.0.5710.0":["25.0.0-alpha.3","25.0.0-alpha.4","26.0.0-nightly.20230413","26.0.0-nightly.20230414","26.0.0-nightly.20230417"],"114.0.5719.0":["25.0.0-alpha.5","25.0.0-alpha.6","25.0.0-beta.1","25.0.0-beta.2","25.0.0-beta.3","26.0.0-nightly.20230421","26.0.0-nightly.20230424","26.0.0-nightly.20230425","26.0.0-nightly.20230426","26.0.0-nightly.20230427","26.0.0-nightly.20230428","26.0.0-nightly.20230501","26.0.0-nightly.20230502","26.0.0-nightly.20230503","26.0.0-nightly.20230504","26.0.0-nightly.20230505","26.0.0-nightly.20230508","26.0.0-nightly.20230509","26.0.0-nightly.20230510"],"114.0.5735.16":["25.0.0-beta.4","25.0.0-beta.5","25.0.0-beta.6","25.0.0-beta.7"],"114.0.5735.35":["25.0.0-beta.8"],"114.0.5735.45":["25.0.0-beta.9","25.0.0","25.0.1"],"113.0.5636.0":["25.0.0-nightly.20230314"],"113.0.5651.0":["25.0.0-nightly.20230315"],"113.0.5653.0":["25.0.0-nightly.20230317"],"113.0.5660.0":["25.0.0-nightly.20230320"],"113.0.5664.0":["25.0.0-nightly.20230321"],"113.0.5666.0":["25.0.0-nightly.20230322"],"113.0.5668.0":["25.0.0-nightly.20230323"],"113.0.5670.0":["25.0.0-nightly.20230324","25.0.0-nightly.20230327","25.0.0-nightly.20230328","25.0.0-nightly.20230329","25.0.0-nightly.20230330"],"114.0.5684.0":["25.0.0-nightly.20230331","25.0.0-nightly.20230403"],"114.0.5692.0":["25.0.0-nightly.20230404"],"114.0.5735.106":["25.1.0","25.1.1"],"114.0.5735.134":["25.2.0"],"114.0.5735.199":["25.3.0"],"114.0.5735.243":["25.3.1"],"114.0.5735.248":["25.3.2","25.4.0"],"114.0.5735.289":["25.5.0","25.6.0","25.7.0","25.8.0","25.8.1","25.8.2","25.8.3","25.8.4","25.9.0","25.9.1","25.9.2","25.9.3","25.9.4","25.9.5"],"116.0.5791.0":["26.0.0-alpha.1","26.0.0-alpha.2","26.0.0-alpha.3","26.0.0-alpha.4","26.0.0-alpha.5","26.0.0-nightly.20230526","26.0.0-nightly.20230529","26.0.0-nightly.20230530","26.0.0-nightly.20230531","27.0.0-nightly.20230601","27.0.0-nightly.20230602","27.0.0-nightly.20230605","27.0.0-nightly.20230606","27.0.0-nightly.20230607","27.0.0-nightly.20230609"],"116.0.5815.0":["26.0.0-alpha.6","27.0.0-nightly.20230612","27.0.0-nightly.20230613"],"116.0.5831.0":["26.0.0-alpha.7","27.0.0-nightly.20230615"],"116.0.5845.0":["26.0.0-alpha.8","26.0.0-beta.1","27.0.0-nightly.20230622","27.0.0-nightly.20230623","27.0.0-nightly.20230626","27.0.0-nightly.20230627","27.0.0-nightly.20230628","27.0.0-nightly.20230629","27.0.0-nightly.20230630"],"116.0.5845.14":["26.0.0-beta.2","26.0.0-beta.3","26.0.0-beta.4","26.0.0-beta.5","26.0.0-beta.6","26.0.0-beta.7"],"116.0.5845.42":["26.0.0-beta.8","26.0.0-beta.9"],"116.0.5845.49":["26.0.0-beta.10","26.0.0-beta.11"],"116.0.5845.62":["26.0.0-beta.12"],"114.0.5708.0":["26.0.0-nightly.20230412"],"114.0.5715.0":["26.0.0-nightly.20230418"],"115.0.5760.0":["26.0.0-nightly.20230511","26.0.0-nightly.20230512","26.0.0-nightly.20230515","26.0.0-nightly.20230516","26.0.0-nightly.20230517","26.0.0-nightly.20230518","26.0.0-nightly.20230519","26.0.0-nightly.20230522","26.0.0-nightly.20230523"],"115.0.5786.0":["26.0.0-nightly.20230524"],"115.0.5790.0":["26.0.0-nightly.20230525"],"116.0.5845.82":["26.0.0"],"116.0.5845.97":["26.1.0"],"116.0.5845.179":["26.2.0"],"116.0.5845.188":["26.2.1"],"116.0.5845.190":["26.2.2","26.2.3","26.2.4"],"116.0.5845.228":["26.3.0","26.4.0","26.4.1","26.4.2","26.4.3","26.5.0","26.6.0"],"118.0.5949.0":["27.0.0-alpha.1","27.0.0-alpha.2","27.0.0-alpha.3","27.0.0-alpha.4","27.0.0-alpha.5","27.0.0-alpha.6","27.0.0-nightly.20230816","28.0.0-nightly.20230817","28.0.0-nightly.20230818","28.0.0-nightly.20230821","28.0.0-nightly.20230822","28.0.0-nightly.20230823","28.0.0-nightly.20230824","28.0.0-nightly.20230825","28.0.0-nightly.20230828","28.0.0-nightly.20230829","28.0.0-nightly.20230830","28.0.0-nightly.20230831"],"118.0.5993.5":["27.0.0-beta.1","27.0.0-beta.2","27.0.0-beta.3"],"118.0.5993.11":["27.0.0-beta.4"],"118.0.5993.18":["27.0.0-beta.5","27.0.0-beta.6","27.0.0-beta.7","27.0.0-beta.8","27.0.0-beta.9"],"116.0.5829.0":["27.0.0-nightly.20230614"],"116.0.5833.0":["27.0.0-nightly.20230616","27.0.0-nightly.20230619","27.0.0-nightly.20230620","27.0.0-nightly.20230621"],"117.0.5852.0":["27.0.0-nightly.20230703","27.0.0-nightly.20230704","27.0.0-nightly.20230705","27.0.0-nightly.20230706","27.0.0-nightly.20230707","27.0.0-nightly.20230710","27.0.0-nightly.20230711","27.0.0-nightly.20230712","27.0.0-nightly.20230713","27.0.0-nightly.20230714"],"117.0.5884.1":["27.0.0-nightly.20230717","27.0.0-nightly.20230718"],"117.0.5892.0":["27.0.0-nightly.20230719"],"117.0.5897.0":["27.0.0-nightly.20230720","27.0.0-nightly.20230721","27.0.0-nightly.20230724","27.0.0-nightly.20230725","27.0.0-nightly.20230726","27.0.0-nightly.20230727","27.0.0-nightly.20230728","27.0.0-nightly.20230731"],"117.0.5911.0":["27.0.0-nightly.20230801","27.0.0-nightly.20230802","27.0.0-nightly.20230803"],"117.0.5921.0":["27.0.0-nightly.20230804","27.0.0-nightly.20230807","27.0.0-nightly.20230808","27.0.0-nightly.20230814","27.0.0-nightly.20230815"],"118.0.5993.54":["27.0.0"],"118.0.5993.89":["27.0.1","27.0.2"],"118.0.5993.120":["27.0.3"],"118.0.5993.129":["27.0.4"],"118.0.5993.144":["27.1.0"],"119.0.6045.0":["28.0.0-alpha.1","28.0.0-alpha.2","28.0.0-nightly.20231006","28.0.0-nightly.20231009","28.0.0-nightly.20231010","28.0.0-nightly.20231011","29.0.0-nightly.20231012","29.0.0-nightly.20231013","29.0.0-nightly.20231016","29.0.0-nightly.20231017","29.0.0-nightly.20231018","29.0.0-nightly.20231019","29.0.0-nightly.20231020","29.0.0-nightly.20231023","29.0.0-nightly.20231024"],"119.0.6045.21":["28.0.0-alpha.3","28.0.0-alpha.4"],"119.0.6045.33":["28.0.0-alpha.5","28.0.0-alpha.6","28.0.0-alpha.7","28.0.0-beta.1"],"120.0.6099.0":["28.0.0-beta.2"],"120.0.6099.5":["28.0.0-beta.3","28.0.0-beta.4"],"120.0.6099.18":["28.0.0-beta.5","28.0.0-beta.6","28.0.0-beta.7"],"118.0.5991.0":["28.0.0-nightly.20230906"],"118.0.5993.0":["28.0.0-nightly.20230907","28.0.0-nightly.20230908","28.0.0-nightly.20230911","28.0.0-nightly.20230912","28.0.0-nightly.20230913","28.0.0-nightly.20230914","28.0.0-nightly.20230915"],"119.0.6006.0":["28.0.0-nightly.20230919"],"119.0.6017.0":["28.0.0-nightly.20230920"],"119.0.6019.2":["28.0.0-nightly.20230921","28.0.0-nightly.20230925","28.0.0-nightly.20230926","28.0.0-nightly.20230927","28.0.0-nightly.20230928"],"119.0.6029.0":["28.0.0-nightly.20230929","28.0.0-nightly.20231002"],"119.0.6043.0":["28.0.0-nightly.20231003","28.0.0-nightly.20231004","28.0.0-nightly.20231005"],"120.0.6078.0":["29.0.0-nightly.20231025","29.0.0-nightly.20231026","29.0.0-nightly.20231027","29.0.0-nightly.20231030","29.0.0-nightly.20231031","29.0.0-nightly.20231101"],"121.0.6100.0":["29.0.0-nightly.20231102","29.0.0-nightly.20231103"],"121.0.6104.0":["29.0.0-nightly.20231106"],"121.0.6110.0":["29.0.0-nightly.20231107","29.0.0-nightly.20231108","29.0.0-nightly.20231109","29.0.0-nightly.20231110","29.0.0-nightly.20231113","29.0.0-nightly.20231114"],"121.0.6116.0":["29.0.0-nightly.20231115","29.0.0-nightly.20231116","29.0.0-nightly.20231117"]} \ No newline at end of file +{"39.0.2171.65":["0.20.0","0.20.1","0.20.2","0.20.3","0.20.4","0.20.5","0.20.6","0.20.7","0.20.8"],"40.0.2214.91":["0.21.0","0.21.1","0.21.2"],"41.0.2272.76":["0.21.3","0.22.1","0.22.2","0.22.3","0.23.0","0.24.0"],"42.0.2311.107":["0.25.0","0.25.1","0.25.2","0.25.3","0.26.0","0.26.1","0.27.0","0.27.1"],"43.0.2357.65":["0.27.2","0.27.3","0.28.0","0.28.1","0.28.2","0.28.3","0.29.1","0.29.2"],"44.0.2403.125":["0.30.4","0.31.0"],"45.0.2454.85":["0.31.2","0.32.2","0.32.3","0.33.0","0.33.1","0.33.2","0.33.3","0.33.4","0.33.6","0.33.7","0.33.8","0.33.9","0.34.0","0.34.1","0.34.2","0.34.3","0.34.4","0.35.1","0.35.2","0.35.3","0.35.4","0.35.5"],"47.0.2526.73":["0.36.0","0.36.2","0.36.3","0.36.4"],"47.0.2526.110":["0.36.5","0.36.6","0.36.7","0.36.8","0.36.9","0.36.10","0.36.11","0.36.12"],"49.0.2623.75":["0.37.0","0.37.1","0.37.3","0.37.4","0.37.5","0.37.6","0.37.7","0.37.8","1.0.0","1.0.1","1.0.2"],"50.0.2661.102":["1.1.0","1.1.1","1.1.2","1.1.3"],"51.0.2704.63":["1.2.0","1.2.1"],"51.0.2704.84":["1.2.2","1.2.3"],"51.0.2704.103":["1.2.4","1.2.5"],"51.0.2704.106":["1.2.6","1.2.7","1.2.8"],"52.0.2743.82":["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.9","1.3.10","1.3.13","1.3.14","1.3.15"],"53.0.2785.113":["1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5"],"53.0.2785.143":["1.4.6","1.4.7","1.4.8","1.4.10","1.4.11","1.4.13","1.4.14","1.4.15","1.4.16"],"54.0.2840.51":["1.4.12"],"54.0.2840.101":["1.5.0","1.5.1"],"56.0.2924.87":["1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","1.6.10","1.6.11","1.6.12","1.6.13","1.6.14","1.6.15","1.6.16","1.6.17","1.6.18"],"58.0.3029.110":["1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16"],"59.0.3071.115":["1.8.0","1.8.1","1.8.2-beta.1","1.8.2-beta.2","1.8.2-beta.3","1.8.2-beta.4","1.8.2-beta.5","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8"],"61.0.3163.100":["2.0.0-beta.1","2.0.0-beta.2","2.0.0-beta.3","2.0.0-beta.4","2.0.0-beta.5","2.0.0-beta.6","2.0.0-beta.7","2.0.0-beta.8","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8-nightly.20180819","2.0.8-nightly.20180820","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.1.0-unsupported.20180809"],"66.0.3359.181":["3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0-beta.6","3.0.0-beta.7","3.0.0-beta.8","3.0.0-beta.9","3.0.0-beta.10","3.0.0-beta.11","3.0.0-beta.12","3.0.0-beta.13","3.0.0-nightly.20180818","3.0.0-nightly.20180821","3.0.0-nightly.20180823","3.0.0-nightly.20180904","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.1.0-beta.1","3.1.0-beta.2","3.1.0-beta.3","3.1.0-beta.4","3.1.0-beta.5","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13","4.0.0-nightly.20180817","4.0.0-nightly.20180819","4.0.0-nightly.20180821"],"69.0.3497.106":["4.0.0-beta.1","4.0.0-beta.2","4.0.0-beta.3","4.0.0-beta.4","4.0.0-beta.5","4.0.0-beta.6","4.0.0-beta.7","4.0.0-beta.8","4.0.0-beta.9","4.0.0-beta.10","4.0.0-beta.11","4.0.0-nightly.20181010","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"67.0.3396.99":["4.0.0-nightly.20180929"],"68.0.3440.128":["4.0.0-nightly.20181006"],"69.0.3497.128":["4.0.7","4.0.8","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.2.0","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.2.11","4.2.12"],"72.0.3626.52":["5.0.0-beta.1","5.0.0-beta.2","6.0.0-nightly.20190123"],"73.0.3683.27":["5.0.0-beta.3"],"73.0.3683.54":["5.0.0-beta.4"],"73.0.3683.61":["5.0.0-beta.5"],"73.0.3683.84":["5.0.0-beta.6"],"73.0.3683.94":["5.0.0-beta.7"],"73.0.3683.104":["5.0.0-beta.8"],"73.0.3683.117":["5.0.0-beta.9"],"70.0.3538.110":["5.0.0-nightly.20190107"],"71.0.3578.98":["5.0.0-nightly.20190121","5.0.0-nightly.20190122"],"73.0.3683.119":["5.0.0"],"73.0.3683.121":["5.0.1","5.0.2","5.0.3","5.0.4","5.0.5","5.0.6","5.0.7","5.0.8","5.0.9","5.0.10","5.0.11","5.0.12","5.0.13"],"76.0.3774.1":["6.0.0-beta.1"],"76.0.3783.1":["6.0.0-beta.2","6.0.0-beta.3","6.0.0-beta.4"],"76.0.3805.4":["6.0.0-beta.5"],"76.0.3809.3":["6.0.0-beta.6"],"76.0.3809.22":["6.0.0-beta.7"],"76.0.3809.26":["6.0.0-beta.8","6.0.0-beta.9"],"76.0.3809.37":["6.0.0-beta.10"],"76.0.3809.42":["6.0.0-beta.11"],"76.0.3809.54":["6.0.0-beta.12"],"76.0.3809.60":["6.0.0-beta.13"],"76.0.3809.68":["6.0.0-beta.14"],"76.0.3809.74":["6.0.0-beta.15"],"72.0.3626.107":["6.0.0-nightly.20190212"],"72.0.3626.110":["6.0.0-nightly.20190213"],"74.0.3724.8":["6.0.0-nightly.20190311"],"76.0.3809.88":["6.0.0"],"76.0.3809.102":["6.0.1"],"76.0.3809.110":["6.0.2"],"76.0.3809.126":["6.0.3"],"76.0.3809.131":["6.0.4"],"76.0.3809.136":["6.0.5"],"76.0.3809.138":["6.0.6"],"76.0.3809.139":["6.0.7"],"76.0.3809.146":["6.0.8","6.0.9","6.0.10","6.0.11","6.0.12","6.1.0","6.1.1","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","6.1.7","6.1.8","6.1.9","6.1.10","6.1.11","6.1.12"],"78.0.3866.0":["7.0.0-beta.1","7.0.0-beta.2","7.0.0-beta.3","7.0.0-nightly.20190727","7.0.0-nightly.20190728","7.0.0-nightly.20190729","7.0.0-nightly.20190730","7.0.0-nightly.20190731","8.0.0-nightly.20190801","8.0.0-nightly.20190802"],"78.0.3896.6":["7.0.0-beta.4"],"78.0.3905.1":["7.0.0-beta.5","7.0.0-beta.6","7.0.0-beta.7","7.0.0"],"76.0.3784.0":["7.0.0-nightly.20190521"],"76.0.3806.0":["7.0.0-nightly.20190529","7.0.0-nightly.20190530","7.0.0-nightly.20190531","7.0.0-nightly.20190602","7.0.0-nightly.20190603"],"77.0.3814.0":["7.0.0-nightly.20190604"],"77.0.3815.0":["7.0.0-nightly.20190605","7.0.0-nightly.20190606","7.0.0-nightly.20190607","7.0.0-nightly.20190608","7.0.0-nightly.20190609","7.0.0-nightly.20190611","7.0.0-nightly.20190612","7.0.0-nightly.20190613","7.0.0-nightly.20190615","7.0.0-nightly.20190616","7.0.0-nightly.20190618","7.0.0-nightly.20190619","7.0.0-nightly.20190622","7.0.0-nightly.20190623","7.0.0-nightly.20190624","7.0.0-nightly.20190627","7.0.0-nightly.20190629","7.0.0-nightly.20190630","7.0.0-nightly.20190701","7.0.0-nightly.20190702"],"77.0.3843.0":["7.0.0-nightly.20190704","7.0.0-nightly.20190705"],"77.0.3848.0":["7.0.0-nightly.20190719","7.0.0-nightly.20190720","7.0.0-nightly.20190721"],"77.0.3864.0":["7.0.0-nightly.20190726"],"78.0.3904.92":["7.0.1"],"78.0.3904.94":["7.1.0"],"78.0.3904.99":["7.1.1"],"78.0.3904.113":["7.1.2"],"78.0.3904.126":["7.1.3"],"78.0.3904.130":["7.1.4","7.1.5","7.1.6","7.1.7","7.1.8","7.1.9","7.1.10","7.1.11","7.1.12","7.1.13","7.1.14","7.2.0","7.2.1","7.2.2","7.2.3","7.2.4","7.3.0","7.3.1","7.3.2","7.3.3"],"79.0.3931.0":["8.0.0-beta.1","8.0.0-beta.2","8.0.0-nightly.20191019","8.0.0-nightly.20191020","8.0.0-nightly.20191021","8.0.0-nightly.20191023"],"80.0.3955.0":["8.0.0-beta.3","8.0.0-beta.4"],"80.0.3987.14":["8.0.0-beta.5"],"80.0.3987.51":["8.0.0-beta.6"],"80.0.3987.59":["8.0.0-beta.7"],"80.0.3987.75":["8.0.0-beta.8","8.0.0-beta.9"],"78.0.3871.0":["8.0.0-nightly.20190803","8.0.0-nightly.20190806","8.0.0-nightly.20190807","8.0.0-nightly.20190808","8.0.0-nightly.20190809","8.0.0-nightly.20190810","8.0.0-nightly.20190811","8.0.0-nightly.20190812","8.0.0-nightly.20190813","8.0.0-nightly.20190814","8.0.0-nightly.20190815"],"78.0.3881.0":["8.0.0-nightly.20190816","8.0.0-nightly.20190817","8.0.0-nightly.20190818","8.0.0-nightly.20190819","8.0.0-nightly.20190820"],"78.0.3892.0":["8.0.0-nightly.20190824","8.0.0-nightly.20190825","8.0.0-nightly.20190827","8.0.0-nightly.20190828","8.0.0-nightly.20190830","8.0.0-nightly.20190901","8.0.0-nightly.20190902","8.0.0-nightly.20190907","8.0.0-nightly.20190909","8.0.0-nightly.20190910","8.0.0-nightly.20190911","8.0.0-nightly.20190912","8.0.0-nightly.20190913","8.0.0-nightly.20190914","8.0.0-nightly.20190915","8.0.0-nightly.20190917"],"79.0.3915.0":["8.0.0-nightly.20190919","8.0.0-nightly.20190920"],"79.0.3919.0":["8.0.0-nightly.20190922","8.0.0-nightly.20190923","8.0.0-nightly.20190924","8.0.0-nightly.20190926","8.0.0-nightly.20190928","8.0.0-nightly.20190929","8.0.0-nightly.20190930","8.0.0-nightly.20191001","8.0.0-nightly.20191004","8.0.0-nightly.20191005","8.0.0-nightly.20191006","8.0.0-nightly.20191009","8.0.0-nightly.20191011","8.0.0-nightly.20191012","8.0.0-nightly.20191017"],"80.0.3952.0":["8.0.0-nightly.20191101","8.0.0-nightly.20191103","8.0.0-nightly.20191105"],"80.0.3987.86":["8.0.0","8.0.1","8.0.2"],"80.0.3987.134":["8.0.3"],"80.0.3987.137":["8.1.0"],"80.0.3987.141":["8.1.1"],"80.0.3987.158":["8.2.0"],"80.0.3987.163":["8.2.1","8.2.2","8.2.3","8.5.3","8.5.4","8.5.5"],"80.0.3987.165":["8.2.4","8.2.5","8.3.0","8.3.1","8.3.2","8.3.3","8.3.4","8.4.0","8.4.1","8.5.0","8.5.1","8.5.2"],"82.0.4048.0":["9.0.0-beta.1","9.0.0-beta.2","9.0.0-beta.3","9.0.0-beta.4","9.0.0-beta.5"],"82.0.4058.2":["9.0.0-beta.6","9.0.0-beta.7","9.0.0-beta.9"],"82.0.4085.10":["9.0.0-beta.10"],"82.0.4085.14":["9.0.0-beta.11","9.0.0-beta.12","9.0.0-beta.13"],"82.0.4085.27":["9.0.0-beta.14"],"83.0.4102.3":["9.0.0-beta.15","9.0.0-beta.16"],"83.0.4103.14":["9.0.0-beta.17"],"83.0.4103.16":["9.0.0-beta.18"],"83.0.4103.24":["9.0.0-beta.19"],"83.0.4103.26":["9.0.0-beta.20","9.0.0-beta.21"],"83.0.4103.34":["9.0.0-beta.22"],"83.0.4103.44":["9.0.0-beta.23"],"83.0.4103.45":["9.0.0-beta.24"],"80.0.3954.0":["9.0.0-nightly.20191121","9.0.0-nightly.20191122","9.0.0-nightly.20191123","9.0.0-nightly.20191124","9.0.0-nightly.20191126","9.0.0-nightly.20191128","9.0.0-nightly.20191129","9.0.0-nightly.20191130","9.0.0-nightly.20191201","9.0.0-nightly.20191202","9.0.0-nightly.20191203","9.0.0-nightly.20191204","9.0.0-nightly.20191205","9.0.0-nightly.20191210"],"81.0.3994.0":["9.0.0-nightly.20191220","9.0.0-nightly.20191221","9.0.0-nightly.20191222","9.0.0-nightly.20191223","9.0.0-nightly.20191224","9.0.0-nightly.20191225","9.0.0-nightly.20191226","9.0.0-nightly.20191228","9.0.0-nightly.20191229","9.0.0-nightly.20191230","9.0.0-nightly.20191231","9.0.0-nightly.20200101","9.0.0-nightly.20200103","9.0.0-nightly.20200104","9.0.0-nightly.20200105","9.0.0-nightly.20200106","9.0.0-nightly.20200108","9.0.0-nightly.20200109","9.0.0-nightly.20200110","9.0.0-nightly.20200111","9.0.0-nightly.20200113","9.0.0-nightly.20200115","9.0.0-nightly.20200116","9.0.0-nightly.20200117"],"81.0.4030.0":["9.0.0-nightly.20200119","9.0.0-nightly.20200121"],"83.0.4103.64":["9.0.0"],"83.0.4103.94":["9.0.1","9.0.2"],"83.0.4103.100":["9.0.3"],"83.0.4103.104":["9.0.4"],"83.0.4103.119":["9.0.5"],"83.0.4103.122":["9.1.0","9.1.1","9.1.2","9.2.0","9.2.1","9.3.0","9.3.1","9.3.2","9.3.3","9.3.4","9.3.5","9.4.0","9.4.1","9.4.2","9.4.3","9.4.4"],"84.0.4129.0":["10.0.0-beta.1","10.0.0-beta.2","10.0.0-nightly.20200501","10.0.0-nightly.20200504","10.0.0-nightly.20200505","10.0.0-nightly.20200506","10.0.0-nightly.20200507","10.0.0-nightly.20200508","10.0.0-nightly.20200511","10.0.0-nightly.20200512","10.0.0-nightly.20200513","10.0.0-nightly.20200514","10.0.0-nightly.20200515","10.0.0-nightly.20200518","10.0.0-nightly.20200519","10.0.0-nightly.20200520","10.0.0-nightly.20200521","11.0.0-nightly.20200525","11.0.0-nightly.20200526"],"85.0.4161.2":["10.0.0-beta.3","10.0.0-beta.4"],"85.0.4181.1":["10.0.0-beta.8","10.0.0-beta.9"],"85.0.4183.19":["10.0.0-beta.10"],"85.0.4183.20":["10.0.0-beta.11"],"85.0.4183.26":["10.0.0-beta.12"],"85.0.4183.39":["10.0.0-beta.13","10.0.0-beta.14","10.0.0-beta.15","10.0.0-beta.17","10.0.0-beta.19","10.0.0-beta.20","10.0.0-beta.21"],"85.0.4183.70":["10.0.0-beta.23"],"85.0.4183.78":["10.0.0-beta.24"],"85.0.4183.80":["10.0.0-beta.25"],"82.0.4050.0":["10.0.0-nightly.20200209","10.0.0-nightly.20200210","10.0.0-nightly.20200211","10.0.0-nightly.20200216","10.0.0-nightly.20200217","10.0.0-nightly.20200218","10.0.0-nightly.20200221","10.0.0-nightly.20200222","10.0.0-nightly.20200223","10.0.0-nightly.20200226","10.0.0-nightly.20200303"],"82.0.4076.0":["10.0.0-nightly.20200304","10.0.0-nightly.20200305","10.0.0-nightly.20200306","10.0.0-nightly.20200309","10.0.0-nightly.20200310"],"82.0.4083.0":["10.0.0-nightly.20200311"],"83.0.4086.0":["10.0.0-nightly.20200316"],"83.0.4087.0":["10.0.0-nightly.20200317","10.0.0-nightly.20200318","10.0.0-nightly.20200320","10.0.0-nightly.20200323","10.0.0-nightly.20200324","10.0.0-nightly.20200325","10.0.0-nightly.20200326","10.0.0-nightly.20200327","10.0.0-nightly.20200330","10.0.0-nightly.20200331","10.0.0-nightly.20200401","10.0.0-nightly.20200402","10.0.0-nightly.20200403","10.0.0-nightly.20200406"],"83.0.4095.0":["10.0.0-nightly.20200408","10.0.0-nightly.20200410","10.0.0-nightly.20200413"],"84.0.4114.0":["10.0.0-nightly.20200414"],"84.0.4115.0":["10.0.0-nightly.20200415","10.0.0-nightly.20200416","10.0.0-nightly.20200417"],"84.0.4121.0":["10.0.0-nightly.20200422","10.0.0-nightly.20200423"],"84.0.4125.0":["10.0.0-nightly.20200427","10.0.0-nightly.20200428","10.0.0-nightly.20200429","10.0.0-nightly.20200430"],"85.0.4183.84":["10.0.0"],"85.0.4183.86":["10.0.1"],"85.0.4183.87":["10.1.0"],"85.0.4183.93":["10.1.1"],"85.0.4183.98":["10.1.2"],"85.0.4183.121":["10.1.3","10.1.4","10.1.5","10.1.6","10.1.7","10.2.0","10.3.0","10.3.1","10.3.2","10.4.0","10.4.1","10.4.2","10.4.3","10.4.4","10.4.5","10.4.6","10.4.7"],"86.0.4234.0":["11.0.0-beta.1","11.0.0-beta.3","11.0.0-beta.4","11.0.0-beta.5","11.0.0-beta.6","11.0.0-beta.7","11.0.0-nightly.20200822","11.0.0-nightly.20200824","11.0.0-nightly.20200825","11.0.0-nightly.20200826","12.0.0-nightly.20200827","12.0.0-nightly.20200831","12.0.0-nightly.20200902","12.0.0-nightly.20200903","12.0.0-nightly.20200907","12.0.0-nightly.20200910","12.0.0-nightly.20200911","12.0.0-nightly.20200914"],"87.0.4251.1":["11.0.0-beta.8","11.0.0-beta.9","11.0.0-beta.11"],"87.0.4280.11":["11.0.0-beta.12","11.0.0-beta.13"],"87.0.4280.27":["11.0.0-beta.16","11.0.0-beta.17","11.0.0-beta.18","11.0.0-beta.19"],"87.0.4280.40":["11.0.0-beta.20"],"87.0.4280.47":["11.0.0-beta.22","11.0.0-beta.23"],"85.0.4156.0":["11.0.0-nightly.20200529"],"85.0.4162.0":["11.0.0-nightly.20200602","11.0.0-nightly.20200603","11.0.0-nightly.20200604","11.0.0-nightly.20200609","11.0.0-nightly.20200610","11.0.0-nightly.20200611","11.0.0-nightly.20200615","11.0.0-nightly.20200616","11.0.0-nightly.20200617","11.0.0-nightly.20200618","11.0.0-nightly.20200619"],"85.0.4179.0":["11.0.0-nightly.20200701","11.0.0-nightly.20200702","11.0.0-nightly.20200703","11.0.0-nightly.20200706","11.0.0-nightly.20200707","11.0.0-nightly.20200708","11.0.0-nightly.20200709"],"86.0.4203.0":["11.0.0-nightly.20200716","11.0.0-nightly.20200717","11.0.0-nightly.20200720","11.0.0-nightly.20200721"],"86.0.4209.0":["11.0.0-nightly.20200723","11.0.0-nightly.20200724","11.0.0-nightly.20200729","11.0.0-nightly.20200730","11.0.0-nightly.20200731","11.0.0-nightly.20200803","11.0.0-nightly.20200804","11.0.0-nightly.20200805","11.0.0-nightly.20200811","11.0.0-nightly.20200812"],"87.0.4280.60":["11.0.0","11.0.1"],"87.0.4280.67":["11.0.2","11.0.3","11.0.4"],"87.0.4280.88":["11.0.5","11.1.0","11.1.1"],"87.0.4280.141":["11.2.0","11.2.1","11.2.2","11.2.3","11.3.0","11.4.0","11.4.1","11.4.2","11.4.3","11.4.4","11.4.5","11.4.6","11.4.7","11.4.8","11.4.9","11.4.10","11.4.11","11.4.12","11.5.0"],"89.0.4328.0":["12.0.0-beta.1","12.0.0-beta.3","12.0.0-beta.4","12.0.0-beta.5","12.0.0-beta.6","12.0.0-beta.7","12.0.0-beta.8","12.0.0-beta.9","12.0.0-beta.10","12.0.0-beta.11","12.0.0-beta.12","12.0.0-beta.14","13.0.0-nightly.20201119","13.0.0-nightly.20201123","13.0.0-nightly.20201124","13.0.0-nightly.20201126","13.0.0-nightly.20201127","13.0.0-nightly.20201130","13.0.0-nightly.20201201","13.0.0-nightly.20201202","13.0.0-nightly.20201203","13.0.0-nightly.20201204","13.0.0-nightly.20201207","13.0.0-nightly.20201208","13.0.0-nightly.20201209","13.0.0-nightly.20201210","13.0.0-nightly.20201211","13.0.0-nightly.20201214"],"89.0.4348.1":["12.0.0-beta.16","12.0.0-beta.18","12.0.0-beta.19","12.0.0-beta.20"],"89.0.4388.2":["12.0.0-beta.21","12.0.0-beta.22","12.0.0-beta.23","12.0.0-beta.24","12.0.0-beta.25","12.0.0-beta.26"],"89.0.4389.23":["12.0.0-beta.27","12.0.0-beta.28","12.0.0-beta.29"],"89.0.4389.58":["12.0.0-beta.30","12.0.0-beta.31"],"87.0.4268.0":["12.0.0-nightly.20201002","12.0.0-nightly.20201007","12.0.0-nightly.20201009","12.0.0-nightly.20201012","12.0.0-nightly.20201013","12.0.0-nightly.20201014","12.0.0-nightly.20201015"],"88.0.4292.0":["12.0.0-nightly.20201023","12.0.0-nightly.20201026"],"88.0.4306.0":["12.0.0-nightly.20201030","12.0.0-nightly.20201102","12.0.0-nightly.20201103","12.0.0-nightly.20201104","12.0.0-nightly.20201105","12.0.0-nightly.20201106","12.0.0-nightly.20201111","12.0.0-nightly.20201112"],"88.0.4324.0":["12.0.0-nightly.20201116"],"89.0.4389.69":["12.0.0"],"89.0.4389.82":["12.0.1"],"89.0.4389.90":["12.0.2"],"89.0.4389.114":["12.0.3","12.0.4"],"89.0.4389.128":["12.0.5","12.0.6","12.0.7","12.0.8","12.0.9","12.0.10","12.0.11","12.0.12","12.0.13","12.0.14","12.0.15","12.0.16","12.0.17","12.0.18","12.1.0","12.1.1","12.1.2","12.2.0","12.2.1","12.2.2","12.2.3"],"90.0.4402.0":["13.0.0-beta.2","13.0.0-beta.3","13.0.0-nightly.20210210","13.0.0-nightly.20210211","13.0.0-nightly.20210212","13.0.0-nightly.20210216","13.0.0-nightly.20210217","13.0.0-nightly.20210218","13.0.0-nightly.20210219","13.0.0-nightly.20210222","13.0.0-nightly.20210225","13.0.0-nightly.20210226","13.0.0-nightly.20210301","13.0.0-nightly.20210302","13.0.0-nightly.20210303","14.0.0-nightly.20210304"],"90.0.4415.0":["13.0.0-beta.4","13.0.0-beta.5","13.0.0-beta.6","13.0.0-beta.7","13.0.0-beta.8","13.0.0-beta.9","13.0.0-beta.10","13.0.0-beta.11","13.0.0-beta.12","13.0.0-beta.13","14.0.0-nightly.20210305","14.0.0-nightly.20210308","14.0.0-nightly.20210309","14.0.0-nightly.20210311","14.0.0-nightly.20210315","14.0.0-nightly.20210316","14.0.0-nightly.20210317","14.0.0-nightly.20210318","14.0.0-nightly.20210319","14.0.0-nightly.20210323","14.0.0-nightly.20210324","14.0.0-nightly.20210325","14.0.0-nightly.20210326","14.0.0-nightly.20210329","14.0.0-nightly.20210330"],"91.0.4448.0":["13.0.0-beta.14","13.0.0-beta.16","13.0.0-beta.17","13.0.0-beta.18","13.0.0-beta.20","14.0.0-nightly.20210331","14.0.0-nightly.20210401","14.0.0-nightly.20210402","14.0.0-nightly.20210406","14.0.0-nightly.20210407","14.0.0-nightly.20210408","14.0.0-nightly.20210409","14.0.0-nightly.20210413"],"91.0.4472.33":["13.0.0-beta.21","13.0.0-beta.22","13.0.0-beta.23"],"91.0.4472.38":["13.0.0-beta.24","13.0.0-beta.25","13.0.0-beta.26","13.0.0-beta.27","13.0.0-beta.28"],"89.0.4349.0":["13.0.0-nightly.20201215","13.0.0-nightly.20201216","13.0.0-nightly.20201221","13.0.0-nightly.20201222"],"89.0.4359.0":["13.0.0-nightly.20201223","13.0.0-nightly.20210104","13.0.0-nightly.20210108","13.0.0-nightly.20210111"],"89.0.4386.0":["13.0.0-nightly.20210113","13.0.0-nightly.20210114","13.0.0-nightly.20210118","13.0.0-nightly.20210122","13.0.0-nightly.20210125"],"89.0.4389.0":["13.0.0-nightly.20210127","13.0.0-nightly.20210128","13.0.0-nightly.20210129","13.0.0-nightly.20210201","13.0.0-nightly.20210202","13.0.0-nightly.20210203","13.0.0-nightly.20210205","13.0.0-nightly.20210208","13.0.0-nightly.20210209"],"91.0.4472.69":["13.0.0","13.0.1"],"91.0.4472.77":["13.1.0","13.1.1","13.1.2"],"91.0.4472.106":["13.1.3","13.1.4"],"91.0.4472.124":["13.1.5","13.1.6","13.1.7"],"91.0.4472.164":["13.1.8","13.1.9","13.2.0","13.2.1","13.2.2","13.2.3","13.3.0","13.4.0","13.5.0","13.5.1","13.5.2","13.6.0","13.6.1","13.6.2","13.6.3","13.6.6","13.6.7","13.6.8","13.6.9"],"92.0.4511.0":["14.0.0-beta.1","14.0.0-beta.2","14.0.0-beta.3","14.0.0-nightly.20210520","14.0.0-nightly.20210523","14.0.0-nightly.20210524","15.0.0-nightly.20210527","15.0.0-nightly.20210528","15.0.0-nightly.20210531","15.0.0-nightly.20210601","15.0.0-nightly.20210602"],"93.0.4536.0":["14.0.0-beta.5","14.0.0-beta.6","14.0.0-beta.7","14.0.0-beta.8","15.0.0-nightly.20210609","15.0.0-nightly.20210610","15.0.0-nightly.20210611","15.0.0-nightly.20210614","15.0.0-nightly.20210615","15.0.0-nightly.20210616"],"93.0.4539.0":["14.0.0-beta.9","14.0.0-beta.10","15.0.0-nightly.20210617","15.0.0-nightly.20210618","15.0.0-nightly.20210621","15.0.0-nightly.20210622"],"93.0.4557.4":["14.0.0-beta.11","14.0.0-beta.12"],"93.0.4566.0":["14.0.0-beta.13","14.0.0-beta.14","14.0.0-beta.15","14.0.0-beta.16","14.0.0-beta.17","15.0.0-alpha.1","15.0.0-alpha.2","15.0.0-nightly.20210706","15.0.0-nightly.20210707","15.0.0-nightly.20210708","15.0.0-nightly.20210709","15.0.0-nightly.20210712","15.0.0-nightly.20210713","15.0.0-nightly.20210714","15.0.0-nightly.20210715","15.0.0-nightly.20210716","15.0.0-nightly.20210719","15.0.0-nightly.20210720","15.0.0-nightly.20210721","16.0.0-nightly.20210722","16.0.0-nightly.20210723","16.0.0-nightly.20210726"],"93.0.4577.15":["14.0.0-beta.18","14.0.0-beta.19","14.0.0-beta.20","14.0.0-beta.21"],"93.0.4577.25":["14.0.0-beta.22","14.0.0-beta.23"],"93.0.4577.51":["14.0.0-beta.24","14.0.0-beta.25"],"92.0.4475.0":["14.0.0-nightly.20210426","14.0.0-nightly.20210427"],"92.0.4488.0":["14.0.0-nightly.20210430","14.0.0-nightly.20210503"],"92.0.4496.0":["14.0.0-nightly.20210505"],"92.0.4498.0":["14.0.0-nightly.20210506"],"92.0.4499.0":["14.0.0-nightly.20210507","14.0.0-nightly.20210510","14.0.0-nightly.20210511","14.0.0-nightly.20210512","14.0.0-nightly.20210513"],"92.0.4505.0":["14.0.0-nightly.20210514","14.0.0-nightly.20210517","14.0.0-nightly.20210518","14.0.0-nightly.20210519"],"93.0.4577.58":["14.0.0"],"93.0.4577.63":["14.0.1"],"93.0.4577.82":["14.0.2","14.1.0","14.1.1","14.2.0","14.2.1","14.2.2","14.2.3","14.2.4","14.2.5","14.2.6","14.2.7","14.2.8","14.2.9"],"94.0.4584.0":["15.0.0-alpha.3","15.0.0-alpha.4","15.0.0-alpha.5","15.0.0-alpha.6","16.0.0-nightly.20210727","16.0.0-nightly.20210728","16.0.0-nightly.20210729","16.0.0-nightly.20210730","16.0.0-nightly.20210802","16.0.0-nightly.20210803","16.0.0-nightly.20210804","16.0.0-nightly.20210805","16.0.0-nightly.20210806","16.0.0-nightly.20210809","16.0.0-nightly.20210810","16.0.0-nightly.20210811"],"94.0.4590.2":["15.0.0-alpha.7","15.0.0-alpha.8","15.0.0-alpha.9","16.0.0-nightly.20210812","16.0.0-nightly.20210813","16.0.0-nightly.20210816","16.0.0-nightly.20210817","16.0.0-nightly.20210818","16.0.0-nightly.20210819","16.0.0-nightly.20210820","16.0.0-nightly.20210823"],"94.0.4606.12":["15.0.0-alpha.10"],"94.0.4606.20":["15.0.0-beta.1","15.0.0-beta.2"],"94.0.4606.31":["15.0.0-beta.3","15.0.0-beta.4","15.0.0-beta.5","15.0.0-beta.6","15.0.0-beta.7"],"93.0.4530.0":["15.0.0-nightly.20210603","15.0.0-nightly.20210604"],"93.0.4535.0":["15.0.0-nightly.20210608"],"93.0.4550.0":["15.0.0-nightly.20210623","15.0.0-nightly.20210624"],"93.0.4552.0":["15.0.0-nightly.20210625","15.0.0-nightly.20210628","15.0.0-nightly.20210629"],"93.0.4558.0":["15.0.0-nightly.20210630","15.0.0-nightly.20210701","15.0.0-nightly.20210702","15.0.0-nightly.20210705"],"94.0.4606.51":["15.0.0"],"94.0.4606.61":["15.1.0","15.1.1"],"94.0.4606.71":["15.1.2"],"94.0.4606.81":["15.2.0","15.3.0","15.3.1","15.3.2","15.3.3","15.3.4","15.3.5","15.3.6","15.3.7","15.4.0","15.4.1","15.4.2","15.5.0","15.5.1","15.5.2","15.5.3","15.5.4","15.5.5","15.5.6","15.5.7"],"95.0.4629.0":["16.0.0-alpha.1","16.0.0-alpha.2","16.0.0-alpha.3","16.0.0-alpha.4","16.0.0-alpha.5","16.0.0-alpha.6","16.0.0-alpha.7","16.0.0-nightly.20210902","16.0.0-nightly.20210903","16.0.0-nightly.20210906","16.0.0-nightly.20210907","16.0.0-nightly.20210908","16.0.0-nightly.20210909","16.0.0-nightly.20210910","16.0.0-nightly.20210913","16.0.0-nightly.20210914","16.0.0-nightly.20210915","16.0.0-nightly.20210916","16.0.0-nightly.20210917","16.0.0-nightly.20210920","16.0.0-nightly.20210921","16.0.0-nightly.20210922","17.0.0-nightly.20210923","17.0.0-nightly.20210924","17.0.0-nightly.20210927","17.0.0-nightly.20210928","17.0.0-nightly.20210929","17.0.0-nightly.20210930","17.0.0-nightly.20211001","17.0.0-nightly.20211004","17.0.0-nightly.20211005"],"96.0.4647.0":["16.0.0-alpha.8","16.0.0-alpha.9","16.0.0-beta.1","16.0.0-beta.2","16.0.0-beta.3","17.0.0-nightly.20211006","17.0.0-nightly.20211007","17.0.0-nightly.20211008","17.0.0-nightly.20211011","17.0.0-nightly.20211012","17.0.0-nightly.20211013","17.0.0-nightly.20211014","17.0.0-nightly.20211015","17.0.0-nightly.20211018","17.0.0-nightly.20211019","17.0.0-nightly.20211020","17.0.0-nightly.20211021"],"96.0.4664.18":["16.0.0-beta.4","16.0.0-beta.5"],"96.0.4664.27":["16.0.0-beta.6","16.0.0-beta.7"],"96.0.4664.35":["16.0.0-beta.8","16.0.0-beta.9"],"95.0.4612.5":["16.0.0-nightly.20210824","16.0.0-nightly.20210825","16.0.0-nightly.20210826","16.0.0-nightly.20210827","16.0.0-nightly.20210830","16.0.0-nightly.20210831","16.0.0-nightly.20210901"],"96.0.4664.45":["16.0.0","16.0.1"],"96.0.4664.55":["16.0.2","16.0.3","16.0.4","16.0.5"],"96.0.4664.110":["16.0.6","16.0.7","16.0.8"],"96.0.4664.174":["16.0.9","16.0.10","16.1.0","16.1.1","16.2.0","16.2.1","16.2.2","16.2.3","16.2.4","16.2.5","16.2.6","16.2.7","16.2.8"],"96.0.4664.4":["17.0.0-alpha.1","17.0.0-alpha.2","17.0.0-alpha.3","17.0.0-nightly.20211022","17.0.0-nightly.20211025","17.0.0-nightly.20211026","17.0.0-nightly.20211027","17.0.0-nightly.20211028","17.0.0-nightly.20211029","17.0.0-nightly.20211101","17.0.0-nightly.20211102","17.0.0-nightly.20211103","17.0.0-nightly.20211104","17.0.0-nightly.20211105","17.0.0-nightly.20211108","17.0.0-nightly.20211109","17.0.0-nightly.20211110","17.0.0-nightly.20211111","17.0.0-nightly.20211112","17.0.0-nightly.20211115","17.0.0-nightly.20211116","17.0.0-nightly.20211117","18.0.0-nightly.20211118","18.0.0-nightly.20211119","18.0.0-nightly.20211122","18.0.0-nightly.20211123"],"98.0.4706.0":["17.0.0-alpha.4","17.0.0-alpha.5","17.0.0-alpha.6","17.0.0-beta.1","17.0.0-beta.2","18.0.0-nightly.20211124","18.0.0-nightly.20211125","18.0.0-nightly.20211126","18.0.0-nightly.20211129","18.0.0-nightly.20211130","18.0.0-nightly.20211201","18.0.0-nightly.20211202","18.0.0-nightly.20211203","18.0.0-nightly.20211206","18.0.0-nightly.20211207","18.0.0-nightly.20211208","18.0.0-nightly.20211209","18.0.0-nightly.20211210","18.0.0-nightly.20211213","18.0.0-nightly.20211214","18.0.0-nightly.20211215","18.0.0-nightly.20211216","18.0.0-nightly.20211217","18.0.0-nightly.20211220","18.0.0-nightly.20211221","18.0.0-nightly.20211222","18.0.0-nightly.20211223","18.0.0-nightly.20211228","18.0.0-nightly.20211229","18.0.0-nightly.20211231","18.0.0-nightly.20220103","18.0.0-nightly.20220104","18.0.0-nightly.20220105","18.0.0-nightly.20220106","18.0.0-nightly.20220107","18.0.0-nightly.20220110"],"98.0.4758.9":["17.0.0-beta.3"],"98.0.4758.11":["17.0.0-beta.4","17.0.0-beta.5","17.0.0-beta.6","17.0.0-beta.7","17.0.0-beta.8","17.0.0-beta.9"],"98.0.4758.74":["17.0.0"],"98.0.4758.82":["17.0.1"],"98.0.4758.102":["17.1.0"],"98.0.4758.109":["17.1.1","17.1.2","17.2.0"],"98.0.4758.141":["17.3.0","17.3.1","17.4.0","17.4.1","17.4.2","17.4.3","17.4.4","17.4.5","17.4.6","17.4.7","17.4.8","17.4.9","17.4.10","17.4.11"],"99.0.4767.0":["18.0.0-alpha.1","18.0.0-alpha.2","18.0.0-alpha.3","18.0.0-alpha.4","18.0.0-alpha.5","18.0.0-nightly.20220111","18.0.0-nightly.20220112","18.0.0-nightly.20220113","18.0.0-nightly.20220114","18.0.0-nightly.20220117","18.0.0-nightly.20220118","18.0.0-nightly.20220119","18.0.0-nightly.20220121","18.0.0-nightly.20220124","18.0.0-nightly.20220125","18.0.0-nightly.20220127","18.0.0-nightly.20220128","18.0.0-nightly.20220131","18.0.0-nightly.20220201","19.0.0-nightly.20220202","19.0.0-nightly.20220203","19.0.0-nightly.20220204","19.0.0-nightly.20220207","19.0.0-nightly.20220208","19.0.0-nightly.20220209"],"100.0.4894.0":["18.0.0-beta.1","18.0.0-beta.2","18.0.0-beta.3","18.0.0-beta.4","18.0.0-beta.5","18.0.0-beta.6","19.0.0-nightly.20220308","19.0.0-nightly.20220309","19.0.0-nightly.20220310","19.0.0-nightly.20220311","19.0.0-nightly.20220314","19.0.0-nightly.20220315","19.0.0-nightly.20220316","19.0.0-nightly.20220317","19.0.0-nightly.20220318","19.0.0-nightly.20220321","19.0.0-nightly.20220322","19.0.0-nightly.20220323","19.0.0-nightly.20220324"],"100.0.4896.56":["18.0.0"],"100.0.4896.60":["18.0.1","18.0.2"],"100.0.4896.75":["18.0.3","18.0.4"],"100.0.4896.127":["18.1.0"],"100.0.4896.143":["18.2.0","18.2.1","18.2.2","18.2.3"],"100.0.4896.160":["18.2.4","18.3.0","18.3.1","18.3.2","18.3.3","18.3.4","18.3.5","18.3.6","18.3.7","18.3.8","18.3.9","18.3.11","18.3.12","18.3.13","18.3.14","18.3.15"],"102.0.4962.3":["19.0.0-alpha.1","19.0.0-nightly.20220328","19.0.0-nightly.20220329","20.0.0-nightly.20220330"],"102.0.4971.0":["19.0.0-alpha.2","19.0.0-alpha.3","20.0.0-nightly.20220411"],"102.0.4989.0":["19.0.0-alpha.4","19.0.0-alpha.5","20.0.0-nightly.20220414","20.0.0-nightly.20220415","20.0.0-nightly.20220418","20.0.0-nightly.20220419","20.0.0-nightly.20220420","20.0.0-nightly.20220421"],"102.0.4999.0":["19.0.0-beta.1","19.0.0-beta.2","19.0.0-beta.3","20.0.0-nightly.20220425","20.0.0-nightly.20220426","20.0.0-nightly.20220427","20.0.0-nightly.20220428","20.0.0-nightly.20220429","20.0.0-nightly.20220502","20.0.0-nightly.20220503","20.0.0-nightly.20220504","20.0.0-nightly.20220505","20.0.0-nightly.20220506","20.0.0-nightly.20220509","20.0.0-nightly.20220511","20.0.0-nightly.20220512","20.0.0-nightly.20220513","20.0.0-nightly.20220516","20.0.0-nightly.20220517"],"102.0.5005.27":["19.0.0-beta.4"],"102.0.5005.40":["19.0.0-beta.5","19.0.0-beta.6","19.0.0-beta.7"],"102.0.5005.49":["19.0.0-beta.8"],"102.0.4961.0":["19.0.0-nightly.20220325"],"102.0.5005.61":["19.0.0","19.0.1"],"102.0.5005.63":["19.0.2","19.0.3","19.0.4"],"102.0.5005.115":["19.0.5","19.0.6"],"102.0.5005.134":["19.0.7"],"102.0.5005.148":["19.0.8"],"102.0.5005.167":["19.0.9","19.0.10","19.0.11","19.0.12","19.0.13","19.0.14","19.0.15","19.0.16","19.0.17","19.1.0","19.1.1","19.1.2","19.1.3","19.1.4","19.1.5","19.1.6","19.1.7","19.1.8","19.1.9"],"103.0.5044.0":["20.0.0-alpha.1","20.0.0-nightly.20220518","20.0.0-nightly.20220519","20.0.0-nightly.20220520","20.0.0-nightly.20220523","20.0.0-nightly.20220524","21.0.0-nightly.20220526","21.0.0-nightly.20220527","21.0.0-nightly.20220530","21.0.0-nightly.20220531"],"104.0.5073.0":["20.0.0-alpha.2","20.0.0-alpha.3","20.0.0-alpha.4","20.0.0-alpha.5","20.0.0-alpha.6","20.0.0-alpha.7","20.0.0-beta.1","20.0.0-beta.2","20.0.0-beta.3","20.0.0-beta.4","20.0.0-beta.5","20.0.0-beta.6","20.0.0-beta.7","20.0.0-beta.8","21.0.0-nightly.20220602","21.0.0-nightly.20220603","21.0.0-nightly.20220606","21.0.0-nightly.20220607","21.0.0-nightly.20220608","21.0.0-nightly.20220609","21.0.0-nightly.20220610","21.0.0-nightly.20220613","21.0.0-nightly.20220614","21.0.0-nightly.20220615","21.0.0-nightly.20220616","21.0.0-nightly.20220617","21.0.0-nightly.20220620","21.0.0-nightly.20220621","21.0.0-nightly.20220622","21.0.0-nightly.20220623","21.0.0-nightly.20220624","21.0.0-nightly.20220627"],"104.0.5112.39":["20.0.0-beta.9"],"104.0.5112.48":["20.0.0-beta.10","20.0.0-beta.11","20.0.0-beta.12"],"104.0.5112.57":["20.0.0-beta.13"],"104.0.5112.65":["20.0.0"],"104.0.5112.81":["20.0.1","20.0.2","20.0.3"],"104.0.5112.102":["20.1.0","20.1.1"],"104.0.5112.114":["20.1.2","20.1.3","20.1.4"],"104.0.5112.124":["20.2.0","20.3.0","20.3.1","20.3.2","20.3.3","20.3.4","20.3.5","20.3.6","20.3.7","20.3.8","20.3.9","20.3.10","20.3.11","20.3.12"],"105.0.5187.0":["21.0.0-alpha.1","21.0.0-alpha.2","21.0.0-alpha.3","21.0.0-alpha.4","21.0.0-alpha.5","21.0.0-nightly.20220720","21.0.0-nightly.20220721","21.0.0-nightly.20220722","21.0.0-nightly.20220725","21.0.0-nightly.20220726","21.0.0-nightly.20220727","21.0.0-nightly.20220728","21.0.0-nightly.20220801","21.0.0-nightly.20220802","22.0.0-nightly.20220808","22.0.0-nightly.20220809","22.0.0-nightly.20220810","22.0.0-nightly.20220811","22.0.0-nightly.20220812","22.0.0-nightly.20220815","22.0.0-nightly.20220816","22.0.0-nightly.20220817"],"106.0.5216.0":["21.0.0-alpha.6","21.0.0-beta.1","21.0.0-beta.2","21.0.0-beta.3","21.0.0-beta.4","21.0.0-beta.5","22.0.0-nightly.20220822","22.0.0-nightly.20220823","22.0.0-nightly.20220824","22.0.0-nightly.20220825","22.0.0-nightly.20220829","22.0.0-nightly.20220830","22.0.0-nightly.20220831","22.0.0-nightly.20220901","22.0.0-nightly.20220902","22.0.0-nightly.20220905"],"106.0.5249.40":["21.0.0-beta.6","21.0.0-beta.7","21.0.0-beta.8"],"105.0.5129.0":["21.0.0-nightly.20220628","21.0.0-nightly.20220629","21.0.0-nightly.20220630","21.0.0-nightly.20220701","21.0.0-nightly.20220704","21.0.0-nightly.20220705","21.0.0-nightly.20220706","21.0.0-nightly.20220707","21.0.0-nightly.20220708","21.0.0-nightly.20220711","21.0.0-nightly.20220712","21.0.0-nightly.20220713"],"105.0.5173.0":["21.0.0-nightly.20220715","21.0.0-nightly.20220718","21.0.0-nightly.20220719"],"106.0.5249.51":["21.0.0"],"106.0.5249.61":["21.0.1"],"106.0.5249.91":["21.1.0"],"106.0.5249.103":["21.1.1"],"106.0.5249.119":["21.2.0"],"106.0.5249.165":["21.2.1"],"106.0.5249.168":["21.2.2","21.2.3"],"106.0.5249.181":["21.3.0","21.3.1"],"106.0.5249.199":["21.3.3","21.3.4","21.3.5","21.4.0","21.4.1","21.4.2","21.4.3","21.4.4"],"107.0.5286.0":["22.0.0-alpha.1","22.0.0-nightly.20220909","22.0.0-nightly.20220912","22.0.0-nightly.20220913","22.0.0-nightly.20220914","22.0.0-nightly.20220915","22.0.0-nightly.20220916","22.0.0-nightly.20220919","22.0.0-nightly.20220920","22.0.0-nightly.20220921","22.0.0-nightly.20220922","22.0.0-nightly.20220923","22.0.0-nightly.20220926","22.0.0-nightly.20220927","22.0.0-nightly.20220928","23.0.0-nightly.20220929","23.0.0-nightly.20220930","23.0.0-nightly.20221003"],"108.0.5329.0":["22.0.0-alpha.3","22.0.0-alpha.4","22.0.0-alpha.5","22.0.0-alpha.6","23.0.0-nightly.20221004","23.0.0-nightly.20221005","23.0.0-nightly.20221006","23.0.0-nightly.20221007","23.0.0-nightly.20221010","23.0.0-nightly.20221011","23.0.0-nightly.20221012","23.0.0-nightly.20221013","23.0.0-nightly.20221014","23.0.0-nightly.20221017"],"108.0.5355.0":["22.0.0-alpha.7","23.0.0-nightly.20221018","23.0.0-nightly.20221019","23.0.0-nightly.20221020","23.0.0-nightly.20221021","23.0.0-nightly.20221024","23.0.0-nightly.20221026"],"108.0.5359.10":["22.0.0-alpha.8","22.0.0-beta.1","22.0.0-beta.2","22.0.0-beta.3"],"108.0.5359.29":["22.0.0-beta.4"],"108.0.5359.40":["22.0.0-beta.5","22.0.0-beta.6"],"108.0.5359.48":["22.0.0-beta.7","22.0.0-beta.8"],"107.0.5274.0":["22.0.0-nightly.20220908"],"108.0.5359.62":["22.0.0"],"108.0.5359.125":["22.0.1"],"108.0.5359.179":["22.0.2","22.0.3","22.1.0"],"108.0.5359.215":["22.2.0","22.2.1","22.3.0","22.3.1","22.3.2","22.3.3","22.3.4","22.3.5","22.3.6","22.3.7","22.3.8","22.3.9","22.3.10","22.3.11","22.3.12","22.3.13","22.3.14","22.3.15","22.3.16","22.3.17","22.3.18","22.3.20","22.3.21","22.3.22","22.3.23","22.3.24","22.3.25","22.3.26","22.3.27"],"110.0.5415.0":["23.0.0-alpha.1","23.0.0-nightly.20221118","23.0.0-nightly.20221121","23.0.0-nightly.20221122","23.0.0-nightly.20221123","23.0.0-nightly.20221124","23.0.0-nightly.20221125","23.0.0-nightly.20221128","23.0.0-nightly.20221129","23.0.0-nightly.20221130","24.0.0-nightly.20221201","24.0.0-nightly.20221202","24.0.0-nightly.20221205"],"110.0.5451.0":["23.0.0-alpha.2","23.0.0-alpha.3","24.0.0-nightly.20221206","24.0.0-nightly.20221207","24.0.0-nightly.20221208","24.0.0-nightly.20221213","24.0.0-nightly.20221214","24.0.0-nightly.20221215","24.0.0-nightly.20221216"],"110.0.5478.5":["23.0.0-beta.1","23.0.0-beta.2","23.0.0-beta.3"],"110.0.5481.30":["23.0.0-beta.4"],"110.0.5481.38":["23.0.0-beta.5"],"110.0.5481.52":["23.0.0-beta.6","23.0.0-beta.8"],"109.0.5382.0":["23.0.0-nightly.20221027","23.0.0-nightly.20221028","23.0.0-nightly.20221031","23.0.0-nightly.20221101","23.0.0-nightly.20221102","23.0.0-nightly.20221103","23.0.0-nightly.20221104","23.0.0-nightly.20221107","23.0.0-nightly.20221108","23.0.0-nightly.20221109","23.0.0-nightly.20221110","23.0.0-nightly.20221111","23.0.0-nightly.20221114","23.0.0-nightly.20221115","23.0.0-nightly.20221116","23.0.0-nightly.20221117"],"110.0.5481.77":["23.0.0"],"110.0.5481.100":["23.1.0"],"110.0.5481.104":["23.1.1"],"110.0.5481.177":["23.1.2"],"110.0.5481.179":["23.1.3"],"110.0.5481.192":["23.1.4","23.2.0"],"110.0.5481.208":["23.2.1","23.2.2","23.2.3","23.2.4","23.3.0","23.3.1","23.3.2","23.3.3","23.3.4","23.3.5","23.3.6","23.3.7","23.3.8","23.3.9","23.3.10","23.3.11","23.3.12","23.3.13"],"111.0.5560.0":["24.0.0-alpha.1","24.0.0-alpha.2","24.0.0-alpha.3","24.0.0-alpha.4","24.0.0-alpha.5","24.0.0-alpha.6","24.0.0-alpha.7","24.0.0-nightly.20230203","24.0.0-nightly.20230206","24.0.0-nightly.20230207","24.0.0-nightly.20230208","24.0.0-nightly.20230209","25.0.0-nightly.20230210","25.0.0-nightly.20230214","25.0.0-nightly.20230215","25.0.0-nightly.20230216","25.0.0-nightly.20230217","25.0.0-nightly.20230220","25.0.0-nightly.20230221","25.0.0-nightly.20230222","25.0.0-nightly.20230223","25.0.0-nightly.20230224","25.0.0-nightly.20230227","25.0.0-nightly.20230228","25.0.0-nightly.20230301","25.0.0-nightly.20230302","25.0.0-nightly.20230303","25.0.0-nightly.20230306","25.0.0-nightly.20230307","25.0.0-nightly.20230308","25.0.0-nightly.20230309","25.0.0-nightly.20230310"],"111.0.5563.50":["24.0.0-beta.1","24.0.0-beta.2"],"112.0.5615.20":["24.0.0-beta.3","24.0.0-beta.4"],"112.0.5615.29":["24.0.0-beta.5"],"112.0.5615.39":["24.0.0-beta.6","24.0.0-beta.7"],"111.0.5518.0":["24.0.0-nightly.20230109","24.0.0-nightly.20230110","24.0.0-nightly.20230111","24.0.0-nightly.20230112","24.0.0-nightly.20230113","24.0.0-nightly.20230116","24.0.0-nightly.20230117","24.0.0-nightly.20230118","24.0.0-nightly.20230119","24.0.0-nightly.20230120","24.0.0-nightly.20230123","24.0.0-nightly.20230124","24.0.0-nightly.20230125","24.0.0-nightly.20230126","24.0.0-nightly.20230127","24.0.0-nightly.20230131","24.0.0-nightly.20230201","24.0.0-nightly.20230202"],"112.0.5615.49":["24.0.0"],"112.0.5615.50":["24.1.0","24.1.1"],"112.0.5615.87":["24.1.2"],"112.0.5615.165":["24.1.3","24.2.0","24.3.0"],"112.0.5615.183":["24.3.1"],"112.0.5615.204":["24.4.0","24.4.1","24.5.0","24.5.1","24.6.0","24.6.1","24.6.2","24.6.3","24.6.4","24.6.5","24.7.0","24.7.1","24.8.0","24.8.1","24.8.2","24.8.3","24.8.4","24.8.5","24.8.6","24.8.7","24.8.8"],"114.0.5694.0":["25.0.0-alpha.1","25.0.0-alpha.2","25.0.0-nightly.20230405","26.0.0-nightly.20230406","26.0.0-nightly.20230407","26.0.0-nightly.20230410","26.0.0-nightly.20230411"],"114.0.5710.0":["25.0.0-alpha.3","25.0.0-alpha.4","26.0.0-nightly.20230413","26.0.0-nightly.20230414","26.0.0-nightly.20230417"],"114.0.5719.0":["25.0.0-alpha.5","25.0.0-alpha.6","25.0.0-beta.1","25.0.0-beta.2","25.0.0-beta.3","26.0.0-nightly.20230421","26.0.0-nightly.20230424","26.0.0-nightly.20230425","26.0.0-nightly.20230426","26.0.0-nightly.20230427","26.0.0-nightly.20230428","26.0.0-nightly.20230501","26.0.0-nightly.20230502","26.0.0-nightly.20230503","26.0.0-nightly.20230504","26.0.0-nightly.20230505","26.0.0-nightly.20230508","26.0.0-nightly.20230509","26.0.0-nightly.20230510"],"114.0.5735.16":["25.0.0-beta.4","25.0.0-beta.5","25.0.0-beta.6","25.0.0-beta.7"],"114.0.5735.35":["25.0.0-beta.8"],"114.0.5735.45":["25.0.0-beta.9","25.0.0","25.0.1"],"113.0.5636.0":["25.0.0-nightly.20230314"],"113.0.5651.0":["25.0.0-nightly.20230315"],"113.0.5653.0":["25.0.0-nightly.20230317"],"113.0.5660.0":["25.0.0-nightly.20230320"],"113.0.5664.0":["25.0.0-nightly.20230321"],"113.0.5666.0":["25.0.0-nightly.20230322"],"113.0.5668.0":["25.0.0-nightly.20230323"],"113.0.5670.0":["25.0.0-nightly.20230324","25.0.0-nightly.20230327","25.0.0-nightly.20230328","25.0.0-nightly.20230329","25.0.0-nightly.20230330"],"114.0.5684.0":["25.0.0-nightly.20230331","25.0.0-nightly.20230403"],"114.0.5692.0":["25.0.0-nightly.20230404"],"114.0.5735.106":["25.1.0","25.1.1"],"114.0.5735.134":["25.2.0"],"114.0.5735.199":["25.3.0"],"114.0.5735.243":["25.3.1"],"114.0.5735.248":["25.3.2","25.4.0"],"114.0.5735.289":["25.5.0","25.6.0","25.7.0","25.8.0","25.8.1","25.8.2","25.8.3","25.8.4","25.9.0","25.9.1","25.9.2","25.9.3","25.9.4","25.9.5","25.9.6","25.9.7"],"116.0.5791.0":["26.0.0-alpha.1","26.0.0-alpha.2","26.0.0-alpha.3","26.0.0-alpha.4","26.0.0-alpha.5","26.0.0-nightly.20230526","26.0.0-nightly.20230529","26.0.0-nightly.20230530","26.0.0-nightly.20230531","27.0.0-nightly.20230601","27.0.0-nightly.20230602","27.0.0-nightly.20230605","27.0.0-nightly.20230606","27.0.0-nightly.20230607","27.0.0-nightly.20230609"],"116.0.5815.0":["26.0.0-alpha.6","27.0.0-nightly.20230612","27.0.0-nightly.20230613"],"116.0.5831.0":["26.0.0-alpha.7","27.0.0-nightly.20230615"],"116.0.5845.0":["26.0.0-alpha.8","26.0.0-beta.1","27.0.0-nightly.20230622","27.0.0-nightly.20230623","27.0.0-nightly.20230626","27.0.0-nightly.20230627","27.0.0-nightly.20230628","27.0.0-nightly.20230629","27.0.0-nightly.20230630"],"116.0.5845.14":["26.0.0-beta.2","26.0.0-beta.3","26.0.0-beta.4","26.0.0-beta.5","26.0.0-beta.6","26.0.0-beta.7"],"116.0.5845.42":["26.0.0-beta.8","26.0.0-beta.9"],"116.0.5845.49":["26.0.0-beta.10","26.0.0-beta.11"],"116.0.5845.62":["26.0.0-beta.12"],"114.0.5708.0":["26.0.0-nightly.20230412"],"114.0.5715.0":["26.0.0-nightly.20230418"],"115.0.5760.0":["26.0.0-nightly.20230511","26.0.0-nightly.20230512","26.0.0-nightly.20230515","26.0.0-nightly.20230516","26.0.0-nightly.20230517","26.0.0-nightly.20230518","26.0.0-nightly.20230519","26.0.0-nightly.20230522","26.0.0-nightly.20230523"],"115.0.5786.0":["26.0.0-nightly.20230524"],"115.0.5790.0":["26.0.0-nightly.20230525"],"116.0.5845.82":["26.0.0"],"116.0.5845.97":["26.1.0"],"116.0.5845.179":["26.2.0"],"116.0.5845.188":["26.2.1"],"116.0.5845.190":["26.2.2","26.2.3","26.2.4"],"116.0.5845.228":["26.3.0","26.4.0","26.4.1","26.4.2","26.4.3","26.5.0","26.6.0","26.6.1","26.6.2"],"118.0.5949.0":["27.0.0-alpha.1","27.0.0-alpha.2","27.0.0-alpha.3","27.0.0-alpha.4","27.0.0-alpha.5","27.0.0-alpha.6","27.0.0-nightly.20230816","28.0.0-nightly.20230817","28.0.0-nightly.20230818","28.0.0-nightly.20230821","28.0.0-nightly.20230822","28.0.0-nightly.20230823","28.0.0-nightly.20230824","28.0.0-nightly.20230825","28.0.0-nightly.20230828","28.0.0-nightly.20230829","28.0.0-nightly.20230830","28.0.0-nightly.20230831"],"118.0.5993.5":["27.0.0-beta.1","27.0.0-beta.2","27.0.0-beta.3"],"118.0.5993.11":["27.0.0-beta.4"],"118.0.5993.18":["27.0.0-beta.5","27.0.0-beta.6","27.0.0-beta.7","27.0.0-beta.8","27.0.0-beta.9"],"116.0.5829.0":["27.0.0-nightly.20230614"],"116.0.5833.0":["27.0.0-nightly.20230616","27.0.0-nightly.20230619","27.0.0-nightly.20230620","27.0.0-nightly.20230621"],"117.0.5852.0":["27.0.0-nightly.20230703","27.0.0-nightly.20230704","27.0.0-nightly.20230705","27.0.0-nightly.20230706","27.0.0-nightly.20230707","27.0.0-nightly.20230710","27.0.0-nightly.20230711","27.0.0-nightly.20230712","27.0.0-nightly.20230713","27.0.0-nightly.20230714"],"117.0.5884.1":["27.0.0-nightly.20230717","27.0.0-nightly.20230718"],"117.0.5892.0":["27.0.0-nightly.20230719"],"117.0.5897.0":["27.0.0-nightly.20230720","27.0.0-nightly.20230721","27.0.0-nightly.20230724","27.0.0-nightly.20230725","27.0.0-nightly.20230726","27.0.0-nightly.20230727","27.0.0-nightly.20230728","27.0.0-nightly.20230731"],"117.0.5911.0":["27.0.0-nightly.20230801","27.0.0-nightly.20230802","27.0.0-nightly.20230803"],"117.0.5921.0":["27.0.0-nightly.20230804","27.0.0-nightly.20230807","27.0.0-nightly.20230808","27.0.0-nightly.20230814","27.0.0-nightly.20230815"],"118.0.5993.54":["27.0.0"],"118.0.5993.89":["27.0.1","27.0.2"],"118.0.5993.120":["27.0.3"],"118.0.5993.129":["27.0.4"],"118.0.5993.144":["27.1.0","27.1.2"],"118.0.5993.159":["27.1.3"],"119.0.6045.0":["28.0.0-alpha.1","28.0.0-alpha.2","28.0.0-nightly.20231006","28.0.0-nightly.20231009","28.0.0-nightly.20231010","28.0.0-nightly.20231011","29.0.0-nightly.20231012","29.0.0-nightly.20231013","29.0.0-nightly.20231016","29.0.0-nightly.20231017","29.0.0-nightly.20231018","29.0.0-nightly.20231019","29.0.0-nightly.20231020","29.0.0-nightly.20231023","29.0.0-nightly.20231024"],"119.0.6045.21":["28.0.0-alpha.3","28.0.0-alpha.4"],"119.0.6045.33":["28.0.0-alpha.5","28.0.0-alpha.6","28.0.0-alpha.7","28.0.0-beta.1"],"120.0.6099.0":["28.0.0-beta.2"],"120.0.6099.5":["28.0.0-beta.3","28.0.0-beta.4"],"120.0.6099.18":["28.0.0-beta.5","28.0.0-beta.6","28.0.0-beta.7","28.0.0-beta.8","28.0.0-beta.9","28.0.0-beta.10"],"120.0.6099.35":["28.0.0-beta.11"],"118.0.5991.0":["28.0.0-nightly.20230906"],"118.0.5993.0":["28.0.0-nightly.20230907","28.0.0-nightly.20230908","28.0.0-nightly.20230911","28.0.0-nightly.20230912","28.0.0-nightly.20230913","28.0.0-nightly.20230914","28.0.0-nightly.20230915"],"119.0.6006.0":["28.0.0-nightly.20230919"],"119.0.6017.0":["28.0.0-nightly.20230920"],"119.0.6019.2":["28.0.0-nightly.20230921","28.0.0-nightly.20230925","28.0.0-nightly.20230926","28.0.0-nightly.20230927","28.0.0-nightly.20230928"],"119.0.6029.0":["28.0.0-nightly.20230929","28.0.0-nightly.20231002"],"119.0.6043.0":["28.0.0-nightly.20231003","28.0.0-nightly.20231004","28.0.0-nightly.20231005"],"120.0.6078.0":["29.0.0-nightly.20231025","29.0.0-nightly.20231026","29.0.0-nightly.20231027","29.0.0-nightly.20231030","29.0.0-nightly.20231031","29.0.0-nightly.20231101"],"121.0.6100.0":["29.0.0-nightly.20231102","29.0.0-nightly.20231103"],"121.0.6104.0":["29.0.0-nightly.20231106"],"121.0.6110.0":["29.0.0-nightly.20231107","29.0.0-nightly.20231108","29.0.0-nightly.20231109","29.0.0-nightly.20231110","29.0.0-nightly.20231113","29.0.0-nightly.20231114"],"121.0.6116.0":["29.0.0-nightly.20231115","29.0.0-nightly.20231116","29.0.0-nightly.20231117","29.0.0-nightly.20231120","29.0.0-nightly.20231121","29.0.0-nightly.20231122","29.0.0-nightly.20231123","29.0.0-nightly.20231124","29.0.0-nightly.20231127","29.0.0-nightly.20231128"],"121.0.6147.0":["29.0.0-nightly.20231129","29.0.0-nightly.20231130","29.0.0-nightly.20231201"]} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js index bf87afdc6f6687..2465f89719adab 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js @@ -1921,6 +1921,8 @@ module.exports = { "25.9.3": "114.0.5735.289", "25.9.4": "114.0.5735.289", "25.9.5": "114.0.5735.289", + "25.9.6": "114.0.5735.289", + "25.9.7": "114.0.5735.289", "26.0.0-alpha.1": "116.0.5791.0", "26.0.0-alpha.2": "116.0.5791.0", "26.0.0-alpha.3": "116.0.5791.0", @@ -1993,6 +1995,8 @@ module.exports = { "26.4.3": "116.0.5845.228", "26.5.0": "116.0.5845.228", "26.6.0": "116.0.5845.228", + "26.6.1": "116.0.5845.228", + "26.6.2": "116.0.5845.228", "27.0.0-alpha.1": "118.0.5949.0", "27.0.0-alpha.2": "118.0.5949.0", "27.0.0-alpha.3": "118.0.5949.0", @@ -2065,6 +2069,8 @@ module.exports = { "27.0.3": "118.0.5993.120", "27.0.4": "118.0.5993.129", "27.1.0": "118.0.5993.144", + "27.1.2": "118.0.5993.144", + "27.1.3": "118.0.5993.159", "28.0.0-alpha.1": "119.0.6045.0", "28.0.0-alpha.2": "119.0.6045.0", "28.0.0-alpha.3": "119.0.6045.21", @@ -2079,6 +2085,10 @@ module.exports = { "28.0.0-beta.5": "120.0.6099.18", "28.0.0-beta.6": "120.0.6099.18", "28.0.0-beta.7": "120.0.6099.18", + "28.0.0-beta.8": "120.0.6099.18", + "28.0.0-beta.9": "120.0.6099.18", + "28.0.0-beta.10": "120.0.6099.18", + "28.0.0-beta.11": "120.0.6099.35", "28.0.0-nightly.20230817": "118.0.5949.0", "28.0.0-nightly.20230818": "118.0.5949.0", "28.0.0-nightly.20230821": "118.0.5949.0", @@ -2140,5 +2150,15 @@ module.exports = { "29.0.0-nightly.20231114": "121.0.6110.0", "29.0.0-nightly.20231115": "121.0.6116.0", "29.0.0-nightly.20231116": "121.0.6116.0", - "29.0.0-nightly.20231117": "121.0.6116.0" + "29.0.0-nightly.20231117": "121.0.6116.0", + "29.0.0-nightly.20231120": "121.0.6116.0", + "29.0.0-nightly.20231121": "121.0.6116.0", + "29.0.0-nightly.20231122": "121.0.6116.0", + "29.0.0-nightly.20231123": "121.0.6116.0", + "29.0.0-nightly.20231124": "121.0.6116.0", + "29.0.0-nightly.20231127": "121.0.6116.0", + "29.0.0-nightly.20231128": "121.0.6116.0", + "29.0.0-nightly.20231129": "121.0.6147.0", + "29.0.0-nightly.20231130": "121.0.6147.0", + "29.0.0-nightly.20231201": "121.0.6147.0" }; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json index dcdef7131c8182..1470e3b28ff1be 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json @@ -1 +1 @@ -{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8-nightly.20180819":"61.0.3163.100","2.0.8-nightly.20180820":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.100","3.0.0-beta.1":"66.0.3359.181","3.0.0-beta.2":"66.0.3359.181","3.0.0-beta.3":"66.0.3359.181","3.0.0-beta.4":"66.0.3359.181","3.0.0-beta.5":"66.0.3359.181","3.0.0-beta.6":"66.0.3359.181","3.0.0-beta.7":"66.0.3359.181","3.0.0-beta.8":"66.0.3359.181","3.0.0-beta.9":"66.0.3359.181","3.0.0-beta.10":"66.0.3359.181","3.0.0-beta.11":"66.0.3359.181","3.0.0-beta.12":"66.0.3359.181","3.0.0-beta.13":"66.0.3359.181","3.0.0-nightly.20180818":"66.0.3359.181","3.0.0-nightly.20180821":"66.0.3359.181","3.0.0-nightly.20180823":"66.0.3359.181","3.0.0-nightly.20180904":"66.0.3359.181","3.0.0":"66.0.3359.181","3.0.1":"66.0.3359.181","3.0.2":"66.0.3359.181","3.0.3":"66.0.3359.181","3.0.4":"66.0.3359.181","3.0.5":"66.0.3359.181","3.0.6":"66.0.3359.181","3.0.7":"66.0.3359.181","3.0.8":"66.0.3359.181","3.0.9":"66.0.3359.181","3.0.10":"66.0.3359.181","3.0.11":"66.0.3359.181","3.0.12":"66.0.3359.181","3.0.13":"66.0.3359.181","3.0.14":"66.0.3359.181","3.0.15":"66.0.3359.181","3.0.16":"66.0.3359.181","3.1.0-beta.1":"66.0.3359.181","3.1.0-beta.2":"66.0.3359.181","3.1.0-beta.3":"66.0.3359.181","3.1.0-beta.4":"66.0.3359.181","3.1.0-beta.5":"66.0.3359.181","3.1.0":"66.0.3359.181","3.1.1":"66.0.3359.181","3.1.2":"66.0.3359.181","3.1.3":"66.0.3359.181","3.1.4":"66.0.3359.181","3.1.5":"66.0.3359.181","3.1.6":"66.0.3359.181","3.1.7":"66.0.3359.181","3.1.8":"66.0.3359.181","3.1.9":"66.0.3359.181","3.1.10":"66.0.3359.181","3.1.11":"66.0.3359.181","3.1.12":"66.0.3359.181","3.1.13":"66.0.3359.181","4.0.0-beta.1":"69.0.3497.106","4.0.0-beta.2":"69.0.3497.106","4.0.0-beta.3":"69.0.3497.106","4.0.0-beta.4":"69.0.3497.106","4.0.0-beta.5":"69.0.3497.106","4.0.0-beta.6":"69.0.3497.106","4.0.0-beta.7":"69.0.3497.106","4.0.0-beta.8":"69.0.3497.106","4.0.0-beta.9":"69.0.3497.106","4.0.0-beta.10":"69.0.3497.106","4.0.0-beta.11":"69.0.3497.106","4.0.0-nightly.20180817":"66.0.3359.181","4.0.0-nightly.20180819":"66.0.3359.181","4.0.0-nightly.20180821":"66.0.3359.181","4.0.0-nightly.20180929":"67.0.3396.99","4.0.0-nightly.20181006":"68.0.3440.128","4.0.0-nightly.20181010":"69.0.3497.106","4.0.0":"69.0.3497.106","4.0.1":"69.0.3497.106","4.0.2":"69.0.3497.106","4.0.3":"69.0.3497.106","4.0.4":"69.0.3497.106","4.0.5":"69.0.3497.106","4.0.6":"69.0.3497.106","4.0.7":"69.0.3497.128","4.0.8":"69.0.3497.128","4.1.0":"69.0.3497.128","4.1.1":"69.0.3497.128","4.1.2":"69.0.3497.128","4.1.3":"69.0.3497.128","4.1.4":"69.0.3497.128","4.1.5":"69.0.3497.128","4.2.0":"69.0.3497.128","4.2.1":"69.0.3497.128","4.2.2":"69.0.3497.128","4.2.3":"69.0.3497.128","4.2.4":"69.0.3497.128","4.2.5":"69.0.3497.128","4.2.6":"69.0.3497.128","4.2.7":"69.0.3497.128","4.2.8":"69.0.3497.128","4.2.9":"69.0.3497.128","4.2.10":"69.0.3497.128","4.2.11":"69.0.3497.128","4.2.12":"69.0.3497.128","5.0.0-beta.1":"72.0.3626.52","5.0.0-beta.2":"72.0.3626.52","5.0.0-beta.3":"73.0.3683.27","5.0.0-beta.4":"73.0.3683.54","5.0.0-beta.5":"73.0.3683.61","5.0.0-beta.6":"73.0.3683.84","5.0.0-beta.7":"73.0.3683.94","5.0.0-beta.8":"73.0.3683.104","5.0.0-beta.9":"73.0.3683.117","5.0.0-nightly.20190107":"70.0.3538.110","5.0.0-nightly.20190121":"71.0.3578.98","5.0.0-nightly.20190122":"71.0.3578.98","5.0.0":"73.0.3683.119","5.0.1":"73.0.3683.121","5.0.2":"73.0.3683.121","5.0.3":"73.0.3683.121","5.0.4":"73.0.3683.121","5.0.5":"73.0.3683.121","5.0.6":"73.0.3683.121","5.0.7":"73.0.3683.121","5.0.8":"73.0.3683.121","5.0.9":"73.0.3683.121","5.0.10":"73.0.3683.121","5.0.11":"73.0.3683.121","5.0.12":"73.0.3683.121","5.0.13":"73.0.3683.121","6.0.0-beta.1":"76.0.3774.1","6.0.0-beta.2":"76.0.3783.1","6.0.0-beta.3":"76.0.3783.1","6.0.0-beta.4":"76.0.3783.1","6.0.0-beta.5":"76.0.3805.4","6.0.0-beta.6":"76.0.3809.3","6.0.0-beta.7":"76.0.3809.22","6.0.0-beta.8":"76.0.3809.26","6.0.0-beta.9":"76.0.3809.26","6.0.0-beta.10":"76.0.3809.37","6.0.0-beta.11":"76.0.3809.42","6.0.0-beta.12":"76.0.3809.54","6.0.0-beta.13":"76.0.3809.60","6.0.0-beta.14":"76.0.3809.68","6.0.0-beta.15":"76.0.3809.74","6.0.0-nightly.20190123":"72.0.3626.52","6.0.0-nightly.20190212":"72.0.3626.107","6.0.0-nightly.20190213":"72.0.3626.110","6.0.0-nightly.20190311":"74.0.3724.8","6.0.0":"76.0.3809.88","6.0.1":"76.0.3809.102","6.0.2":"76.0.3809.110","6.0.3":"76.0.3809.126","6.0.4":"76.0.3809.131","6.0.5":"76.0.3809.136","6.0.6":"76.0.3809.138","6.0.7":"76.0.3809.139","6.0.8":"76.0.3809.146","6.0.9":"76.0.3809.146","6.0.10":"76.0.3809.146","6.0.11":"76.0.3809.146","6.0.12":"76.0.3809.146","6.1.0":"76.0.3809.146","6.1.1":"76.0.3809.146","6.1.2":"76.0.3809.146","6.1.3":"76.0.3809.146","6.1.4":"76.0.3809.146","6.1.5":"76.0.3809.146","6.1.6":"76.0.3809.146","6.1.7":"76.0.3809.146","6.1.8":"76.0.3809.146","6.1.9":"76.0.3809.146","6.1.10":"76.0.3809.146","6.1.11":"76.0.3809.146","6.1.12":"76.0.3809.146","7.0.0-beta.1":"78.0.3866.0","7.0.0-beta.2":"78.0.3866.0","7.0.0-beta.3":"78.0.3866.0","7.0.0-beta.4":"78.0.3896.6","7.0.0-beta.5":"78.0.3905.1","7.0.0-beta.6":"78.0.3905.1","7.0.0-beta.7":"78.0.3905.1","7.0.0-nightly.20190521":"76.0.3784.0","7.0.0-nightly.20190529":"76.0.3806.0","7.0.0-nightly.20190530":"76.0.3806.0","7.0.0-nightly.20190531":"76.0.3806.0","7.0.0-nightly.20190602":"76.0.3806.0","7.0.0-nightly.20190603":"76.0.3806.0","7.0.0-nightly.20190604":"77.0.3814.0","7.0.0-nightly.20190605":"77.0.3815.0","7.0.0-nightly.20190606":"77.0.3815.0","7.0.0-nightly.20190607":"77.0.3815.0","7.0.0-nightly.20190608":"77.0.3815.0","7.0.0-nightly.20190609":"77.0.3815.0","7.0.0-nightly.20190611":"77.0.3815.0","7.0.0-nightly.20190612":"77.0.3815.0","7.0.0-nightly.20190613":"77.0.3815.0","7.0.0-nightly.20190615":"77.0.3815.0","7.0.0-nightly.20190616":"77.0.3815.0","7.0.0-nightly.20190618":"77.0.3815.0","7.0.0-nightly.20190619":"77.0.3815.0","7.0.0-nightly.20190622":"77.0.3815.0","7.0.0-nightly.20190623":"77.0.3815.0","7.0.0-nightly.20190624":"77.0.3815.0","7.0.0-nightly.20190627":"77.0.3815.0","7.0.0-nightly.20190629":"77.0.3815.0","7.0.0-nightly.20190630":"77.0.3815.0","7.0.0-nightly.20190701":"77.0.3815.0","7.0.0-nightly.20190702":"77.0.3815.0","7.0.0-nightly.20190704":"77.0.3843.0","7.0.0-nightly.20190705":"77.0.3843.0","7.0.0-nightly.20190719":"77.0.3848.0","7.0.0-nightly.20190720":"77.0.3848.0","7.0.0-nightly.20190721":"77.0.3848.0","7.0.0-nightly.20190726":"77.0.3864.0","7.0.0-nightly.20190727":"78.0.3866.0","7.0.0-nightly.20190728":"78.0.3866.0","7.0.0-nightly.20190729":"78.0.3866.0","7.0.0-nightly.20190730":"78.0.3866.0","7.0.0-nightly.20190731":"78.0.3866.0","7.0.0":"78.0.3905.1","7.0.1":"78.0.3904.92","7.1.0":"78.0.3904.94","7.1.1":"78.0.3904.99","7.1.2":"78.0.3904.113","7.1.3":"78.0.3904.126","7.1.4":"78.0.3904.130","7.1.5":"78.0.3904.130","7.1.6":"78.0.3904.130","7.1.7":"78.0.3904.130","7.1.8":"78.0.3904.130","7.1.9":"78.0.3904.130","7.1.10":"78.0.3904.130","7.1.11":"78.0.3904.130","7.1.12":"78.0.3904.130","7.1.13":"78.0.3904.130","7.1.14":"78.0.3904.130","7.2.0":"78.0.3904.130","7.2.1":"78.0.3904.130","7.2.2":"78.0.3904.130","7.2.3":"78.0.3904.130","7.2.4":"78.0.3904.130","7.3.0":"78.0.3904.130","7.3.1":"78.0.3904.130","7.3.2":"78.0.3904.130","7.3.3":"78.0.3904.130","8.0.0-beta.1":"79.0.3931.0","8.0.0-beta.2":"79.0.3931.0","8.0.0-beta.3":"80.0.3955.0","8.0.0-beta.4":"80.0.3955.0","8.0.0-beta.5":"80.0.3987.14","8.0.0-beta.6":"80.0.3987.51","8.0.0-beta.7":"80.0.3987.59","8.0.0-beta.8":"80.0.3987.75","8.0.0-beta.9":"80.0.3987.75","8.0.0-nightly.20190801":"78.0.3866.0","8.0.0-nightly.20190802":"78.0.3866.0","8.0.0-nightly.20190803":"78.0.3871.0","8.0.0-nightly.20190806":"78.0.3871.0","8.0.0-nightly.20190807":"78.0.3871.0","8.0.0-nightly.20190808":"78.0.3871.0","8.0.0-nightly.20190809":"78.0.3871.0","8.0.0-nightly.20190810":"78.0.3871.0","8.0.0-nightly.20190811":"78.0.3871.0","8.0.0-nightly.20190812":"78.0.3871.0","8.0.0-nightly.20190813":"78.0.3871.0","8.0.0-nightly.20190814":"78.0.3871.0","8.0.0-nightly.20190815":"78.0.3871.0","8.0.0-nightly.20190816":"78.0.3881.0","8.0.0-nightly.20190817":"78.0.3881.0","8.0.0-nightly.20190818":"78.0.3881.0","8.0.0-nightly.20190819":"78.0.3881.0","8.0.0-nightly.20190820":"78.0.3881.0","8.0.0-nightly.20190824":"78.0.3892.0","8.0.0-nightly.20190825":"78.0.3892.0","8.0.0-nightly.20190827":"78.0.3892.0","8.0.0-nightly.20190828":"78.0.3892.0","8.0.0-nightly.20190830":"78.0.3892.0","8.0.0-nightly.20190901":"78.0.3892.0","8.0.0-nightly.20190902":"78.0.3892.0","8.0.0-nightly.20190907":"78.0.3892.0","8.0.0-nightly.20190909":"78.0.3892.0","8.0.0-nightly.20190910":"78.0.3892.0","8.0.0-nightly.20190911":"78.0.3892.0","8.0.0-nightly.20190912":"78.0.3892.0","8.0.0-nightly.20190913":"78.0.3892.0","8.0.0-nightly.20190914":"78.0.3892.0","8.0.0-nightly.20190915":"78.0.3892.0","8.0.0-nightly.20190917":"78.0.3892.0","8.0.0-nightly.20190919":"79.0.3915.0","8.0.0-nightly.20190920":"79.0.3915.0","8.0.0-nightly.20190922":"79.0.3919.0","8.0.0-nightly.20190923":"79.0.3919.0","8.0.0-nightly.20190924":"79.0.3919.0","8.0.0-nightly.20190926":"79.0.3919.0","8.0.0-nightly.20190928":"79.0.3919.0","8.0.0-nightly.20190929":"79.0.3919.0","8.0.0-nightly.20190930":"79.0.3919.0","8.0.0-nightly.20191001":"79.0.3919.0","8.0.0-nightly.20191004":"79.0.3919.0","8.0.0-nightly.20191005":"79.0.3919.0","8.0.0-nightly.20191006":"79.0.3919.0","8.0.0-nightly.20191009":"79.0.3919.0","8.0.0-nightly.20191011":"79.0.3919.0","8.0.0-nightly.20191012":"79.0.3919.0","8.0.0-nightly.20191017":"79.0.3919.0","8.0.0-nightly.20191019":"79.0.3931.0","8.0.0-nightly.20191020":"79.0.3931.0","8.0.0-nightly.20191021":"79.0.3931.0","8.0.0-nightly.20191023":"79.0.3931.0","8.0.0-nightly.20191101":"80.0.3952.0","8.0.0-nightly.20191103":"80.0.3952.0","8.0.0-nightly.20191105":"80.0.3952.0","8.0.0":"80.0.3987.86","8.0.1":"80.0.3987.86","8.0.2":"80.0.3987.86","8.0.3":"80.0.3987.134","8.1.0":"80.0.3987.137","8.1.1":"80.0.3987.141","8.2.0":"80.0.3987.158","8.2.1":"80.0.3987.163","8.2.2":"80.0.3987.163","8.2.3":"80.0.3987.163","8.2.4":"80.0.3987.165","8.2.5":"80.0.3987.165","8.3.0":"80.0.3987.165","8.3.1":"80.0.3987.165","8.3.2":"80.0.3987.165","8.3.3":"80.0.3987.165","8.3.4":"80.0.3987.165","8.4.0":"80.0.3987.165","8.4.1":"80.0.3987.165","8.5.0":"80.0.3987.165","8.5.1":"80.0.3987.165","8.5.2":"80.0.3987.165","8.5.3":"80.0.3987.163","8.5.4":"80.0.3987.163","8.5.5":"80.0.3987.163","9.0.0-beta.1":"82.0.4048.0","9.0.0-beta.2":"82.0.4048.0","9.0.0-beta.3":"82.0.4048.0","9.0.0-beta.4":"82.0.4048.0","9.0.0-beta.5":"82.0.4048.0","9.0.0-beta.6":"82.0.4058.2","9.0.0-beta.7":"82.0.4058.2","9.0.0-beta.9":"82.0.4058.2","9.0.0-beta.10":"82.0.4085.10","9.0.0-beta.11":"82.0.4085.14","9.0.0-beta.12":"82.0.4085.14","9.0.0-beta.13":"82.0.4085.14","9.0.0-beta.14":"82.0.4085.27","9.0.0-beta.15":"83.0.4102.3","9.0.0-beta.16":"83.0.4102.3","9.0.0-beta.17":"83.0.4103.14","9.0.0-beta.18":"83.0.4103.16","9.0.0-beta.19":"83.0.4103.24","9.0.0-beta.20":"83.0.4103.26","9.0.0-beta.21":"83.0.4103.26","9.0.0-beta.22":"83.0.4103.34","9.0.0-beta.23":"83.0.4103.44","9.0.0-beta.24":"83.0.4103.45","9.0.0-nightly.20191121":"80.0.3954.0","9.0.0-nightly.20191122":"80.0.3954.0","9.0.0-nightly.20191123":"80.0.3954.0","9.0.0-nightly.20191124":"80.0.3954.0","9.0.0-nightly.20191126":"80.0.3954.0","9.0.0-nightly.20191128":"80.0.3954.0","9.0.0-nightly.20191129":"80.0.3954.0","9.0.0-nightly.20191130":"80.0.3954.0","9.0.0-nightly.20191201":"80.0.3954.0","9.0.0-nightly.20191202":"80.0.3954.0","9.0.0-nightly.20191203":"80.0.3954.0","9.0.0-nightly.20191204":"80.0.3954.0","9.0.0-nightly.20191205":"80.0.3954.0","9.0.0-nightly.20191210":"80.0.3954.0","9.0.0-nightly.20191220":"81.0.3994.0","9.0.0-nightly.20191221":"81.0.3994.0","9.0.0-nightly.20191222":"81.0.3994.0","9.0.0-nightly.20191223":"81.0.3994.0","9.0.0-nightly.20191224":"81.0.3994.0","9.0.0-nightly.20191225":"81.0.3994.0","9.0.0-nightly.20191226":"81.0.3994.0","9.0.0-nightly.20191228":"81.0.3994.0","9.0.0-nightly.20191229":"81.0.3994.0","9.0.0-nightly.20191230":"81.0.3994.0","9.0.0-nightly.20191231":"81.0.3994.0","9.0.0-nightly.20200101":"81.0.3994.0","9.0.0-nightly.20200103":"81.0.3994.0","9.0.0-nightly.20200104":"81.0.3994.0","9.0.0-nightly.20200105":"81.0.3994.0","9.0.0-nightly.20200106":"81.0.3994.0","9.0.0-nightly.20200108":"81.0.3994.0","9.0.0-nightly.20200109":"81.0.3994.0","9.0.0-nightly.20200110":"81.0.3994.0","9.0.0-nightly.20200111":"81.0.3994.0","9.0.0-nightly.20200113":"81.0.3994.0","9.0.0-nightly.20200115":"81.0.3994.0","9.0.0-nightly.20200116":"81.0.3994.0","9.0.0-nightly.20200117":"81.0.3994.0","9.0.0-nightly.20200119":"81.0.4030.0","9.0.0-nightly.20200121":"81.0.4030.0","9.0.0":"83.0.4103.64","9.0.1":"83.0.4103.94","9.0.2":"83.0.4103.94","9.0.3":"83.0.4103.100","9.0.4":"83.0.4103.104","9.0.5":"83.0.4103.119","9.1.0":"83.0.4103.122","9.1.1":"83.0.4103.122","9.1.2":"83.0.4103.122","9.2.0":"83.0.4103.122","9.2.1":"83.0.4103.122","9.3.0":"83.0.4103.122","9.3.1":"83.0.4103.122","9.3.2":"83.0.4103.122","9.3.3":"83.0.4103.122","9.3.4":"83.0.4103.122","9.3.5":"83.0.4103.122","9.4.0":"83.0.4103.122","9.4.1":"83.0.4103.122","9.4.2":"83.0.4103.122","9.4.3":"83.0.4103.122","9.4.4":"83.0.4103.122","10.0.0-beta.1":"84.0.4129.0","10.0.0-beta.2":"84.0.4129.0","10.0.0-beta.3":"85.0.4161.2","10.0.0-beta.4":"85.0.4161.2","10.0.0-beta.8":"85.0.4181.1","10.0.0-beta.9":"85.0.4181.1","10.0.0-beta.10":"85.0.4183.19","10.0.0-beta.11":"85.0.4183.20","10.0.0-beta.12":"85.0.4183.26","10.0.0-beta.13":"85.0.4183.39","10.0.0-beta.14":"85.0.4183.39","10.0.0-beta.15":"85.0.4183.39","10.0.0-beta.17":"85.0.4183.39","10.0.0-beta.19":"85.0.4183.39","10.0.0-beta.20":"85.0.4183.39","10.0.0-beta.21":"85.0.4183.39","10.0.0-beta.23":"85.0.4183.70","10.0.0-beta.24":"85.0.4183.78","10.0.0-beta.25":"85.0.4183.80","10.0.0-nightly.20200209":"82.0.4050.0","10.0.0-nightly.20200210":"82.0.4050.0","10.0.0-nightly.20200211":"82.0.4050.0","10.0.0-nightly.20200216":"82.0.4050.0","10.0.0-nightly.20200217":"82.0.4050.0","10.0.0-nightly.20200218":"82.0.4050.0","10.0.0-nightly.20200221":"82.0.4050.0","10.0.0-nightly.20200222":"82.0.4050.0","10.0.0-nightly.20200223":"82.0.4050.0","10.0.0-nightly.20200226":"82.0.4050.0","10.0.0-nightly.20200303":"82.0.4050.0","10.0.0-nightly.20200304":"82.0.4076.0","10.0.0-nightly.20200305":"82.0.4076.0","10.0.0-nightly.20200306":"82.0.4076.0","10.0.0-nightly.20200309":"82.0.4076.0","10.0.0-nightly.20200310":"82.0.4076.0","10.0.0-nightly.20200311":"82.0.4083.0","10.0.0-nightly.20200316":"83.0.4086.0","10.0.0-nightly.20200317":"83.0.4087.0","10.0.0-nightly.20200318":"83.0.4087.0","10.0.0-nightly.20200320":"83.0.4087.0","10.0.0-nightly.20200323":"83.0.4087.0","10.0.0-nightly.20200324":"83.0.4087.0","10.0.0-nightly.20200325":"83.0.4087.0","10.0.0-nightly.20200326":"83.0.4087.0","10.0.0-nightly.20200327":"83.0.4087.0","10.0.0-nightly.20200330":"83.0.4087.0","10.0.0-nightly.20200331":"83.0.4087.0","10.0.0-nightly.20200401":"83.0.4087.0","10.0.0-nightly.20200402":"83.0.4087.0","10.0.0-nightly.20200403":"83.0.4087.0","10.0.0-nightly.20200406":"83.0.4087.0","10.0.0-nightly.20200408":"83.0.4095.0","10.0.0-nightly.20200410":"83.0.4095.0","10.0.0-nightly.20200413":"83.0.4095.0","10.0.0-nightly.20200414":"84.0.4114.0","10.0.0-nightly.20200415":"84.0.4115.0","10.0.0-nightly.20200416":"84.0.4115.0","10.0.0-nightly.20200417":"84.0.4115.0","10.0.0-nightly.20200422":"84.0.4121.0","10.0.0-nightly.20200423":"84.0.4121.0","10.0.0-nightly.20200427":"84.0.4125.0","10.0.0-nightly.20200428":"84.0.4125.0","10.0.0-nightly.20200429":"84.0.4125.0","10.0.0-nightly.20200430":"84.0.4125.0","10.0.0-nightly.20200501":"84.0.4129.0","10.0.0-nightly.20200504":"84.0.4129.0","10.0.0-nightly.20200505":"84.0.4129.0","10.0.0-nightly.20200506":"84.0.4129.0","10.0.0-nightly.20200507":"84.0.4129.0","10.0.0-nightly.20200508":"84.0.4129.0","10.0.0-nightly.20200511":"84.0.4129.0","10.0.0-nightly.20200512":"84.0.4129.0","10.0.0-nightly.20200513":"84.0.4129.0","10.0.0-nightly.20200514":"84.0.4129.0","10.0.0-nightly.20200515":"84.0.4129.0","10.0.0-nightly.20200518":"84.0.4129.0","10.0.0-nightly.20200519":"84.0.4129.0","10.0.0-nightly.20200520":"84.0.4129.0","10.0.0-nightly.20200521":"84.0.4129.0","10.0.0":"85.0.4183.84","10.0.1":"85.0.4183.86","10.1.0":"85.0.4183.87","10.1.1":"85.0.4183.93","10.1.2":"85.0.4183.98","10.1.3":"85.0.4183.121","10.1.4":"85.0.4183.121","10.1.5":"85.0.4183.121","10.1.6":"85.0.4183.121","10.1.7":"85.0.4183.121","10.2.0":"85.0.4183.121","10.3.0":"85.0.4183.121","10.3.1":"85.0.4183.121","10.3.2":"85.0.4183.121","10.4.0":"85.0.4183.121","10.4.1":"85.0.4183.121","10.4.2":"85.0.4183.121","10.4.3":"85.0.4183.121","10.4.4":"85.0.4183.121","10.4.5":"85.0.4183.121","10.4.6":"85.0.4183.121","10.4.7":"85.0.4183.121","11.0.0-beta.1":"86.0.4234.0","11.0.0-beta.3":"86.0.4234.0","11.0.0-beta.4":"86.0.4234.0","11.0.0-beta.5":"86.0.4234.0","11.0.0-beta.6":"86.0.4234.0","11.0.0-beta.7":"86.0.4234.0","11.0.0-beta.8":"87.0.4251.1","11.0.0-beta.9":"87.0.4251.1","11.0.0-beta.11":"87.0.4251.1","11.0.0-beta.12":"87.0.4280.11","11.0.0-beta.13":"87.0.4280.11","11.0.0-beta.16":"87.0.4280.27","11.0.0-beta.17":"87.0.4280.27","11.0.0-beta.18":"87.0.4280.27","11.0.0-beta.19":"87.0.4280.27","11.0.0-beta.20":"87.0.4280.40","11.0.0-beta.22":"87.0.4280.47","11.0.0-beta.23":"87.0.4280.47","11.0.0-nightly.20200525":"84.0.4129.0","11.0.0-nightly.20200526":"84.0.4129.0","11.0.0-nightly.20200529":"85.0.4156.0","11.0.0-nightly.20200602":"85.0.4162.0","11.0.0-nightly.20200603":"85.0.4162.0","11.0.0-nightly.20200604":"85.0.4162.0","11.0.0-nightly.20200609":"85.0.4162.0","11.0.0-nightly.20200610":"85.0.4162.0","11.0.0-nightly.20200611":"85.0.4162.0","11.0.0-nightly.20200615":"85.0.4162.0","11.0.0-nightly.20200616":"85.0.4162.0","11.0.0-nightly.20200617":"85.0.4162.0","11.0.0-nightly.20200618":"85.0.4162.0","11.0.0-nightly.20200619":"85.0.4162.0","11.0.0-nightly.20200701":"85.0.4179.0","11.0.0-nightly.20200702":"85.0.4179.0","11.0.0-nightly.20200703":"85.0.4179.0","11.0.0-nightly.20200706":"85.0.4179.0","11.0.0-nightly.20200707":"85.0.4179.0","11.0.0-nightly.20200708":"85.0.4179.0","11.0.0-nightly.20200709":"85.0.4179.0","11.0.0-nightly.20200716":"86.0.4203.0","11.0.0-nightly.20200717":"86.0.4203.0","11.0.0-nightly.20200720":"86.0.4203.0","11.0.0-nightly.20200721":"86.0.4203.0","11.0.0-nightly.20200723":"86.0.4209.0","11.0.0-nightly.20200724":"86.0.4209.0","11.0.0-nightly.20200729":"86.0.4209.0","11.0.0-nightly.20200730":"86.0.4209.0","11.0.0-nightly.20200731":"86.0.4209.0","11.0.0-nightly.20200803":"86.0.4209.0","11.0.0-nightly.20200804":"86.0.4209.0","11.0.0-nightly.20200805":"86.0.4209.0","11.0.0-nightly.20200811":"86.0.4209.0","11.0.0-nightly.20200812":"86.0.4209.0","11.0.0-nightly.20200822":"86.0.4234.0","11.0.0-nightly.20200824":"86.0.4234.0","11.0.0-nightly.20200825":"86.0.4234.0","11.0.0-nightly.20200826":"86.0.4234.0","11.0.0":"87.0.4280.60","11.0.1":"87.0.4280.60","11.0.2":"87.0.4280.67","11.0.3":"87.0.4280.67","11.0.4":"87.0.4280.67","11.0.5":"87.0.4280.88","11.1.0":"87.0.4280.88","11.1.1":"87.0.4280.88","11.2.0":"87.0.4280.141","11.2.1":"87.0.4280.141","11.2.2":"87.0.4280.141","11.2.3":"87.0.4280.141","11.3.0":"87.0.4280.141","11.4.0":"87.0.4280.141","11.4.1":"87.0.4280.141","11.4.2":"87.0.4280.141","11.4.3":"87.0.4280.141","11.4.4":"87.0.4280.141","11.4.5":"87.0.4280.141","11.4.6":"87.0.4280.141","11.4.7":"87.0.4280.141","11.4.8":"87.0.4280.141","11.4.9":"87.0.4280.141","11.4.10":"87.0.4280.141","11.4.11":"87.0.4280.141","11.4.12":"87.0.4280.141","11.5.0":"87.0.4280.141","12.0.0-beta.1":"89.0.4328.0","12.0.0-beta.3":"89.0.4328.0","12.0.0-beta.4":"89.0.4328.0","12.0.0-beta.5":"89.0.4328.0","12.0.0-beta.6":"89.0.4328.0","12.0.0-beta.7":"89.0.4328.0","12.0.0-beta.8":"89.0.4328.0","12.0.0-beta.9":"89.0.4328.0","12.0.0-beta.10":"89.0.4328.0","12.0.0-beta.11":"89.0.4328.0","12.0.0-beta.12":"89.0.4328.0","12.0.0-beta.14":"89.0.4328.0","12.0.0-beta.16":"89.0.4348.1","12.0.0-beta.18":"89.0.4348.1","12.0.0-beta.19":"89.0.4348.1","12.0.0-beta.20":"89.0.4348.1","12.0.0-beta.21":"89.0.4388.2","12.0.0-beta.22":"89.0.4388.2","12.0.0-beta.23":"89.0.4388.2","12.0.0-beta.24":"89.0.4388.2","12.0.0-beta.25":"89.0.4388.2","12.0.0-beta.26":"89.0.4388.2","12.0.0-beta.27":"89.0.4389.23","12.0.0-beta.28":"89.0.4389.23","12.0.0-beta.29":"89.0.4389.23","12.0.0-beta.30":"89.0.4389.58","12.0.0-beta.31":"89.0.4389.58","12.0.0-nightly.20200827":"86.0.4234.0","12.0.0-nightly.20200831":"86.0.4234.0","12.0.0-nightly.20200902":"86.0.4234.0","12.0.0-nightly.20200903":"86.0.4234.0","12.0.0-nightly.20200907":"86.0.4234.0","12.0.0-nightly.20200910":"86.0.4234.0","12.0.0-nightly.20200911":"86.0.4234.0","12.0.0-nightly.20200914":"86.0.4234.0","12.0.0-nightly.20201002":"87.0.4268.0","12.0.0-nightly.20201007":"87.0.4268.0","12.0.0-nightly.20201009":"87.0.4268.0","12.0.0-nightly.20201012":"87.0.4268.0","12.0.0-nightly.20201013":"87.0.4268.0","12.0.0-nightly.20201014":"87.0.4268.0","12.0.0-nightly.20201015":"87.0.4268.0","12.0.0-nightly.20201023":"88.0.4292.0","12.0.0-nightly.20201026":"88.0.4292.0","12.0.0-nightly.20201030":"88.0.4306.0","12.0.0-nightly.20201102":"88.0.4306.0","12.0.0-nightly.20201103":"88.0.4306.0","12.0.0-nightly.20201104":"88.0.4306.0","12.0.0-nightly.20201105":"88.0.4306.0","12.0.0-nightly.20201106":"88.0.4306.0","12.0.0-nightly.20201111":"88.0.4306.0","12.0.0-nightly.20201112":"88.0.4306.0","12.0.0-nightly.20201116":"88.0.4324.0","12.0.0":"89.0.4389.69","12.0.1":"89.0.4389.82","12.0.2":"89.0.4389.90","12.0.3":"89.0.4389.114","12.0.4":"89.0.4389.114","12.0.5":"89.0.4389.128","12.0.6":"89.0.4389.128","12.0.7":"89.0.4389.128","12.0.8":"89.0.4389.128","12.0.9":"89.0.4389.128","12.0.10":"89.0.4389.128","12.0.11":"89.0.4389.128","12.0.12":"89.0.4389.128","12.0.13":"89.0.4389.128","12.0.14":"89.0.4389.128","12.0.15":"89.0.4389.128","12.0.16":"89.0.4389.128","12.0.17":"89.0.4389.128","12.0.18":"89.0.4389.128","12.1.0":"89.0.4389.128","12.1.1":"89.0.4389.128","12.1.2":"89.0.4389.128","12.2.0":"89.0.4389.128","12.2.1":"89.0.4389.128","12.2.2":"89.0.4389.128","12.2.3":"89.0.4389.128","13.0.0-beta.2":"90.0.4402.0","13.0.0-beta.3":"90.0.4402.0","13.0.0-beta.4":"90.0.4415.0","13.0.0-beta.5":"90.0.4415.0","13.0.0-beta.6":"90.0.4415.0","13.0.0-beta.7":"90.0.4415.0","13.0.0-beta.8":"90.0.4415.0","13.0.0-beta.9":"90.0.4415.0","13.0.0-beta.10":"90.0.4415.0","13.0.0-beta.11":"90.0.4415.0","13.0.0-beta.12":"90.0.4415.0","13.0.0-beta.13":"90.0.4415.0","13.0.0-beta.14":"91.0.4448.0","13.0.0-beta.16":"91.0.4448.0","13.0.0-beta.17":"91.0.4448.0","13.0.0-beta.18":"91.0.4448.0","13.0.0-beta.20":"91.0.4448.0","13.0.0-beta.21":"91.0.4472.33","13.0.0-beta.22":"91.0.4472.33","13.0.0-beta.23":"91.0.4472.33","13.0.0-beta.24":"91.0.4472.38","13.0.0-beta.25":"91.0.4472.38","13.0.0-beta.26":"91.0.4472.38","13.0.0-beta.27":"91.0.4472.38","13.0.0-beta.28":"91.0.4472.38","13.0.0-nightly.20201119":"89.0.4328.0","13.0.0-nightly.20201123":"89.0.4328.0","13.0.0-nightly.20201124":"89.0.4328.0","13.0.0-nightly.20201126":"89.0.4328.0","13.0.0-nightly.20201127":"89.0.4328.0","13.0.0-nightly.20201130":"89.0.4328.0","13.0.0-nightly.20201201":"89.0.4328.0","13.0.0-nightly.20201202":"89.0.4328.0","13.0.0-nightly.20201203":"89.0.4328.0","13.0.0-nightly.20201204":"89.0.4328.0","13.0.0-nightly.20201207":"89.0.4328.0","13.0.0-nightly.20201208":"89.0.4328.0","13.0.0-nightly.20201209":"89.0.4328.0","13.0.0-nightly.20201210":"89.0.4328.0","13.0.0-nightly.20201211":"89.0.4328.0","13.0.0-nightly.20201214":"89.0.4328.0","13.0.0-nightly.20201215":"89.0.4349.0","13.0.0-nightly.20201216":"89.0.4349.0","13.0.0-nightly.20201221":"89.0.4349.0","13.0.0-nightly.20201222":"89.0.4349.0","13.0.0-nightly.20201223":"89.0.4359.0","13.0.0-nightly.20210104":"89.0.4359.0","13.0.0-nightly.20210108":"89.0.4359.0","13.0.0-nightly.20210111":"89.0.4359.0","13.0.0-nightly.20210113":"89.0.4386.0","13.0.0-nightly.20210114":"89.0.4386.0","13.0.0-nightly.20210118":"89.0.4386.0","13.0.0-nightly.20210122":"89.0.4386.0","13.0.0-nightly.20210125":"89.0.4386.0","13.0.0-nightly.20210127":"89.0.4389.0","13.0.0-nightly.20210128":"89.0.4389.0","13.0.0-nightly.20210129":"89.0.4389.0","13.0.0-nightly.20210201":"89.0.4389.0","13.0.0-nightly.20210202":"89.0.4389.0","13.0.0-nightly.20210203":"89.0.4389.0","13.0.0-nightly.20210205":"89.0.4389.0","13.0.0-nightly.20210208":"89.0.4389.0","13.0.0-nightly.20210209":"89.0.4389.0","13.0.0-nightly.20210210":"90.0.4402.0","13.0.0-nightly.20210211":"90.0.4402.0","13.0.0-nightly.20210212":"90.0.4402.0","13.0.0-nightly.20210216":"90.0.4402.0","13.0.0-nightly.20210217":"90.0.4402.0","13.0.0-nightly.20210218":"90.0.4402.0","13.0.0-nightly.20210219":"90.0.4402.0","13.0.0-nightly.20210222":"90.0.4402.0","13.0.0-nightly.20210225":"90.0.4402.0","13.0.0-nightly.20210226":"90.0.4402.0","13.0.0-nightly.20210301":"90.0.4402.0","13.0.0-nightly.20210302":"90.0.4402.0","13.0.0-nightly.20210303":"90.0.4402.0","13.0.0":"91.0.4472.69","13.0.1":"91.0.4472.69","13.1.0":"91.0.4472.77","13.1.1":"91.0.4472.77","13.1.2":"91.0.4472.77","13.1.3":"91.0.4472.106","13.1.4":"91.0.4472.106","13.1.5":"91.0.4472.124","13.1.6":"91.0.4472.124","13.1.7":"91.0.4472.124","13.1.8":"91.0.4472.164","13.1.9":"91.0.4472.164","13.2.0":"91.0.4472.164","13.2.1":"91.0.4472.164","13.2.2":"91.0.4472.164","13.2.3":"91.0.4472.164","13.3.0":"91.0.4472.164","13.4.0":"91.0.4472.164","13.5.0":"91.0.4472.164","13.5.1":"91.0.4472.164","13.5.2":"91.0.4472.164","13.6.0":"91.0.4472.164","13.6.1":"91.0.4472.164","13.6.2":"91.0.4472.164","13.6.3":"91.0.4472.164","13.6.6":"91.0.4472.164","13.6.7":"91.0.4472.164","13.6.8":"91.0.4472.164","13.6.9":"91.0.4472.164","14.0.0-beta.1":"92.0.4511.0","14.0.0-beta.2":"92.0.4511.0","14.0.0-beta.3":"92.0.4511.0","14.0.0-beta.5":"93.0.4536.0","14.0.0-beta.6":"93.0.4536.0","14.0.0-beta.7":"93.0.4536.0","14.0.0-beta.8":"93.0.4536.0","14.0.0-beta.9":"93.0.4539.0","14.0.0-beta.10":"93.0.4539.0","14.0.0-beta.11":"93.0.4557.4","14.0.0-beta.12":"93.0.4557.4","14.0.0-beta.13":"93.0.4566.0","14.0.0-beta.14":"93.0.4566.0","14.0.0-beta.15":"93.0.4566.0","14.0.0-beta.16":"93.0.4566.0","14.0.0-beta.17":"93.0.4566.0","14.0.0-beta.18":"93.0.4577.15","14.0.0-beta.19":"93.0.4577.15","14.0.0-beta.20":"93.0.4577.15","14.0.0-beta.21":"93.0.4577.15","14.0.0-beta.22":"93.0.4577.25","14.0.0-beta.23":"93.0.4577.25","14.0.0-beta.24":"93.0.4577.51","14.0.0-beta.25":"93.0.4577.51","14.0.0-nightly.20210304":"90.0.4402.0","14.0.0-nightly.20210305":"90.0.4415.0","14.0.0-nightly.20210308":"90.0.4415.0","14.0.0-nightly.20210309":"90.0.4415.0","14.0.0-nightly.20210311":"90.0.4415.0","14.0.0-nightly.20210315":"90.0.4415.0","14.0.0-nightly.20210316":"90.0.4415.0","14.0.0-nightly.20210317":"90.0.4415.0","14.0.0-nightly.20210318":"90.0.4415.0","14.0.0-nightly.20210319":"90.0.4415.0","14.0.0-nightly.20210323":"90.0.4415.0","14.0.0-nightly.20210324":"90.0.4415.0","14.0.0-nightly.20210325":"90.0.4415.0","14.0.0-nightly.20210326":"90.0.4415.0","14.0.0-nightly.20210329":"90.0.4415.0","14.0.0-nightly.20210330":"90.0.4415.0","14.0.0-nightly.20210331":"91.0.4448.0","14.0.0-nightly.20210401":"91.0.4448.0","14.0.0-nightly.20210402":"91.0.4448.0","14.0.0-nightly.20210406":"91.0.4448.0","14.0.0-nightly.20210407":"91.0.4448.0","14.0.0-nightly.20210408":"91.0.4448.0","14.0.0-nightly.20210409":"91.0.4448.0","14.0.0-nightly.20210413":"91.0.4448.0","14.0.0-nightly.20210426":"92.0.4475.0","14.0.0-nightly.20210427":"92.0.4475.0","14.0.0-nightly.20210430":"92.0.4488.0","14.0.0-nightly.20210503":"92.0.4488.0","14.0.0-nightly.20210505":"92.0.4496.0","14.0.0-nightly.20210506":"92.0.4498.0","14.0.0-nightly.20210507":"92.0.4499.0","14.0.0-nightly.20210510":"92.0.4499.0","14.0.0-nightly.20210511":"92.0.4499.0","14.0.0-nightly.20210512":"92.0.4499.0","14.0.0-nightly.20210513":"92.0.4499.0","14.0.0-nightly.20210514":"92.0.4505.0","14.0.0-nightly.20210517":"92.0.4505.0","14.0.0-nightly.20210518":"92.0.4505.0","14.0.0-nightly.20210519":"92.0.4505.0","14.0.0-nightly.20210520":"92.0.4511.0","14.0.0-nightly.20210523":"92.0.4511.0","14.0.0-nightly.20210524":"92.0.4511.0","14.0.0":"93.0.4577.58","14.0.1":"93.0.4577.63","14.0.2":"93.0.4577.82","14.1.0":"93.0.4577.82","14.1.1":"93.0.4577.82","14.2.0":"93.0.4577.82","14.2.1":"93.0.4577.82","14.2.2":"93.0.4577.82","14.2.3":"93.0.4577.82","14.2.4":"93.0.4577.82","14.2.5":"93.0.4577.82","14.2.6":"93.0.4577.82","14.2.7":"93.0.4577.82","14.2.8":"93.0.4577.82","14.2.9":"93.0.4577.82","15.0.0-alpha.1":"93.0.4566.0","15.0.0-alpha.2":"93.0.4566.0","15.0.0-alpha.3":"94.0.4584.0","15.0.0-alpha.4":"94.0.4584.0","15.0.0-alpha.5":"94.0.4584.0","15.0.0-alpha.6":"94.0.4584.0","15.0.0-alpha.7":"94.0.4590.2","15.0.0-alpha.8":"94.0.4590.2","15.0.0-alpha.9":"94.0.4590.2","15.0.0-alpha.10":"94.0.4606.12","15.0.0-beta.1":"94.0.4606.20","15.0.0-beta.2":"94.0.4606.20","15.0.0-beta.3":"94.0.4606.31","15.0.0-beta.4":"94.0.4606.31","15.0.0-beta.5":"94.0.4606.31","15.0.0-beta.6":"94.0.4606.31","15.0.0-beta.7":"94.0.4606.31","15.0.0-nightly.20210527":"92.0.4511.0","15.0.0-nightly.20210528":"92.0.4511.0","15.0.0-nightly.20210531":"92.0.4511.0","15.0.0-nightly.20210601":"92.0.4511.0","15.0.0-nightly.20210602":"92.0.4511.0","15.0.0-nightly.20210603":"93.0.4530.0","15.0.0-nightly.20210604":"93.0.4530.0","15.0.0-nightly.20210608":"93.0.4535.0","15.0.0-nightly.20210609":"93.0.4536.0","15.0.0-nightly.20210610":"93.0.4536.0","15.0.0-nightly.20210611":"93.0.4536.0","15.0.0-nightly.20210614":"93.0.4536.0","15.0.0-nightly.20210615":"93.0.4536.0","15.0.0-nightly.20210616":"93.0.4536.0","15.0.0-nightly.20210617":"93.0.4539.0","15.0.0-nightly.20210618":"93.0.4539.0","15.0.0-nightly.20210621":"93.0.4539.0","15.0.0-nightly.20210622":"93.0.4539.0","15.0.0-nightly.20210623":"93.0.4550.0","15.0.0-nightly.20210624":"93.0.4550.0","15.0.0-nightly.20210625":"93.0.4552.0","15.0.0-nightly.20210628":"93.0.4552.0","15.0.0-nightly.20210629":"93.0.4552.0","15.0.0-nightly.20210630":"93.0.4558.0","15.0.0-nightly.20210701":"93.0.4558.0","15.0.0-nightly.20210702":"93.0.4558.0","15.0.0-nightly.20210705":"93.0.4558.0","15.0.0-nightly.20210706":"93.0.4566.0","15.0.0-nightly.20210707":"93.0.4566.0","15.0.0-nightly.20210708":"93.0.4566.0","15.0.0-nightly.20210709":"93.0.4566.0","15.0.0-nightly.20210712":"93.0.4566.0","15.0.0-nightly.20210713":"93.0.4566.0","15.0.0-nightly.20210714":"93.0.4566.0","15.0.0-nightly.20210715":"93.0.4566.0","15.0.0-nightly.20210716":"93.0.4566.0","15.0.0-nightly.20210719":"93.0.4566.0","15.0.0-nightly.20210720":"93.0.4566.0","15.0.0-nightly.20210721":"93.0.4566.0","15.0.0":"94.0.4606.51","15.1.0":"94.0.4606.61","15.1.1":"94.0.4606.61","15.1.2":"94.0.4606.71","15.2.0":"94.0.4606.81","15.3.0":"94.0.4606.81","15.3.1":"94.0.4606.81","15.3.2":"94.0.4606.81","15.3.3":"94.0.4606.81","15.3.4":"94.0.4606.81","15.3.5":"94.0.4606.81","15.3.6":"94.0.4606.81","15.3.7":"94.0.4606.81","15.4.0":"94.0.4606.81","15.4.1":"94.0.4606.81","15.4.2":"94.0.4606.81","15.5.0":"94.0.4606.81","15.5.1":"94.0.4606.81","15.5.2":"94.0.4606.81","15.5.3":"94.0.4606.81","15.5.4":"94.0.4606.81","15.5.5":"94.0.4606.81","15.5.6":"94.0.4606.81","15.5.7":"94.0.4606.81","16.0.0-alpha.1":"95.0.4629.0","16.0.0-alpha.2":"95.0.4629.0","16.0.0-alpha.3":"95.0.4629.0","16.0.0-alpha.4":"95.0.4629.0","16.0.0-alpha.5":"95.0.4629.0","16.0.0-alpha.6":"95.0.4629.0","16.0.0-alpha.7":"95.0.4629.0","16.0.0-alpha.8":"96.0.4647.0","16.0.0-alpha.9":"96.0.4647.0","16.0.0-beta.1":"96.0.4647.0","16.0.0-beta.2":"96.0.4647.0","16.0.0-beta.3":"96.0.4647.0","16.0.0-beta.4":"96.0.4664.18","16.0.0-beta.5":"96.0.4664.18","16.0.0-beta.6":"96.0.4664.27","16.0.0-beta.7":"96.0.4664.27","16.0.0-beta.8":"96.0.4664.35","16.0.0-beta.9":"96.0.4664.35","16.0.0-nightly.20210722":"93.0.4566.0","16.0.0-nightly.20210723":"93.0.4566.0","16.0.0-nightly.20210726":"93.0.4566.0","16.0.0-nightly.20210727":"94.0.4584.0","16.0.0-nightly.20210728":"94.0.4584.0","16.0.0-nightly.20210729":"94.0.4584.0","16.0.0-nightly.20210730":"94.0.4584.0","16.0.0-nightly.20210802":"94.0.4584.0","16.0.0-nightly.20210803":"94.0.4584.0","16.0.0-nightly.20210804":"94.0.4584.0","16.0.0-nightly.20210805":"94.0.4584.0","16.0.0-nightly.20210806":"94.0.4584.0","16.0.0-nightly.20210809":"94.0.4584.0","16.0.0-nightly.20210810":"94.0.4584.0","16.0.0-nightly.20210811":"94.0.4584.0","16.0.0-nightly.20210812":"94.0.4590.2","16.0.0-nightly.20210813":"94.0.4590.2","16.0.0-nightly.20210816":"94.0.4590.2","16.0.0-nightly.20210817":"94.0.4590.2","16.0.0-nightly.20210818":"94.0.4590.2","16.0.0-nightly.20210819":"94.0.4590.2","16.0.0-nightly.20210820":"94.0.4590.2","16.0.0-nightly.20210823":"94.0.4590.2","16.0.0-nightly.20210824":"95.0.4612.5","16.0.0-nightly.20210825":"95.0.4612.5","16.0.0-nightly.20210826":"95.0.4612.5","16.0.0-nightly.20210827":"95.0.4612.5","16.0.0-nightly.20210830":"95.0.4612.5","16.0.0-nightly.20210831":"95.0.4612.5","16.0.0-nightly.20210901":"95.0.4612.5","16.0.0-nightly.20210902":"95.0.4629.0","16.0.0-nightly.20210903":"95.0.4629.0","16.0.0-nightly.20210906":"95.0.4629.0","16.0.0-nightly.20210907":"95.0.4629.0","16.0.0-nightly.20210908":"95.0.4629.0","16.0.0-nightly.20210909":"95.0.4629.0","16.0.0-nightly.20210910":"95.0.4629.0","16.0.0-nightly.20210913":"95.0.4629.0","16.0.0-nightly.20210914":"95.0.4629.0","16.0.0-nightly.20210915":"95.0.4629.0","16.0.0-nightly.20210916":"95.0.4629.0","16.0.0-nightly.20210917":"95.0.4629.0","16.0.0-nightly.20210920":"95.0.4629.0","16.0.0-nightly.20210921":"95.0.4629.0","16.0.0-nightly.20210922":"95.0.4629.0","16.0.0":"96.0.4664.45","16.0.1":"96.0.4664.45","16.0.2":"96.0.4664.55","16.0.3":"96.0.4664.55","16.0.4":"96.0.4664.55","16.0.5":"96.0.4664.55","16.0.6":"96.0.4664.110","16.0.7":"96.0.4664.110","16.0.8":"96.0.4664.110","16.0.9":"96.0.4664.174","16.0.10":"96.0.4664.174","16.1.0":"96.0.4664.174","16.1.1":"96.0.4664.174","16.2.0":"96.0.4664.174","16.2.1":"96.0.4664.174","16.2.2":"96.0.4664.174","16.2.3":"96.0.4664.174","16.2.4":"96.0.4664.174","16.2.5":"96.0.4664.174","16.2.6":"96.0.4664.174","16.2.7":"96.0.4664.174","16.2.8":"96.0.4664.174","17.0.0-alpha.1":"96.0.4664.4","17.0.0-alpha.2":"96.0.4664.4","17.0.0-alpha.3":"96.0.4664.4","17.0.0-alpha.4":"98.0.4706.0","17.0.0-alpha.5":"98.0.4706.0","17.0.0-alpha.6":"98.0.4706.0","17.0.0-beta.1":"98.0.4706.0","17.0.0-beta.2":"98.0.4706.0","17.0.0-beta.3":"98.0.4758.9","17.0.0-beta.4":"98.0.4758.11","17.0.0-beta.5":"98.0.4758.11","17.0.0-beta.6":"98.0.4758.11","17.0.0-beta.7":"98.0.4758.11","17.0.0-beta.8":"98.0.4758.11","17.0.0-beta.9":"98.0.4758.11","17.0.0-nightly.20210923":"95.0.4629.0","17.0.0-nightly.20210924":"95.0.4629.0","17.0.0-nightly.20210927":"95.0.4629.0","17.0.0-nightly.20210928":"95.0.4629.0","17.0.0-nightly.20210929":"95.0.4629.0","17.0.0-nightly.20210930":"95.0.4629.0","17.0.0-nightly.20211001":"95.0.4629.0","17.0.0-nightly.20211004":"95.0.4629.0","17.0.0-nightly.20211005":"95.0.4629.0","17.0.0-nightly.20211006":"96.0.4647.0","17.0.0-nightly.20211007":"96.0.4647.0","17.0.0-nightly.20211008":"96.0.4647.0","17.0.0-nightly.20211011":"96.0.4647.0","17.0.0-nightly.20211012":"96.0.4647.0","17.0.0-nightly.20211013":"96.0.4647.0","17.0.0-nightly.20211014":"96.0.4647.0","17.0.0-nightly.20211015":"96.0.4647.0","17.0.0-nightly.20211018":"96.0.4647.0","17.0.0-nightly.20211019":"96.0.4647.0","17.0.0-nightly.20211020":"96.0.4647.0","17.0.0-nightly.20211021":"96.0.4647.0","17.0.0-nightly.20211022":"96.0.4664.4","17.0.0-nightly.20211025":"96.0.4664.4","17.0.0-nightly.20211026":"96.0.4664.4","17.0.0-nightly.20211027":"96.0.4664.4","17.0.0-nightly.20211028":"96.0.4664.4","17.0.0-nightly.20211029":"96.0.4664.4","17.0.0-nightly.20211101":"96.0.4664.4","17.0.0-nightly.20211102":"96.0.4664.4","17.0.0-nightly.20211103":"96.0.4664.4","17.0.0-nightly.20211104":"96.0.4664.4","17.0.0-nightly.20211105":"96.0.4664.4","17.0.0-nightly.20211108":"96.0.4664.4","17.0.0-nightly.20211109":"96.0.4664.4","17.0.0-nightly.20211110":"96.0.4664.4","17.0.0-nightly.20211111":"96.0.4664.4","17.0.0-nightly.20211112":"96.0.4664.4","17.0.0-nightly.20211115":"96.0.4664.4","17.0.0-nightly.20211116":"96.0.4664.4","17.0.0-nightly.20211117":"96.0.4664.4","17.0.0":"98.0.4758.74","17.0.1":"98.0.4758.82","17.1.0":"98.0.4758.102","17.1.1":"98.0.4758.109","17.1.2":"98.0.4758.109","17.2.0":"98.0.4758.109","17.3.0":"98.0.4758.141","17.3.1":"98.0.4758.141","17.4.0":"98.0.4758.141","17.4.1":"98.0.4758.141","17.4.2":"98.0.4758.141","17.4.3":"98.0.4758.141","17.4.4":"98.0.4758.141","17.4.5":"98.0.4758.141","17.4.6":"98.0.4758.141","17.4.7":"98.0.4758.141","17.4.8":"98.0.4758.141","17.4.9":"98.0.4758.141","17.4.10":"98.0.4758.141","17.4.11":"98.0.4758.141","18.0.0-alpha.1":"99.0.4767.0","18.0.0-alpha.2":"99.0.4767.0","18.0.0-alpha.3":"99.0.4767.0","18.0.0-alpha.4":"99.0.4767.0","18.0.0-alpha.5":"99.0.4767.0","18.0.0-beta.1":"100.0.4894.0","18.0.0-beta.2":"100.0.4894.0","18.0.0-beta.3":"100.0.4894.0","18.0.0-beta.4":"100.0.4894.0","18.0.0-beta.5":"100.0.4894.0","18.0.0-beta.6":"100.0.4894.0","18.0.0-nightly.20211118":"96.0.4664.4","18.0.0-nightly.20211119":"96.0.4664.4","18.0.0-nightly.20211122":"96.0.4664.4","18.0.0-nightly.20211123":"96.0.4664.4","18.0.0-nightly.20211124":"98.0.4706.0","18.0.0-nightly.20211125":"98.0.4706.0","18.0.0-nightly.20211126":"98.0.4706.0","18.0.0-nightly.20211129":"98.0.4706.0","18.0.0-nightly.20211130":"98.0.4706.0","18.0.0-nightly.20211201":"98.0.4706.0","18.0.0-nightly.20211202":"98.0.4706.0","18.0.0-nightly.20211203":"98.0.4706.0","18.0.0-nightly.20211206":"98.0.4706.0","18.0.0-nightly.20211207":"98.0.4706.0","18.0.0-nightly.20211208":"98.0.4706.0","18.0.0-nightly.20211209":"98.0.4706.0","18.0.0-nightly.20211210":"98.0.4706.0","18.0.0-nightly.20211213":"98.0.4706.0","18.0.0-nightly.20211214":"98.0.4706.0","18.0.0-nightly.20211215":"98.0.4706.0","18.0.0-nightly.20211216":"98.0.4706.0","18.0.0-nightly.20211217":"98.0.4706.0","18.0.0-nightly.20211220":"98.0.4706.0","18.0.0-nightly.20211221":"98.0.4706.0","18.0.0-nightly.20211222":"98.0.4706.0","18.0.0-nightly.20211223":"98.0.4706.0","18.0.0-nightly.20211228":"98.0.4706.0","18.0.0-nightly.20211229":"98.0.4706.0","18.0.0-nightly.20211231":"98.0.4706.0","18.0.0-nightly.20220103":"98.0.4706.0","18.0.0-nightly.20220104":"98.0.4706.0","18.0.0-nightly.20220105":"98.0.4706.0","18.0.0-nightly.20220106":"98.0.4706.0","18.0.0-nightly.20220107":"98.0.4706.0","18.0.0-nightly.20220110":"98.0.4706.0","18.0.0-nightly.20220111":"99.0.4767.0","18.0.0-nightly.20220112":"99.0.4767.0","18.0.0-nightly.20220113":"99.0.4767.0","18.0.0-nightly.20220114":"99.0.4767.0","18.0.0-nightly.20220117":"99.0.4767.0","18.0.0-nightly.20220118":"99.0.4767.0","18.0.0-nightly.20220119":"99.0.4767.0","18.0.0-nightly.20220121":"99.0.4767.0","18.0.0-nightly.20220124":"99.0.4767.0","18.0.0-nightly.20220125":"99.0.4767.0","18.0.0-nightly.20220127":"99.0.4767.0","18.0.0-nightly.20220128":"99.0.4767.0","18.0.0-nightly.20220131":"99.0.4767.0","18.0.0-nightly.20220201":"99.0.4767.0","18.0.0":"100.0.4896.56","18.0.1":"100.0.4896.60","18.0.2":"100.0.4896.60","18.0.3":"100.0.4896.75","18.0.4":"100.0.4896.75","18.1.0":"100.0.4896.127","18.2.0":"100.0.4896.143","18.2.1":"100.0.4896.143","18.2.2":"100.0.4896.143","18.2.3":"100.0.4896.143","18.2.4":"100.0.4896.160","18.3.0":"100.0.4896.160","18.3.1":"100.0.4896.160","18.3.2":"100.0.4896.160","18.3.3":"100.0.4896.160","18.3.4":"100.0.4896.160","18.3.5":"100.0.4896.160","18.3.6":"100.0.4896.160","18.3.7":"100.0.4896.160","18.3.8":"100.0.4896.160","18.3.9":"100.0.4896.160","18.3.11":"100.0.4896.160","18.3.12":"100.0.4896.160","18.3.13":"100.0.4896.160","18.3.14":"100.0.4896.160","18.3.15":"100.0.4896.160","19.0.0-alpha.1":"102.0.4962.3","19.0.0-alpha.2":"102.0.4971.0","19.0.0-alpha.3":"102.0.4971.0","19.0.0-alpha.4":"102.0.4989.0","19.0.0-alpha.5":"102.0.4989.0","19.0.0-beta.1":"102.0.4999.0","19.0.0-beta.2":"102.0.4999.0","19.0.0-beta.3":"102.0.4999.0","19.0.0-beta.4":"102.0.5005.27","19.0.0-beta.5":"102.0.5005.40","19.0.0-beta.6":"102.0.5005.40","19.0.0-beta.7":"102.0.5005.40","19.0.0-beta.8":"102.0.5005.49","19.0.0-nightly.20220202":"99.0.4767.0","19.0.0-nightly.20220203":"99.0.4767.0","19.0.0-nightly.20220204":"99.0.4767.0","19.0.0-nightly.20220207":"99.0.4767.0","19.0.0-nightly.20220208":"99.0.4767.0","19.0.0-nightly.20220209":"99.0.4767.0","19.0.0-nightly.20220308":"100.0.4894.0","19.0.0-nightly.20220309":"100.0.4894.0","19.0.0-nightly.20220310":"100.0.4894.0","19.0.0-nightly.20220311":"100.0.4894.0","19.0.0-nightly.20220314":"100.0.4894.0","19.0.0-nightly.20220315":"100.0.4894.0","19.0.0-nightly.20220316":"100.0.4894.0","19.0.0-nightly.20220317":"100.0.4894.0","19.0.0-nightly.20220318":"100.0.4894.0","19.0.0-nightly.20220321":"100.0.4894.0","19.0.0-nightly.20220322":"100.0.4894.0","19.0.0-nightly.20220323":"100.0.4894.0","19.0.0-nightly.20220324":"100.0.4894.0","19.0.0-nightly.20220325":"102.0.4961.0","19.0.0-nightly.20220328":"102.0.4962.3","19.0.0-nightly.20220329":"102.0.4962.3","19.0.0":"102.0.5005.61","19.0.1":"102.0.5005.61","19.0.2":"102.0.5005.63","19.0.3":"102.0.5005.63","19.0.4":"102.0.5005.63","19.0.5":"102.0.5005.115","19.0.6":"102.0.5005.115","19.0.7":"102.0.5005.134","19.0.8":"102.0.5005.148","19.0.9":"102.0.5005.167","19.0.10":"102.0.5005.167","19.0.11":"102.0.5005.167","19.0.12":"102.0.5005.167","19.0.13":"102.0.5005.167","19.0.14":"102.0.5005.167","19.0.15":"102.0.5005.167","19.0.16":"102.0.5005.167","19.0.17":"102.0.5005.167","19.1.0":"102.0.5005.167","19.1.1":"102.0.5005.167","19.1.2":"102.0.5005.167","19.1.3":"102.0.5005.167","19.1.4":"102.0.5005.167","19.1.5":"102.0.5005.167","19.1.6":"102.0.5005.167","19.1.7":"102.0.5005.167","19.1.8":"102.0.5005.167","19.1.9":"102.0.5005.167","20.0.0-alpha.1":"103.0.5044.0","20.0.0-alpha.2":"104.0.5073.0","20.0.0-alpha.3":"104.0.5073.0","20.0.0-alpha.4":"104.0.5073.0","20.0.0-alpha.5":"104.0.5073.0","20.0.0-alpha.6":"104.0.5073.0","20.0.0-alpha.7":"104.0.5073.0","20.0.0-beta.1":"104.0.5073.0","20.0.0-beta.2":"104.0.5073.0","20.0.0-beta.3":"104.0.5073.0","20.0.0-beta.4":"104.0.5073.0","20.0.0-beta.5":"104.0.5073.0","20.0.0-beta.6":"104.0.5073.0","20.0.0-beta.7":"104.0.5073.0","20.0.0-beta.8":"104.0.5073.0","20.0.0-beta.9":"104.0.5112.39","20.0.0-beta.10":"104.0.5112.48","20.0.0-beta.11":"104.0.5112.48","20.0.0-beta.12":"104.0.5112.48","20.0.0-beta.13":"104.0.5112.57","20.0.0-nightly.20220330":"102.0.4962.3","20.0.0-nightly.20220411":"102.0.4971.0","20.0.0-nightly.20220414":"102.0.4989.0","20.0.0-nightly.20220415":"102.0.4989.0","20.0.0-nightly.20220418":"102.0.4989.0","20.0.0-nightly.20220419":"102.0.4989.0","20.0.0-nightly.20220420":"102.0.4989.0","20.0.0-nightly.20220421":"102.0.4989.0","20.0.0-nightly.20220425":"102.0.4999.0","20.0.0-nightly.20220426":"102.0.4999.0","20.0.0-nightly.20220427":"102.0.4999.0","20.0.0-nightly.20220428":"102.0.4999.0","20.0.0-nightly.20220429":"102.0.4999.0","20.0.0-nightly.20220502":"102.0.4999.0","20.0.0-nightly.20220503":"102.0.4999.0","20.0.0-nightly.20220504":"102.0.4999.0","20.0.0-nightly.20220505":"102.0.4999.0","20.0.0-nightly.20220506":"102.0.4999.0","20.0.0-nightly.20220509":"102.0.4999.0","20.0.0-nightly.20220511":"102.0.4999.0","20.0.0-nightly.20220512":"102.0.4999.0","20.0.0-nightly.20220513":"102.0.4999.0","20.0.0-nightly.20220516":"102.0.4999.0","20.0.0-nightly.20220517":"102.0.4999.0","20.0.0-nightly.20220518":"103.0.5044.0","20.0.0-nightly.20220519":"103.0.5044.0","20.0.0-nightly.20220520":"103.0.5044.0","20.0.0-nightly.20220523":"103.0.5044.0","20.0.0-nightly.20220524":"103.0.5044.0","20.0.0":"104.0.5112.65","20.0.1":"104.0.5112.81","20.0.2":"104.0.5112.81","20.0.3":"104.0.5112.81","20.1.0":"104.0.5112.102","20.1.1":"104.0.5112.102","20.1.2":"104.0.5112.114","20.1.3":"104.0.5112.114","20.1.4":"104.0.5112.114","20.2.0":"104.0.5112.124","20.3.0":"104.0.5112.124","20.3.1":"104.0.5112.124","20.3.2":"104.0.5112.124","20.3.3":"104.0.5112.124","20.3.4":"104.0.5112.124","20.3.5":"104.0.5112.124","20.3.6":"104.0.5112.124","20.3.7":"104.0.5112.124","20.3.8":"104.0.5112.124","20.3.9":"104.0.5112.124","20.3.10":"104.0.5112.124","20.3.11":"104.0.5112.124","20.3.12":"104.0.5112.124","21.0.0-alpha.1":"105.0.5187.0","21.0.0-alpha.2":"105.0.5187.0","21.0.0-alpha.3":"105.0.5187.0","21.0.0-alpha.4":"105.0.5187.0","21.0.0-alpha.5":"105.0.5187.0","21.0.0-alpha.6":"106.0.5216.0","21.0.0-beta.1":"106.0.5216.0","21.0.0-beta.2":"106.0.5216.0","21.0.0-beta.3":"106.0.5216.0","21.0.0-beta.4":"106.0.5216.0","21.0.0-beta.5":"106.0.5216.0","21.0.0-beta.6":"106.0.5249.40","21.0.0-beta.7":"106.0.5249.40","21.0.0-beta.8":"106.0.5249.40","21.0.0-nightly.20220526":"103.0.5044.0","21.0.0-nightly.20220527":"103.0.5044.0","21.0.0-nightly.20220530":"103.0.5044.0","21.0.0-nightly.20220531":"103.0.5044.0","21.0.0-nightly.20220602":"104.0.5073.0","21.0.0-nightly.20220603":"104.0.5073.0","21.0.0-nightly.20220606":"104.0.5073.0","21.0.0-nightly.20220607":"104.0.5073.0","21.0.0-nightly.20220608":"104.0.5073.0","21.0.0-nightly.20220609":"104.0.5073.0","21.0.0-nightly.20220610":"104.0.5073.0","21.0.0-nightly.20220613":"104.0.5073.0","21.0.0-nightly.20220614":"104.0.5073.0","21.0.0-nightly.20220615":"104.0.5073.0","21.0.0-nightly.20220616":"104.0.5073.0","21.0.0-nightly.20220617":"104.0.5073.0","21.0.0-nightly.20220620":"104.0.5073.0","21.0.0-nightly.20220621":"104.0.5073.0","21.0.0-nightly.20220622":"104.0.5073.0","21.0.0-nightly.20220623":"104.0.5073.0","21.0.0-nightly.20220624":"104.0.5073.0","21.0.0-nightly.20220627":"104.0.5073.0","21.0.0-nightly.20220628":"105.0.5129.0","21.0.0-nightly.20220629":"105.0.5129.0","21.0.0-nightly.20220630":"105.0.5129.0","21.0.0-nightly.20220701":"105.0.5129.0","21.0.0-nightly.20220704":"105.0.5129.0","21.0.0-nightly.20220705":"105.0.5129.0","21.0.0-nightly.20220706":"105.0.5129.0","21.0.0-nightly.20220707":"105.0.5129.0","21.0.0-nightly.20220708":"105.0.5129.0","21.0.0-nightly.20220711":"105.0.5129.0","21.0.0-nightly.20220712":"105.0.5129.0","21.0.0-nightly.20220713":"105.0.5129.0","21.0.0-nightly.20220715":"105.0.5173.0","21.0.0-nightly.20220718":"105.0.5173.0","21.0.0-nightly.20220719":"105.0.5173.0","21.0.0-nightly.20220720":"105.0.5187.0","21.0.0-nightly.20220721":"105.0.5187.0","21.0.0-nightly.20220722":"105.0.5187.0","21.0.0-nightly.20220725":"105.0.5187.0","21.0.0-nightly.20220726":"105.0.5187.0","21.0.0-nightly.20220727":"105.0.5187.0","21.0.0-nightly.20220728":"105.0.5187.0","21.0.0-nightly.20220801":"105.0.5187.0","21.0.0-nightly.20220802":"105.0.5187.0","21.0.0":"106.0.5249.51","21.0.1":"106.0.5249.61","21.1.0":"106.0.5249.91","21.1.1":"106.0.5249.103","21.2.0":"106.0.5249.119","21.2.1":"106.0.5249.165","21.2.2":"106.0.5249.168","21.2.3":"106.0.5249.168","21.3.0":"106.0.5249.181","21.3.1":"106.0.5249.181","21.3.3":"106.0.5249.199","21.3.4":"106.0.5249.199","21.3.5":"106.0.5249.199","21.4.0":"106.0.5249.199","21.4.1":"106.0.5249.199","21.4.2":"106.0.5249.199","21.4.3":"106.0.5249.199","21.4.4":"106.0.5249.199","22.0.0-alpha.1":"107.0.5286.0","22.0.0-alpha.3":"108.0.5329.0","22.0.0-alpha.4":"108.0.5329.0","22.0.0-alpha.5":"108.0.5329.0","22.0.0-alpha.6":"108.0.5329.0","22.0.0-alpha.7":"108.0.5355.0","22.0.0-alpha.8":"108.0.5359.10","22.0.0-beta.1":"108.0.5359.10","22.0.0-beta.2":"108.0.5359.10","22.0.0-beta.3":"108.0.5359.10","22.0.0-beta.4":"108.0.5359.29","22.0.0-beta.5":"108.0.5359.40","22.0.0-beta.6":"108.0.5359.40","22.0.0-beta.7":"108.0.5359.48","22.0.0-beta.8":"108.0.5359.48","22.0.0-nightly.20220808":"105.0.5187.0","22.0.0-nightly.20220809":"105.0.5187.0","22.0.0-nightly.20220810":"105.0.5187.0","22.0.0-nightly.20220811":"105.0.5187.0","22.0.0-nightly.20220812":"105.0.5187.0","22.0.0-nightly.20220815":"105.0.5187.0","22.0.0-nightly.20220816":"105.0.5187.0","22.0.0-nightly.20220817":"105.0.5187.0","22.0.0-nightly.20220822":"106.0.5216.0","22.0.0-nightly.20220823":"106.0.5216.0","22.0.0-nightly.20220824":"106.0.5216.0","22.0.0-nightly.20220825":"106.0.5216.0","22.0.0-nightly.20220829":"106.0.5216.0","22.0.0-nightly.20220830":"106.0.5216.0","22.0.0-nightly.20220831":"106.0.5216.0","22.0.0-nightly.20220901":"106.0.5216.0","22.0.0-nightly.20220902":"106.0.5216.0","22.0.0-nightly.20220905":"106.0.5216.0","22.0.0-nightly.20220908":"107.0.5274.0","22.0.0-nightly.20220909":"107.0.5286.0","22.0.0-nightly.20220912":"107.0.5286.0","22.0.0-nightly.20220913":"107.0.5286.0","22.0.0-nightly.20220914":"107.0.5286.0","22.0.0-nightly.20220915":"107.0.5286.0","22.0.0-nightly.20220916":"107.0.5286.0","22.0.0-nightly.20220919":"107.0.5286.0","22.0.0-nightly.20220920":"107.0.5286.0","22.0.0-nightly.20220921":"107.0.5286.0","22.0.0-nightly.20220922":"107.0.5286.0","22.0.0-nightly.20220923":"107.0.5286.0","22.0.0-nightly.20220926":"107.0.5286.0","22.0.0-nightly.20220927":"107.0.5286.0","22.0.0-nightly.20220928":"107.0.5286.0","22.0.0":"108.0.5359.62","22.0.1":"108.0.5359.125","22.0.2":"108.0.5359.179","22.0.3":"108.0.5359.179","22.1.0":"108.0.5359.179","22.2.0":"108.0.5359.215","22.2.1":"108.0.5359.215","22.3.0":"108.0.5359.215","22.3.1":"108.0.5359.215","22.3.2":"108.0.5359.215","22.3.3":"108.0.5359.215","22.3.4":"108.0.5359.215","22.3.5":"108.0.5359.215","22.3.6":"108.0.5359.215","22.3.7":"108.0.5359.215","22.3.8":"108.0.5359.215","22.3.9":"108.0.5359.215","22.3.10":"108.0.5359.215","22.3.11":"108.0.5359.215","22.3.12":"108.0.5359.215","22.3.13":"108.0.5359.215","22.3.14":"108.0.5359.215","22.3.15":"108.0.5359.215","22.3.16":"108.0.5359.215","22.3.17":"108.0.5359.215","22.3.18":"108.0.5359.215","22.3.20":"108.0.5359.215","22.3.21":"108.0.5359.215","22.3.22":"108.0.5359.215","22.3.23":"108.0.5359.215","22.3.24":"108.0.5359.215","22.3.25":"108.0.5359.215","22.3.26":"108.0.5359.215","22.3.27":"108.0.5359.215","23.0.0-alpha.1":"110.0.5415.0","23.0.0-alpha.2":"110.0.5451.0","23.0.0-alpha.3":"110.0.5451.0","23.0.0-beta.1":"110.0.5478.5","23.0.0-beta.2":"110.0.5478.5","23.0.0-beta.3":"110.0.5478.5","23.0.0-beta.4":"110.0.5481.30","23.0.0-beta.5":"110.0.5481.38","23.0.0-beta.6":"110.0.5481.52","23.0.0-beta.8":"110.0.5481.52","23.0.0-nightly.20220929":"107.0.5286.0","23.0.0-nightly.20220930":"107.0.5286.0","23.0.0-nightly.20221003":"107.0.5286.0","23.0.0-nightly.20221004":"108.0.5329.0","23.0.0-nightly.20221005":"108.0.5329.0","23.0.0-nightly.20221006":"108.0.5329.0","23.0.0-nightly.20221007":"108.0.5329.0","23.0.0-nightly.20221010":"108.0.5329.0","23.0.0-nightly.20221011":"108.0.5329.0","23.0.0-nightly.20221012":"108.0.5329.0","23.0.0-nightly.20221013":"108.0.5329.0","23.0.0-nightly.20221014":"108.0.5329.0","23.0.0-nightly.20221017":"108.0.5329.0","23.0.0-nightly.20221018":"108.0.5355.0","23.0.0-nightly.20221019":"108.0.5355.0","23.0.0-nightly.20221020":"108.0.5355.0","23.0.0-nightly.20221021":"108.0.5355.0","23.0.0-nightly.20221024":"108.0.5355.0","23.0.0-nightly.20221026":"108.0.5355.0","23.0.0-nightly.20221027":"109.0.5382.0","23.0.0-nightly.20221028":"109.0.5382.0","23.0.0-nightly.20221031":"109.0.5382.0","23.0.0-nightly.20221101":"109.0.5382.0","23.0.0-nightly.20221102":"109.0.5382.0","23.0.0-nightly.20221103":"109.0.5382.0","23.0.0-nightly.20221104":"109.0.5382.0","23.0.0-nightly.20221107":"109.0.5382.0","23.0.0-nightly.20221108":"109.0.5382.0","23.0.0-nightly.20221109":"109.0.5382.0","23.0.0-nightly.20221110":"109.0.5382.0","23.0.0-nightly.20221111":"109.0.5382.0","23.0.0-nightly.20221114":"109.0.5382.0","23.0.0-nightly.20221115":"109.0.5382.0","23.0.0-nightly.20221116":"109.0.5382.0","23.0.0-nightly.20221117":"109.0.5382.0","23.0.0-nightly.20221118":"110.0.5415.0","23.0.0-nightly.20221121":"110.0.5415.0","23.0.0-nightly.20221122":"110.0.5415.0","23.0.0-nightly.20221123":"110.0.5415.0","23.0.0-nightly.20221124":"110.0.5415.0","23.0.0-nightly.20221125":"110.0.5415.0","23.0.0-nightly.20221128":"110.0.5415.0","23.0.0-nightly.20221129":"110.0.5415.0","23.0.0-nightly.20221130":"110.0.5415.0","23.0.0":"110.0.5481.77","23.1.0":"110.0.5481.100","23.1.1":"110.0.5481.104","23.1.2":"110.0.5481.177","23.1.3":"110.0.5481.179","23.1.4":"110.0.5481.192","23.2.0":"110.0.5481.192","23.2.1":"110.0.5481.208","23.2.2":"110.0.5481.208","23.2.3":"110.0.5481.208","23.2.4":"110.0.5481.208","23.3.0":"110.0.5481.208","23.3.1":"110.0.5481.208","23.3.2":"110.0.5481.208","23.3.3":"110.0.5481.208","23.3.4":"110.0.5481.208","23.3.5":"110.0.5481.208","23.3.6":"110.0.5481.208","23.3.7":"110.0.5481.208","23.3.8":"110.0.5481.208","23.3.9":"110.0.5481.208","23.3.10":"110.0.5481.208","23.3.11":"110.0.5481.208","23.3.12":"110.0.5481.208","23.3.13":"110.0.5481.208","24.0.0-alpha.1":"111.0.5560.0","24.0.0-alpha.2":"111.0.5560.0","24.0.0-alpha.3":"111.0.5560.0","24.0.0-alpha.4":"111.0.5560.0","24.0.0-alpha.5":"111.0.5560.0","24.0.0-alpha.6":"111.0.5560.0","24.0.0-alpha.7":"111.0.5560.0","24.0.0-beta.1":"111.0.5563.50","24.0.0-beta.2":"111.0.5563.50","24.0.0-beta.3":"112.0.5615.20","24.0.0-beta.4":"112.0.5615.20","24.0.0-beta.5":"112.0.5615.29","24.0.0-beta.6":"112.0.5615.39","24.0.0-beta.7":"112.0.5615.39","24.0.0-nightly.20221201":"110.0.5415.0","24.0.0-nightly.20221202":"110.0.5415.0","24.0.0-nightly.20221205":"110.0.5415.0","24.0.0-nightly.20221206":"110.0.5451.0","24.0.0-nightly.20221207":"110.0.5451.0","24.0.0-nightly.20221208":"110.0.5451.0","24.0.0-nightly.20221213":"110.0.5451.0","24.0.0-nightly.20221214":"110.0.5451.0","24.0.0-nightly.20221215":"110.0.5451.0","24.0.0-nightly.20221216":"110.0.5451.0","24.0.0-nightly.20230109":"111.0.5518.0","24.0.0-nightly.20230110":"111.0.5518.0","24.0.0-nightly.20230111":"111.0.5518.0","24.0.0-nightly.20230112":"111.0.5518.0","24.0.0-nightly.20230113":"111.0.5518.0","24.0.0-nightly.20230116":"111.0.5518.0","24.0.0-nightly.20230117":"111.0.5518.0","24.0.0-nightly.20230118":"111.0.5518.0","24.0.0-nightly.20230119":"111.0.5518.0","24.0.0-nightly.20230120":"111.0.5518.0","24.0.0-nightly.20230123":"111.0.5518.0","24.0.0-nightly.20230124":"111.0.5518.0","24.0.0-nightly.20230125":"111.0.5518.0","24.0.0-nightly.20230126":"111.0.5518.0","24.0.0-nightly.20230127":"111.0.5518.0","24.0.0-nightly.20230131":"111.0.5518.0","24.0.0-nightly.20230201":"111.0.5518.0","24.0.0-nightly.20230202":"111.0.5518.0","24.0.0-nightly.20230203":"111.0.5560.0","24.0.0-nightly.20230206":"111.0.5560.0","24.0.0-nightly.20230207":"111.0.5560.0","24.0.0-nightly.20230208":"111.0.5560.0","24.0.0-nightly.20230209":"111.0.5560.0","24.0.0":"112.0.5615.49","24.1.0":"112.0.5615.50","24.1.1":"112.0.5615.50","24.1.2":"112.0.5615.87","24.1.3":"112.0.5615.165","24.2.0":"112.0.5615.165","24.3.0":"112.0.5615.165","24.3.1":"112.0.5615.183","24.4.0":"112.0.5615.204","24.4.1":"112.0.5615.204","24.5.0":"112.0.5615.204","24.5.1":"112.0.5615.204","24.6.0":"112.0.5615.204","24.6.1":"112.0.5615.204","24.6.2":"112.0.5615.204","24.6.3":"112.0.5615.204","24.6.4":"112.0.5615.204","24.6.5":"112.0.5615.204","24.7.0":"112.0.5615.204","24.7.1":"112.0.5615.204","24.8.0":"112.0.5615.204","24.8.1":"112.0.5615.204","24.8.2":"112.0.5615.204","24.8.3":"112.0.5615.204","24.8.4":"112.0.5615.204","24.8.5":"112.0.5615.204","24.8.6":"112.0.5615.204","24.8.7":"112.0.5615.204","24.8.8":"112.0.5615.204","25.0.0-alpha.1":"114.0.5694.0","25.0.0-alpha.2":"114.0.5694.0","25.0.0-alpha.3":"114.0.5710.0","25.0.0-alpha.4":"114.0.5710.0","25.0.0-alpha.5":"114.0.5719.0","25.0.0-alpha.6":"114.0.5719.0","25.0.0-beta.1":"114.0.5719.0","25.0.0-beta.2":"114.0.5719.0","25.0.0-beta.3":"114.0.5719.0","25.0.0-beta.4":"114.0.5735.16","25.0.0-beta.5":"114.0.5735.16","25.0.0-beta.6":"114.0.5735.16","25.0.0-beta.7":"114.0.5735.16","25.0.0-beta.8":"114.0.5735.35","25.0.0-beta.9":"114.0.5735.45","25.0.0-nightly.20230210":"111.0.5560.0","25.0.0-nightly.20230214":"111.0.5560.0","25.0.0-nightly.20230215":"111.0.5560.0","25.0.0-nightly.20230216":"111.0.5560.0","25.0.0-nightly.20230217":"111.0.5560.0","25.0.0-nightly.20230220":"111.0.5560.0","25.0.0-nightly.20230221":"111.0.5560.0","25.0.0-nightly.20230222":"111.0.5560.0","25.0.0-nightly.20230223":"111.0.5560.0","25.0.0-nightly.20230224":"111.0.5560.0","25.0.0-nightly.20230227":"111.0.5560.0","25.0.0-nightly.20230228":"111.0.5560.0","25.0.0-nightly.20230301":"111.0.5560.0","25.0.0-nightly.20230302":"111.0.5560.0","25.0.0-nightly.20230303":"111.0.5560.0","25.0.0-nightly.20230306":"111.0.5560.0","25.0.0-nightly.20230307":"111.0.5560.0","25.0.0-nightly.20230308":"111.0.5560.0","25.0.0-nightly.20230309":"111.0.5560.0","25.0.0-nightly.20230310":"111.0.5560.0","25.0.0-nightly.20230314":"113.0.5636.0","25.0.0-nightly.20230315":"113.0.5651.0","25.0.0-nightly.20230317":"113.0.5653.0","25.0.0-nightly.20230320":"113.0.5660.0","25.0.0-nightly.20230321":"113.0.5664.0","25.0.0-nightly.20230322":"113.0.5666.0","25.0.0-nightly.20230323":"113.0.5668.0","25.0.0-nightly.20230324":"113.0.5670.0","25.0.0-nightly.20230327":"113.0.5670.0","25.0.0-nightly.20230328":"113.0.5670.0","25.0.0-nightly.20230329":"113.0.5670.0","25.0.0-nightly.20230330":"113.0.5670.0","25.0.0-nightly.20230331":"114.0.5684.0","25.0.0-nightly.20230403":"114.0.5684.0","25.0.0-nightly.20230404":"114.0.5692.0","25.0.0-nightly.20230405":"114.0.5694.0","25.0.0":"114.0.5735.45","25.0.1":"114.0.5735.45","25.1.0":"114.0.5735.106","25.1.1":"114.0.5735.106","25.2.0":"114.0.5735.134","25.3.0":"114.0.5735.199","25.3.1":"114.0.5735.243","25.3.2":"114.0.5735.248","25.4.0":"114.0.5735.248","25.5.0":"114.0.5735.289","25.6.0":"114.0.5735.289","25.7.0":"114.0.5735.289","25.8.0":"114.0.5735.289","25.8.1":"114.0.5735.289","25.8.2":"114.0.5735.289","25.8.3":"114.0.5735.289","25.8.4":"114.0.5735.289","25.9.0":"114.0.5735.289","25.9.1":"114.0.5735.289","25.9.2":"114.0.5735.289","25.9.3":"114.0.5735.289","25.9.4":"114.0.5735.289","25.9.5":"114.0.5735.289","26.0.0-alpha.1":"116.0.5791.0","26.0.0-alpha.2":"116.0.5791.0","26.0.0-alpha.3":"116.0.5791.0","26.0.0-alpha.4":"116.0.5791.0","26.0.0-alpha.5":"116.0.5791.0","26.0.0-alpha.6":"116.0.5815.0","26.0.0-alpha.7":"116.0.5831.0","26.0.0-alpha.8":"116.0.5845.0","26.0.0-beta.1":"116.0.5845.0","26.0.0-beta.2":"116.0.5845.14","26.0.0-beta.3":"116.0.5845.14","26.0.0-beta.4":"116.0.5845.14","26.0.0-beta.5":"116.0.5845.14","26.0.0-beta.6":"116.0.5845.14","26.0.0-beta.7":"116.0.5845.14","26.0.0-beta.8":"116.0.5845.42","26.0.0-beta.9":"116.0.5845.42","26.0.0-beta.10":"116.0.5845.49","26.0.0-beta.11":"116.0.5845.49","26.0.0-beta.12":"116.0.5845.62","26.0.0-nightly.20230406":"114.0.5694.0","26.0.0-nightly.20230407":"114.0.5694.0","26.0.0-nightly.20230410":"114.0.5694.0","26.0.0-nightly.20230411":"114.0.5694.0","26.0.0-nightly.20230412":"114.0.5708.0","26.0.0-nightly.20230413":"114.0.5710.0","26.0.0-nightly.20230414":"114.0.5710.0","26.0.0-nightly.20230417":"114.0.5710.0","26.0.0-nightly.20230418":"114.0.5715.0","26.0.0-nightly.20230421":"114.0.5719.0","26.0.0-nightly.20230424":"114.0.5719.0","26.0.0-nightly.20230425":"114.0.5719.0","26.0.0-nightly.20230426":"114.0.5719.0","26.0.0-nightly.20230427":"114.0.5719.0","26.0.0-nightly.20230428":"114.0.5719.0","26.0.0-nightly.20230501":"114.0.5719.0","26.0.0-nightly.20230502":"114.0.5719.0","26.0.0-nightly.20230503":"114.0.5719.0","26.0.0-nightly.20230504":"114.0.5719.0","26.0.0-nightly.20230505":"114.0.5719.0","26.0.0-nightly.20230508":"114.0.5719.0","26.0.0-nightly.20230509":"114.0.5719.0","26.0.0-nightly.20230510":"114.0.5719.0","26.0.0-nightly.20230511":"115.0.5760.0","26.0.0-nightly.20230512":"115.0.5760.0","26.0.0-nightly.20230515":"115.0.5760.0","26.0.0-nightly.20230516":"115.0.5760.0","26.0.0-nightly.20230517":"115.0.5760.0","26.0.0-nightly.20230518":"115.0.5760.0","26.0.0-nightly.20230519":"115.0.5760.0","26.0.0-nightly.20230522":"115.0.5760.0","26.0.0-nightly.20230523":"115.0.5760.0","26.0.0-nightly.20230524":"115.0.5786.0","26.0.0-nightly.20230525":"115.0.5790.0","26.0.0-nightly.20230526":"116.0.5791.0","26.0.0-nightly.20230529":"116.0.5791.0","26.0.0-nightly.20230530":"116.0.5791.0","26.0.0-nightly.20230531":"116.0.5791.0","26.0.0":"116.0.5845.82","26.1.0":"116.0.5845.97","26.2.0":"116.0.5845.179","26.2.1":"116.0.5845.188","26.2.2":"116.0.5845.190","26.2.3":"116.0.5845.190","26.2.4":"116.0.5845.190","26.3.0":"116.0.5845.228","26.4.0":"116.0.5845.228","26.4.1":"116.0.5845.228","26.4.2":"116.0.5845.228","26.4.3":"116.0.5845.228","26.5.0":"116.0.5845.228","26.6.0":"116.0.5845.228","27.0.0-alpha.1":"118.0.5949.0","27.0.0-alpha.2":"118.0.5949.0","27.0.0-alpha.3":"118.0.5949.0","27.0.0-alpha.4":"118.0.5949.0","27.0.0-alpha.5":"118.0.5949.0","27.0.0-alpha.6":"118.0.5949.0","27.0.0-beta.1":"118.0.5993.5","27.0.0-beta.2":"118.0.5993.5","27.0.0-beta.3":"118.0.5993.5","27.0.0-beta.4":"118.0.5993.11","27.0.0-beta.5":"118.0.5993.18","27.0.0-beta.6":"118.0.5993.18","27.0.0-beta.7":"118.0.5993.18","27.0.0-beta.8":"118.0.5993.18","27.0.0-beta.9":"118.0.5993.18","27.0.0-nightly.20230601":"116.0.5791.0","27.0.0-nightly.20230602":"116.0.5791.0","27.0.0-nightly.20230605":"116.0.5791.0","27.0.0-nightly.20230606":"116.0.5791.0","27.0.0-nightly.20230607":"116.0.5791.0","27.0.0-nightly.20230609":"116.0.5791.0","27.0.0-nightly.20230612":"116.0.5815.0","27.0.0-nightly.20230613":"116.0.5815.0","27.0.0-nightly.20230614":"116.0.5829.0","27.0.0-nightly.20230615":"116.0.5831.0","27.0.0-nightly.20230616":"116.0.5833.0","27.0.0-nightly.20230619":"116.0.5833.0","27.0.0-nightly.20230620":"116.0.5833.0","27.0.0-nightly.20230621":"116.0.5833.0","27.0.0-nightly.20230622":"116.0.5845.0","27.0.0-nightly.20230623":"116.0.5845.0","27.0.0-nightly.20230626":"116.0.5845.0","27.0.0-nightly.20230627":"116.0.5845.0","27.0.0-nightly.20230628":"116.0.5845.0","27.0.0-nightly.20230629":"116.0.5845.0","27.0.0-nightly.20230630":"116.0.5845.0","27.0.0-nightly.20230703":"117.0.5852.0","27.0.0-nightly.20230704":"117.0.5852.0","27.0.0-nightly.20230705":"117.0.5852.0","27.0.0-nightly.20230706":"117.0.5852.0","27.0.0-nightly.20230707":"117.0.5852.0","27.0.0-nightly.20230710":"117.0.5852.0","27.0.0-nightly.20230711":"117.0.5852.0","27.0.0-nightly.20230712":"117.0.5852.0","27.0.0-nightly.20230713":"117.0.5852.0","27.0.0-nightly.20230714":"117.0.5852.0","27.0.0-nightly.20230717":"117.0.5884.1","27.0.0-nightly.20230718":"117.0.5884.1","27.0.0-nightly.20230719":"117.0.5892.0","27.0.0-nightly.20230720":"117.0.5897.0","27.0.0-nightly.20230721":"117.0.5897.0","27.0.0-nightly.20230724":"117.0.5897.0","27.0.0-nightly.20230725":"117.0.5897.0","27.0.0-nightly.20230726":"117.0.5897.0","27.0.0-nightly.20230727":"117.0.5897.0","27.0.0-nightly.20230728":"117.0.5897.0","27.0.0-nightly.20230731":"117.0.5897.0","27.0.0-nightly.20230801":"117.0.5911.0","27.0.0-nightly.20230802":"117.0.5911.0","27.0.0-nightly.20230803":"117.0.5911.0","27.0.0-nightly.20230804":"117.0.5921.0","27.0.0-nightly.20230807":"117.0.5921.0","27.0.0-nightly.20230808":"117.0.5921.0","27.0.0-nightly.20230814":"117.0.5921.0","27.0.0-nightly.20230815":"117.0.5921.0","27.0.0-nightly.20230816":"118.0.5949.0","27.0.0":"118.0.5993.54","27.0.1":"118.0.5993.89","27.0.2":"118.0.5993.89","27.0.3":"118.0.5993.120","27.0.4":"118.0.5993.129","27.1.0":"118.0.5993.144","28.0.0-alpha.1":"119.0.6045.0","28.0.0-alpha.2":"119.0.6045.0","28.0.0-alpha.3":"119.0.6045.21","28.0.0-alpha.4":"119.0.6045.21","28.0.0-alpha.5":"119.0.6045.33","28.0.0-alpha.6":"119.0.6045.33","28.0.0-alpha.7":"119.0.6045.33","28.0.0-beta.1":"119.0.6045.33","28.0.0-beta.2":"120.0.6099.0","28.0.0-beta.3":"120.0.6099.5","28.0.0-beta.4":"120.0.6099.5","28.0.0-beta.5":"120.0.6099.18","28.0.0-beta.6":"120.0.6099.18","28.0.0-beta.7":"120.0.6099.18","28.0.0-nightly.20230817":"118.0.5949.0","28.0.0-nightly.20230818":"118.0.5949.0","28.0.0-nightly.20230821":"118.0.5949.0","28.0.0-nightly.20230822":"118.0.5949.0","28.0.0-nightly.20230823":"118.0.5949.0","28.0.0-nightly.20230824":"118.0.5949.0","28.0.0-nightly.20230825":"118.0.5949.0","28.0.0-nightly.20230828":"118.0.5949.0","28.0.0-nightly.20230829":"118.0.5949.0","28.0.0-nightly.20230830":"118.0.5949.0","28.0.0-nightly.20230831":"118.0.5949.0","28.0.0-nightly.20230906":"118.0.5991.0","28.0.0-nightly.20230907":"118.0.5993.0","28.0.0-nightly.20230908":"118.0.5993.0","28.0.0-nightly.20230911":"118.0.5993.0","28.0.0-nightly.20230912":"118.0.5993.0","28.0.0-nightly.20230913":"118.0.5993.0","28.0.0-nightly.20230914":"118.0.5993.0","28.0.0-nightly.20230915":"118.0.5993.0","28.0.0-nightly.20230919":"119.0.6006.0","28.0.0-nightly.20230920":"119.0.6017.0","28.0.0-nightly.20230921":"119.0.6019.2","28.0.0-nightly.20230925":"119.0.6019.2","28.0.0-nightly.20230926":"119.0.6019.2","28.0.0-nightly.20230927":"119.0.6019.2","28.0.0-nightly.20230928":"119.0.6019.2","28.0.0-nightly.20230929":"119.0.6029.0","28.0.0-nightly.20231002":"119.0.6029.0","28.0.0-nightly.20231003":"119.0.6043.0","28.0.0-nightly.20231004":"119.0.6043.0","28.0.0-nightly.20231005":"119.0.6043.0","28.0.0-nightly.20231006":"119.0.6045.0","28.0.0-nightly.20231009":"119.0.6045.0","28.0.0-nightly.20231010":"119.0.6045.0","28.0.0-nightly.20231011":"119.0.6045.0","29.0.0-nightly.20231012":"119.0.6045.0","29.0.0-nightly.20231013":"119.0.6045.0","29.0.0-nightly.20231016":"119.0.6045.0","29.0.0-nightly.20231017":"119.0.6045.0","29.0.0-nightly.20231018":"119.0.6045.0","29.0.0-nightly.20231019":"119.0.6045.0","29.0.0-nightly.20231020":"119.0.6045.0","29.0.0-nightly.20231023":"119.0.6045.0","29.0.0-nightly.20231024":"119.0.6045.0","29.0.0-nightly.20231025":"120.0.6078.0","29.0.0-nightly.20231026":"120.0.6078.0","29.0.0-nightly.20231027":"120.0.6078.0","29.0.0-nightly.20231030":"120.0.6078.0","29.0.0-nightly.20231031":"120.0.6078.0","29.0.0-nightly.20231101":"120.0.6078.0","29.0.0-nightly.20231102":"121.0.6100.0","29.0.0-nightly.20231103":"121.0.6100.0","29.0.0-nightly.20231106":"121.0.6104.0","29.0.0-nightly.20231107":"121.0.6110.0","29.0.0-nightly.20231108":"121.0.6110.0","29.0.0-nightly.20231109":"121.0.6110.0","29.0.0-nightly.20231110":"121.0.6110.0","29.0.0-nightly.20231113":"121.0.6110.0","29.0.0-nightly.20231114":"121.0.6110.0","29.0.0-nightly.20231115":"121.0.6116.0","29.0.0-nightly.20231116":"121.0.6116.0","29.0.0-nightly.20231117":"121.0.6116.0"} \ No newline at end of file +{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8-nightly.20180819":"61.0.3163.100","2.0.8-nightly.20180820":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.100","3.0.0-beta.1":"66.0.3359.181","3.0.0-beta.2":"66.0.3359.181","3.0.0-beta.3":"66.0.3359.181","3.0.0-beta.4":"66.0.3359.181","3.0.0-beta.5":"66.0.3359.181","3.0.0-beta.6":"66.0.3359.181","3.0.0-beta.7":"66.0.3359.181","3.0.0-beta.8":"66.0.3359.181","3.0.0-beta.9":"66.0.3359.181","3.0.0-beta.10":"66.0.3359.181","3.0.0-beta.11":"66.0.3359.181","3.0.0-beta.12":"66.0.3359.181","3.0.0-beta.13":"66.0.3359.181","3.0.0-nightly.20180818":"66.0.3359.181","3.0.0-nightly.20180821":"66.0.3359.181","3.0.0-nightly.20180823":"66.0.3359.181","3.0.0-nightly.20180904":"66.0.3359.181","3.0.0":"66.0.3359.181","3.0.1":"66.0.3359.181","3.0.2":"66.0.3359.181","3.0.3":"66.0.3359.181","3.0.4":"66.0.3359.181","3.0.5":"66.0.3359.181","3.0.6":"66.0.3359.181","3.0.7":"66.0.3359.181","3.0.8":"66.0.3359.181","3.0.9":"66.0.3359.181","3.0.10":"66.0.3359.181","3.0.11":"66.0.3359.181","3.0.12":"66.0.3359.181","3.0.13":"66.0.3359.181","3.0.14":"66.0.3359.181","3.0.15":"66.0.3359.181","3.0.16":"66.0.3359.181","3.1.0-beta.1":"66.0.3359.181","3.1.0-beta.2":"66.0.3359.181","3.1.0-beta.3":"66.0.3359.181","3.1.0-beta.4":"66.0.3359.181","3.1.0-beta.5":"66.0.3359.181","3.1.0":"66.0.3359.181","3.1.1":"66.0.3359.181","3.1.2":"66.0.3359.181","3.1.3":"66.0.3359.181","3.1.4":"66.0.3359.181","3.1.5":"66.0.3359.181","3.1.6":"66.0.3359.181","3.1.7":"66.0.3359.181","3.1.8":"66.0.3359.181","3.1.9":"66.0.3359.181","3.1.10":"66.0.3359.181","3.1.11":"66.0.3359.181","3.1.12":"66.0.3359.181","3.1.13":"66.0.3359.181","4.0.0-beta.1":"69.0.3497.106","4.0.0-beta.2":"69.0.3497.106","4.0.0-beta.3":"69.0.3497.106","4.0.0-beta.4":"69.0.3497.106","4.0.0-beta.5":"69.0.3497.106","4.0.0-beta.6":"69.0.3497.106","4.0.0-beta.7":"69.0.3497.106","4.0.0-beta.8":"69.0.3497.106","4.0.0-beta.9":"69.0.3497.106","4.0.0-beta.10":"69.0.3497.106","4.0.0-beta.11":"69.0.3497.106","4.0.0-nightly.20180817":"66.0.3359.181","4.0.0-nightly.20180819":"66.0.3359.181","4.0.0-nightly.20180821":"66.0.3359.181","4.0.0-nightly.20180929":"67.0.3396.99","4.0.0-nightly.20181006":"68.0.3440.128","4.0.0-nightly.20181010":"69.0.3497.106","4.0.0":"69.0.3497.106","4.0.1":"69.0.3497.106","4.0.2":"69.0.3497.106","4.0.3":"69.0.3497.106","4.0.4":"69.0.3497.106","4.0.5":"69.0.3497.106","4.0.6":"69.0.3497.106","4.0.7":"69.0.3497.128","4.0.8":"69.0.3497.128","4.1.0":"69.0.3497.128","4.1.1":"69.0.3497.128","4.1.2":"69.0.3497.128","4.1.3":"69.0.3497.128","4.1.4":"69.0.3497.128","4.1.5":"69.0.3497.128","4.2.0":"69.0.3497.128","4.2.1":"69.0.3497.128","4.2.2":"69.0.3497.128","4.2.3":"69.0.3497.128","4.2.4":"69.0.3497.128","4.2.5":"69.0.3497.128","4.2.6":"69.0.3497.128","4.2.7":"69.0.3497.128","4.2.8":"69.0.3497.128","4.2.9":"69.0.3497.128","4.2.10":"69.0.3497.128","4.2.11":"69.0.3497.128","4.2.12":"69.0.3497.128","5.0.0-beta.1":"72.0.3626.52","5.0.0-beta.2":"72.0.3626.52","5.0.0-beta.3":"73.0.3683.27","5.0.0-beta.4":"73.0.3683.54","5.0.0-beta.5":"73.0.3683.61","5.0.0-beta.6":"73.0.3683.84","5.0.0-beta.7":"73.0.3683.94","5.0.0-beta.8":"73.0.3683.104","5.0.0-beta.9":"73.0.3683.117","5.0.0-nightly.20190107":"70.0.3538.110","5.0.0-nightly.20190121":"71.0.3578.98","5.0.0-nightly.20190122":"71.0.3578.98","5.0.0":"73.0.3683.119","5.0.1":"73.0.3683.121","5.0.2":"73.0.3683.121","5.0.3":"73.0.3683.121","5.0.4":"73.0.3683.121","5.0.5":"73.0.3683.121","5.0.6":"73.0.3683.121","5.0.7":"73.0.3683.121","5.0.8":"73.0.3683.121","5.0.9":"73.0.3683.121","5.0.10":"73.0.3683.121","5.0.11":"73.0.3683.121","5.0.12":"73.0.3683.121","5.0.13":"73.0.3683.121","6.0.0-beta.1":"76.0.3774.1","6.0.0-beta.2":"76.0.3783.1","6.0.0-beta.3":"76.0.3783.1","6.0.0-beta.4":"76.0.3783.1","6.0.0-beta.5":"76.0.3805.4","6.0.0-beta.6":"76.0.3809.3","6.0.0-beta.7":"76.0.3809.22","6.0.0-beta.8":"76.0.3809.26","6.0.0-beta.9":"76.0.3809.26","6.0.0-beta.10":"76.0.3809.37","6.0.0-beta.11":"76.0.3809.42","6.0.0-beta.12":"76.0.3809.54","6.0.0-beta.13":"76.0.3809.60","6.0.0-beta.14":"76.0.3809.68","6.0.0-beta.15":"76.0.3809.74","6.0.0-nightly.20190123":"72.0.3626.52","6.0.0-nightly.20190212":"72.0.3626.107","6.0.0-nightly.20190213":"72.0.3626.110","6.0.0-nightly.20190311":"74.0.3724.8","6.0.0":"76.0.3809.88","6.0.1":"76.0.3809.102","6.0.2":"76.0.3809.110","6.0.3":"76.0.3809.126","6.0.4":"76.0.3809.131","6.0.5":"76.0.3809.136","6.0.6":"76.0.3809.138","6.0.7":"76.0.3809.139","6.0.8":"76.0.3809.146","6.0.9":"76.0.3809.146","6.0.10":"76.0.3809.146","6.0.11":"76.0.3809.146","6.0.12":"76.0.3809.146","6.1.0":"76.0.3809.146","6.1.1":"76.0.3809.146","6.1.2":"76.0.3809.146","6.1.3":"76.0.3809.146","6.1.4":"76.0.3809.146","6.1.5":"76.0.3809.146","6.1.6":"76.0.3809.146","6.1.7":"76.0.3809.146","6.1.8":"76.0.3809.146","6.1.9":"76.0.3809.146","6.1.10":"76.0.3809.146","6.1.11":"76.0.3809.146","6.1.12":"76.0.3809.146","7.0.0-beta.1":"78.0.3866.0","7.0.0-beta.2":"78.0.3866.0","7.0.0-beta.3":"78.0.3866.0","7.0.0-beta.4":"78.0.3896.6","7.0.0-beta.5":"78.0.3905.1","7.0.0-beta.6":"78.0.3905.1","7.0.0-beta.7":"78.0.3905.1","7.0.0-nightly.20190521":"76.0.3784.0","7.0.0-nightly.20190529":"76.0.3806.0","7.0.0-nightly.20190530":"76.0.3806.0","7.0.0-nightly.20190531":"76.0.3806.0","7.0.0-nightly.20190602":"76.0.3806.0","7.0.0-nightly.20190603":"76.0.3806.0","7.0.0-nightly.20190604":"77.0.3814.0","7.0.0-nightly.20190605":"77.0.3815.0","7.0.0-nightly.20190606":"77.0.3815.0","7.0.0-nightly.20190607":"77.0.3815.0","7.0.0-nightly.20190608":"77.0.3815.0","7.0.0-nightly.20190609":"77.0.3815.0","7.0.0-nightly.20190611":"77.0.3815.0","7.0.0-nightly.20190612":"77.0.3815.0","7.0.0-nightly.20190613":"77.0.3815.0","7.0.0-nightly.20190615":"77.0.3815.0","7.0.0-nightly.20190616":"77.0.3815.0","7.0.0-nightly.20190618":"77.0.3815.0","7.0.0-nightly.20190619":"77.0.3815.0","7.0.0-nightly.20190622":"77.0.3815.0","7.0.0-nightly.20190623":"77.0.3815.0","7.0.0-nightly.20190624":"77.0.3815.0","7.0.0-nightly.20190627":"77.0.3815.0","7.0.0-nightly.20190629":"77.0.3815.0","7.0.0-nightly.20190630":"77.0.3815.0","7.0.0-nightly.20190701":"77.0.3815.0","7.0.0-nightly.20190702":"77.0.3815.0","7.0.0-nightly.20190704":"77.0.3843.0","7.0.0-nightly.20190705":"77.0.3843.0","7.0.0-nightly.20190719":"77.0.3848.0","7.0.0-nightly.20190720":"77.0.3848.0","7.0.0-nightly.20190721":"77.0.3848.0","7.0.0-nightly.20190726":"77.0.3864.0","7.0.0-nightly.20190727":"78.0.3866.0","7.0.0-nightly.20190728":"78.0.3866.0","7.0.0-nightly.20190729":"78.0.3866.0","7.0.0-nightly.20190730":"78.0.3866.0","7.0.0-nightly.20190731":"78.0.3866.0","7.0.0":"78.0.3905.1","7.0.1":"78.0.3904.92","7.1.0":"78.0.3904.94","7.1.1":"78.0.3904.99","7.1.2":"78.0.3904.113","7.1.3":"78.0.3904.126","7.1.4":"78.0.3904.130","7.1.5":"78.0.3904.130","7.1.6":"78.0.3904.130","7.1.7":"78.0.3904.130","7.1.8":"78.0.3904.130","7.1.9":"78.0.3904.130","7.1.10":"78.0.3904.130","7.1.11":"78.0.3904.130","7.1.12":"78.0.3904.130","7.1.13":"78.0.3904.130","7.1.14":"78.0.3904.130","7.2.0":"78.0.3904.130","7.2.1":"78.0.3904.130","7.2.2":"78.0.3904.130","7.2.3":"78.0.3904.130","7.2.4":"78.0.3904.130","7.3.0":"78.0.3904.130","7.3.1":"78.0.3904.130","7.3.2":"78.0.3904.130","7.3.3":"78.0.3904.130","8.0.0-beta.1":"79.0.3931.0","8.0.0-beta.2":"79.0.3931.0","8.0.0-beta.3":"80.0.3955.0","8.0.0-beta.4":"80.0.3955.0","8.0.0-beta.5":"80.0.3987.14","8.0.0-beta.6":"80.0.3987.51","8.0.0-beta.7":"80.0.3987.59","8.0.0-beta.8":"80.0.3987.75","8.0.0-beta.9":"80.0.3987.75","8.0.0-nightly.20190801":"78.0.3866.0","8.0.0-nightly.20190802":"78.0.3866.0","8.0.0-nightly.20190803":"78.0.3871.0","8.0.0-nightly.20190806":"78.0.3871.0","8.0.0-nightly.20190807":"78.0.3871.0","8.0.0-nightly.20190808":"78.0.3871.0","8.0.0-nightly.20190809":"78.0.3871.0","8.0.0-nightly.20190810":"78.0.3871.0","8.0.0-nightly.20190811":"78.0.3871.0","8.0.0-nightly.20190812":"78.0.3871.0","8.0.0-nightly.20190813":"78.0.3871.0","8.0.0-nightly.20190814":"78.0.3871.0","8.0.0-nightly.20190815":"78.0.3871.0","8.0.0-nightly.20190816":"78.0.3881.0","8.0.0-nightly.20190817":"78.0.3881.0","8.0.0-nightly.20190818":"78.0.3881.0","8.0.0-nightly.20190819":"78.0.3881.0","8.0.0-nightly.20190820":"78.0.3881.0","8.0.0-nightly.20190824":"78.0.3892.0","8.0.0-nightly.20190825":"78.0.3892.0","8.0.0-nightly.20190827":"78.0.3892.0","8.0.0-nightly.20190828":"78.0.3892.0","8.0.0-nightly.20190830":"78.0.3892.0","8.0.0-nightly.20190901":"78.0.3892.0","8.0.0-nightly.20190902":"78.0.3892.0","8.0.0-nightly.20190907":"78.0.3892.0","8.0.0-nightly.20190909":"78.0.3892.0","8.0.0-nightly.20190910":"78.0.3892.0","8.0.0-nightly.20190911":"78.0.3892.0","8.0.0-nightly.20190912":"78.0.3892.0","8.0.0-nightly.20190913":"78.0.3892.0","8.0.0-nightly.20190914":"78.0.3892.0","8.0.0-nightly.20190915":"78.0.3892.0","8.0.0-nightly.20190917":"78.0.3892.0","8.0.0-nightly.20190919":"79.0.3915.0","8.0.0-nightly.20190920":"79.0.3915.0","8.0.0-nightly.20190922":"79.0.3919.0","8.0.0-nightly.20190923":"79.0.3919.0","8.0.0-nightly.20190924":"79.0.3919.0","8.0.0-nightly.20190926":"79.0.3919.0","8.0.0-nightly.20190928":"79.0.3919.0","8.0.0-nightly.20190929":"79.0.3919.0","8.0.0-nightly.20190930":"79.0.3919.0","8.0.0-nightly.20191001":"79.0.3919.0","8.0.0-nightly.20191004":"79.0.3919.0","8.0.0-nightly.20191005":"79.0.3919.0","8.0.0-nightly.20191006":"79.0.3919.0","8.0.0-nightly.20191009":"79.0.3919.0","8.0.0-nightly.20191011":"79.0.3919.0","8.0.0-nightly.20191012":"79.0.3919.0","8.0.0-nightly.20191017":"79.0.3919.0","8.0.0-nightly.20191019":"79.0.3931.0","8.0.0-nightly.20191020":"79.0.3931.0","8.0.0-nightly.20191021":"79.0.3931.0","8.0.0-nightly.20191023":"79.0.3931.0","8.0.0-nightly.20191101":"80.0.3952.0","8.0.0-nightly.20191103":"80.0.3952.0","8.0.0-nightly.20191105":"80.0.3952.0","8.0.0":"80.0.3987.86","8.0.1":"80.0.3987.86","8.0.2":"80.0.3987.86","8.0.3":"80.0.3987.134","8.1.0":"80.0.3987.137","8.1.1":"80.0.3987.141","8.2.0":"80.0.3987.158","8.2.1":"80.0.3987.163","8.2.2":"80.0.3987.163","8.2.3":"80.0.3987.163","8.2.4":"80.0.3987.165","8.2.5":"80.0.3987.165","8.3.0":"80.0.3987.165","8.3.1":"80.0.3987.165","8.3.2":"80.0.3987.165","8.3.3":"80.0.3987.165","8.3.4":"80.0.3987.165","8.4.0":"80.0.3987.165","8.4.1":"80.0.3987.165","8.5.0":"80.0.3987.165","8.5.1":"80.0.3987.165","8.5.2":"80.0.3987.165","8.5.3":"80.0.3987.163","8.5.4":"80.0.3987.163","8.5.5":"80.0.3987.163","9.0.0-beta.1":"82.0.4048.0","9.0.0-beta.2":"82.0.4048.0","9.0.0-beta.3":"82.0.4048.0","9.0.0-beta.4":"82.0.4048.0","9.0.0-beta.5":"82.0.4048.0","9.0.0-beta.6":"82.0.4058.2","9.0.0-beta.7":"82.0.4058.2","9.0.0-beta.9":"82.0.4058.2","9.0.0-beta.10":"82.0.4085.10","9.0.0-beta.11":"82.0.4085.14","9.0.0-beta.12":"82.0.4085.14","9.0.0-beta.13":"82.0.4085.14","9.0.0-beta.14":"82.0.4085.27","9.0.0-beta.15":"83.0.4102.3","9.0.0-beta.16":"83.0.4102.3","9.0.0-beta.17":"83.0.4103.14","9.0.0-beta.18":"83.0.4103.16","9.0.0-beta.19":"83.0.4103.24","9.0.0-beta.20":"83.0.4103.26","9.0.0-beta.21":"83.0.4103.26","9.0.0-beta.22":"83.0.4103.34","9.0.0-beta.23":"83.0.4103.44","9.0.0-beta.24":"83.0.4103.45","9.0.0-nightly.20191121":"80.0.3954.0","9.0.0-nightly.20191122":"80.0.3954.0","9.0.0-nightly.20191123":"80.0.3954.0","9.0.0-nightly.20191124":"80.0.3954.0","9.0.0-nightly.20191126":"80.0.3954.0","9.0.0-nightly.20191128":"80.0.3954.0","9.0.0-nightly.20191129":"80.0.3954.0","9.0.0-nightly.20191130":"80.0.3954.0","9.0.0-nightly.20191201":"80.0.3954.0","9.0.0-nightly.20191202":"80.0.3954.0","9.0.0-nightly.20191203":"80.0.3954.0","9.0.0-nightly.20191204":"80.0.3954.0","9.0.0-nightly.20191205":"80.0.3954.0","9.0.0-nightly.20191210":"80.0.3954.0","9.0.0-nightly.20191220":"81.0.3994.0","9.0.0-nightly.20191221":"81.0.3994.0","9.0.0-nightly.20191222":"81.0.3994.0","9.0.0-nightly.20191223":"81.0.3994.0","9.0.0-nightly.20191224":"81.0.3994.0","9.0.0-nightly.20191225":"81.0.3994.0","9.0.0-nightly.20191226":"81.0.3994.0","9.0.0-nightly.20191228":"81.0.3994.0","9.0.0-nightly.20191229":"81.0.3994.0","9.0.0-nightly.20191230":"81.0.3994.0","9.0.0-nightly.20191231":"81.0.3994.0","9.0.0-nightly.20200101":"81.0.3994.0","9.0.0-nightly.20200103":"81.0.3994.0","9.0.0-nightly.20200104":"81.0.3994.0","9.0.0-nightly.20200105":"81.0.3994.0","9.0.0-nightly.20200106":"81.0.3994.0","9.0.0-nightly.20200108":"81.0.3994.0","9.0.0-nightly.20200109":"81.0.3994.0","9.0.0-nightly.20200110":"81.0.3994.0","9.0.0-nightly.20200111":"81.0.3994.0","9.0.0-nightly.20200113":"81.0.3994.0","9.0.0-nightly.20200115":"81.0.3994.0","9.0.0-nightly.20200116":"81.0.3994.0","9.0.0-nightly.20200117":"81.0.3994.0","9.0.0-nightly.20200119":"81.0.4030.0","9.0.0-nightly.20200121":"81.0.4030.0","9.0.0":"83.0.4103.64","9.0.1":"83.0.4103.94","9.0.2":"83.0.4103.94","9.0.3":"83.0.4103.100","9.0.4":"83.0.4103.104","9.0.5":"83.0.4103.119","9.1.0":"83.0.4103.122","9.1.1":"83.0.4103.122","9.1.2":"83.0.4103.122","9.2.0":"83.0.4103.122","9.2.1":"83.0.4103.122","9.3.0":"83.0.4103.122","9.3.1":"83.0.4103.122","9.3.2":"83.0.4103.122","9.3.3":"83.0.4103.122","9.3.4":"83.0.4103.122","9.3.5":"83.0.4103.122","9.4.0":"83.0.4103.122","9.4.1":"83.0.4103.122","9.4.2":"83.0.4103.122","9.4.3":"83.0.4103.122","9.4.4":"83.0.4103.122","10.0.0-beta.1":"84.0.4129.0","10.0.0-beta.2":"84.0.4129.0","10.0.0-beta.3":"85.0.4161.2","10.0.0-beta.4":"85.0.4161.2","10.0.0-beta.8":"85.0.4181.1","10.0.0-beta.9":"85.0.4181.1","10.0.0-beta.10":"85.0.4183.19","10.0.0-beta.11":"85.0.4183.20","10.0.0-beta.12":"85.0.4183.26","10.0.0-beta.13":"85.0.4183.39","10.0.0-beta.14":"85.0.4183.39","10.0.0-beta.15":"85.0.4183.39","10.0.0-beta.17":"85.0.4183.39","10.0.0-beta.19":"85.0.4183.39","10.0.0-beta.20":"85.0.4183.39","10.0.0-beta.21":"85.0.4183.39","10.0.0-beta.23":"85.0.4183.70","10.0.0-beta.24":"85.0.4183.78","10.0.0-beta.25":"85.0.4183.80","10.0.0-nightly.20200209":"82.0.4050.0","10.0.0-nightly.20200210":"82.0.4050.0","10.0.0-nightly.20200211":"82.0.4050.0","10.0.0-nightly.20200216":"82.0.4050.0","10.0.0-nightly.20200217":"82.0.4050.0","10.0.0-nightly.20200218":"82.0.4050.0","10.0.0-nightly.20200221":"82.0.4050.0","10.0.0-nightly.20200222":"82.0.4050.0","10.0.0-nightly.20200223":"82.0.4050.0","10.0.0-nightly.20200226":"82.0.4050.0","10.0.0-nightly.20200303":"82.0.4050.0","10.0.0-nightly.20200304":"82.0.4076.0","10.0.0-nightly.20200305":"82.0.4076.0","10.0.0-nightly.20200306":"82.0.4076.0","10.0.0-nightly.20200309":"82.0.4076.0","10.0.0-nightly.20200310":"82.0.4076.0","10.0.0-nightly.20200311":"82.0.4083.0","10.0.0-nightly.20200316":"83.0.4086.0","10.0.0-nightly.20200317":"83.0.4087.0","10.0.0-nightly.20200318":"83.0.4087.0","10.0.0-nightly.20200320":"83.0.4087.0","10.0.0-nightly.20200323":"83.0.4087.0","10.0.0-nightly.20200324":"83.0.4087.0","10.0.0-nightly.20200325":"83.0.4087.0","10.0.0-nightly.20200326":"83.0.4087.0","10.0.0-nightly.20200327":"83.0.4087.0","10.0.0-nightly.20200330":"83.0.4087.0","10.0.0-nightly.20200331":"83.0.4087.0","10.0.0-nightly.20200401":"83.0.4087.0","10.0.0-nightly.20200402":"83.0.4087.0","10.0.0-nightly.20200403":"83.0.4087.0","10.0.0-nightly.20200406":"83.0.4087.0","10.0.0-nightly.20200408":"83.0.4095.0","10.0.0-nightly.20200410":"83.0.4095.0","10.0.0-nightly.20200413":"83.0.4095.0","10.0.0-nightly.20200414":"84.0.4114.0","10.0.0-nightly.20200415":"84.0.4115.0","10.0.0-nightly.20200416":"84.0.4115.0","10.0.0-nightly.20200417":"84.0.4115.0","10.0.0-nightly.20200422":"84.0.4121.0","10.0.0-nightly.20200423":"84.0.4121.0","10.0.0-nightly.20200427":"84.0.4125.0","10.0.0-nightly.20200428":"84.0.4125.0","10.0.0-nightly.20200429":"84.0.4125.0","10.0.0-nightly.20200430":"84.0.4125.0","10.0.0-nightly.20200501":"84.0.4129.0","10.0.0-nightly.20200504":"84.0.4129.0","10.0.0-nightly.20200505":"84.0.4129.0","10.0.0-nightly.20200506":"84.0.4129.0","10.0.0-nightly.20200507":"84.0.4129.0","10.0.0-nightly.20200508":"84.0.4129.0","10.0.0-nightly.20200511":"84.0.4129.0","10.0.0-nightly.20200512":"84.0.4129.0","10.0.0-nightly.20200513":"84.0.4129.0","10.0.0-nightly.20200514":"84.0.4129.0","10.0.0-nightly.20200515":"84.0.4129.0","10.0.0-nightly.20200518":"84.0.4129.0","10.0.0-nightly.20200519":"84.0.4129.0","10.0.0-nightly.20200520":"84.0.4129.0","10.0.0-nightly.20200521":"84.0.4129.0","10.0.0":"85.0.4183.84","10.0.1":"85.0.4183.86","10.1.0":"85.0.4183.87","10.1.1":"85.0.4183.93","10.1.2":"85.0.4183.98","10.1.3":"85.0.4183.121","10.1.4":"85.0.4183.121","10.1.5":"85.0.4183.121","10.1.6":"85.0.4183.121","10.1.7":"85.0.4183.121","10.2.0":"85.0.4183.121","10.3.0":"85.0.4183.121","10.3.1":"85.0.4183.121","10.3.2":"85.0.4183.121","10.4.0":"85.0.4183.121","10.4.1":"85.0.4183.121","10.4.2":"85.0.4183.121","10.4.3":"85.0.4183.121","10.4.4":"85.0.4183.121","10.4.5":"85.0.4183.121","10.4.6":"85.0.4183.121","10.4.7":"85.0.4183.121","11.0.0-beta.1":"86.0.4234.0","11.0.0-beta.3":"86.0.4234.0","11.0.0-beta.4":"86.0.4234.0","11.0.0-beta.5":"86.0.4234.0","11.0.0-beta.6":"86.0.4234.0","11.0.0-beta.7":"86.0.4234.0","11.0.0-beta.8":"87.0.4251.1","11.0.0-beta.9":"87.0.4251.1","11.0.0-beta.11":"87.0.4251.1","11.0.0-beta.12":"87.0.4280.11","11.0.0-beta.13":"87.0.4280.11","11.0.0-beta.16":"87.0.4280.27","11.0.0-beta.17":"87.0.4280.27","11.0.0-beta.18":"87.0.4280.27","11.0.0-beta.19":"87.0.4280.27","11.0.0-beta.20":"87.0.4280.40","11.0.0-beta.22":"87.0.4280.47","11.0.0-beta.23":"87.0.4280.47","11.0.0-nightly.20200525":"84.0.4129.0","11.0.0-nightly.20200526":"84.0.4129.0","11.0.0-nightly.20200529":"85.0.4156.0","11.0.0-nightly.20200602":"85.0.4162.0","11.0.0-nightly.20200603":"85.0.4162.0","11.0.0-nightly.20200604":"85.0.4162.0","11.0.0-nightly.20200609":"85.0.4162.0","11.0.0-nightly.20200610":"85.0.4162.0","11.0.0-nightly.20200611":"85.0.4162.0","11.0.0-nightly.20200615":"85.0.4162.0","11.0.0-nightly.20200616":"85.0.4162.0","11.0.0-nightly.20200617":"85.0.4162.0","11.0.0-nightly.20200618":"85.0.4162.0","11.0.0-nightly.20200619":"85.0.4162.0","11.0.0-nightly.20200701":"85.0.4179.0","11.0.0-nightly.20200702":"85.0.4179.0","11.0.0-nightly.20200703":"85.0.4179.0","11.0.0-nightly.20200706":"85.0.4179.0","11.0.0-nightly.20200707":"85.0.4179.0","11.0.0-nightly.20200708":"85.0.4179.0","11.0.0-nightly.20200709":"85.0.4179.0","11.0.0-nightly.20200716":"86.0.4203.0","11.0.0-nightly.20200717":"86.0.4203.0","11.0.0-nightly.20200720":"86.0.4203.0","11.0.0-nightly.20200721":"86.0.4203.0","11.0.0-nightly.20200723":"86.0.4209.0","11.0.0-nightly.20200724":"86.0.4209.0","11.0.0-nightly.20200729":"86.0.4209.0","11.0.0-nightly.20200730":"86.0.4209.0","11.0.0-nightly.20200731":"86.0.4209.0","11.0.0-nightly.20200803":"86.0.4209.0","11.0.0-nightly.20200804":"86.0.4209.0","11.0.0-nightly.20200805":"86.0.4209.0","11.0.0-nightly.20200811":"86.0.4209.0","11.0.0-nightly.20200812":"86.0.4209.0","11.0.0-nightly.20200822":"86.0.4234.0","11.0.0-nightly.20200824":"86.0.4234.0","11.0.0-nightly.20200825":"86.0.4234.0","11.0.0-nightly.20200826":"86.0.4234.0","11.0.0":"87.0.4280.60","11.0.1":"87.0.4280.60","11.0.2":"87.0.4280.67","11.0.3":"87.0.4280.67","11.0.4":"87.0.4280.67","11.0.5":"87.0.4280.88","11.1.0":"87.0.4280.88","11.1.1":"87.0.4280.88","11.2.0":"87.0.4280.141","11.2.1":"87.0.4280.141","11.2.2":"87.0.4280.141","11.2.3":"87.0.4280.141","11.3.0":"87.0.4280.141","11.4.0":"87.0.4280.141","11.4.1":"87.0.4280.141","11.4.2":"87.0.4280.141","11.4.3":"87.0.4280.141","11.4.4":"87.0.4280.141","11.4.5":"87.0.4280.141","11.4.6":"87.0.4280.141","11.4.7":"87.0.4280.141","11.4.8":"87.0.4280.141","11.4.9":"87.0.4280.141","11.4.10":"87.0.4280.141","11.4.11":"87.0.4280.141","11.4.12":"87.0.4280.141","11.5.0":"87.0.4280.141","12.0.0-beta.1":"89.0.4328.0","12.0.0-beta.3":"89.0.4328.0","12.0.0-beta.4":"89.0.4328.0","12.0.0-beta.5":"89.0.4328.0","12.0.0-beta.6":"89.0.4328.0","12.0.0-beta.7":"89.0.4328.0","12.0.0-beta.8":"89.0.4328.0","12.0.0-beta.9":"89.0.4328.0","12.0.0-beta.10":"89.0.4328.0","12.0.0-beta.11":"89.0.4328.0","12.0.0-beta.12":"89.0.4328.0","12.0.0-beta.14":"89.0.4328.0","12.0.0-beta.16":"89.0.4348.1","12.0.0-beta.18":"89.0.4348.1","12.0.0-beta.19":"89.0.4348.1","12.0.0-beta.20":"89.0.4348.1","12.0.0-beta.21":"89.0.4388.2","12.0.0-beta.22":"89.0.4388.2","12.0.0-beta.23":"89.0.4388.2","12.0.0-beta.24":"89.0.4388.2","12.0.0-beta.25":"89.0.4388.2","12.0.0-beta.26":"89.0.4388.2","12.0.0-beta.27":"89.0.4389.23","12.0.0-beta.28":"89.0.4389.23","12.0.0-beta.29":"89.0.4389.23","12.0.0-beta.30":"89.0.4389.58","12.0.0-beta.31":"89.0.4389.58","12.0.0-nightly.20200827":"86.0.4234.0","12.0.0-nightly.20200831":"86.0.4234.0","12.0.0-nightly.20200902":"86.0.4234.0","12.0.0-nightly.20200903":"86.0.4234.0","12.0.0-nightly.20200907":"86.0.4234.0","12.0.0-nightly.20200910":"86.0.4234.0","12.0.0-nightly.20200911":"86.0.4234.0","12.0.0-nightly.20200914":"86.0.4234.0","12.0.0-nightly.20201002":"87.0.4268.0","12.0.0-nightly.20201007":"87.0.4268.0","12.0.0-nightly.20201009":"87.0.4268.0","12.0.0-nightly.20201012":"87.0.4268.0","12.0.0-nightly.20201013":"87.0.4268.0","12.0.0-nightly.20201014":"87.0.4268.0","12.0.0-nightly.20201015":"87.0.4268.0","12.0.0-nightly.20201023":"88.0.4292.0","12.0.0-nightly.20201026":"88.0.4292.0","12.0.0-nightly.20201030":"88.0.4306.0","12.0.0-nightly.20201102":"88.0.4306.0","12.0.0-nightly.20201103":"88.0.4306.0","12.0.0-nightly.20201104":"88.0.4306.0","12.0.0-nightly.20201105":"88.0.4306.0","12.0.0-nightly.20201106":"88.0.4306.0","12.0.0-nightly.20201111":"88.0.4306.0","12.0.0-nightly.20201112":"88.0.4306.0","12.0.0-nightly.20201116":"88.0.4324.0","12.0.0":"89.0.4389.69","12.0.1":"89.0.4389.82","12.0.2":"89.0.4389.90","12.0.3":"89.0.4389.114","12.0.4":"89.0.4389.114","12.0.5":"89.0.4389.128","12.0.6":"89.0.4389.128","12.0.7":"89.0.4389.128","12.0.8":"89.0.4389.128","12.0.9":"89.0.4389.128","12.0.10":"89.0.4389.128","12.0.11":"89.0.4389.128","12.0.12":"89.0.4389.128","12.0.13":"89.0.4389.128","12.0.14":"89.0.4389.128","12.0.15":"89.0.4389.128","12.0.16":"89.0.4389.128","12.0.17":"89.0.4389.128","12.0.18":"89.0.4389.128","12.1.0":"89.0.4389.128","12.1.1":"89.0.4389.128","12.1.2":"89.0.4389.128","12.2.0":"89.0.4389.128","12.2.1":"89.0.4389.128","12.2.2":"89.0.4389.128","12.2.3":"89.0.4389.128","13.0.0-beta.2":"90.0.4402.0","13.0.0-beta.3":"90.0.4402.0","13.0.0-beta.4":"90.0.4415.0","13.0.0-beta.5":"90.0.4415.0","13.0.0-beta.6":"90.0.4415.0","13.0.0-beta.7":"90.0.4415.0","13.0.0-beta.8":"90.0.4415.0","13.0.0-beta.9":"90.0.4415.0","13.0.0-beta.10":"90.0.4415.0","13.0.0-beta.11":"90.0.4415.0","13.0.0-beta.12":"90.0.4415.0","13.0.0-beta.13":"90.0.4415.0","13.0.0-beta.14":"91.0.4448.0","13.0.0-beta.16":"91.0.4448.0","13.0.0-beta.17":"91.0.4448.0","13.0.0-beta.18":"91.0.4448.0","13.0.0-beta.20":"91.0.4448.0","13.0.0-beta.21":"91.0.4472.33","13.0.0-beta.22":"91.0.4472.33","13.0.0-beta.23":"91.0.4472.33","13.0.0-beta.24":"91.0.4472.38","13.0.0-beta.25":"91.0.4472.38","13.0.0-beta.26":"91.0.4472.38","13.0.0-beta.27":"91.0.4472.38","13.0.0-beta.28":"91.0.4472.38","13.0.0-nightly.20201119":"89.0.4328.0","13.0.0-nightly.20201123":"89.0.4328.0","13.0.0-nightly.20201124":"89.0.4328.0","13.0.0-nightly.20201126":"89.0.4328.0","13.0.0-nightly.20201127":"89.0.4328.0","13.0.0-nightly.20201130":"89.0.4328.0","13.0.0-nightly.20201201":"89.0.4328.0","13.0.0-nightly.20201202":"89.0.4328.0","13.0.0-nightly.20201203":"89.0.4328.0","13.0.0-nightly.20201204":"89.0.4328.0","13.0.0-nightly.20201207":"89.0.4328.0","13.0.0-nightly.20201208":"89.0.4328.0","13.0.0-nightly.20201209":"89.0.4328.0","13.0.0-nightly.20201210":"89.0.4328.0","13.0.0-nightly.20201211":"89.0.4328.0","13.0.0-nightly.20201214":"89.0.4328.0","13.0.0-nightly.20201215":"89.0.4349.0","13.0.0-nightly.20201216":"89.0.4349.0","13.0.0-nightly.20201221":"89.0.4349.0","13.0.0-nightly.20201222":"89.0.4349.0","13.0.0-nightly.20201223":"89.0.4359.0","13.0.0-nightly.20210104":"89.0.4359.0","13.0.0-nightly.20210108":"89.0.4359.0","13.0.0-nightly.20210111":"89.0.4359.0","13.0.0-nightly.20210113":"89.0.4386.0","13.0.0-nightly.20210114":"89.0.4386.0","13.0.0-nightly.20210118":"89.0.4386.0","13.0.0-nightly.20210122":"89.0.4386.0","13.0.0-nightly.20210125":"89.0.4386.0","13.0.0-nightly.20210127":"89.0.4389.0","13.0.0-nightly.20210128":"89.0.4389.0","13.0.0-nightly.20210129":"89.0.4389.0","13.0.0-nightly.20210201":"89.0.4389.0","13.0.0-nightly.20210202":"89.0.4389.0","13.0.0-nightly.20210203":"89.0.4389.0","13.0.0-nightly.20210205":"89.0.4389.0","13.0.0-nightly.20210208":"89.0.4389.0","13.0.0-nightly.20210209":"89.0.4389.0","13.0.0-nightly.20210210":"90.0.4402.0","13.0.0-nightly.20210211":"90.0.4402.0","13.0.0-nightly.20210212":"90.0.4402.0","13.0.0-nightly.20210216":"90.0.4402.0","13.0.0-nightly.20210217":"90.0.4402.0","13.0.0-nightly.20210218":"90.0.4402.0","13.0.0-nightly.20210219":"90.0.4402.0","13.0.0-nightly.20210222":"90.0.4402.0","13.0.0-nightly.20210225":"90.0.4402.0","13.0.0-nightly.20210226":"90.0.4402.0","13.0.0-nightly.20210301":"90.0.4402.0","13.0.0-nightly.20210302":"90.0.4402.0","13.0.0-nightly.20210303":"90.0.4402.0","13.0.0":"91.0.4472.69","13.0.1":"91.0.4472.69","13.1.0":"91.0.4472.77","13.1.1":"91.0.4472.77","13.1.2":"91.0.4472.77","13.1.3":"91.0.4472.106","13.1.4":"91.0.4472.106","13.1.5":"91.0.4472.124","13.1.6":"91.0.4472.124","13.1.7":"91.0.4472.124","13.1.8":"91.0.4472.164","13.1.9":"91.0.4472.164","13.2.0":"91.0.4472.164","13.2.1":"91.0.4472.164","13.2.2":"91.0.4472.164","13.2.3":"91.0.4472.164","13.3.0":"91.0.4472.164","13.4.0":"91.0.4472.164","13.5.0":"91.0.4472.164","13.5.1":"91.0.4472.164","13.5.2":"91.0.4472.164","13.6.0":"91.0.4472.164","13.6.1":"91.0.4472.164","13.6.2":"91.0.4472.164","13.6.3":"91.0.4472.164","13.6.6":"91.0.4472.164","13.6.7":"91.0.4472.164","13.6.8":"91.0.4472.164","13.6.9":"91.0.4472.164","14.0.0-beta.1":"92.0.4511.0","14.0.0-beta.2":"92.0.4511.0","14.0.0-beta.3":"92.0.4511.0","14.0.0-beta.5":"93.0.4536.0","14.0.0-beta.6":"93.0.4536.0","14.0.0-beta.7":"93.0.4536.0","14.0.0-beta.8":"93.0.4536.0","14.0.0-beta.9":"93.0.4539.0","14.0.0-beta.10":"93.0.4539.0","14.0.0-beta.11":"93.0.4557.4","14.0.0-beta.12":"93.0.4557.4","14.0.0-beta.13":"93.0.4566.0","14.0.0-beta.14":"93.0.4566.0","14.0.0-beta.15":"93.0.4566.0","14.0.0-beta.16":"93.0.4566.0","14.0.0-beta.17":"93.0.4566.0","14.0.0-beta.18":"93.0.4577.15","14.0.0-beta.19":"93.0.4577.15","14.0.0-beta.20":"93.0.4577.15","14.0.0-beta.21":"93.0.4577.15","14.0.0-beta.22":"93.0.4577.25","14.0.0-beta.23":"93.0.4577.25","14.0.0-beta.24":"93.0.4577.51","14.0.0-beta.25":"93.0.4577.51","14.0.0-nightly.20210304":"90.0.4402.0","14.0.0-nightly.20210305":"90.0.4415.0","14.0.0-nightly.20210308":"90.0.4415.0","14.0.0-nightly.20210309":"90.0.4415.0","14.0.0-nightly.20210311":"90.0.4415.0","14.0.0-nightly.20210315":"90.0.4415.0","14.0.0-nightly.20210316":"90.0.4415.0","14.0.0-nightly.20210317":"90.0.4415.0","14.0.0-nightly.20210318":"90.0.4415.0","14.0.0-nightly.20210319":"90.0.4415.0","14.0.0-nightly.20210323":"90.0.4415.0","14.0.0-nightly.20210324":"90.0.4415.0","14.0.0-nightly.20210325":"90.0.4415.0","14.0.0-nightly.20210326":"90.0.4415.0","14.0.0-nightly.20210329":"90.0.4415.0","14.0.0-nightly.20210330":"90.0.4415.0","14.0.0-nightly.20210331":"91.0.4448.0","14.0.0-nightly.20210401":"91.0.4448.0","14.0.0-nightly.20210402":"91.0.4448.0","14.0.0-nightly.20210406":"91.0.4448.0","14.0.0-nightly.20210407":"91.0.4448.0","14.0.0-nightly.20210408":"91.0.4448.0","14.0.0-nightly.20210409":"91.0.4448.0","14.0.0-nightly.20210413":"91.0.4448.0","14.0.0-nightly.20210426":"92.0.4475.0","14.0.0-nightly.20210427":"92.0.4475.0","14.0.0-nightly.20210430":"92.0.4488.0","14.0.0-nightly.20210503":"92.0.4488.0","14.0.0-nightly.20210505":"92.0.4496.0","14.0.0-nightly.20210506":"92.0.4498.0","14.0.0-nightly.20210507":"92.0.4499.0","14.0.0-nightly.20210510":"92.0.4499.0","14.0.0-nightly.20210511":"92.0.4499.0","14.0.0-nightly.20210512":"92.0.4499.0","14.0.0-nightly.20210513":"92.0.4499.0","14.0.0-nightly.20210514":"92.0.4505.0","14.0.0-nightly.20210517":"92.0.4505.0","14.0.0-nightly.20210518":"92.0.4505.0","14.0.0-nightly.20210519":"92.0.4505.0","14.0.0-nightly.20210520":"92.0.4511.0","14.0.0-nightly.20210523":"92.0.4511.0","14.0.0-nightly.20210524":"92.0.4511.0","14.0.0":"93.0.4577.58","14.0.1":"93.0.4577.63","14.0.2":"93.0.4577.82","14.1.0":"93.0.4577.82","14.1.1":"93.0.4577.82","14.2.0":"93.0.4577.82","14.2.1":"93.0.4577.82","14.2.2":"93.0.4577.82","14.2.3":"93.0.4577.82","14.2.4":"93.0.4577.82","14.2.5":"93.0.4577.82","14.2.6":"93.0.4577.82","14.2.7":"93.0.4577.82","14.2.8":"93.0.4577.82","14.2.9":"93.0.4577.82","15.0.0-alpha.1":"93.0.4566.0","15.0.0-alpha.2":"93.0.4566.0","15.0.0-alpha.3":"94.0.4584.0","15.0.0-alpha.4":"94.0.4584.0","15.0.0-alpha.5":"94.0.4584.0","15.0.0-alpha.6":"94.0.4584.0","15.0.0-alpha.7":"94.0.4590.2","15.0.0-alpha.8":"94.0.4590.2","15.0.0-alpha.9":"94.0.4590.2","15.0.0-alpha.10":"94.0.4606.12","15.0.0-beta.1":"94.0.4606.20","15.0.0-beta.2":"94.0.4606.20","15.0.0-beta.3":"94.0.4606.31","15.0.0-beta.4":"94.0.4606.31","15.0.0-beta.5":"94.0.4606.31","15.0.0-beta.6":"94.0.4606.31","15.0.0-beta.7":"94.0.4606.31","15.0.0-nightly.20210527":"92.0.4511.0","15.0.0-nightly.20210528":"92.0.4511.0","15.0.0-nightly.20210531":"92.0.4511.0","15.0.0-nightly.20210601":"92.0.4511.0","15.0.0-nightly.20210602":"92.0.4511.0","15.0.0-nightly.20210603":"93.0.4530.0","15.0.0-nightly.20210604":"93.0.4530.0","15.0.0-nightly.20210608":"93.0.4535.0","15.0.0-nightly.20210609":"93.0.4536.0","15.0.0-nightly.20210610":"93.0.4536.0","15.0.0-nightly.20210611":"93.0.4536.0","15.0.0-nightly.20210614":"93.0.4536.0","15.0.0-nightly.20210615":"93.0.4536.0","15.0.0-nightly.20210616":"93.0.4536.0","15.0.0-nightly.20210617":"93.0.4539.0","15.0.0-nightly.20210618":"93.0.4539.0","15.0.0-nightly.20210621":"93.0.4539.0","15.0.0-nightly.20210622":"93.0.4539.0","15.0.0-nightly.20210623":"93.0.4550.0","15.0.0-nightly.20210624":"93.0.4550.0","15.0.0-nightly.20210625":"93.0.4552.0","15.0.0-nightly.20210628":"93.0.4552.0","15.0.0-nightly.20210629":"93.0.4552.0","15.0.0-nightly.20210630":"93.0.4558.0","15.0.0-nightly.20210701":"93.0.4558.0","15.0.0-nightly.20210702":"93.0.4558.0","15.0.0-nightly.20210705":"93.0.4558.0","15.0.0-nightly.20210706":"93.0.4566.0","15.0.0-nightly.20210707":"93.0.4566.0","15.0.0-nightly.20210708":"93.0.4566.0","15.0.0-nightly.20210709":"93.0.4566.0","15.0.0-nightly.20210712":"93.0.4566.0","15.0.0-nightly.20210713":"93.0.4566.0","15.0.0-nightly.20210714":"93.0.4566.0","15.0.0-nightly.20210715":"93.0.4566.0","15.0.0-nightly.20210716":"93.0.4566.0","15.0.0-nightly.20210719":"93.0.4566.0","15.0.0-nightly.20210720":"93.0.4566.0","15.0.0-nightly.20210721":"93.0.4566.0","15.0.0":"94.0.4606.51","15.1.0":"94.0.4606.61","15.1.1":"94.0.4606.61","15.1.2":"94.0.4606.71","15.2.0":"94.0.4606.81","15.3.0":"94.0.4606.81","15.3.1":"94.0.4606.81","15.3.2":"94.0.4606.81","15.3.3":"94.0.4606.81","15.3.4":"94.0.4606.81","15.3.5":"94.0.4606.81","15.3.6":"94.0.4606.81","15.3.7":"94.0.4606.81","15.4.0":"94.0.4606.81","15.4.1":"94.0.4606.81","15.4.2":"94.0.4606.81","15.5.0":"94.0.4606.81","15.5.1":"94.0.4606.81","15.5.2":"94.0.4606.81","15.5.3":"94.0.4606.81","15.5.4":"94.0.4606.81","15.5.5":"94.0.4606.81","15.5.6":"94.0.4606.81","15.5.7":"94.0.4606.81","16.0.0-alpha.1":"95.0.4629.0","16.0.0-alpha.2":"95.0.4629.0","16.0.0-alpha.3":"95.0.4629.0","16.0.0-alpha.4":"95.0.4629.0","16.0.0-alpha.5":"95.0.4629.0","16.0.0-alpha.6":"95.0.4629.0","16.0.0-alpha.7":"95.0.4629.0","16.0.0-alpha.8":"96.0.4647.0","16.0.0-alpha.9":"96.0.4647.0","16.0.0-beta.1":"96.0.4647.0","16.0.0-beta.2":"96.0.4647.0","16.0.0-beta.3":"96.0.4647.0","16.0.0-beta.4":"96.0.4664.18","16.0.0-beta.5":"96.0.4664.18","16.0.0-beta.6":"96.0.4664.27","16.0.0-beta.7":"96.0.4664.27","16.0.0-beta.8":"96.0.4664.35","16.0.0-beta.9":"96.0.4664.35","16.0.0-nightly.20210722":"93.0.4566.0","16.0.0-nightly.20210723":"93.0.4566.0","16.0.0-nightly.20210726":"93.0.4566.0","16.0.0-nightly.20210727":"94.0.4584.0","16.0.0-nightly.20210728":"94.0.4584.0","16.0.0-nightly.20210729":"94.0.4584.0","16.0.0-nightly.20210730":"94.0.4584.0","16.0.0-nightly.20210802":"94.0.4584.0","16.0.0-nightly.20210803":"94.0.4584.0","16.0.0-nightly.20210804":"94.0.4584.0","16.0.0-nightly.20210805":"94.0.4584.0","16.0.0-nightly.20210806":"94.0.4584.0","16.0.0-nightly.20210809":"94.0.4584.0","16.0.0-nightly.20210810":"94.0.4584.0","16.0.0-nightly.20210811":"94.0.4584.0","16.0.0-nightly.20210812":"94.0.4590.2","16.0.0-nightly.20210813":"94.0.4590.2","16.0.0-nightly.20210816":"94.0.4590.2","16.0.0-nightly.20210817":"94.0.4590.2","16.0.0-nightly.20210818":"94.0.4590.2","16.0.0-nightly.20210819":"94.0.4590.2","16.0.0-nightly.20210820":"94.0.4590.2","16.0.0-nightly.20210823":"94.0.4590.2","16.0.0-nightly.20210824":"95.0.4612.5","16.0.0-nightly.20210825":"95.0.4612.5","16.0.0-nightly.20210826":"95.0.4612.5","16.0.0-nightly.20210827":"95.0.4612.5","16.0.0-nightly.20210830":"95.0.4612.5","16.0.0-nightly.20210831":"95.0.4612.5","16.0.0-nightly.20210901":"95.0.4612.5","16.0.0-nightly.20210902":"95.0.4629.0","16.0.0-nightly.20210903":"95.0.4629.0","16.0.0-nightly.20210906":"95.0.4629.0","16.0.0-nightly.20210907":"95.0.4629.0","16.0.0-nightly.20210908":"95.0.4629.0","16.0.0-nightly.20210909":"95.0.4629.0","16.0.0-nightly.20210910":"95.0.4629.0","16.0.0-nightly.20210913":"95.0.4629.0","16.0.0-nightly.20210914":"95.0.4629.0","16.0.0-nightly.20210915":"95.0.4629.0","16.0.0-nightly.20210916":"95.0.4629.0","16.0.0-nightly.20210917":"95.0.4629.0","16.0.0-nightly.20210920":"95.0.4629.0","16.0.0-nightly.20210921":"95.0.4629.0","16.0.0-nightly.20210922":"95.0.4629.0","16.0.0":"96.0.4664.45","16.0.1":"96.0.4664.45","16.0.2":"96.0.4664.55","16.0.3":"96.0.4664.55","16.0.4":"96.0.4664.55","16.0.5":"96.0.4664.55","16.0.6":"96.0.4664.110","16.0.7":"96.0.4664.110","16.0.8":"96.0.4664.110","16.0.9":"96.0.4664.174","16.0.10":"96.0.4664.174","16.1.0":"96.0.4664.174","16.1.1":"96.0.4664.174","16.2.0":"96.0.4664.174","16.2.1":"96.0.4664.174","16.2.2":"96.0.4664.174","16.2.3":"96.0.4664.174","16.2.4":"96.0.4664.174","16.2.5":"96.0.4664.174","16.2.6":"96.0.4664.174","16.2.7":"96.0.4664.174","16.2.8":"96.0.4664.174","17.0.0-alpha.1":"96.0.4664.4","17.0.0-alpha.2":"96.0.4664.4","17.0.0-alpha.3":"96.0.4664.4","17.0.0-alpha.4":"98.0.4706.0","17.0.0-alpha.5":"98.0.4706.0","17.0.0-alpha.6":"98.0.4706.0","17.0.0-beta.1":"98.0.4706.0","17.0.0-beta.2":"98.0.4706.0","17.0.0-beta.3":"98.0.4758.9","17.0.0-beta.4":"98.0.4758.11","17.0.0-beta.5":"98.0.4758.11","17.0.0-beta.6":"98.0.4758.11","17.0.0-beta.7":"98.0.4758.11","17.0.0-beta.8":"98.0.4758.11","17.0.0-beta.9":"98.0.4758.11","17.0.0-nightly.20210923":"95.0.4629.0","17.0.0-nightly.20210924":"95.0.4629.0","17.0.0-nightly.20210927":"95.0.4629.0","17.0.0-nightly.20210928":"95.0.4629.0","17.0.0-nightly.20210929":"95.0.4629.0","17.0.0-nightly.20210930":"95.0.4629.0","17.0.0-nightly.20211001":"95.0.4629.0","17.0.0-nightly.20211004":"95.0.4629.0","17.0.0-nightly.20211005":"95.0.4629.0","17.0.0-nightly.20211006":"96.0.4647.0","17.0.0-nightly.20211007":"96.0.4647.0","17.0.0-nightly.20211008":"96.0.4647.0","17.0.0-nightly.20211011":"96.0.4647.0","17.0.0-nightly.20211012":"96.0.4647.0","17.0.0-nightly.20211013":"96.0.4647.0","17.0.0-nightly.20211014":"96.0.4647.0","17.0.0-nightly.20211015":"96.0.4647.0","17.0.0-nightly.20211018":"96.0.4647.0","17.0.0-nightly.20211019":"96.0.4647.0","17.0.0-nightly.20211020":"96.0.4647.0","17.0.0-nightly.20211021":"96.0.4647.0","17.0.0-nightly.20211022":"96.0.4664.4","17.0.0-nightly.20211025":"96.0.4664.4","17.0.0-nightly.20211026":"96.0.4664.4","17.0.0-nightly.20211027":"96.0.4664.4","17.0.0-nightly.20211028":"96.0.4664.4","17.0.0-nightly.20211029":"96.0.4664.4","17.0.0-nightly.20211101":"96.0.4664.4","17.0.0-nightly.20211102":"96.0.4664.4","17.0.0-nightly.20211103":"96.0.4664.4","17.0.0-nightly.20211104":"96.0.4664.4","17.0.0-nightly.20211105":"96.0.4664.4","17.0.0-nightly.20211108":"96.0.4664.4","17.0.0-nightly.20211109":"96.0.4664.4","17.0.0-nightly.20211110":"96.0.4664.4","17.0.0-nightly.20211111":"96.0.4664.4","17.0.0-nightly.20211112":"96.0.4664.4","17.0.0-nightly.20211115":"96.0.4664.4","17.0.0-nightly.20211116":"96.0.4664.4","17.0.0-nightly.20211117":"96.0.4664.4","17.0.0":"98.0.4758.74","17.0.1":"98.0.4758.82","17.1.0":"98.0.4758.102","17.1.1":"98.0.4758.109","17.1.2":"98.0.4758.109","17.2.0":"98.0.4758.109","17.3.0":"98.0.4758.141","17.3.1":"98.0.4758.141","17.4.0":"98.0.4758.141","17.4.1":"98.0.4758.141","17.4.2":"98.0.4758.141","17.4.3":"98.0.4758.141","17.4.4":"98.0.4758.141","17.4.5":"98.0.4758.141","17.4.6":"98.0.4758.141","17.4.7":"98.0.4758.141","17.4.8":"98.0.4758.141","17.4.9":"98.0.4758.141","17.4.10":"98.0.4758.141","17.4.11":"98.0.4758.141","18.0.0-alpha.1":"99.0.4767.0","18.0.0-alpha.2":"99.0.4767.0","18.0.0-alpha.3":"99.0.4767.0","18.0.0-alpha.4":"99.0.4767.0","18.0.0-alpha.5":"99.0.4767.0","18.0.0-beta.1":"100.0.4894.0","18.0.0-beta.2":"100.0.4894.0","18.0.0-beta.3":"100.0.4894.0","18.0.0-beta.4":"100.0.4894.0","18.0.0-beta.5":"100.0.4894.0","18.0.0-beta.6":"100.0.4894.0","18.0.0-nightly.20211118":"96.0.4664.4","18.0.0-nightly.20211119":"96.0.4664.4","18.0.0-nightly.20211122":"96.0.4664.4","18.0.0-nightly.20211123":"96.0.4664.4","18.0.0-nightly.20211124":"98.0.4706.0","18.0.0-nightly.20211125":"98.0.4706.0","18.0.0-nightly.20211126":"98.0.4706.0","18.0.0-nightly.20211129":"98.0.4706.0","18.0.0-nightly.20211130":"98.0.4706.0","18.0.0-nightly.20211201":"98.0.4706.0","18.0.0-nightly.20211202":"98.0.4706.0","18.0.0-nightly.20211203":"98.0.4706.0","18.0.0-nightly.20211206":"98.0.4706.0","18.0.0-nightly.20211207":"98.0.4706.0","18.0.0-nightly.20211208":"98.0.4706.0","18.0.0-nightly.20211209":"98.0.4706.0","18.0.0-nightly.20211210":"98.0.4706.0","18.0.0-nightly.20211213":"98.0.4706.0","18.0.0-nightly.20211214":"98.0.4706.0","18.0.0-nightly.20211215":"98.0.4706.0","18.0.0-nightly.20211216":"98.0.4706.0","18.0.0-nightly.20211217":"98.0.4706.0","18.0.0-nightly.20211220":"98.0.4706.0","18.0.0-nightly.20211221":"98.0.4706.0","18.0.0-nightly.20211222":"98.0.4706.0","18.0.0-nightly.20211223":"98.0.4706.0","18.0.0-nightly.20211228":"98.0.4706.0","18.0.0-nightly.20211229":"98.0.4706.0","18.0.0-nightly.20211231":"98.0.4706.0","18.0.0-nightly.20220103":"98.0.4706.0","18.0.0-nightly.20220104":"98.0.4706.0","18.0.0-nightly.20220105":"98.0.4706.0","18.0.0-nightly.20220106":"98.0.4706.0","18.0.0-nightly.20220107":"98.0.4706.0","18.0.0-nightly.20220110":"98.0.4706.0","18.0.0-nightly.20220111":"99.0.4767.0","18.0.0-nightly.20220112":"99.0.4767.0","18.0.0-nightly.20220113":"99.0.4767.0","18.0.0-nightly.20220114":"99.0.4767.0","18.0.0-nightly.20220117":"99.0.4767.0","18.0.0-nightly.20220118":"99.0.4767.0","18.0.0-nightly.20220119":"99.0.4767.0","18.0.0-nightly.20220121":"99.0.4767.0","18.0.0-nightly.20220124":"99.0.4767.0","18.0.0-nightly.20220125":"99.0.4767.0","18.0.0-nightly.20220127":"99.0.4767.0","18.0.0-nightly.20220128":"99.0.4767.0","18.0.0-nightly.20220131":"99.0.4767.0","18.0.0-nightly.20220201":"99.0.4767.0","18.0.0":"100.0.4896.56","18.0.1":"100.0.4896.60","18.0.2":"100.0.4896.60","18.0.3":"100.0.4896.75","18.0.4":"100.0.4896.75","18.1.0":"100.0.4896.127","18.2.0":"100.0.4896.143","18.2.1":"100.0.4896.143","18.2.2":"100.0.4896.143","18.2.3":"100.0.4896.143","18.2.4":"100.0.4896.160","18.3.0":"100.0.4896.160","18.3.1":"100.0.4896.160","18.3.2":"100.0.4896.160","18.3.3":"100.0.4896.160","18.3.4":"100.0.4896.160","18.3.5":"100.0.4896.160","18.3.6":"100.0.4896.160","18.3.7":"100.0.4896.160","18.3.8":"100.0.4896.160","18.3.9":"100.0.4896.160","18.3.11":"100.0.4896.160","18.3.12":"100.0.4896.160","18.3.13":"100.0.4896.160","18.3.14":"100.0.4896.160","18.3.15":"100.0.4896.160","19.0.0-alpha.1":"102.0.4962.3","19.0.0-alpha.2":"102.0.4971.0","19.0.0-alpha.3":"102.0.4971.0","19.0.0-alpha.4":"102.0.4989.0","19.0.0-alpha.5":"102.0.4989.0","19.0.0-beta.1":"102.0.4999.0","19.0.0-beta.2":"102.0.4999.0","19.0.0-beta.3":"102.0.4999.0","19.0.0-beta.4":"102.0.5005.27","19.0.0-beta.5":"102.0.5005.40","19.0.0-beta.6":"102.0.5005.40","19.0.0-beta.7":"102.0.5005.40","19.0.0-beta.8":"102.0.5005.49","19.0.0-nightly.20220202":"99.0.4767.0","19.0.0-nightly.20220203":"99.0.4767.0","19.0.0-nightly.20220204":"99.0.4767.0","19.0.0-nightly.20220207":"99.0.4767.0","19.0.0-nightly.20220208":"99.0.4767.0","19.0.0-nightly.20220209":"99.0.4767.0","19.0.0-nightly.20220308":"100.0.4894.0","19.0.0-nightly.20220309":"100.0.4894.0","19.0.0-nightly.20220310":"100.0.4894.0","19.0.0-nightly.20220311":"100.0.4894.0","19.0.0-nightly.20220314":"100.0.4894.0","19.0.0-nightly.20220315":"100.0.4894.0","19.0.0-nightly.20220316":"100.0.4894.0","19.0.0-nightly.20220317":"100.0.4894.0","19.0.0-nightly.20220318":"100.0.4894.0","19.0.0-nightly.20220321":"100.0.4894.0","19.0.0-nightly.20220322":"100.0.4894.0","19.0.0-nightly.20220323":"100.0.4894.0","19.0.0-nightly.20220324":"100.0.4894.0","19.0.0-nightly.20220325":"102.0.4961.0","19.0.0-nightly.20220328":"102.0.4962.3","19.0.0-nightly.20220329":"102.0.4962.3","19.0.0":"102.0.5005.61","19.0.1":"102.0.5005.61","19.0.2":"102.0.5005.63","19.0.3":"102.0.5005.63","19.0.4":"102.0.5005.63","19.0.5":"102.0.5005.115","19.0.6":"102.0.5005.115","19.0.7":"102.0.5005.134","19.0.8":"102.0.5005.148","19.0.9":"102.0.5005.167","19.0.10":"102.0.5005.167","19.0.11":"102.0.5005.167","19.0.12":"102.0.5005.167","19.0.13":"102.0.5005.167","19.0.14":"102.0.5005.167","19.0.15":"102.0.5005.167","19.0.16":"102.0.5005.167","19.0.17":"102.0.5005.167","19.1.0":"102.0.5005.167","19.1.1":"102.0.5005.167","19.1.2":"102.0.5005.167","19.1.3":"102.0.5005.167","19.1.4":"102.0.5005.167","19.1.5":"102.0.5005.167","19.1.6":"102.0.5005.167","19.1.7":"102.0.5005.167","19.1.8":"102.0.5005.167","19.1.9":"102.0.5005.167","20.0.0-alpha.1":"103.0.5044.0","20.0.0-alpha.2":"104.0.5073.0","20.0.0-alpha.3":"104.0.5073.0","20.0.0-alpha.4":"104.0.5073.0","20.0.0-alpha.5":"104.0.5073.0","20.0.0-alpha.6":"104.0.5073.0","20.0.0-alpha.7":"104.0.5073.0","20.0.0-beta.1":"104.0.5073.0","20.0.0-beta.2":"104.0.5073.0","20.0.0-beta.3":"104.0.5073.0","20.0.0-beta.4":"104.0.5073.0","20.0.0-beta.5":"104.0.5073.0","20.0.0-beta.6":"104.0.5073.0","20.0.0-beta.7":"104.0.5073.0","20.0.0-beta.8":"104.0.5073.0","20.0.0-beta.9":"104.0.5112.39","20.0.0-beta.10":"104.0.5112.48","20.0.0-beta.11":"104.0.5112.48","20.0.0-beta.12":"104.0.5112.48","20.0.0-beta.13":"104.0.5112.57","20.0.0-nightly.20220330":"102.0.4962.3","20.0.0-nightly.20220411":"102.0.4971.0","20.0.0-nightly.20220414":"102.0.4989.0","20.0.0-nightly.20220415":"102.0.4989.0","20.0.0-nightly.20220418":"102.0.4989.0","20.0.0-nightly.20220419":"102.0.4989.0","20.0.0-nightly.20220420":"102.0.4989.0","20.0.0-nightly.20220421":"102.0.4989.0","20.0.0-nightly.20220425":"102.0.4999.0","20.0.0-nightly.20220426":"102.0.4999.0","20.0.0-nightly.20220427":"102.0.4999.0","20.0.0-nightly.20220428":"102.0.4999.0","20.0.0-nightly.20220429":"102.0.4999.0","20.0.0-nightly.20220502":"102.0.4999.0","20.0.0-nightly.20220503":"102.0.4999.0","20.0.0-nightly.20220504":"102.0.4999.0","20.0.0-nightly.20220505":"102.0.4999.0","20.0.0-nightly.20220506":"102.0.4999.0","20.0.0-nightly.20220509":"102.0.4999.0","20.0.0-nightly.20220511":"102.0.4999.0","20.0.0-nightly.20220512":"102.0.4999.0","20.0.0-nightly.20220513":"102.0.4999.0","20.0.0-nightly.20220516":"102.0.4999.0","20.0.0-nightly.20220517":"102.0.4999.0","20.0.0-nightly.20220518":"103.0.5044.0","20.0.0-nightly.20220519":"103.0.5044.0","20.0.0-nightly.20220520":"103.0.5044.0","20.0.0-nightly.20220523":"103.0.5044.0","20.0.0-nightly.20220524":"103.0.5044.0","20.0.0":"104.0.5112.65","20.0.1":"104.0.5112.81","20.0.2":"104.0.5112.81","20.0.3":"104.0.5112.81","20.1.0":"104.0.5112.102","20.1.1":"104.0.5112.102","20.1.2":"104.0.5112.114","20.1.3":"104.0.5112.114","20.1.4":"104.0.5112.114","20.2.0":"104.0.5112.124","20.3.0":"104.0.5112.124","20.3.1":"104.0.5112.124","20.3.2":"104.0.5112.124","20.3.3":"104.0.5112.124","20.3.4":"104.0.5112.124","20.3.5":"104.0.5112.124","20.3.6":"104.0.5112.124","20.3.7":"104.0.5112.124","20.3.8":"104.0.5112.124","20.3.9":"104.0.5112.124","20.3.10":"104.0.5112.124","20.3.11":"104.0.5112.124","20.3.12":"104.0.5112.124","21.0.0-alpha.1":"105.0.5187.0","21.0.0-alpha.2":"105.0.5187.0","21.0.0-alpha.3":"105.0.5187.0","21.0.0-alpha.4":"105.0.5187.0","21.0.0-alpha.5":"105.0.5187.0","21.0.0-alpha.6":"106.0.5216.0","21.0.0-beta.1":"106.0.5216.0","21.0.0-beta.2":"106.0.5216.0","21.0.0-beta.3":"106.0.5216.0","21.0.0-beta.4":"106.0.5216.0","21.0.0-beta.5":"106.0.5216.0","21.0.0-beta.6":"106.0.5249.40","21.0.0-beta.7":"106.0.5249.40","21.0.0-beta.8":"106.0.5249.40","21.0.0-nightly.20220526":"103.0.5044.0","21.0.0-nightly.20220527":"103.0.5044.0","21.0.0-nightly.20220530":"103.0.5044.0","21.0.0-nightly.20220531":"103.0.5044.0","21.0.0-nightly.20220602":"104.0.5073.0","21.0.0-nightly.20220603":"104.0.5073.0","21.0.0-nightly.20220606":"104.0.5073.0","21.0.0-nightly.20220607":"104.0.5073.0","21.0.0-nightly.20220608":"104.0.5073.0","21.0.0-nightly.20220609":"104.0.5073.0","21.0.0-nightly.20220610":"104.0.5073.0","21.0.0-nightly.20220613":"104.0.5073.0","21.0.0-nightly.20220614":"104.0.5073.0","21.0.0-nightly.20220615":"104.0.5073.0","21.0.0-nightly.20220616":"104.0.5073.0","21.0.0-nightly.20220617":"104.0.5073.0","21.0.0-nightly.20220620":"104.0.5073.0","21.0.0-nightly.20220621":"104.0.5073.0","21.0.0-nightly.20220622":"104.0.5073.0","21.0.0-nightly.20220623":"104.0.5073.0","21.0.0-nightly.20220624":"104.0.5073.0","21.0.0-nightly.20220627":"104.0.5073.0","21.0.0-nightly.20220628":"105.0.5129.0","21.0.0-nightly.20220629":"105.0.5129.0","21.0.0-nightly.20220630":"105.0.5129.0","21.0.0-nightly.20220701":"105.0.5129.0","21.0.0-nightly.20220704":"105.0.5129.0","21.0.0-nightly.20220705":"105.0.5129.0","21.0.0-nightly.20220706":"105.0.5129.0","21.0.0-nightly.20220707":"105.0.5129.0","21.0.0-nightly.20220708":"105.0.5129.0","21.0.0-nightly.20220711":"105.0.5129.0","21.0.0-nightly.20220712":"105.0.5129.0","21.0.0-nightly.20220713":"105.0.5129.0","21.0.0-nightly.20220715":"105.0.5173.0","21.0.0-nightly.20220718":"105.0.5173.0","21.0.0-nightly.20220719":"105.0.5173.0","21.0.0-nightly.20220720":"105.0.5187.0","21.0.0-nightly.20220721":"105.0.5187.0","21.0.0-nightly.20220722":"105.0.5187.0","21.0.0-nightly.20220725":"105.0.5187.0","21.0.0-nightly.20220726":"105.0.5187.0","21.0.0-nightly.20220727":"105.0.5187.0","21.0.0-nightly.20220728":"105.0.5187.0","21.0.0-nightly.20220801":"105.0.5187.0","21.0.0-nightly.20220802":"105.0.5187.0","21.0.0":"106.0.5249.51","21.0.1":"106.0.5249.61","21.1.0":"106.0.5249.91","21.1.1":"106.0.5249.103","21.2.0":"106.0.5249.119","21.2.1":"106.0.5249.165","21.2.2":"106.0.5249.168","21.2.3":"106.0.5249.168","21.3.0":"106.0.5249.181","21.3.1":"106.0.5249.181","21.3.3":"106.0.5249.199","21.3.4":"106.0.5249.199","21.3.5":"106.0.5249.199","21.4.0":"106.0.5249.199","21.4.1":"106.0.5249.199","21.4.2":"106.0.5249.199","21.4.3":"106.0.5249.199","21.4.4":"106.0.5249.199","22.0.0-alpha.1":"107.0.5286.0","22.0.0-alpha.3":"108.0.5329.0","22.0.0-alpha.4":"108.0.5329.0","22.0.0-alpha.5":"108.0.5329.0","22.0.0-alpha.6":"108.0.5329.0","22.0.0-alpha.7":"108.0.5355.0","22.0.0-alpha.8":"108.0.5359.10","22.0.0-beta.1":"108.0.5359.10","22.0.0-beta.2":"108.0.5359.10","22.0.0-beta.3":"108.0.5359.10","22.0.0-beta.4":"108.0.5359.29","22.0.0-beta.5":"108.0.5359.40","22.0.0-beta.6":"108.0.5359.40","22.0.0-beta.7":"108.0.5359.48","22.0.0-beta.8":"108.0.5359.48","22.0.0-nightly.20220808":"105.0.5187.0","22.0.0-nightly.20220809":"105.0.5187.0","22.0.0-nightly.20220810":"105.0.5187.0","22.0.0-nightly.20220811":"105.0.5187.0","22.0.0-nightly.20220812":"105.0.5187.0","22.0.0-nightly.20220815":"105.0.5187.0","22.0.0-nightly.20220816":"105.0.5187.0","22.0.0-nightly.20220817":"105.0.5187.0","22.0.0-nightly.20220822":"106.0.5216.0","22.0.0-nightly.20220823":"106.0.5216.0","22.0.0-nightly.20220824":"106.0.5216.0","22.0.0-nightly.20220825":"106.0.5216.0","22.0.0-nightly.20220829":"106.0.5216.0","22.0.0-nightly.20220830":"106.0.5216.0","22.0.0-nightly.20220831":"106.0.5216.0","22.0.0-nightly.20220901":"106.0.5216.0","22.0.0-nightly.20220902":"106.0.5216.0","22.0.0-nightly.20220905":"106.0.5216.0","22.0.0-nightly.20220908":"107.0.5274.0","22.0.0-nightly.20220909":"107.0.5286.0","22.0.0-nightly.20220912":"107.0.5286.0","22.0.0-nightly.20220913":"107.0.5286.0","22.0.0-nightly.20220914":"107.0.5286.0","22.0.0-nightly.20220915":"107.0.5286.0","22.0.0-nightly.20220916":"107.0.5286.0","22.0.0-nightly.20220919":"107.0.5286.0","22.0.0-nightly.20220920":"107.0.5286.0","22.0.0-nightly.20220921":"107.0.5286.0","22.0.0-nightly.20220922":"107.0.5286.0","22.0.0-nightly.20220923":"107.0.5286.0","22.0.0-nightly.20220926":"107.0.5286.0","22.0.0-nightly.20220927":"107.0.5286.0","22.0.0-nightly.20220928":"107.0.5286.0","22.0.0":"108.0.5359.62","22.0.1":"108.0.5359.125","22.0.2":"108.0.5359.179","22.0.3":"108.0.5359.179","22.1.0":"108.0.5359.179","22.2.0":"108.0.5359.215","22.2.1":"108.0.5359.215","22.3.0":"108.0.5359.215","22.3.1":"108.0.5359.215","22.3.2":"108.0.5359.215","22.3.3":"108.0.5359.215","22.3.4":"108.0.5359.215","22.3.5":"108.0.5359.215","22.3.6":"108.0.5359.215","22.3.7":"108.0.5359.215","22.3.8":"108.0.5359.215","22.3.9":"108.0.5359.215","22.3.10":"108.0.5359.215","22.3.11":"108.0.5359.215","22.3.12":"108.0.5359.215","22.3.13":"108.0.5359.215","22.3.14":"108.0.5359.215","22.3.15":"108.0.5359.215","22.3.16":"108.0.5359.215","22.3.17":"108.0.5359.215","22.3.18":"108.0.5359.215","22.3.20":"108.0.5359.215","22.3.21":"108.0.5359.215","22.3.22":"108.0.5359.215","22.3.23":"108.0.5359.215","22.3.24":"108.0.5359.215","22.3.25":"108.0.5359.215","22.3.26":"108.0.5359.215","22.3.27":"108.0.5359.215","23.0.0-alpha.1":"110.0.5415.0","23.0.0-alpha.2":"110.0.5451.0","23.0.0-alpha.3":"110.0.5451.0","23.0.0-beta.1":"110.0.5478.5","23.0.0-beta.2":"110.0.5478.5","23.0.0-beta.3":"110.0.5478.5","23.0.0-beta.4":"110.0.5481.30","23.0.0-beta.5":"110.0.5481.38","23.0.0-beta.6":"110.0.5481.52","23.0.0-beta.8":"110.0.5481.52","23.0.0-nightly.20220929":"107.0.5286.0","23.0.0-nightly.20220930":"107.0.5286.0","23.0.0-nightly.20221003":"107.0.5286.0","23.0.0-nightly.20221004":"108.0.5329.0","23.0.0-nightly.20221005":"108.0.5329.0","23.0.0-nightly.20221006":"108.0.5329.0","23.0.0-nightly.20221007":"108.0.5329.0","23.0.0-nightly.20221010":"108.0.5329.0","23.0.0-nightly.20221011":"108.0.5329.0","23.0.0-nightly.20221012":"108.0.5329.0","23.0.0-nightly.20221013":"108.0.5329.0","23.0.0-nightly.20221014":"108.0.5329.0","23.0.0-nightly.20221017":"108.0.5329.0","23.0.0-nightly.20221018":"108.0.5355.0","23.0.0-nightly.20221019":"108.0.5355.0","23.0.0-nightly.20221020":"108.0.5355.0","23.0.0-nightly.20221021":"108.0.5355.0","23.0.0-nightly.20221024":"108.0.5355.0","23.0.0-nightly.20221026":"108.0.5355.0","23.0.0-nightly.20221027":"109.0.5382.0","23.0.0-nightly.20221028":"109.0.5382.0","23.0.0-nightly.20221031":"109.0.5382.0","23.0.0-nightly.20221101":"109.0.5382.0","23.0.0-nightly.20221102":"109.0.5382.0","23.0.0-nightly.20221103":"109.0.5382.0","23.0.0-nightly.20221104":"109.0.5382.0","23.0.0-nightly.20221107":"109.0.5382.0","23.0.0-nightly.20221108":"109.0.5382.0","23.0.0-nightly.20221109":"109.0.5382.0","23.0.0-nightly.20221110":"109.0.5382.0","23.0.0-nightly.20221111":"109.0.5382.0","23.0.0-nightly.20221114":"109.0.5382.0","23.0.0-nightly.20221115":"109.0.5382.0","23.0.0-nightly.20221116":"109.0.5382.0","23.0.0-nightly.20221117":"109.0.5382.0","23.0.0-nightly.20221118":"110.0.5415.0","23.0.0-nightly.20221121":"110.0.5415.0","23.0.0-nightly.20221122":"110.0.5415.0","23.0.0-nightly.20221123":"110.0.5415.0","23.0.0-nightly.20221124":"110.0.5415.0","23.0.0-nightly.20221125":"110.0.5415.0","23.0.0-nightly.20221128":"110.0.5415.0","23.0.0-nightly.20221129":"110.0.5415.0","23.0.0-nightly.20221130":"110.0.5415.0","23.0.0":"110.0.5481.77","23.1.0":"110.0.5481.100","23.1.1":"110.0.5481.104","23.1.2":"110.0.5481.177","23.1.3":"110.0.5481.179","23.1.4":"110.0.5481.192","23.2.0":"110.0.5481.192","23.2.1":"110.0.5481.208","23.2.2":"110.0.5481.208","23.2.3":"110.0.5481.208","23.2.4":"110.0.5481.208","23.3.0":"110.0.5481.208","23.3.1":"110.0.5481.208","23.3.2":"110.0.5481.208","23.3.3":"110.0.5481.208","23.3.4":"110.0.5481.208","23.3.5":"110.0.5481.208","23.3.6":"110.0.5481.208","23.3.7":"110.0.5481.208","23.3.8":"110.0.5481.208","23.3.9":"110.0.5481.208","23.3.10":"110.0.5481.208","23.3.11":"110.0.5481.208","23.3.12":"110.0.5481.208","23.3.13":"110.0.5481.208","24.0.0-alpha.1":"111.0.5560.0","24.0.0-alpha.2":"111.0.5560.0","24.0.0-alpha.3":"111.0.5560.0","24.0.0-alpha.4":"111.0.5560.0","24.0.0-alpha.5":"111.0.5560.0","24.0.0-alpha.6":"111.0.5560.0","24.0.0-alpha.7":"111.0.5560.0","24.0.0-beta.1":"111.0.5563.50","24.0.0-beta.2":"111.0.5563.50","24.0.0-beta.3":"112.0.5615.20","24.0.0-beta.4":"112.0.5615.20","24.0.0-beta.5":"112.0.5615.29","24.0.0-beta.6":"112.0.5615.39","24.0.0-beta.7":"112.0.5615.39","24.0.0-nightly.20221201":"110.0.5415.0","24.0.0-nightly.20221202":"110.0.5415.0","24.0.0-nightly.20221205":"110.0.5415.0","24.0.0-nightly.20221206":"110.0.5451.0","24.0.0-nightly.20221207":"110.0.5451.0","24.0.0-nightly.20221208":"110.0.5451.0","24.0.0-nightly.20221213":"110.0.5451.0","24.0.0-nightly.20221214":"110.0.5451.0","24.0.0-nightly.20221215":"110.0.5451.0","24.0.0-nightly.20221216":"110.0.5451.0","24.0.0-nightly.20230109":"111.0.5518.0","24.0.0-nightly.20230110":"111.0.5518.0","24.0.0-nightly.20230111":"111.0.5518.0","24.0.0-nightly.20230112":"111.0.5518.0","24.0.0-nightly.20230113":"111.0.5518.0","24.0.0-nightly.20230116":"111.0.5518.0","24.0.0-nightly.20230117":"111.0.5518.0","24.0.0-nightly.20230118":"111.0.5518.0","24.0.0-nightly.20230119":"111.0.5518.0","24.0.0-nightly.20230120":"111.0.5518.0","24.0.0-nightly.20230123":"111.0.5518.0","24.0.0-nightly.20230124":"111.0.5518.0","24.0.0-nightly.20230125":"111.0.5518.0","24.0.0-nightly.20230126":"111.0.5518.0","24.0.0-nightly.20230127":"111.0.5518.0","24.0.0-nightly.20230131":"111.0.5518.0","24.0.0-nightly.20230201":"111.0.5518.0","24.0.0-nightly.20230202":"111.0.5518.0","24.0.0-nightly.20230203":"111.0.5560.0","24.0.0-nightly.20230206":"111.0.5560.0","24.0.0-nightly.20230207":"111.0.5560.0","24.0.0-nightly.20230208":"111.0.5560.0","24.0.0-nightly.20230209":"111.0.5560.0","24.0.0":"112.0.5615.49","24.1.0":"112.0.5615.50","24.1.1":"112.0.5615.50","24.1.2":"112.0.5615.87","24.1.3":"112.0.5615.165","24.2.0":"112.0.5615.165","24.3.0":"112.0.5615.165","24.3.1":"112.0.5615.183","24.4.0":"112.0.5615.204","24.4.1":"112.0.5615.204","24.5.0":"112.0.5615.204","24.5.1":"112.0.5615.204","24.6.0":"112.0.5615.204","24.6.1":"112.0.5615.204","24.6.2":"112.0.5615.204","24.6.3":"112.0.5615.204","24.6.4":"112.0.5615.204","24.6.5":"112.0.5615.204","24.7.0":"112.0.5615.204","24.7.1":"112.0.5615.204","24.8.0":"112.0.5615.204","24.8.1":"112.0.5615.204","24.8.2":"112.0.5615.204","24.8.3":"112.0.5615.204","24.8.4":"112.0.5615.204","24.8.5":"112.0.5615.204","24.8.6":"112.0.5615.204","24.8.7":"112.0.5615.204","24.8.8":"112.0.5615.204","25.0.0-alpha.1":"114.0.5694.0","25.0.0-alpha.2":"114.0.5694.0","25.0.0-alpha.3":"114.0.5710.0","25.0.0-alpha.4":"114.0.5710.0","25.0.0-alpha.5":"114.0.5719.0","25.0.0-alpha.6":"114.0.5719.0","25.0.0-beta.1":"114.0.5719.0","25.0.0-beta.2":"114.0.5719.0","25.0.0-beta.3":"114.0.5719.0","25.0.0-beta.4":"114.0.5735.16","25.0.0-beta.5":"114.0.5735.16","25.0.0-beta.6":"114.0.5735.16","25.0.0-beta.7":"114.0.5735.16","25.0.0-beta.8":"114.0.5735.35","25.0.0-beta.9":"114.0.5735.45","25.0.0-nightly.20230210":"111.0.5560.0","25.0.0-nightly.20230214":"111.0.5560.0","25.0.0-nightly.20230215":"111.0.5560.0","25.0.0-nightly.20230216":"111.0.5560.0","25.0.0-nightly.20230217":"111.0.5560.0","25.0.0-nightly.20230220":"111.0.5560.0","25.0.0-nightly.20230221":"111.0.5560.0","25.0.0-nightly.20230222":"111.0.5560.0","25.0.0-nightly.20230223":"111.0.5560.0","25.0.0-nightly.20230224":"111.0.5560.0","25.0.0-nightly.20230227":"111.0.5560.0","25.0.0-nightly.20230228":"111.0.5560.0","25.0.0-nightly.20230301":"111.0.5560.0","25.0.0-nightly.20230302":"111.0.5560.0","25.0.0-nightly.20230303":"111.0.5560.0","25.0.0-nightly.20230306":"111.0.5560.0","25.0.0-nightly.20230307":"111.0.5560.0","25.0.0-nightly.20230308":"111.0.5560.0","25.0.0-nightly.20230309":"111.0.5560.0","25.0.0-nightly.20230310":"111.0.5560.0","25.0.0-nightly.20230314":"113.0.5636.0","25.0.0-nightly.20230315":"113.0.5651.0","25.0.0-nightly.20230317":"113.0.5653.0","25.0.0-nightly.20230320":"113.0.5660.0","25.0.0-nightly.20230321":"113.0.5664.0","25.0.0-nightly.20230322":"113.0.5666.0","25.0.0-nightly.20230323":"113.0.5668.0","25.0.0-nightly.20230324":"113.0.5670.0","25.0.0-nightly.20230327":"113.0.5670.0","25.0.0-nightly.20230328":"113.0.5670.0","25.0.0-nightly.20230329":"113.0.5670.0","25.0.0-nightly.20230330":"113.0.5670.0","25.0.0-nightly.20230331":"114.0.5684.0","25.0.0-nightly.20230403":"114.0.5684.0","25.0.0-nightly.20230404":"114.0.5692.0","25.0.0-nightly.20230405":"114.0.5694.0","25.0.0":"114.0.5735.45","25.0.1":"114.0.5735.45","25.1.0":"114.0.5735.106","25.1.1":"114.0.5735.106","25.2.0":"114.0.5735.134","25.3.0":"114.0.5735.199","25.3.1":"114.0.5735.243","25.3.2":"114.0.5735.248","25.4.0":"114.0.5735.248","25.5.0":"114.0.5735.289","25.6.0":"114.0.5735.289","25.7.0":"114.0.5735.289","25.8.0":"114.0.5735.289","25.8.1":"114.0.5735.289","25.8.2":"114.0.5735.289","25.8.3":"114.0.5735.289","25.8.4":"114.0.5735.289","25.9.0":"114.0.5735.289","25.9.1":"114.0.5735.289","25.9.2":"114.0.5735.289","25.9.3":"114.0.5735.289","25.9.4":"114.0.5735.289","25.9.5":"114.0.5735.289","25.9.6":"114.0.5735.289","25.9.7":"114.0.5735.289","26.0.0-alpha.1":"116.0.5791.0","26.0.0-alpha.2":"116.0.5791.0","26.0.0-alpha.3":"116.0.5791.0","26.0.0-alpha.4":"116.0.5791.0","26.0.0-alpha.5":"116.0.5791.0","26.0.0-alpha.6":"116.0.5815.0","26.0.0-alpha.7":"116.0.5831.0","26.0.0-alpha.8":"116.0.5845.0","26.0.0-beta.1":"116.0.5845.0","26.0.0-beta.2":"116.0.5845.14","26.0.0-beta.3":"116.0.5845.14","26.0.0-beta.4":"116.0.5845.14","26.0.0-beta.5":"116.0.5845.14","26.0.0-beta.6":"116.0.5845.14","26.0.0-beta.7":"116.0.5845.14","26.0.0-beta.8":"116.0.5845.42","26.0.0-beta.9":"116.0.5845.42","26.0.0-beta.10":"116.0.5845.49","26.0.0-beta.11":"116.0.5845.49","26.0.0-beta.12":"116.0.5845.62","26.0.0-nightly.20230406":"114.0.5694.0","26.0.0-nightly.20230407":"114.0.5694.0","26.0.0-nightly.20230410":"114.0.5694.0","26.0.0-nightly.20230411":"114.0.5694.0","26.0.0-nightly.20230412":"114.0.5708.0","26.0.0-nightly.20230413":"114.0.5710.0","26.0.0-nightly.20230414":"114.0.5710.0","26.0.0-nightly.20230417":"114.0.5710.0","26.0.0-nightly.20230418":"114.0.5715.0","26.0.0-nightly.20230421":"114.0.5719.0","26.0.0-nightly.20230424":"114.0.5719.0","26.0.0-nightly.20230425":"114.0.5719.0","26.0.0-nightly.20230426":"114.0.5719.0","26.0.0-nightly.20230427":"114.0.5719.0","26.0.0-nightly.20230428":"114.0.5719.0","26.0.0-nightly.20230501":"114.0.5719.0","26.0.0-nightly.20230502":"114.0.5719.0","26.0.0-nightly.20230503":"114.0.5719.0","26.0.0-nightly.20230504":"114.0.5719.0","26.0.0-nightly.20230505":"114.0.5719.0","26.0.0-nightly.20230508":"114.0.5719.0","26.0.0-nightly.20230509":"114.0.5719.0","26.0.0-nightly.20230510":"114.0.5719.0","26.0.0-nightly.20230511":"115.0.5760.0","26.0.0-nightly.20230512":"115.0.5760.0","26.0.0-nightly.20230515":"115.0.5760.0","26.0.0-nightly.20230516":"115.0.5760.0","26.0.0-nightly.20230517":"115.0.5760.0","26.0.0-nightly.20230518":"115.0.5760.0","26.0.0-nightly.20230519":"115.0.5760.0","26.0.0-nightly.20230522":"115.0.5760.0","26.0.0-nightly.20230523":"115.0.5760.0","26.0.0-nightly.20230524":"115.0.5786.0","26.0.0-nightly.20230525":"115.0.5790.0","26.0.0-nightly.20230526":"116.0.5791.0","26.0.0-nightly.20230529":"116.0.5791.0","26.0.0-nightly.20230530":"116.0.5791.0","26.0.0-nightly.20230531":"116.0.5791.0","26.0.0":"116.0.5845.82","26.1.0":"116.0.5845.97","26.2.0":"116.0.5845.179","26.2.1":"116.0.5845.188","26.2.2":"116.0.5845.190","26.2.3":"116.0.5845.190","26.2.4":"116.0.5845.190","26.3.0":"116.0.5845.228","26.4.0":"116.0.5845.228","26.4.1":"116.0.5845.228","26.4.2":"116.0.5845.228","26.4.3":"116.0.5845.228","26.5.0":"116.0.5845.228","26.6.0":"116.0.5845.228","26.6.1":"116.0.5845.228","26.6.2":"116.0.5845.228","27.0.0-alpha.1":"118.0.5949.0","27.0.0-alpha.2":"118.0.5949.0","27.0.0-alpha.3":"118.0.5949.0","27.0.0-alpha.4":"118.0.5949.0","27.0.0-alpha.5":"118.0.5949.0","27.0.0-alpha.6":"118.0.5949.0","27.0.0-beta.1":"118.0.5993.5","27.0.0-beta.2":"118.0.5993.5","27.0.0-beta.3":"118.0.5993.5","27.0.0-beta.4":"118.0.5993.11","27.0.0-beta.5":"118.0.5993.18","27.0.0-beta.6":"118.0.5993.18","27.0.0-beta.7":"118.0.5993.18","27.0.0-beta.8":"118.0.5993.18","27.0.0-beta.9":"118.0.5993.18","27.0.0-nightly.20230601":"116.0.5791.0","27.0.0-nightly.20230602":"116.0.5791.0","27.0.0-nightly.20230605":"116.0.5791.0","27.0.0-nightly.20230606":"116.0.5791.0","27.0.0-nightly.20230607":"116.0.5791.0","27.0.0-nightly.20230609":"116.0.5791.0","27.0.0-nightly.20230612":"116.0.5815.0","27.0.0-nightly.20230613":"116.0.5815.0","27.0.0-nightly.20230614":"116.0.5829.0","27.0.0-nightly.20230615":"116.0.5831.0","27.0.0-nightly.20230616":"116.0.5833.0","27.0.0-nightly.20230619":"116.0.5833.0","27.0.0-nightly.20230620":"116.0.5833.0","27.0.0-nightly.20230621":"116.0.5833.0","27.0.0-nightly.20230622":"116.0.5845.0","27.0.0-nightly.20230623":"116.0.5845.0","27.0.0-nightly.20230626":"116.0.5845.0","27.0.0-nightly.20230627":"116.0.5845.0","27.0.0-nightly.20230628":"116.0.5845.0","27.0.0-nightly.20230629":"116.0.5845.0","27.0.0-nightly.20230630":"116.0.5845.0","27.0.0-nightly.20230703":"117.0.5852.0","27.0.0-nightly.20230704":"117.0.5852.0","27.0.0-nightly.20230705":"117.0.5852.0","27.0.0-nightly.20230706":"117.0.5852.0","27.0.0-nightly.20230707":"117.0.5852.0","27.0.0-nightly.20230710":"117.0.5852.0","27.0.0-nightly.20230711":"117.0.5852.0","27.0.0-nightly.20230712":"117.0.5852.0","27.0.0-nightly.20230713":"117.0.5852.0","27.0.0-nightly.20230714":"117.0.5852.0","27.0.0-nightly.20230717":"117.0.5884.1","27.0.0-nightly.20230718":"117.0.5884.1","27.0.0-nightly.20230719":"117.0.5892.0","27.0.0-nightly.20230720":"117.0.5897.0","27.0.0-nightly.20230721":"117.0.5897.0","27.0.0-nightly.20230724":"117.0.5897.0","27.0.0-nightly.20230725":"117.0.5897.0","27.0.0-nightly.20230726":"117.0.5897.0","27.0.0-nightly.20230727":"117.0.5897.0","27.0.0-nightly.20230728":"117.0.5897.0","27.0.0-nightly.20230731":"117.0.5897.0","27.0.0-nightly.20230801":"117.0.5911.0","27.0.0-nightly.20230802":"117.0.5911.0","27.0.0-nightly.20230803":"117.0.5911.0","27.0.0-nightly.20230804":"117.0.5921.0","27.0.0-nightly.20230807":"117.0.5921.0","27.0.0-nightly.20230808":"117.0.5921.0","27.0.0-nightly.20230814":"117.0.5921.0","27.0.0-nightly.20230815":"117.0.5921.0","27.0.0-nightly.20230816":"118.0.5949.0","27.0.0":"118.0.5993.54","27.0.1":"118.0.5993.89","27.0.2":"118.0.5993.89","27.0.3":"118.0.5993.120","27.0.4":"118.0.5993.129","27.1.0":"118.0.5993.144","27.1.2":"118.0.5993.144","27.1.3":"118.0.5993.159","28.0.0-alpha.1":"119.0.6045.0","28.0.0-alpha.2":"119.0.6045.0","28.0.0-alpha.3":"119.0.6045.21","28.0.0-alpha.4":"119.0.6045.21","28.0.0-alpha.5":"119.0.6045.33","28.0.0-alpha.6":"119.0.6045.33","28.0.0-alpha.7":"119.0.6045.33","28.0.0-beta.1":"119.0.6045.33","28.0.0-beta.2":"120.0.6099.0","28.0.0-beta.3":"120.0.6099.5","28.0.0-beta.4":"120.0.6099.5","28.0.0-beta.5":"120.0.6099.18","28.0.0-beta.6":"120.0.6099.18","28.0.0-beta.7":"120.0.6099.18","28.0.0-beta.8":"120.0.6099.18","28.0.0-beta.9":"120.0.6099.18","28.0.0-beta.10":"120.0.6099.18","28.0.0-beta.11":"120.0.6099.35","28.0.0-nightly.20230817":"118.0.5949.0","28.0.0-nightly.20230818":"118.0.5949.0","28.0.0-nightly.20230821":"118.0.5949.0","28.0.0-nightly.20230822":"118.0.5949.0","28.0.0-nightly.20230823":"118.0.5949.0","28.0.0-nightly.20230824":"118.0.5949.0","28.0.0-nightly.20230825":"118.0.5949.0","28.0.0-nightly.20230828":"118.0.5949.0","28.0.0-nightly.20230829":"118.0.5949.0","28.0.0-nightly.20230830":"118.0.5949.0","28.0.0-nightly.20230831":"118.0.5949.0","28.0.0-nightly.20230906":"118.0.5991.0","28.0.0-nightly.20230907":"118.0.5993.0","28.0.0-nightly.20230908":"118.0.5993.0","28.0.0-nightly.20230911":"118.0.5993.0","28.0.0-nightly.20230912":"118.0.5993.0","28.0.0-nightly.20230913":"118.0.5993.0","28.0.0-nightly.20230914":"118.0.5993.0","28.0.0-nightly.20230915":"118.0.5993.0","28.0.0-nightly.20230919":"119.0.6006.0","28.0.0-nightly.20230920":"119.0.6017.0","28.0.0-nightly.20230921":"119.0.6019.2","28.0.0-nightly.20230925":"119.0.6019.2","28.0.0-nightly.20230926":"119.0.6019.2","28.0.0-nightly.20230927":"119.0.6019.2","28.0.0-nightly.20230928":"119.0.6019.2","28.0.0-nightly.20230929":"119.0.6029.0","28.0.0-nightly.20231002":"119.0.6029.0","28.0.0-nightly.20231003":"119.0.6043.0","28.0.0-nightly.20231004":"119.0.6043.0","28.0.0-nightly.20231005":"119.0.6043.0","28.0.0-nightly.20231006":"119.0.6045.0","28.0.0-nightly.20231009":"119.0.6045.0","28.0.0-nightly.20231010":"119.0.6045.0","28.0.0-nightly.20231011":"119.0.6045.0","29.0.0-nightly.20231012":"119.0.6045.0","29.0.0-nightly.20231013":"119.0.6045.0","29.0.0-nightly.20231016":"119.0.6045.0","29.0.0-nightly.20231017":"119.0.6045.0","29.0.0-nightly.20231018":"119.0.6045.0","29.0.0-nightly.20231019":"119.0.6045.0","29.0.0-nightly.20231020":"119.0.6045.0","29.0.0-nightly.20231023":"119.0.6045.0","29.0.0-nightly.20231024":"119.0.6045.0","29.0.0-nightly.20231025":"120.0.6078.0","29.0.0-nightly.20231026":"120.0.6078.0","29.0.0-nightly.20231027":"120.0.6078.0","29.0.0-nightly.20231030":"120.0.6078.0","29.0.0-nightly.20231031":"120.0.6078.0","29.0.0-nightly.20231101":"120.0.6078.0","29.0.0-nightly.20231102":"121.0.6100.0","29.0.0-nightly.20231103":"121.0.6100.0","29.0.0-nightly.20231106":"121.0.6104.0","29.0.0-nightly.20231107":"121.0.6110.0","29.0.0-nightly.20231108":"121.0.6110.0","29.0.0-nightly.20231109":"121.0.6110.0","29.0.0-nightly.20231110":"121.0.6110.0","29.0.0-nightly.20231113":"121.0.6110.0","29.0.0-nightly.20231114":"121.0.6110.0","29.0.0-nightly.20231115":"121.0.6116.0","29.0.0-nightly.20231116":"121.0.6116.0","29.0.0-nightly.20231117":"121.0.6116.0","29.0.0-nightly.20231120":"121.0.6116.0","29.0.0-nightly.20231121":"121.0.6116.0","29.0.0-nightly.20231122":"121.0.6116.0","29.0.0-nightly.20231123":"121.0.6116.0","29.0.0-nightly.20231124":"121.0.6116.0","29.0.0-nightly.20231127":"121.0.6116.0","29.0.0-nightly.20231128":"121.0.6116.0","29.0.0-nightly.20231129":"121.0.6147.0","29.0.0-nightly.20231130":"121.0.6147.0","29.0.0-nightly.20231201":"121.0.6147.0"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json b/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json index bacc1f0dd12f04..665a193341236d 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json @@ -1,6 +1,6 @@ { "name": "electron-to-chromium", - "version": "1.4.588", + "version": "1.4.601", "description": "Provides a list of electron-to-chromium version mappings", "main": "index.js", "files": [ diff --git a/tools/node_modules/eslint/node_modules/node-releases/data/processed/envs.json b/tools/node_modules/eslint/node_modules/node-releases/data/processed/envs.json index dfd2f15fea6666..00998c00a104fd 100644 --- a/tools/node_modules/eslint/node_modules/node-releases/data/processed/envs.json +++ b/tools/node_modules/eslint/node_modules/node-releases/data/processed/envs.json @@ -1 +1 @@ -[{"name":"nodejs","version":"0.2.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.3.8.0"},{"name":"nodejs","version":"0.3.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.5.1.0"},{"name":"nodejs","version":"0.4.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.2.0"},{"name":"nodejs","version":"0.5.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.8.25"},{"name":"nodejs","version":"0.6.0","date":"2011-11-04","lts":false,"security":false,"v8":"3.6.6.6"},{"name":"nodejs","version":"0.7.0","date":"2012-01-17","lts":false,"security":false,"v8":"3.8.6.0"},{"name":"nodejs","version":"0.8.0","date":"2012-06-22","lts":false,"security":false,"v8":"3.11.10.10"},{"name":"nodejs","version":"0.9.0","date":"2012-07-20","lts":false,"security":false,"v8":"3.11.10.15"},{"name":"nodejs","version":"0.10.0","date":"2013-03-11","lts":false,"security":false,"v8":"3.14.5.8"},{"name":"nodejs","version":"0.11.0","date":"2013-03-28","lts":false,"security":false,"v8":"3.17.13.0"},{"name":"nodejs","version":"0.12.0","date":"2015-02-06","lts":false,"security":false,"v8":"3.28.73.0"},{"name":"nodejs","version":"4.0.0","date":"2015-09-08","lts":false,"security":false,"v8":"4.5.103.30"},{"name":"nodejs","version":"4.1.0","date":"2015-09-17","lts":false,"security":false,"v8":"4.5.103.33"},{"name":"nodejs","version":"4.2.0","date":"2015-10-12","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.3.0","date":"2016-02-09","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.4.0","date":"2016-03-08","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.5.0","date":"2016-08-16","lts":"Argon","security":false,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.6.0","date":"2016-09-27","lts":"Argon","security":true,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.7.0","date":"2016-12-06","lts":"Argon","security":false,"v8":"4.5.103.43"},{"name":"nodejs","version":"4.8.0","date":"2017-02-21","lts":"Argon","security":false,"v8":"4.5.103.45"},{"name":"nodejs","version":"4.9.0","date":"2018-03-28","lts":"Argon","security":true,"v8":"4.5.103.53"},{"name":"nodejs","version":"5.0.0","date":"2015-10-29","lts":false,"security":false,"v8":"4.6.85.28"},{"name":"nodejs","version":"5.1.0","date":"2015-11-17","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.2.0","date":"2015-12-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.3.0","date":"2015-12-15","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.4.0","date":"2016-01-06","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.5.0","date":"2016-01-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.6.0","date":"2016-02-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.7.0","date":"2016-02-23","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.8.0","date":"2016-03-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.9.0","date":"2016-03-16","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.10.0","date":"2016-04-01","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.11.0","date":"2016-04-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.12.0","date":"2016-06-23","lts":false,"security":false,"v8":"4.6.85.32"},{"name":"nodejs","version":"6.0.0","date":"2016-04-26","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.1.0","date":"2016-05-05","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.2.0","date":"2016-05-17","lts":false,"security":false,"v8":"5.0.71.47"},{"name":"nodejs","version":"6.3.0","date":"2016-07-06","lts":false,"security":false,"v8":"5.0.71.52"},{"name":"nodejs","version":"6.4.0","date":"2016-08-12","lts":false,"security":false,"v8":"5.0.71.60"},{"name":"nodejs","version":"6.5.0","date":"2016-08-26","lts":false,"security":false,"v8":"5.1.281.81"},{"name":"nodejs","version":"6.6.0","date":"2016-09-14","lts":false,"security":false,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.7.0","date":"2016-09-27","lts":false,"security":true,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.8.0","date":"2016-10-12","lts":false,"security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.9.0","date":"2016-10-18","lts":"Boron","security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.10.0","date":"2017-02-21","lts":"Boron","security":false,"v8":"5.1.281.93"},{"name":"nodejs","version":"6.11.0","date":"2017-06-06","lts":"Boron","security":false,"v8":"5.1.281.102"},{"name":"nodejs","version":"6.12.0","date":"2017-11-06","lts":"Boron","security":false,"v8":"5.1.281.108"},{"name":"nodejs","version":"6.13.0","date":"2018-02-10","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.14.0","date":"2018-03-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.15.0","date":"2018-11-27","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.16.0","date":"2018-12-26","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.17.0","date":"2019-02-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"7.0.0","date":"2016-10-25","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.1.0","date":"2016-11-08","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.2.0","date":"2016-11-22","lts":false,"security":false,"v8":"5.4.500.43"},{"name":"nodejs","version":"7.3.0","date":"2016-12-20","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.4.0","date":"2017-01-04","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.5.0","date":"2017-01-31","lts":false,"security":false,"v8":"5.4.500.48"},{"name":"nodejs","version":"7.6.0","date":"2017-02-21","lts":false,"security":false,"v8":"5.5.372.40"},{"name":"nodejs","version":"7.7.0","date":"2017-02-28","lts":false,"security":false,"v8":"5.5.372.41"},{"name":"nodejs","version":"7.8.0","date":"2017-03-29","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.9.0","date":"2017-04-11","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.10.0","date":"2017-05-02","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"8.0.0","date":"2017-05-30","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.1.0","date":"2017-06-08","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.2.0","date":"2017-07-19","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.3.0","date":"2017-08-08","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.4.0","date":"2017-08-15","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.5.0","date":"2017-09-12","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.6.0","date":"2017-09-26","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.7.0","date":"2017-10-11","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.8.0","date":"2017-10-24","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.9.0","date":"2017-10-31","lts":"Carbon","security":false,"v8":"6.1.534.46"},{"name":"nodejs","version":"8.10.0","date":"2018-03-06","lts":"Carbon","security":false,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.11.0","date":"2018-03-28","lts":"Carbon","security":true,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.12.0","date":"2018-09-10","lts":"Carbon","security":false,"v8":"6.2.414.66"},{"name":"nodejs","version":"8.13.0","date":"2018-11-20","lts":"Carbon","security":false,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.14.0","date":"2018-11-27","lts":"Carbon","security":true,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.15.0","date":"2018-12-26","lts":"Carbon","security":false,"v8":"6.2.414.75"},{"name":"nodejs","version":"8.16.0","date":"2019-04-16","lts":"Carbon","security":false,"v8":"6.2.414.77"},{"name":"nodejs","version":"8.17.0","date":"2019-12-17","lts":"Carbon","security":true,"v8":"6.2.414.78"},{"name":"nodejs","version":"9.0.0","date":"2017-10-31","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.1.0","date":"2017-11-07","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.2.0","date":"2017-11-14","lts":false,"security":false,"v8":"6.2.414.44"},{"name":"nodejs","version":"9.3.0","date":"2017-12-12","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.4.0","date":"2018-01-10","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.5.0","date":"2018-01-31","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.6.0","date":"2018-02-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.7.0","date":"2018-03-01","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.8.0","date":"2018-03-07","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.9.0","date":"2018-03-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.10.0","date":"2018-03-28","lts":false,"security":true,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.11.0","date":"2018-04-04","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"10.0.0","date":"2018-04-24","lts":false,"security":false,"v8":"6.6.346.24"},{"name":"nodejs","version":"10.1.0","date":"2018-05-08","lts":false,"security":false,"v8":"6.6.346.27"},{"name":"nodejs","version":"10.2.0","date":"2018-05-23","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.3.0","date":"2018-05-29","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.4.0","date":"2018-06-06","lts":false,"security":false,"v8":"6.7.288.43"},{"name":"nodejs","version":"10.5.0","date":"2018-06-20","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.6.0","date":"2018-07-04","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.7.0","date":"2018-07-18","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.8.0","date":"2018-08-01","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.9.0","date":"2018-08-15","lts":false,"security":false,"v8":"6.8.275.24"},{"name":"nodejs","version":"10.10.0","date":"2018-09-06","lts":false,"security":false,"v8":"6.8.275.30"},{"name":"nodejs","version":"10.11.0","date":"2018-09-19","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.12.0","date":"2018-10-10","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.13.0","date":"2018-10-30","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.14.0","date":"2018-11-27","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.15.0","date":"2018-12-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.16.0","date":"2019-05-28","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.17.0","date":"2019-10-22","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.18.0","date":"2019-12-17","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.19.0","date":"2020-02-05","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.20.0","date":"2020-03-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.21.0","date":"2020-06-02","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.22.0","date":"2020-07-21","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.23.0","date":"2020-10-27","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.24.0","date":"2021-02-23","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"11.0.0","date":"2018-10-23","lts":false,"security":false,"v8":"7.0.276.28"},{"name":"nodejs","version":"11.1.0","date":"2018-10-30","lts":false,"security":false,"v8":"7.0.276.32"},{"name":"nodejs","version":"11.2.0","date":"2018-11-15","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.3.0","date":"2018-11-27","lts":false,"security":true,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.4.0","date":"2018-12-07","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.5.0","date":"2018-12-18","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.6.0","date":"2018-12-26","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.7.0","date":"2019-01-17","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.8.0","date":"2019-01-24","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.9.0","date":"2019-01-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.10.0","date":"2019-02-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.11.0","date":"2019-03-05","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.12.0","date":"2019-03-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.13.0","date":"2019-03-28","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.14.0","date":"2019-04-10","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.15.0","date":"2019-04-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"12.0.0","date":"2019-04-23","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.1.0","date":"2019-04-29","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.2.0","date":"2019-05-07","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.3.0","date":"2019-05-21","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.4.0","date":"2019-06-04","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.5.0","date":"2019-06-26","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.6.0","date":"2019-07-03","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.7.0","date":"2019-07-23","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.8.0","date":"2019-08-06","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.9.0","date":"2019-08-20","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.10.0","date":"2019-09-04","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.11.0","date":"2019-09-25","lts":false,"security":false,"v8":"7.7.299.11"},{"name":"nodejs","version":"12.12.0","date":"2019-10-11","lts":false,"security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.13.0","date":"2019-10-21","lts":"Erbium","security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.14.0","date":"2019-12-17","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.15.0","date":"2020-02-05","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.16.0","date":"2020-02-11","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.17.0","date":"2020-05-26","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.18.0","date":"2020-06-02","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.19.0","date":"2020-10-06","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.20.0","date":"2020-11-24","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.21.0","date":"2021-02-23","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.22.0","date":"2021-03-30","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"13.0.0","date":"2019-10-22","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.1.0","date":"2019-11-05","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.2.0","date":"2019-11-21","lts":false,"security":false,"v8":"7.9.317.23"},{"name":"nodejs","version":"13.3.0","date":"2019-12-03","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.4.0","date":"2019-12-17","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.5.0","date":"2019-12-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.6.0","date":"2020-01-07","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.7.0","date":"2020-01-21","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.8.0","date":"2020-02-05","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.9.0","date":"2020-02-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.10.0","date":"2020-03-04","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.11.0","date":"2020-03-12","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.12.0","date":"2020-03-26","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.13.0","date":"2020-04-14","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.14.0","date":"2020-04-29","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"14.0.0","date":"2020-04-21","lts":false,"security":false,"v8":"8.1.307.30"},{"name":"nodejs","version":"14.1.0","date":"2020-04-29","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.2.0","date":"2020-05-05","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.3.0","date":"2020-05-19","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.4.0","date":"2020-06-02","lts":false,"security":true,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.5.0","date":"2020-06-30","lts":false,"security":false,"v8":"8.3.110.9"},{"name":"nodejs","version":"14.6.0","date":"2020-07-20","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.7.0","date":"2020-07-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.8.0","date":"2020-08-11","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.9.0","date":"2020-08-27","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.10.0","date":"2020-09-08","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.11.0","date":"2020-09-15","lts":false,"security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.12.0","date":"2020-09-22","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.13.0","date":"2020-09-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.14.0","date":"2020-10-15","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.15.0","date":"2020-10-27","lts":"Fermium","security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.16.0","date":"2021-02-23","lts":"Fermium","security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.17.0","date":"2021-05-11","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.18.0","date":"2021-09-28","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.19.0","date":"2022-02-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.20.0","date":"2022-07-07","lts":"Fermium","security":true,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.21.0","date":"2022-11-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"15.0.0","date":"2020-10-20","lts":false,"security":false,"v8":"8.6.395.16"},{"name":"nodejs","version":"15.1.0","date":"2020-11-04","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.2.0","date":"2020-11-10","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.3.0","date":"2020-11-24","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.4.0","date":"2020-12-09","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.5.0","date":"2020-12-22","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.6.0","date":"2021-01-14","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.7.0","date":"2021-01-25","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.8.0","date":"2021-02-02","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.9.0","date":"2021-02-18","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.10.0","date":"2021-02-23","lts":false,"security":true,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.11.0","date":"2021-03-03","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.12.0","date":"2021-03-17","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.13.0","date":"2021-03-31","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.14.0","date":"2021-04-06","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"16.0.0","date":"2021-04-20","lts":false,"security":false,"v8":"9.0.257.17"},{"name":"nodejs","version":"16.1.0","date":"2021-05-04","lts":false,"security":false,"v8":"9.0.257.24"},{"name":"nodejs","version":"16.2.0","date":"2021-05-19","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.3.0","date":"2021-06-03","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.4.0","date":"2021-06-23","lts":false,"security":false,"v8":"9.1.269.36"},{"name":"nodejs","version":"16.5.0","date":"2021-07-14","lts":false,"security":false,"v8":"9.1.269.38"},{"name":"nodejs","version":"16.6.0","date":"2021-07-29","lts":false,"security":true,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.7.0","date":"2021-08-18","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.8.0","date":"2021-08-25","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.9.0","date":"2021-09-07","lts":false,"security":false,"v8":"9.3.345.16"},{"name":"nodejs","version":"16.10.0","date":"2021-09-22","lts":false,"security":false,"v8":"9.3.345.19"},{"name":"nodejs","version":"16.11.0","date":"2021-10-08","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.12.0","date":"2021-10-20","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.13.0","date":"2021-10-26","lts":"Gallium","security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.14.0","date":"2022-02-08","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.15.0","date":"2022-04-26","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.16.0","date":"2022-07-07","lts":"Gallium","security":true,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.17.0","date":"2022-08-16","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.18.0","date":"2022-10-12","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.19.0","date":"2022-12-13","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.20.0","date":"2023-03-28","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"17.0.0","date":"2021-10-19","lts":false,"security":false,"v8":"9.5.172.21"},{"name":"nodejs","version":"17.1.0","date":"2021-11-09","lts":false,"security":false,"v8":"9.5.172.25"},{"name":"nodejs","version":"17.2.0","date":"2021-11-30","lts":false,"security":false,"v8":"9.6.180.14"},{"name":"nodejs","version":"17.3.0","date":"2021-12-17","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.4.0","date":"2022-01-18","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.5.0","date":"2022-02-10","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.6.0","date":"2022-02-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.7.0","date":"2022-03-09","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.8.0","date":"2022-03-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.9.0","date":"2022-04-07","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"18.0.0","date":"2022-04-18","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.1.0","date":"2022-05-03","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.2.0","date":"2022-05-17","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.3.0","date":"2022-06-02","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.4.0","date":"2022-06-16","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.5.0","date":"2022-07-06","lts":false,"security":true,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.6.0","date":"2022-07-13","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.7.0","date":"2022-07-26","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.8.0","date":"2022-08-24","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.9.0","date":"2022-09-07","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.10.0","date":"2022-09-28","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.11.0","date":"2022-10-13","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.12.0","date":"2022-10-25","lts":"Hydrogen","security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.13.0","date":"2023-01-05","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.14.0","date":"2023-02-01","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.15.0","date":"2023-03-05","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.16.0","date":"2023-04-12","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"19.0.0","date":"2022-10-17","lts":false,"security":false,"v8":"10.7.193.13"},{"name":"nodejs","version":"19.1.0","date":"2022-11-14","lts":false,"security":false,"v8":"10.7.193.20"},{"name":"nodejs","version":"19.2.0","date":"2022-11-29","lts":false,"security":false,"v8":"10.8.168.20"},{"name":"nodejs","version":"19.3.0","date":"2022-12-14","lts":false,"security":false,"v8":"10.8.168.21"},{"name":"nodejs","version":"19.4.0","date":"2023-01-05","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.5.0","date":"2023-01-24","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.6.0","date":"2023-02-01","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.7.0","date":"2023-02-21","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.8.0","date":"2023-03-14","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.9.0","date":"2023-04-10","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"20.0.0","date":"2023-04-17","lts":false,"security":false,"v8":"11.3.244.4"},{"name":"nodejs","version":"20.1.0","date":"2023-05-03","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.2.0","date":"2023-05-16","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.3.0","date":"2023-06-08","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.4.0","date":"2023-07-04","lts":false,"security":false,"v8":"11.3.244.8"}] \ No newline at end of file +[{"name":"nodejs","version":"0.2.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.3.8.0"},{"name":"nodejs","version":"0.3.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.5.1.0"},{"name":"nodejs","version":"0.4.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.2.0"},{"name":"nodejs","version":"0.5.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.8.25"},{"name":"nodejs","version":"0.6.0","date":"2011-11-04","lts":false,"security":false,"v8":"3.6.6.6"},{"name":"nodejs","version":"0.7.0","date":"2012-01-17","lts":false,"security":false,"v8":"3.8.6.0"},{"name":"nodejs","version":"0.8.0","date":"2012-06-22","lts":false,"security":false,"v8":"3.11.10.10"},{"name":"nodejs","version":"0.9.0","date":"2012-07-20","lts":false,"security":false,"v8":"3.11.10.15"},{"name":"nodejs","version":"0.10.0","date":"2013-03-11","lts":false,"security":false,"v8":"3.14.5.8"},{"name":"nodejs","version":"0.11.0","date":"2013-03-28","lts":false,"security":false,"v8":"3.17.13.0"},{"name":"nodejs","version":"0.12.0","date":"2015-02-06","lts":false,"security":false,"v8":"3.28.73.0"},{"name":"nodejs","version":"4.0.0","date":"2015-09-08","lts":false,"security":false,"v8":"4.5.103.30"},{"name":"nodejs","version":"4.1.0","date":"2015-09-17","lts":false,"security":false,"v8":"4.5.103.33"},{"name":"nodejs","version":"4.2.0","date":"2015-10-12","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.3.0","date":"2016-02-09","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.4.0","date":"2016-03-08","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.5.0","date":"2016-08-16","lts":"Argon","security":false,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.6.0","date":"2016-09-27","lts":"Argon","security":true,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.7.0","date":"2016-12-06","lts":"Argon","security":false,"v8":"4.5.103.43"},{"name":"nodejs","version":"4.8.0","date":"2017-02-21","lts":"Argon","security":false,"v8":"4.5.103.45"},{"name":"nodejs","version":"4.9.0","date":"2018-03-28","lts":"Argon","security":true,"v8":"4.5.103.53"},{"name":"nodejs","version":"5.0.0","date":"2015-10-29","lts":false,"security":false,"v8":"4.6.85.28"},{"name":"nodejs","version":"5.1.0","date":"2015-11-17","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.2.0","date":"2015-12-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.3.0","date":"2015-12-15","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.4.0","date":"2016-01-06","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.5.0","date":"2016-01-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.6.0","date":"2016-02-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.7.0","date":"2016-02-23","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.8.0","date":"2016-03-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.9.0","date":"2016-03-16","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.10.0","date":"2016-04-01","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.11.0","date":"2016-04-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.12.0","date":"2016-06-23","lts":false,"security":false,"v8":"4.6.85.32"},{"name":"nodejs","version":"6.0.0","date":"2016-04-26","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.1.0","date":"2016-05-05","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.2.0","date":"2016-05-17","lts":false,"security":false,"v8":"5.0.71.47"},{"name":"nodejs","version":"6.3.0","date":"2016-07-06","lts":false,"security":false,"v8":"5.0.71.52"},{"name":"nodejs","version":"6.4.0","date":"2016-08-12","lts":false,"security":false,"v8":"5.0.71.60"},{"name":"nodejs","version":"6.5.0","date":"2016-08-26","lts":false,"security":false,"v8":"5.1.281.81"},{"name":"nodejs","version":"6.6.0","date":"2016-09-14","lts":false,"security":false,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.7.0","date":"2016-09-27","lts":false,"security":true,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.8.0","date":"2016-10-12","lts":false,"security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.9.0","date":"2016-10-18","lts":"Boron","security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.10.0","date":"2017-02-21","lts":"Boron","security":false,"v8":"5.1.281.93"},{"name":"nodejs","version":"6.11.0","date":"2017-06-06","lts":"Boron","security":false,"v8":"5.1.281.102"},{"name":"nodejs","version":"6.12.0","date":"2017-11-06","lts":"Boron","security":false,"v8":"5.1.281.108"},{"name":"nodejs","version":"6.13.0","date":"2018-02-10","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.14.0","date":"2018-03-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.15.0","date":"2018-11-27","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.16.0","date":"2018-12-26","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.17.0","date":"2019-02-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"7.0.0","date":"2016-10-25","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.1.0","date":"2016-11-08","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.2.0","date":"2016-11-22","lts":false,"security":false,"v8":"5.4.500.43"},{"name":"nodejs","version":"7.3.0","date":"2016-12-20","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.4.0","date":"2017-01-04","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.5.0","date":"2017-01-31","lts":false,"security":false,"v8":"5.4.500.48"},{"name":"nodejs","version":"7.6.0","date":"2017-02-21","lts":false,"security":false,"v8":"5.5.372.40"},{"name":"nodejs","version":"7.7.0","date":"2017-02-28","lts":false,"security":false,"v8":"5.5.372.41"},{"name":"nodejs","version":"7.8.0","date":"2017-03-29","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.9.0","date":"2017-04-11","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.10.0","date":"2017-05-02","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"8.0.0","date":"2017-05-30","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.1.0","date":"2017-06-08","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.2.0","date":"2017-07-19","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.3.0","date":"2017-08-08","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.4.0","date":"2017-08-15","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.5.0","date":"2017-09-12","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.6.0","date":"2017-09-26","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.7.0","date":"2017-10-11","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.8.0","date":"2017-10-24","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.9.0","date":"2017-10-31","lts":"Carbon","security":false,"v8":"6.1.534.46"},{"name":"nodejs","version":"8.10.0","date":"2018-03-06","lts":"Carbon","security":false,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.11.0","date":"2018-03-28","lts":"Carbon","security":true,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.12.0","date":"2018-09-10","lts":"Carbon","security":false,"v8":"6.2.414.66"},{"name":"nodejs","version":"8.13.0","date":"2018-11-20","lts":"Carbon","security":false,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.14.0","date":"2018-11-27","lts":"Carbon","security":true,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.15.0","date":"2018-12-26","lts":"Carbon","security":false,"v8":"6.2.414.75"},{"name":"nodejs","version":"8.16.0","date":"2019-04-16","lts":"Carbon","security":false,"v8":"6.2.414.77"},{"name":"nodejs","version":"8.17.0","date":"2019-12-17","lts":"Carbon","security":true,"v8":"6.2.414.78"},{"name":"nodejs","version":"9.0.0","date":"2017-10-31","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.1.0","date":"2017-11-07","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.2.0","date":"2017-11-14","lts":false,"security":false,"v8":"6.2.414.44"},{"name":"nodejs","version":"9.3.0","date":"2017-12-12","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.4.0","date":"2018-01-10","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.5.0","date":"2018-01-31","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.6.0","date":"2018-02-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.7.0","date":"2018-03-01","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.8.0","date":"2018-03-07","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.9.0","date":"2018-03-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.10.0","date":"2018-03-28","lts":false,"security":true,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.11.0","date":"2018-04-04","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"10.0.0","date":"2018-04-24","lts":false,"security":false,"v8":"6.6.346.24"},{"name":"nodejs","version":"10.1.0","date":"2018-05-08","lts":false,"security":false,"v8":"6.6.346.27"},{"name":"nodejs","version":"10.2.0","date":"2018-05-23","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.3.0","date":"2018-05-29","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.4.0","date":"2018-06-06","lts":false,"security":false,"v8":"6.7.288.43"},{"name":"nodejs","version":"10.5.0","date":"2018-06-20","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.6.0","date":"2018-07-04","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.7.0","date":"2018-07-18","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.8.0","date":"2018-08-01","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.9.0","date":"2018-08-15","lts":false,"security":false,"v8":"6.8.275.24"},{"name":"nodejs","version":"10.10.0","date":"2018-09-06","lts":false,"security":false,"v8":"6.8.275.30"},{"name":"nodejs","version":"10.11.0","date":"2018-09-19","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.12.0","date":"2018-10-10","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.13.0","date":"2018-10-30","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.14.0","date":"2018-11-27","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.15.0","date":"2018-12-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.16.0","date":"2019-05-28","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.17.0","date":"2019-10-22","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.18.0","date":"2019-12-17","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.19.0","date":"2020-02-05","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.20.0","date":"2020-03-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.21.0","date":"2020-06-02","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.22.0","date":"2020-07-21","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.23.0","date":"2020-10-27","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.24.0","date":"2021-02-23","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"11.0.0","date":"2018-10-23","lts":false,"security":false,"v8":"7.0.276.28"},{"name":"nodejs","version":"11.1.0","date":"2018-10-30","lts":false,"security":false,"v8":"7.0.276.32"},{"name":"nodejs","version":"11.2.0","date":"2018-11-15","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.3.0","date":"2018-11-27","lts":false,"security":true,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.4.0","date":"2018-12-07","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.5.0","date":"2018-12-18","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.6.0","date":"2018-12-26","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.7.0","date":"2019-01-17","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.8.0","date":"2019-01-24","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.9.0","date":"2019-01-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.10.0","date":"2019-02-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.11.0","date":"2019-03-05","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.12.0","date":"2019-03-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.13.0","date":"2019-03-28","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.14.0","date":"2019-04-10","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.15.0","date":"2019-04-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"12.0.0","date":"2019-04-23","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.1.0","date":"2019-04-29","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.2.0","date":"2019-05-07","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.3.0","date":"2019-05-21","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.4.0","date":"2019-06-04","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.5.0","date":"2019-06-26","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.6.0","date":"2019-07-03","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.7.0","date":"2019-07-23","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.8.0","date":"2019-08-06","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.9.0","date":"2019-08-20","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.10.0","date":"2019-09-04","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.11.0","date":"2019-09-25","lts":false,"security":false,"v8":"7.7.299.11"},{"name":"nodejs","version":"12.12.0","date":"2019-10-11","lts":false,"security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.13.0","date":"2019-10-21","lts":"Erbium","security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.14.0","date":"2019-12-17","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.15.0","date":"2020-02-05","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.16.0","date":"2020-02-11","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.17.0","date":"2020-05-26","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.18.0","date":"2020-06-02","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.19.0","date":"2020-10-06","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.20.0","date":"2020-11-24","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.21.0","date":"2021-02-23","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.22.0","date":"2021-03-30","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"13.0.0","date":"2019-10-22","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.1.0","date":"2019-11-05","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.2.0","date":"2019-11-21","lts":false,"security":false,"v8":"7.9.317.23"},{"name":"nodejs","version":"13.3.0","date":"2019-12-03","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.4.0","date":"2019-12-17","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.5.0","date":"2019-12-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.6.0","date":"2020-01-07","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.7.0","date":"2020-01-21","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.8.0","date":"2020-02-05","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.9.0","date":"2020-02-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.10.0","date":"2020-03-04","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.11.0","date":"2020-03-12","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.12.0","date":"2020-03-26","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.13.0","date":"2020-04-14","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.14.0","date":"2020-04-29","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"14.0.0","date":"2020-04-21","lts":false,"security":false,"v8":"8.1.307.30"},{"name":"nodejs","version":"14.1.0","date":"2020-04-29","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.2.0","date":"2020-05-05","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.3.0","date":"2020-05-19","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.4.0","date":"2020-06-02","lts":false,"security":true,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.5.0","date":"2020-06-30","lts":false,"security":false,"v8":"8.3.110.9"},{"name":"nodejs","version":"14.6.0","date":"2020-07-20","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.7.0","date":"2020-07-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.8.0","date":"2020-08-11","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.9.0","date":"2020-08-27","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.10.0","date":"2020-09-08","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.11.0","date":"2020-09-15","lts":false,"security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.12.0","date":"2020-09-22","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.13.0","date":"2020-09-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.14.0","date":"2020-10-15","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.15.0","date":"2020-10-27","lts":"Fermium","security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.16.0","date":"2021-02-23","lts":"Fermium","security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.17.0","date":"2021-05-11","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.18.0","date":"2021-09-28","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.19.0","date":"2022-02-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.20.0","date":"2022-07-07","lts":"Fermium","security":true,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.21.0","date":"2022-11-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"15.0.0","date":"2020-10-20","lts":false,"security":false,"v8":"8.6.395.16"},{"name":"nodejs","version":"15.1.0","date":"2020-11-04","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.2.0","date":"2020-11-10","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.3.0","date":"2020-11-24","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.4.0","date":"2020-12-09","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.5.0","date":"2020-12-22","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.6.0","date":"2021-01-14","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.7.0","date":"2021-01-25","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.8.0","date":"2021-02-02","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.9.0","date":"2021-02-18","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.10.0","date":"2021-02-23","lts":false,"security":true,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.11.0","date":"2021-03-03","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.12.0","date":"2021-03-17","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.13.0","date":"2021-03-31","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.14.0","date":"2021-04-06","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"16.0.0","date":"2021-04-20","lts":false,"security":false,"v8":"9.0.257.17"},{"name":"nodejs","version":"16.1.0","date":"2021-05-04","lts":false,"security":false,"v8":"9.0.257.24"},{"name":"nodejs","version":"16.2.0","date":"2021-05-19","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.3.0","date":"2021-06-03","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.4.0","date":"2021-06-23","lts":false,"security":false,"v8":"9.1.269.36"},{"name":"nodejs","version":"16.5.0","date":"2021-07-14","lts":false,"security":false,"v8":"9.1.269.38"},{"name":"nodejs","version":"16.6.0","date":"2021-07-29","lts":false,"security":true,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.7.0","date":"2021-08-18","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.8.0","date":"2021-08-25","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.9.0","date":"2021-09-07","lts":false,"security":false,"v8":"9.3.345.16"},{"name":"nodejs","version":"16.10.0","date":"2021-09-22","lts":false,"security":false,"v8":"9.3.345.19"},{"name":"nodejs","version":"16.11.0","date":"2021-10-08","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.12.0","date":"2021-10-20","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.13.0","date":"2021-10-26","lts":"Gallium","security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.14.0","date":"2022-02-08","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.15.0","date":"2022-04-26","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.16.0","date":"2022-07-07","lts":"Gallium","security":true,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.17.0","date":"2022-08-16","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.18.0","date":"2022-10-12","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.19.0","date":"2022-12-13","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.20.0","date":"2023-03-28","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"17.0.0","date":"2021-10-19","lts":false,"security":false,"v8":"9.5.172.21"},{"name":"nodejs","version":"17.1.0","date":"2021-11-09","lts":false,"security":false,"v8":"9.5.172.25"},{"name":"nodejs","version":"17.2.0","date":"2021-11-30","lts":false,"security":false,"v8":"9.6.180.14"},{"name":"nodejs","version":"17.3.0","date":"2021-12-17","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.4.0","date":"2022-01-18","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.5.0","date":"2022-02-10","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.6.0","date":"2022-02-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.7.0","date":"2022-03-09","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.8.0","date":"2022-03-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.9.0","date":"2022-04-07","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"18.0.0","date":"2022-04-18","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.1.0","date":"2022-05-03","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.2.0","date":"2022-05-17","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.3.0","date":"2022-06-02","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.4.0","date":"2022-06-16","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.5.0","date":"2022-07-06","lts":false,"security":true,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.6.0","date":"2022-07-13","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.7.0","date":"2022-07-26","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.8.0","date":"2022-08-24","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.9.0","date":"2022-09-07","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.10.0","date":"2022-09-28","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.11.0","date":"2022-10-13","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.12.0","date":"2022-10-25","lts":"Hydrogen","security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.13.0","date":"2023-01-05","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.14.0","date":"2023-02-01","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.15.0","date":"2023-03-05","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.16.0","date":"2023-04-12","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.17.0","date":"2023-07-18","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.18.0","date":"2023-09-18","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.19.0","date":"2023-11-29","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"19.0.0","date":"2022-10-17","lts":false,"security":false,"v8":"10.7.193.13"},{"name":"nodejs","version":"19.1.0","date":"2022-11-14","lts":false,"security":false,"v8":"10.7.193.20"},{"name":"nodejs","version":"19.2.0","date":"2022-11-29","lts":false,"security":false,"v8":"10.8.168.20"},{"name":"nodejs","version":"19.3.0","date":"2022-12-14","lts":false,"security":false,"v8":"10.8.168.21"},{"name":"nodejs","version":"19.4.0","date":"2023-01-05","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.5.0","date":"2023-01-24","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.6.0","date":"2023-02-01","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.7.0","date":"2023-02-21","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.8.0","date":"2023-03-14","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.9.0","date":"2023-04-10","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"20.0.0","date":"2023-04-17","lts":false,"security":false,"v8":"11.3.244.4"},{"name":"nodejs","version":"20.1.0","date":"2023-05-03","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.2.0","date":"2023-05-16","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.3.0","date":"2023-06-08","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.4.0","date":"2023-07-04","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.5.0","date":"2023-07-19","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.6.0","date":"2023-08-23","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.7.0","date":"2023-09-18","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.8.0","date":"2023-09-28","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.9.0","date":"2023-10-24","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.10.0","date":"2023-11-22","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"21.0.0","date":"2023-10-17","lts":false,"security":false,"v8":"11.8.172.13"},{"name":"nodejs","version":"21.1.0","date":"2023-10-24","lts":false,"security":false,"v8":"11.8.172.15"},{"name":"nodejs","version":"21.2.0","date":"2023-11-14","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.3.0","date":"2023-11-30","lts":false,"security":false,"v8":"11.8.172.17"}] \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/node-releases/data/release-schedule/release-schedule.json b/tools/node_modules/eslint/node_modules/node-releases/data/release-schedule/release-schedule.json index 5eca422e2a5266..167314aa2ea19d 100644 --- a/tools/node_modules/eslint/node_modules/node-releases/data/release-schedule/release-schedule.json +++ b/tools/node_modules/eslint/node_modules/node-releases/data/release-schedule/release-schedule.json @@ -1 +1 @@ -{"v0.8":{"start":"2012-06-25","end":"2014-07-31"},"v0.10":{"start":"2013-03-11","end":"2016-10-31"},"v0.12":{"start":"2015-02-06","end":"2016-12-31"},"v4":{"start":"2015-09-08","lts":"2015-10-12","maintenance":"2017-04-01","end":"2018-04-30","codename":"Argon"},"v5":{"start":"2015-10-29","maintenance":"2016-04-30","end":"2016-06-30"},"v6":{"start":"2016-04-26","lts":"2016-10-18","maintenance":"2018-04-30","end":"2019-04-30","codename":"Boron"},"v7":{"start":"2016-10-25","maintenance":"2017-04-30","end":"2017-06-30"},"v8":{"start":"2017-05-30","lts":"2017-10-31","maintenance":"2019-01-01","end":"2019-12-31","codename":"Carbon"},"v9":{"start":"2017-10-01","maintenance":"2018-04-01","end":"2018-06-30"},"v10":{"start":"2018-04-24","lts":"2018-10-30","maintenance":"2020-05-19","end":"2021-04-30","codename":"Dubnium"},"v11":{"start":"2018-10-23","maintenance":"2019-04-22","end":"2019-06-01"},"v12":{"start":"2019-04-23","lts":"2019-10-21","maintenance":"2020-11-30","end":"2022-04-30","codename":"Erbium"},"v13":{"start":"2019-10-22","maintenance":"2020-04-01","end":"2020-06-01"},"v14":{"start":"2020-04-21","lts":"2020-10-27","maintenance":"2021-10-19","end":"2023-04-30","codename":"Fermium"},"v15":{"start":"2020-10-20","maintenance":"2021-04-01","end":"2021-06-01"},"v16":{"start":"2021-04-20","lts":"2021-10-26","maintenance":"2022-10-18","end":"2023-09-11","codename":"Gallium"},"v17":{"start":"2021-10-19","maintenance":"2022-04-01","end":"2022-06-01"},"v18":{"start":"2022-04-19","lts":"2022-10-25","maintenance":"2023-10-18","end":"2025-04-30","codename":"Hydrogen"},"v19":{"start":"2022-10-18","maintenance":"2023-04-01","end":"2023-06-01"},"v20":{"start":"2023-04-18","lts":"2023-10-24","maintenance":"2024-10-22","end":"2026-04-30","codename":""}} \ No newline at end of file +{"v0.8":{"start":"2012-06-25","end":"2014-07-31"},"v0.10":{"start":"2013-03-11","end":"2016-10-31"},"v0.12":{"start":"2015-02-06","end":"2016-12-31"},"v4":{"start":"2015-09-08","lts":"2015-10-12","maintenance":"2017-04-01","end":"2018-04-30","codename":"Argon"},"v5":{"start":"2015-10-29","maintenance":"2016-04-30","end":"2016-06-30"},"v6":{"start":"2016-04-26","lts":"2016-10-18","maintenance":"2018-04-30","end":"2019-04-30","codename":"Boron"},"v7":{"start":"2016-10-25","maintenance":"2017-04-30","end":"2017-06-30"},"v8":{"start":"2017-05-30","lts":"2017-10-31","maintenance":"2019-01-01","end":"2019-12-31","codename":"Carbon"},"v9":{"start":"2017-10-01","maintenance":"2018-04-01","end":"2018-06-30"},"v10":{"start":"2018-04-24","lts":"2018-10-30","maintenance":"2020-05-19","end":"2021-04-30","codename":"Dubnium"},"v11":{"start":"2018-10-23","maintenance":"2019-04-22","end":"2019-06-01"},"v12":{"start":"2019-04-23","lts":"2019-10-21","maintenance":"2020-11-30","end":"2022-04-30","codename":"Erbium"},"v13":{"start":"2019-10-22","maintenance":"2020-04-01","end":"2020-06-01"},"v14":{"start":"2020-04-21","lts":"2020-10-27","maintenance":"2021-10-19","end":"2023-04-30","codename":"Fermium"},"v15":{"start":"2020-10-20","maintenance":"2021-04-01","end":"2021-06-01"},"v16":{"start":"2021-04-20","lts":"2021-10-26","maintenance":"2022-10-18","end":"2023-09-11","codename":"Gallium"},"v17":{"start":"2021-10-19","maintenance":"2022-04-01","end":"2022-06-01"},"v18":{"start":"2022-04-19","lts":"2022-10-25","maintenance":"2023-10-18","end":"2025-04-30","codename":"Hydrogen"},"v19":{"start":"2022-10-18","maintenance":"2023-04-01","end":"2023-06-01"},"v20":{"start":"2023-04-18","lts":"2023-10-24","maintenance":"2024-10-22","end":"2026-04-30","codename":"Iron"},"v21":{"start":"2023-10-17","maintenance":"2024-04-01","end":"2024-06-01"},"v22":{"start":"2024-04-23","lts":"2024-10-29","maintenance":"2025-10-21","end":"2027-04-30","codename":""},"v23":{"start":"2024-10-15","maintenance":"2025-04-01","end":"2025-06-01"},"v24":{"start":"2025-04-22","lts":"2025-10-28","maintenance":"2026-10-20","end":"2028-04-30","codename":""}} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/node-releases/package.json b/tools/node_modules/eslint/node_modules/node-releases/package.json index c61ab94abdac4c..b3334e92900a73 100644 --- a/tools/node_modules/eslint/node_modules/node-releases/package.json +++ b/tools/node_modules/eslint/node_modules/node-releases/package.json @@ -1,6 +1,6 @@ { "name": "node-releases", - "version": "2.0.13", + "version": "2.0.14", "description": "Node.js releases data", "type": "module", "scripts": { diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index cefe8b440e1a0c..298d76af39aeeb 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -1,6 +1,6 @@ { "name": "eslint", - "version": "8.54.0", + "version": "8.55.0", "author": "Nicholas C. Zakas ", "description": "An AST-based pattern checker for JavaScript.", "bin": { @@ -19,6 +19,7 @@ "build:readme": "node tools/update-readme.js", "lint": "node Makefile.js lint", "lint:docs:js": "node Makefile.js lintDocsJS", + "lint:docs:rule-examples": "node Makefile.js checkRuleExamples", "lint:fix": "node Makefile.js lint -- fix", "lint:fix:docs:js": "node Makefile.js lintDocsJS -- fix", "release:generate:alpha": "node Makefile.js generatePrerelease -- alpha", @@ -42,6 +43,7 @@ "git add packages/js/src/configs/eslint-all.js" ], "docs/src/rules/*.md": [ + "node tools/check-rule-examples.js", "node tools/fetch-docs-links.js", "git add docs/src/_data/further_reading_links.json" ], @@ -62,8 +64,8 @@ "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.54.0", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.55.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -130,6 +132,8 @@ "gray-matter": "^4.0.3", "lint-staged": "^11.0.0", "load-perf": "^0.2.0", + "markdown-it": "^12.2.0", + "markdown-it-container": "^3.0.0", "markdownlint": "^0.31.1", "markdownlint-cli": "^0.37.0", "marked": "^4.0.8", From 7a8a2d563220c9bcc4149a93046527f86e3f9308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E?= Date: Tue, 5 Dec 2023 17:24:14 +0800 Subject: [PATCH 19/67] lib: don't parse windows drive letters as schemes We were incorrectly parsing windows drive letters as schemes. This was polluting the source map cache with malformed file paths. Fixes: https://github.com/nodejs/node/issues/50523 PR-URL: https://github.com/nodejs/node/pull/50580 Reviewed-By: Chengzhong Wu --- lib/internal/source_map/source_map_cache.js | 5 +++++ test/fixtures/source-map/ts-node-win32.js | 10 +++++++++ test/fixtures/source-map/ts-node.ts | 11 ++++++++++ test/parallel/test-source-map-enable.js | 24 +++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 test/fixtures/source-map/ts-node-win32.js create mode 100644 test/fixtures/source-map/ts-node.ts diff --git a/lib/internal/source_map/source_map_cache.js b/lib/internal/source_map/source_map_cache.js index 963b34ebcd241e..23a8ceb4da4d1e 100644 --- a/lib/internal/source_map/source_map_cache.js +++ b/lib/internal/source_map/source_map_cache.js @@ -39,6 +39,7 @@ const kLeadingProtocol = /^\w+:\/\//; const kSourceMappingURLMagicComment = /\/[*/]#\s+sourceMappingURL=(?[^\s]+)/g; const kSourceURLMagicComment = /\/[*/]#\s+sourceURL=(?[^\s]+)/g; +const { isAbsolute } = require('path'); const { fileURLToPath, pathToFileURL, URL } = require('internal/url'); let SourceMap; @@ -263,9 +264,13 @@ function sourceMapFromDataUrl(sourceURL, url) { // If the sources are not absolute URLs after prepending of the "sourceRoot", // the sources are resolved relative to the SourceMap (like resolving script // src in a html document). +// If the sources are absolute paths, the sources are converted to absolute file URLs. function sourcesToAbsolute(baseURL, data) { data.sources = data.sources.map((source) => { source = (data.sourceRoot || '') + source; + if (isAbsolute(source)) { + return pathToFileURL(source).href; + } return new URL(source, baseURL).href; }); // The sources array is now resolved to absolute URLs, sourceRoot should diff --git a/test/fixtures/source-map/ts-node-win32.js b/test/fixtures/source-map/ts-node-win32.js new file mode 100644 index 00000000000000..22606906c9a5ba --- /dev/null +++ b/test/fixtures/source-map/ts-node-win32.js @@ -0,0 +1,10 @@ +function foo(str) { + return str; +} +foo('noop'); +// To recreate (Windows only): +// +// const filePath = require.resolve('./test/fixtures/source-map/ts-node.ts'); +// const compiled = require('ts-node').create({ transpileOnly: true }).compile(fs.readFileSync(filePath, 'utf8'), filePath); +// fs.writeFileSync('test/fixtures/source-map/ts-node-win32.js', compiled); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRDovd29ya3NwYWNlcy9ub2RlL3Rlc3QvZml4dHVyZXMvc291cmNlLW1hcC90cy1ub2RlLnRzIiwic291cmNlcyI6WyJEOi93b3Jrc3BhY2VzL25vZGUvdGVzdC9maXh0dXJlcy9zb3VyY2UtbWFwL3RzLW5vZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsU0FBUyxHQUFHLENBQUMsR0FBVztJQUN0QixPQUFPLEdBQUcsQ0FBQztBQUNiLENBQUM7QUFFRCxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUM7QUFFWiw4QkFBOEI7QUFDOUIsRUFBRTtBQUNGLDZFQUE2RTtBQUM3RSw0SEFBNEg7QUFDNUgsMkVBQTJFIiwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gZm9vKHN0cjogc3RyaW5nKSB7XG4gIHJldHVybiBzdHI7XG59XG5cbmZvbygnbm9vcCcpO1xuXG4vLyBUbyByZWNyZWF0ZSAoV2luZG93cyBvbmx5KTpcbi8vXG4vLyBjb25zdCBmaWxlUGF0aCA9IHJlcXVpcmUucmVzb2x2ZSgnLi90ZXN0L2ZpeHR1cmVzL3NvdXJjZS1tYXAvdHMtbm9kZS50cycpO1xuLy8gY29uc3QgY29tcGlsZWQgPSByZXF1aXJlKCd0cy1ub2RlJykuY3JlYXRlKHsgdHJhbnNwaWxlT25seTogdHJ1ZSB9KS5jb21waWxlKGZzLnJlYWRGaWxlU3luYyhmaWxlUGF0aCwgJ3V0ZjgnKSwgZmlsZVBhdGgpO1xuLy8gZnMud3JpdGVGaWxlU3luYygndGVzdC9maXh0dXJlcy9zb3VyY2UtbWFwL3RzLW5vZGUtd2luMzIuanMnLCBjb21waWxlZCk7XG4iXX0= diff --git a/test/fixtures/source-map/ts-node.ts b/test/fixtures/source-map/ts-node.ts new file mode 100644 index 00000000000000..2ff34e0f942f15 --- /dev/null +++ b/test/fixtures/source-map/ts-node.ts @@ -0,0 +1,11 @@ +function foo(str: string) { + return str; +} + +foo('noop'); + +// To recreate (Windows only): +// +// const filePath = require.resolve('./test/fixtures/source-map/ts-node.ts'); +// const compiled = require('ts-node').create({ transpileOnly: true }).compile(fs.readFileSync(filePath, 'utf8'), filePath); +// fs.writeFileSync('test/fixtures/source-map/ts-node-win32.js', compiled); diff --git a/test/parallel/test-source-map-enable.js b/test/parallel/test-source-map-enable.js index 5038aff360e518..46c25d26cfa8e7 100644 --- a/test/parallel/test-source-map-enable.js +++ b/test/parallel/test-source-map-enable.js @@ -289,6 +289,30 @@ function nextdir() { assert.match(output.stderr.toString(), /at functionC.*10:3/); } +// Properly converts Windows absolute paths to absolute URLs. +// Refs: https://github.com/nodejs/node/issues/50523 +// Refs: https://github.com/TypeStrong/ts-node/issues/1769 +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/ts-node-win32.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache( + 'ts-node-win32.js', + coverageDirectory + ); + // base64 JSON should have been decoded, the D: in the sources field should + // have been taken as the drive letter on Windows, the scheme on POSIX. + assert.strictEqual( + sourceMap.data.sources[0], + common.isWindows ? + 'file:///D:/workspaces/node/test/fixtures/source-map/ts-node.ts' : + 'd:/workspaces/node/test/fixtures/source-map/ts-node.ts' + ); +} + // Stores and applies source map associated with file that throws while // being required. { From c3abdc58aff762b8d8088ca9487c55c4ffe2fe50 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 5 Dec 2023 12:26:44 +0100 Subject: [PATCH 20/67] src: implement --trace-promises MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch implements a debugging flag that dumps the current stack trace when a promise is created or resolved. To reduce noise we ignore before and after events (as the execution is less interesting) and use the per-isolate hook to avoid extra JS frames. This flag can assist work in reducing unnecessary promise overhead. PR-URL: https://github.com/nodejs/node/pull/50899 Reviewed-By: Yagiz Nizipli Reviewed-By: Geoffrey Booth Reviewed-By: Vinícius Lourenço Claro Cardoso Reviewed-By: Chengzhong Wu Reviewed-By: Benjamin Gruenbaum --- src/env.cc | 58 +++++++++++++++++++ src/env.h | 4 ++ src/env_properties.h | 1 + src/node.cc | 3 + src/node_errors.cc | 7 +++ src/node_internals.h | 2 + src/node_options.cc | 4 ++ src/node_options.h | 1 + ...rocess-env-allowed-flags-are-documented.js | 2 + 9 files changed, 82 insertions(+) diff --git a/src/env.cc b/src/env.cc index a429d5526d0af6..f921a545f1be3e 100644 --- a/src/env.cc +++ b/src/env.cc @@ -30,6 +30,7 @@ #include #include #include +#include #include namespace node { @@ -55,6 +56,8 @@ using v8::Number; using v8::Object; using v8::ObjectTemplate; using v8::Private; +using v8::Promise; +using v8::PromiseHookType; using v8::Script; using v8::SnapshotCreator; using v8::StackTrace; @@ -62,6 +65,7 @@ using v8::String; using v8::Symbol; using v8::TracingController; using v8::TryCatch; +using v8::Uint32; using v8::Undefined; using v8::Value; using v8::WrapperDescriptor; @@ -1839,6 +1843,60 @@ void Environment::BuildEmbedderGraph(Isolate* isolate, tracker.Track(env); } +std::optional GetPromiseId(Environment* env, Local promise) { + Local id_val; + if (!promise->GetPrivate(env->context(), env->promise_trace_id()) + .ToLocal(&id_val) || + !id_val->IsUint32()) { + return std::nullopt; + } + return id_val.As()->Value(); +} + +void Environment::TracePromises(PromiseHookType type, + Local promise, + Local parent) { + // We don't care about the execution of promises, just the + // creation/resolution. + if (type == PromiseHookType::kBefore || type == PromiseHookType::kAfter) { + return; + } + Isolate* isolate = Isolate::GetCurrent(); + Local context = isolate->GetCurrentContext(); + Environment* env = Environment::GetCurrent(context); + if (env == nullptr) return; + + std::optional parent_id; + if (!parent.IsEmpty() && parent->IsPromise()) { + parent_id = GetPromiseId(env, parent.As()); + } + + uint32_t id = 0; + std::string action; + if (type == PromiseHookType::kInit) { + id = env->trace_promise_id_counter_++; + promise->SetPrivate( + context, env->promise_trace_id(), Uint32::New(isolate, id)); + action = "created"; + } else if (type == PromiseHookType::kResolve) { + auto opt = GetPromiseId(env, promise); + if (!opt.has_value()) return; + id = opt.value(); + action = "resolved"; + } else { + UNREACHABLE(); + } + + FPrintF(stderr, "[--trace-promises] "); + if (parent_id.has_value()) { + FPrintF(stderr, "promise #%d ", parent_id.value()); + } + FPrintF(stderr, "%s promise #%d\n", action, id); + // TODO(joyeecheung): we can dump the native stack trace too if the + // JS stack trace is empty i.e. it may be resolved on the native side. + PrintCurrentStackTrace(isolate); +} + size_t Environment::NearHeapLimitCallback(void* data, size_t current_heap_limit, size_t initial_heap_limit) { diff --git a/src/env.h b/src/env.h index 1047f1d794da2a..244b8828c73a18 100644 --- a/src/env.h +++ b/src/env.h @@ -934,6 +934,9 @@ class Environment : public MemoryRetainer { inline void RemoveCleanupHook(CleanupQueue::Callback cb, void* arg); void RunCleanup(); + static void TracePromises(v8::PromiseHookType type, + v8::Local promise, + v8::Local parent); static size_t NearHeapLimitCallback(void* data, size_t current_heap_limit, size_t initial_heap_limit); @@ -1094,6 +1097,7 @@ class Environment : public MemoryRetainer { uint32_t module_id_counter_ = 0; uint32_t script_id_counter_ = 0; uint32_t function_id_counter_ = 0; + uint32_t trace_promise_id_counter_ = 0; AliasedInt32Array exit_info_; diff --git a/src/env_properties.h b/src/env_properties.h index 7356846d6e7085..916dc4033fa833 100644 --- a/src/env_properties.h +++ b/src/env_properties.h @@ -28,6 +28,7 @@ V(napi_wrapper, "node:napi:wrapper") \ V(untransferable_object_private_symbol, "node:untransferableObject") \ V(exit_info_private_symbol, "node:exit_info_private_symbol") \ + V(promise_trace_id, "node:promise_trace_id") \ V(require_private_symbol, "node:require_private_symbol") // Symbols are per-isolate primitives but Environment proxies them diff --git a/src/node.cc b/src/node.cc index 524f80ee69ee52..0d601ae21b8314 100644 --- a/src/node.cc +++ b/src/node.cc @@ -264,6 +264,9 @@ void Environment::InitializeDiagnostics() { env->isolate()->SetAtomicsWaitCallback(nullptr, nullptr); }, this); } + if (options_->trace_promises) { + isolate_->SetPromiseHook(TracePromises); + } } static diff --git a/src/node_errors.cc b/src/node_errors.cc index 50618e6c716f0b..7ef6ea7f07998f 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -291,6 +291,13 @@ void PrintStackTrace(Isolate* isolate, PrintToStderrAndFlush(FormatStackTrace(isolate, stack, prefix)); } +void PrintCurrentStackTrace(Isolate* isolate, StackTracePrefix prefix) { + Local stack; + if (GetCurrentStackTrace(isolate).ToLocal(&stack)) { + PrintStackTrace(isolate, stack, prefix); + } +} + std::string FormatCaughtException(Isolate* isolate, Local context, Local err, diff --git a/src/node_internals.h b/src/node_internals.h index 9a96e042fc5cda..5604f35aeff6b4 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -87,6 +87,8 @@ enum class StackTracePrefix { kAt, // " at " kNumber }; +void PrintCurrentStackTrace(v8::Isolate* isolate, + StackTracePrefix prefix = StackTracePrefix::kAt); void PrintStackTrace(v8::Isolate* isolate, v8::Local stack, StackTracePrefix prefix = StackTracePrefix::kAt); diff --git a/src/node_options.cc b/src/node_options.cc index 9680ea6ed8312b..ccfca6f4e55523 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -672,6 +672,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { "show stack traces on process warnings", &EnvironmentOptions::trace_warnings, kAllowedInEnvvar); + AddOption("--trace-promises", + "show stack traces on promise initialization and resolution", + &EnvironmentOptions::trace_promises, + kAllowedInEnvvar); AddOption("--experimental-default-type", "set module system to use by default", &EnvironmentOptions::type, diff --git a/src/node_options.h b/src/node_options.h index af19dd612387ae..21b572c265c4c9 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -179,6 +179,7 @@ class EnvironmentOptions : public Options { bool trace_tls = false; bool trace_uncaught = false; bool trace_warnings = false; + bool trace_promises = false; bool extra_info_on_fatal_exception = true; std::string unhandled_rejections; std::vector userland_loaders; diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js index dc4c704b6f0b88..2746fdfc086f99 100644 --- a/test/parallel/test-process-env-allowed-flags-are-documented.js +++ b/test/parallel/test-process-env-allowed-flags-are-documented.js @@ -106,6 +106,8 @@ assert(undocumented.delete('--no-node-snapshot')); assert(undocumented.delete('--loader')); assert(undocumented.delete('--verify-base-objects')); assert(undocumented.delete('--no-verify-base-objects')); +assert(undocumented.delete('--trace-promises')); +assert(undocumented.delete('--no-trace-promises')); // Remove negated versions of the flags. for (const flag of undocumented) { From 7f5291d783b4fea9c01ff8dd13bf6dddeb2749e1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 6 Dec 2023 03:28:17 +0900 Subject: [PATCH 21/67] test: resolve path of embedtest binary correctly PR-URL: https://github.com/nodejs/node/pull/50276 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Yagiz Nizipli --- test/embedding/test-embedding.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/embedding/test-embedding.js b/test/embedding/test-embedding.js index 1fb3bc73f494cb..558ccaee47ff0f 100644 --- a/test/embedding/test-embedding.js +++ b/test/embedding/test-embedding.js @@ -14,12 +14,11 @@ tmpdir.refresh(); common.allowGlobals(global.require); common.allowGlobals(global.embedVars); -function resolveBuiltBinary(bin) { - let binary = `out/${common.buildType}/${bin}`; +function resolveBuiltBinary(binary) { if (common.isWindows) { binary += '.exe'; } - return path.resolve(__dirname, '..', '..', binary); + return path.join(path.dirname(process.execPath), binary); } const binary = resolveBuiltBinary('embedtest'); From 3f7f3ce8c9a148bc3f7be83e0e6ca74a4ea322e6 Mon Sep 17 00:00:00 2001 From: IlyasShabi <33763729+IlyasShabi@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:31:23 +0100 Subject: [PATCH 22/67] fs: improve error performance of readvSync PR-URL: https://github.com/nodejs/node/pull/50100 Refs: https://github.com/nodejs/performance/issues/106 Reviewed-By: Yagiz Nizipli Reviewed-By: Antoine du Hamel --- benchmark/fs/bench-readvSync.js | 58 +++++++++++++++++++++++++++++++++ lib/fs.js | 6 +--- src/node_file.cc | 14 ++++---- 3 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 benchmark/fs/bench-readvSync.js diff --git a/benchmark/fs/bench-readvSync.js b/benchmark/fs/bench-readvSync.js new file mode 100644 index 00000000000000..c163429b5f6212 --- /dev/null +++ b/benchmark/fs/bench-readvSync.js @@ -0,0 +1,58 @@ +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); +const tmpdir = require('../../test/common/tmpdir'); +tmpdir.refresh(); + +const exptectedBuff = Buffer.from('Benchmark Data'); +const expectedLength = exptectedBuff.length; + +const bufferArr = [Buffer.alloc(expectedLength)]; + +const filename = tmpdir.resolve('readv_sync.txt'); +fs.writeFileSync(filename, exptectedBuff); + +const bench = common.createBenchmark(main, { + type: ['valid', 'invalid'], + n: [1e5], +}); + +function main({ n, type }) { + let fd; + let result; + + switch (type) { + case 'valid': + fd = fs.openSync(filename, 'r'); + + bench.start(); + for (let i = 0; i < n; i++) { + result = fs.readvSync(fd, bufferArr, 0); + } + + bench.end(n); + assert.strictEqual(result, expectedLength); + fs.closeSync(fd); + break; + case 'invalid': { + fd = 1 << 30; + let hasError = false; + bench.start(); + for (let i = 0; i < n; i++) { + try { + result = fs.readvSync(fd, bufferArr, 0); + } catch { + hasError = true; + } + } + + bench.end(n); + assert(hasError); + break; + } + default: + throw new Error('Invalid type'); + } +} diff --git a/lib/fs.js b/lib/fs.js index f52f9e8f48d3b9..c26979a65e0664 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -801,14 +801,10 @@ function readvSync(fd, buffers, position) { fd = getValidatedFd(fd); validateBufferArray(buffers); - const ctx = {}; - if (typeof position !== 'number') position = null; - const result = binding.readBuffers(fd, buffers, position, undefined, ctx); - handleErrorFromBinding(ctx); - return result; + return binding.readBuffers(fd, buffers, position); } /** diff --git a/src/node_file.cc b/src/node_file.cc index 0855bda583a62d..e426319daf7856 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -2467,18 +2467,20 @@ static void ReadBuffers(const FunctionCallbackInfo& args) { iovs[i] = uv_buf_init(Buffer::Data(buffer), Buffer::Length(buffer)); } - FSReqBase* req_wrap_async = GetReqWrap(args, 3); - if (req_wrap_async != nullptr) { // readBuffers(fd, buffers, pos, req) + if (argc > 3) { // readBuffers(fd, buffers, pos, req) + FSReqBase* req_wrap_async = GetReqWrap(args, 3); FS_ASYNC_TRACE_BEGIN0(UV_FS_READ, req_wrap_async) AsyncCall(env, req_wrap_async, args, "read", UTF8, AfterInteger, uv_fs_read, fd, *iovs, iovs.length(), pos); } else { // readBuffers(fd, buffers, undefined, ctx) - CHECK_EQ(argc, 5); - FSReqWrapSync req_wrap_sync; + FSReqWrapSync req_wrap_sync("read"); FS_SYNC_TRACE_BEGIN(read); - int bytesRead = SyncCall(env, /* ctx */ args[4], &req_wrap_sync, "read", - uv_fs_read, fd, *iovs, iovs.length(), pos); + int bytesRead = SyncCallAndThrowOnError( + env, &req_wrap_sync, uv_fs_read, fd, *iovs, iovs.length(), pos); FS_SYNC_TRACE_END(read, "bytesRead", bytesRead); + if (is_uv_error(bytesRead)) { + return; + } args.GetReturnValue().Set(bytesRead); } } From 99501032532d319b8d2f097149e522717ab66c2e Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Tue, 5 Dec 2023 20:42:43 +0200 Subject: [PATCH 23/67] deps: update zlib to 1.3-22124f5 PR-URL: https://github.com/nodejs/node/pull/50910 Reviewed-By: Luigi Pinca Reviewed-By: Michael Dawson --- deps/zlib/CMakeLists.txt | 4 ++-- deps/zlib/deflate.c | 4 ++-- deps/zlib/inftrees.c | 6 +++--- deps/zlib/zlib.h | 18 +++++++++--------- .../maintaining/maintaining-dependencies.md | 6 +++--- src/zlib_version.h | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/deps/zlib/CMakeLists.txt b/deps/zlib/CMakeLists.txt index 234eab8db41def..a9cf9c5f945378 100644 --- a/deps/zlib/CMakeLists.txt +++ b/deps/zlib/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 2.4.4...3.15.0) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) -set(VERSION "1.2.13.1") +set(VERSION "1.3") set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") diff --git a/deps/zlib/deflate.c b/deps/zlib/deflate.c index d1611cce058931..779bd294b0c8af 100644 --- a/deps/zlib/deflate.c +++ b/deps/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -65,7 +65,7 @@ #endif const char deflate_copyright[] = - " deflate 1.2.13.1 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; + " deflate 1.3 Copyright 1995-2023 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot diff --git a/deps/zlib/inftrees.c b/deps/zlib/inftrees.c index afc4c4212d8022..8a208c2daa8cee 100644 --- a/deps/zlib/inftrees.c +++ b/deps/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2022 Mark Adler + * Copyright (C) 1995-2023 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.13.1 Copyright 1995-2022 Mark Adler "; + " inflate 1.3 Copyright 1995-2023 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 76}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/deps/zlib/zlib.h b/deps/zlib/zlib.h index cd7b165cc863e9..8f296ec481f73c 100644 --- a/deps/zlib/zlib.h +++ b/deps/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.13.1, October xxth, 2022 + version 1.3, August 18th, 2023 - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,12 +37,12 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.13.1-motley" -#define ZLIB_VERNUM 0x12d1 +#define ZLIB_VERSION "1.3" +#define ZLIB_VERNUM 0x1300 #define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 13 -#define ZLIB_VER_SUBREVISION 1 +#define ZLIB_VER_MINOR 3 +#define ZLIB_VER_REVISION 0 +#define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and @@ -320,8 +320,8 @@ ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush); with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. + avail_out is greater than six when the flush marker begins, in order to avoid + repeated flush markers upon calling deflate() again when avail_out == 0. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index ce440fbf41861e..e4b5370fdaf6e7 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -32,7 +32,7 @@ This a list of all the dependencies: * [undici 5.28.2][] * [uvwasi 0.0.19][] * [V8 11.8.172.12][] -* [zlib 1.2.13.1-motley-5daffc7][] +* [zlib 1.3-22124f5][] Any code which meets one or more of these conditions should be managed as a dependency: @@ -317,7 +317,7 @@ See [maintaining-web-assembly][] for more informations. high-performance JavaScript and WebAssembly engine, written in C++. See [maintaining-V8][] for more informations. -### zlib 1.2.13.1-motley-5daffc7 +### zlib 1.3-22124f5 The [zlib](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/zlib) dependency lossless data-compression library, @@ -356,4 +356,4 @@ performance improvements not currently available in standard zlib. [update-openssl-action]: ../../../.github/workflows/update-openssl.yml [uvwasi 0.0.19]: #uvwasi-0019 [v8 11.8.172.12]: #v8-11817212 -[zlib 1.2.13.1-motley-5daffc7]: #zlib-12131-motley-5daffc7 +[zlib 1.3-22124f5]: #zlib-13-22124f5 diff --git a/src/zlib_version.h b/src/zlib_version.h index cb48f4e9a02ad4..62d4f1536e783e 100644 --- a/src/zlib_version.h +++ b/src/zlib_version.h @@ -2,5 +2,5 @@ // Refer to tools/dep_updaters/update-zlib.sh #ifndef SRC_ZLIB_VERSION_H_ #define SRC_ZLIB_VERSION_H_ -#define ZLIB_VERSION "1.2.13.1-motley-5daffc7" +#define ZLIB_VERSION "1.3-22124f5" #endif // SRC_ZLIB_VERSION_H_ From c2b6edf9ab81794ef7523f4469ac0ec3231aef44 Mon Sep 17 00:00:00 2001 From: Bruce MacNaughton Date: Tue, 5 Dec 2023 10:54:01 -0800 Subject: [PATCH 24/67] esm: fix hook name in error message PR-URL: https://github.com/nodejs/node/pull/50466 Reviewed-By: Geoffrey Booth Reviewed-By: Jacob Smith Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel --- lib/internal/errors.js | 4 ++-- lib/internal/modules/esm/translators.js | 2 +- test/es-module/test-esm-loader.mjs | 5 +++++ test/fixtures/es-module-loaders/hooks-custom.mjs | 8 ++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 39e512762a470c..ad151cc2bdd227 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -1475,11 +1475,11 @@ E('ERR_INVALID_REPL_EVAL_CONFIG', E('ERR_INVALID_REPL_INPUT', '%s', TypeError); E('ERR_INVALID_RETURN_PROPERTY', (input, name, prop, value) => { return `Expected a valid ${input} to be returned for the "${prop}" from the` + - ` "${name}" function but got ${determineSpecificType(value)}.`; + ` "${name}" hook but got ${determineSpecificType(value)}.`; }, TypeError); E('ERR_INVALID_RETURN_PROPERTY_VALUE', (input, name, prop, value) => { return `Expected ${input} to be returned for the "${prop}" from the` + - ` "${name}" function but got ${determineSpecificType(value)}.`; + ` "${name}" hook but got ${determineSpecificType(value)}.`; }, TypeError); E('ERR_INVALID_RETURN_VALUE', (input, name, value) => { const type = determineSpecificType(value); diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 9976b819f266c6..949dbab7f6ad6b 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -128,7 +128,7 @@ function assertBufferSource(body, allowString, hookName) { */ function stringify(body) { if (typeof body === 'string') { return body; } - assertBufferSource(body, false, 'transformSource'); + assertBufferSource(body, false, 'load'); const { TextDecoder } = require('internal/encoding'); DECODER = DECODER === null ? new TextDecoder() : DECODER; return DECODER.decode(body); diff --git a/test/es-module/test-esm-loader.mjs b/test/es-module/test-esm-loader.mjs index e19a38cc4231b0..de34814324818c 100644 --- a/test/es-module/test-esm-loader.mjs +++ b/test/es-module/test-esm-loader.mjs @@ -43,6 +43,11 @@ await assert.rejects( { code: 'ERR_INVALID_RETURN_PROPERTY_VALUE' }, ); +await assert.rejects(import('esmHook/commonJsNullSource.mjs'), { + code: 'ERR_INVALID_RETURN_PROPERTY_VALUE', + message: /"source".*'load'.*got type bigint/, +}); + await import('../fixtures/es-module-loaders/js-as-esm.js') .then((parsedModule) => { assert.strictEqual(typeof parsedModule, 'object'); diff --git a/test/fixtures/es-module-loaders/hooks-custom.mjs b/test/fixtures/es-module-loaders/hooks-custom.mjs index 5656f95232b856..3c38649a88794f 100644 --- a/test/fixtures/es-module-loaders/hooks-custom.mjs +++ b/test/fixtures/es-module-loaders/hooks-custom.mjs @@ -97,5 +97,13 @@ export function load(url, context, next) { }; } + if (url.endsWith('esmHook/commonJsNullSource.mjs')) { + return { + format: 'commonjs', + shortCircuit: true, + source: 1n, + }; + } + return next(url); } From c45a9a31872df00cc0ce8a86d5e2fbdb38ce42b1 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 5 Dec 2023 22:15:23 +0100 Subject: [PATCH 25/67] doc: add deprecation notice to `dirent.path` Refs: https://github.com/nodejs/node/pull/51020 PR-URL: https://github.com/nodejs/node/pull/51059 Reviewed-By: Debadree Chatterjee Reviewed-By: Luigi Pinca Reviewed-By: Moshe Atlow --- doc/api/fs.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 43177269e60e8b..99070d37a59e45 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -6633,8 +6633,11 @@ The path to the parent directory of the file this {fs.Dirent} object refers to. added: - v20.1.0 - v18.17.0 +deprecated: REPLACEME --> +> Stability: 0 - Deprecated: Use [`dirent.parentPath`][] instead. + * {string} Alias for `dirent.parentPath`. @@ -8190,6 +8193,7 @@ the file contents. [`Number.MAX_SAFE_INTEGER`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER [`ReadDirectoryChangesW`]: https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-readdirectorychangesw [`UV_THREADPOOL_SIZE`]: cli.md#uv_threadpool_sizesize +[`dirent.parentPath`]: #direntparentpath [`event ports`]: https://illumos.org/man/port_create [`filehandle.createReadStream()`]: #filehandlecreatereadstreamoptions [`filehandle.createWriteStream()`]: #filehandlecreatewritestreamoptions From b148c43244b37ea22c25948bd424b275a0b5f550 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 5 Dec 2023 23:59:31 +0100 Subject: [PATCH 26/67] benchmark: add create-hash benchmark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51026 Refs: https://github.com/nodejs/performance/issues/136 Reviewed-By: Matteo Collina Reviewed-By: Michaël Zasso Reviewed-By: Vinícius Lourenço Claro Cardoso Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca --- benchmark/crypto/create-hash.js | 22 ++++++++++++++++++++++ lib/internal/crypto/hash.js | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 benchmark/crypto/create-hash.js diff --git a/benchmark/crypto/create-hash.js b/benchmark/crypto/create-hash.js new file mode 100644 index 00000000000000..119534d5c24f83 --- /dev/null +++ b/benchmark/crypto/create-hash.js @@ -0,0 +1,22 @@ +'use strict'; + +const common = require('../common.js'); +const { createHash } = require('crypto'); +const assert = require('assert'); + +const bench = common.createBenchmark(main, { + n: [1e5], +}); + +function main({ n }) { + const array = []; + for (let i = 0; i < n; ++i) { + array.push(null); + } + bench.start(); + for (let i = 0; i < n; ++i) { + array[i] = createHash('sha1'); + } + bench.end(n); + assert.strictEqual(typeof array[n - 1], 'object'); +} diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 57fcb63518d52d..4ed97034f612fb 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -57,7 +57,7 @@ const kState = Symbol('kState'); const kFinalized = Symbol('kFinalized'); function Hash(algorithm, options) { - if (!(this instanceof Hash)) + if (!new.target) return new Hash(algorithm, options); if (!(algorithm instanceof _Hash)) validateString(algorithm, 'algorithm'); From 4705023343ee5cffe5c0d8248eaeced6e9115915 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 30 Nov 2023 19:26:14 -0500 Subject: [PATCH 27/67] tools: fix simdjson updater PR-URL: https://github.com/nodejs/node/pull/50986 Reviewed-By: Geoffrey Booth Reviewed-By: Marco Ippolito --- tools/dep_updaters/update-simdjson.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/dep_updaters/update-simdjson.sh b/tools/dep_updaters/update-simdjson.sh index 48a0bd0f64c743..3aa0e06eff0fcf 100755 --- a/tools/dep_updaters/update-simdjson.sh +++ b/tools/dep_updaters/update-simdjson.sh @@ -7,6 +7,9 @@ DEPS_DIR="$BASE_DIR/deps" [ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node" [ -x "$NODE" ] || NODE=$(command -v node) +# shellcheck disable=SC1091 +. "$BASE_DIR/tools/dep_updaters/utils.sh" + NEW_VERSION="$("$NODE" --input-type=module <<'EOF' const res = await fetch('https://api.github.com/repos/simdjson/simdjson/releases/latest'); if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); From 429fbb37c173c3c0cf43bfaad379ba222018c3f3 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 30 Nov 2023 19:26:33 -0500 Subject: [PATCH 28/67] deps: update simdjson to v3.6.2 PR-URL: https://github.com/nodejs/node/pull/50986 Reviewed-By: Geoffrey Booth Reviewed-By: Marco Ippolito --- deps/simdjson/simdjson.cpp | 325 +++++------- deps/simdjson/simdjson.h | 479 ++++++++++-------- .../maintaining/maintaining-dependencies.md | 6 +- 3 files changed, 393 insertions(+), 417 deletions(-) diff --git a/deps/simdjson/simdjson.cpp b/deps/simdjson/simdjson.cpp index 11742711a0e712..6de55c7222448d 100644 --- a/deps/simdjson/simdjson.cpp +++ b/deps/simdjson/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2023-10-30 12:51:02 -0400. Do not edit! */ +/* auto-generated on 2023-12-01 13:55:28 -0500. Do not edit! */ /* including simdjson.cpp: */ /* begin file simdjson.cpp */ #define SIMDJSON_SRC_SIMDJSON_CPP @@ -109,6 +109,8 @@ #define SIMDJSON_IS_X86_64 1 #elif defined(__aarch64__) || defined(_M_ARM64) #define SIMDJSON_IS_ARM64 1 +#elif defined(__riscv) && __riscv_xlen == 64 +#define SIMDJSON_IS_RISCV64 1 #elif defined(__PPC64__) || defined(_M_PPC64) #if defined(__ALTIVEC__) #define SIMDJSON_IS_PPC64_VMX 1 @@ -2335,7 +2337,7 @@ enum error_code { INVALID_URI_FRAGMENT, ///< Invalid URI fragment UNEXPECTED_ERROR, ///< indicative of a bug in simdjson PARSER_IN_USE, ///< parser is already in use. - OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order + OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order (checked when SIMDJSON_DEVELOPMENT_CHECKS=1) INSUFFICIENT_PADDING, ///< The JSON doesn't have enough padding for simdjson to safely parse it. INCOMPLETE_ARRAY_OR_OBJECT, ///< The document ends early. SCALAR_DOCUMENT_AS_VALUE, ///< A scalar document is treated as a value. @@ -2344,6 +2346,13 @@ enum error_code { NUM_ERROR_CODES }; +/** + * It is the convention throughout the code that the macro SIMDJSON_DEVELOPMENT_CHECKS determines whether + * we check for OUT_OF_ORDER_ITERATION. The logic behind it is that these errors only occurs when the code + * that was written while breaking some simdjson::ondemand requirement. They should not occur in released + * code after these issues were fixed. + */ + /** * Get the error message for the given error code. * @@ -2503,11 +2512,11 @@ struct simdjson_result : public internal::simdjson_result_base { */ simdjson_inline simdjson_result() noexcept; /** - * @private Create a new error result. + * @private Create a new successful result. */ simdjson_inline simdjson_result(T &&value) noexcept; /** - * @private Create a new successful result. + * @private Create a new error result. */ simdjson_inline simdjson_result(error_code error_code) noexcept; /** @@ -7557,89 +7566,53 @@ namespace { // Start of private section with Visual Studio workaround -/** - * make_uint8x16_t initializes a SIMD register (uint8x16_t). - * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} - * is not recognized under Visual Studio! This is a workaround. - * Using a std::initializer_list as a parameter resulted in - * inefficient code. With the current approach, if the parameters are - * compile-time constants, - * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. - * You should not use this function except for compile-time constants: - * it is not efficient. - */ -simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, - uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, - uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { - // Doing a load like so end ups generating worse code. - // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_u8(array); - uint8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_u8(x1, x, 0); - x = vsetq_lane_u8(x2, x, 1); - x = vsetq_lane_u8(x3, x, 2); - x = vsetq_lane_u8(x4, x, 3); - x = vsetq_lane_u8(x5, x, 4); - x = vsetq_lane_u8(x6, x, 5); - x = vsetq_lane_u8(x7, x, 6); - x = vsetq_lane_u8(x8, x, 7); - x = vsetq_lane_u8(x9, x, 8); - x = vsetq_lane_u8(x10, x, 9); - x = vsetq_lane_u8(x11, x, 10); - x = vsetq_lane_u8(x12, x, 11); - x = vsetq_lane_u8(x13, x, 12); - x = vsetq_lane_u8(x14, x, 13); - x = vsetq_lane_u8(x15, x, 14); - x = vsetq_lane_u8(x16, x, 15); - return x; -} - -simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { - uint8x8_t x{}; - x = vset_lane_u8(x1, x, 0); - x = vset_lane_u8(x2, x, 1); - x = vset_lane_u8(x3, x, 2); - x = vset_lane_u8(x4, x, 3); - x = vset_lane_u8(x5, x, 4); - x = vset_lane_u8(x6, x, 5); - x = vset_lane_u8(x7, x, 6); - x = vset_lane_u8(x8, x, 7); - return x; -} - -// We have to do the same work for make_int8x16_t -simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, - int8_t x5, int8_t x6, int8_t x7, int8_t x8, - int8_t x9, int8_t x10, int8_t x11, int8_t x12, - int8_t x13, int8_t x14, int8_t x15, int8_t x16) { - // Doing a load like so end ups generating worse code. - // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_s8(array); - int8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_s8(x1, x, 0); - x = vsetq_lane_s8(x2, x, 1); - x = vsetq_lane_s8(x3, x, 2); - x = vsetq_lane_s8(x4, x, 3); - x = vsetq_lane_s8(x5, x, 4); - x = vsetq_lane_s8(x6, x, 5); - x = vsetq_lane_s8(x7, x, 6); - x = vsetq_lane_s8(x8, x, 7); - x = vsetq_lane_s8(x9, x, 8); - x = vsetq_lane_s8(x10, x, 9); - x = vsetq_lane_s8(x11, x, 10); - x = vsetq_lane_s8(x12, x, 11); - x = vsetq_lane_s8(x13, x, 12); - x = vsetq_lane_s8(x14, x, 13); - x = vsetq_lane_s8(x15, x, 14); - x = vsetq_lane_s8(x16, x, 15); - return x; -} +#ifndef simdjson_make_uint8x16_t +#define simdjson_make_uint8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x16_t +#define simdjson_make_int8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_s8(array); \ + }()) +#endif + +#ifndef simdjson_make_uint8x8_t +#define simdjson_make_uint8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x8_t +#define simdjson_make_int8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_s8(array); \ + }()) +#endif +#ifndef simdjson_make_uint16x8_t +#define simdjson_make_uint16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_u16(array); \ + }()) +#endif +#ifndef simdjson_make_int16x8_t +#define simdjson_make_int16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_s16(array); \ + }()) +#endif // End of private section with Visual Studio workaround } // namespace @@ -7698,7 +7671,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int // purposes (cutting it down to uint16_t costs performance in some compilers). simdjson_inline uint32_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + const uint8x16_t bit_mask = simdjson_make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); #else const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, @@ -7732,7 +7705,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 - ) : simd8(make_uint8x16_t( + ) : simd8(simdjson_make_uint8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -7823,7 +7796,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x16_t inc = simdjson_make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -7853,7 +7826,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x8_t inc = simdjson_make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -7908,7 +7881,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 - ) : simd8(make_int8x16_t( + ) : simd8(simdjson_make_int8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -8026,7 +7999,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline uint64_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t( + const uint8x16_t bit_mask = simdjson_make_uint8x16_t( 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 ); @@ -10298,89 +10271,53 @@ namespace { // Start of private section with Visual Studio workaround -/** - * make_uint8x16_t initializes a SIMD register (uint8x16_t). - * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} - * is not recognized under Visual Studio! This is a workaround. - * Using a std::initializer_list as a parameter resulted in - * inefficient code. With the current approach, if the parameters are - * compile-time constants, - * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. - * You should not use this function except for compile-time constants: - * it is not efficient. - */ -simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, - uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, - uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { - // Doing a load like so end ups generating worse code. - // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_u8(array); - uint8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_u8(x1, x, 0); - x = vsetq_lane_u8(x2, x, 1); - x = vsetq_lane_u8(x3, x, 2); - x = vsetq_lane_u8(x4, x, 3); - x = vsetq_lane_u8(x5, x, 4); - x = vsetq_lane_u8(x6, x, 5); - x = vsetq_lane_u8(x7, x, 6); - x = vsetq_lane_u8(x8, x, 7); - x = vsetq_lane_u8(x9, x, 8); - x = vsetq_lane_u8(x10, x, 9); - x = vsetq_lane_u8(x11, x, 10); - x = vsetq_lane_u8(x12, x, 11); - x = vsetq_lane_u8(x13, x, 12); - x = vsetq_lane_u8(x14, x, 13); - x = vsetq_lane_u8(x15, x, 14); - x = vsetq_lane_u8(x16, x, 15); - return x; -} - -simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { - uint8x8_t x{}; - x = vset_lane_u8(x1, x, 0); - x = vset_lane_u8(x2, x, 1); - x = vset_lane_u8(x3, x, 2); - x = vset_lane_u8(x4, x, 3); - x = vset_lane_u8(x5, x, 4); - x = vset_lane_u8(x6, x, 5); - x = vset_lane_u8(x7, x, 6); - x = vset_lane_u8(x8, x, 7); - return x; -} - -// We have to do the same work for make_int8x16_t -simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, - int8_t x5, int8_t x6, int8_t x7, int8_t x8, - int8_t x9, int8_t x10, int8_t x11, int8_t x12, - int8_t x13, int8_t x14, int8_t x15, int8_t x16) { - // Doing a load like so end ups generating worse code. - // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_s8(array); - int8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_s8(x1, x, 0); - x = vsetq_lane_s8(x2, x, 1); - x = vsetq_lane_s8(x3, x, 2); - x = vsetq_lane_s8(x4, x, 3); - x = vsetq_lane_s8(x5, x, 4); - x = vsetq_lane_s8(x6, x, 5); - x = vsetq_lane_s8(x7, x, 6); - x = vsetq_lane_s8(x8, x, 7); - x = vsetq_lane_s8(x9, x, 8); - x = vsetq_lane_s8(x10, x, 9); - x = vsetq_lane_s8(x11, x, 10); - x = vsetq_lane_s8(x12, x, 11); - x = vsetq_lane_s8(x13, x, 12); - x = vsetq_lane_s8(x14, x, 13); - x = vsetq_lane_s8(x15, x, 14); - x = vsetq_lane_s8(x16, x, 15); - return x; -} +#ifndef simdjson_make_uint8x16_t +#define simdjson_make_uint8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x16_t +#define simdjson_make_int8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_s8(array); \ + }()) +#endif + +#ifndef simdjson_make_uint8x8_t +#define simdjson_make_uint8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x8_t +#define simdjson_make_int8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_s8(array); \ + }()) +#endif +#ifndef simdjson_make_uint16x8_t +#define simdjson_make_uint16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_u16(array); \ + }()) +#endif +#ifndef simdjson_make_int16x8_t +#define simdjson_make_int16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_s16(array); \ + }()) +#endif // End of private section with Visual Studio workaround } // namespace @@ -10439,7 +10376,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int // purposes (cutting it down to uint16_t costs performance in some compilers). simdjson_inline uint32_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + const uint8x16_t bit_mask = simdjson_make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); #else const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, @@ -10473,7 +10410,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 - ) : simd8(make_uint8x16_t( + ) : simd8(simdjson_make_uint8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -10564,7 +10501,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x16_t inc = simdjson_make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -10594,7 +10531,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x8_t inc = simdjson_make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -10649,7 +10586,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 - ) : simd8(make_int8x16_t( + ) : simd8(simdjson_make_int8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -10767,7 +10704,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline uint64_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t( + const uint8x16_t bit_mask = simdjson_make_uint8x16_t( 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 ); @@ -13159,8 +13096,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, u dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { @@ -13206,8 +13141,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } } // namespace stringparsing @@ -16353,8 +16286,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, u dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { @@ -16400,8 +16331,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } } // namespace stringparsing @@ -23245,8 +23174,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, u dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { @@ -23292,8 +23219,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } } // namespace stringparsing @@ -29411,8 +29336,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, u dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { @@ -29458,8 +29381,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } } // namespace stringparsing @@ -35848,8 +35769,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, u dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { @@ -35895,8 +35814,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } } // namespace stringparsing @@ -42859,8 +42776,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, u dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t *src, uint8_t *dst) { @@ -42906,8 +42821,6 @@ simdjson_warn_unused simdjson_inline uint8_t *parse_wobbly_string(const uint8_t dst += backslash_and_quote::BYTES_PROCESSED; } } - /* can't be reached */ - return nullptr; } } // namespace stringparsing diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h index 25e255066b0a54..6cb19b06943fa0 100644 --- a/deps/simdjson/simdjson.h +++ b/deps/simdjson/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on 2023-10-30 12:51:02 -0400. Do not edit! */ +/* auto-generated on 2023-12-01 13:55:28 -0500. Do not edit! */ /* including simdjson.h: */ /* begin file simdjson.h */ #ifndef SIMDJSON_H @@ -129,6 +129,8 @@ #define SIMDJSON_IS_X86_64 1 #elif defined(__aarch64__) || defined(_M_ARM64) #define SIMDJSON_IS_ARM64 1 +#elif defined(__riscv) && __riscv_xlen == 64 +#define SIMDJSON_IS_RISCV64 1 #elif defined(__PPC64__) || defined(_M_PPC64) #if defined(__ALTIVEC__) #define SIMDJSON_IS_PPC64_VMX 1 @@ -2319,7 +2321,7 @@ namespace std { #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION "3.6.0" +#define SIMDJSON_VERSION "3.6.2" namespace simdjson { enum { @@ -2334,7 +2336,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 0 + SIMDJSON_VERSION_REVISION = 2 }; } // namespace simdjson @@ -2398,7 +2400,7 @@ enum error_code { INVALID_URI_FRAGMENT, ///< Invalid URI fragment UNEXPECTED_ERROR, ///< indicative of a bug in simdjson PARSER_IN_USE, ///< parser is already in use. - OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order + OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order (checked when SIMDJSON_DEVELOPMENT_CHECKS=1) INSUFFICIENT_PADDING, ///< The JSON doesn't have enough padding for simdjson to safely parse it. INCOMPLETE_ARRAY_OR_OBJECT, ///< The document ends early. SCALAR_DOCUMENT_AS_VALUE, ///< A scalar document is treated as a value. @@ -2407,6 +2409,13 @@ enum error_code { NUM_ERROR_CODES }; +/** + * It is the convention throughout the code that the macro SIMDJSON_DEVELOPMENT_CHECKS determines whether + * we check for OUT_OF_ORDER_ITERATION. The logic behind it is that these errors only occurs when the code + * that was written while breaking some simdjson::ondemand requirement. They should not occur in released + * code after these issues were fixed. + */ + /** * Get the error message for the given error code. * @@ -2566,11 +2575,11 @@ struct simdjson_result : public internal::simdjson_result_base { */ simdjson_inline simdjson_result() noexcept; /** - * @private Create a new error result. + * @private Create a new successful result. */ simdjson_inline simdjson_result(T &&value) noexcept; /** - * @private Create a new successful result. + * @private Create a new error result. */ simdjson_inline simdjson_result(error_code error_code) noexcept; /** @@ -10641,89 +10650,53 @@ namespace { // Start of private section with Visual Studio workaround -/** - * make_uint8x16_t initializes a SIMD register (uint8x16_t). - * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} - * is not recognized under Visual Studio! This is a workaround. - * Using a std::initializer_list as a parameter resulted in - * inefficient code. With the current approach, if the parameters are - * compile-time constants, - * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. - * You should not use this function except for compile-time constants: - * it is not efficient. - */ -simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, - uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, - uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { - // Doing a load like so end ups generating worse code. - // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_u8(array); - uint8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_u8(x1, x, 0); - x = vsetq_lane_u8(x2, x, 1); - x = vsetq_lane_u8(x3, x, 2); - x = vsetq_lane_u8(x4, x, 3); - x = vsetq_lane_u8(x5, x, 4); - x = vsetq_lane_u8(x6, x, 5); - x = vsetq_lane_u8(x7, x, 6); - x = vsetq_lane_u8(x8, x, 7); - x = vsetq_lane_u8(x9, x, 8); - x = vsetq_lane_u8(x10, x, 9); - x = vsetq_lane_u8(x11, x, 10); - x = vsetq_lane_u8(x12, x, 11); - x = vsetq_lane_u8(x13, x, 12); - x = vsetq_lane_u8(x14, x, 13); - x = vsetq_lane_u8(x15, x, 14); - x = vsetq_lane_u8(x16, x, 15); - return x; -} - -simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { - uint8x8_t x{}; - x = vset_lane_u8(x1, x, 0); - x = vset_lane_u8(x2, x, 1); - x = vset_lane_u8(x3, x, 2); - x = vset_lane_u8(x4, x, 3); - x = vset_lane_u8(x5, x, 4); - x = vset_lane_u8(x6, x, 5); - x = vset_lane_u8(x7, x, 6); - x = vset_lane_u8(x8, x, 7); - return x; -} - -// We have to do the same work for make_int8x16_t -simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, - int8_t x5, int8_t x6, int8_t x7, int8_t x8, - int8_t x9, int8_t x10, int8_t x11, int8_t x12, - int8_t x13, int8_t x14, int8_t x15, int8_t x16) { - // Doing a load like so end ups generating worse code. - // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_s8(array); - int8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_s8(x1, x, 0); - x = vsetq_lane_s8(x2, x, 1); - x = vsetq_lane_s8(x3, x, 2); - x = vsetq_lane_s8(x4, x, 3); - x = vsetq_lane_s8(x5, x, 4); - x = vsetq_lane_s8(x6, x, 5); - x = vsetq_lane_s8(x7, x, 6); - x = vsetq_lane_s8(x8, x, 7); - x = vsetq_lane_s8(x9, x, 8); - x = vsetq_lane_s8(x10, x, 9); - x = vsetq_lane_s8(x11, x, 10); - x = vsetq_lane_s8(x12, x, 11); - x = vsetq_lane_s8(x13, x, 12); - x = vsetq_lane_s8(x14, x, 13); - x = vsetq_lane_s8(x15, x, 14); - x = vsetq_lane_s8(x16, x, 15); - return x; -} +#ifndef simdjson_make_uint8x16_t +#define simdjson_make_uint8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x16_t +#define simdjson_make_int8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_s8(array); \ + }()) +#endif + +#ifndef simdjson_make_uint8x8_t +#define simdjson_make_uint8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x8_t +#define simdjson_make_int8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_s8(array); \ + }()) +#endif +#ifndef simdjson_make_uint16x8_t +#define simdjson_make_uint16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_u16(array); \ + }()) +#endif +#ifndef simdjson_make_int16x8_t +#define simdjson_make_int16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_s16(array); \ + }()) +#endif // End of private section with Visual Studio workaround } // namespace @@ -10782,7 +10755,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int // purposes (cutting it down to uint16_t costs performance in some compilers). simdjson_inline uint32_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + const uint8x16_t bit_mask = simdjson_make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); #else const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, @@ -10816,7 +10789,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 - ) : simd8(make_uint8x16_t( + ) : simd8(simdjson_make_uint8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -10907,7 +10880,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x16_t inc = simdjson_make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -10937,7 +10910,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x8_t inc = simdjson_make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -10992,7 +10965,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 - ) : simd8(make_int8x16_t( + ) : simd8(simdjson_make_int8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -11110,7 +11083,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline uint64_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t( + const uint8x16_t bit_mask = simdjson_make_uint8x16_t( 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 ); @@ -26169,89 +26142,53 @@ namespace { // Start of private section with Visual Studio workaround -/** - * make_uint8x16_t initializes a SIMD register (uint8x16_t). - * This is needed because, incredibly, the syntax uint8x16_t x = {1,2,3...} - * is not recognized under Visual Studio! This is a workaround. - * Using a std::initializer_list as a parameter resulted in - * inefficient code. With the current approach, if the parameters are - * compile-time constants, - * GNU GCC compiles it to ldr, the same as uint8x16_t x = {1,2,3...}. - * You should not use this function except for compile-time constants: - * it is not efficient. - */ -simdjson_inline uint8x16_t make_uint8x16_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8, - uint8_t x9, uint8_t x10, uint8_t x11, uint8_t x12, - uint8_t x13, uint8_t x14, uint8_t x15, uint8_t x16) { - // Doing a load like so end ups generating worse code. - // uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_u8(array); - uint8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_u8(x1, x, 0); - x = vsetq_lane_u8(x2, x, 1); - x = vsetq_lane_u8(x3, x, 2); - x = vsetq_lane_u8(x4, x, 3); - x = vsetq_lane_u8(x5, x, 4); - x = vsetq_lane_u8(x6, x, 5); - x = vsetq_lane_u8(x7, x, 6); - x = vsetq_lane_u8(x8, x, 7); - x = vsetq_lane_u8(x9, x, 8); - x = vsetq_lane_u8(x10, x, 9); - x = vsetq_lane_u8(x11, x, 10); - x = vsetq_lane_u8(x12, x, 11); - x = vsetq_lane_u8(x13, x, 12); - x = vsetq_lane_u8(x14, x, 13); - x = vsetq_lane_u8(x15, x, 14); - x = vsetq_lane_u8(x16, x, 15); - return x; -} - -simdjson_inline uint8x8_t make_uint8x8_t(uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, - uint8_t x5, uint8_t x6, uint8_t x7, uint8_t x8) { - uint8x8_t x{}; - x = vset_lane_u8(x1, x, 0); - x = vset_lane_u8(x2, x, 1); - x = vset_lane_u8(x3, x, 2); - x = vset_lane_u8(x4, x, 3); - x = vset_lane_u8(x5, x, 4); - x = vset_lane_u8(x6, x, 5); - x = vset_lane_u8(x7, x, 6); - x = vset_lane_u8(x8, x, 7); - return x; -} - -// We have to do the same work for make_int8x16_t -simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int8_t x4, - int8_t x5, int8_t x6, int8_t x7, int8_t x8, - int8_t x9, int8_t x10, int8_t x11, int8_t x12, - int8_t x13, int8_t x14, int8_t x15, int8_t x16) { - // Doing a load like so end ups generating worse code. - // int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, - // x9, x10,x11,x12,x13,x14,x15,x16}; - // return vld1q_s8(array); - int8x16_t x{}; - // incredibly, Visual Studio does not allow x[0] = x1 - x = vsetq_lane_s8(x1, x, 0); - x = vsetq_lane_s8(x2, x, 1); - x = vsetq_lane_s8(x3, x, 2); - x = vsetq_lane_s8(x4, x, 3); - x = vsetq_lane_s8(x5, x, 4); - x = vsetq_lane_s8(x6, x, 5); - x = vsetq_lane_s8(x7, x, 6); - x = vsetq_lane_s8(x8, x, 7); - x = vsetq_lane_s8(x9, x, 8); - x = vsetq_lane_s8(x10, x, 9); - x = vsetq_lane_s8(x11, x, 10); - x = vsetq_lane_s8(x12, x, 11); - x = vsetq_lane_s8(x13, x, 12); - x = vsetq_lane_s8(x14, x, 13); - x = vsetq_lane_s8(x15, x, 14); - x = vsetq_lane_s8(x16, x, 15); - return x; -} +#ifndef simdjson_make_uint8x16_t +#define simdjson_make_uint8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + uint8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x16_t +#define simdjson_make_int8x16_t(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, \ + x13, x14, x15, x16) \ + ([=]() { \ + int8_t array[16] = {x1, x2, x3, x4, x5, x6, x7, x8, \ + x9, x10, x11, x12, x13, x14, x15, x16}; \ + return vld1q_s8(array); \ + }()) +#endif + +#ifndef simdjson_make_uint8x8_t +#define simdjson_make_uint8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_u8(array); \ + }()) +#endif +#ifndef simdjson_make_int8x8_t +#define simdjson_make_int8x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int8_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1_s8(array); \ + }()) +#endif +#ifndef simdjson_make_uint16x8_t +#define simdjson_make_uint16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + uint16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_u16(array); \ + }()) +#endif +#ifndef simdjson_make_int16x8_t +#define simdjson_make_int16x8_t(x1, x2, x3, x4, x5, x6, x7, x8) \ + ([=]() { \ + int16_t array[8] = {x1, x2, x3, x4, x5, x6, x7, x8}; \ + return vld1q_s16(array); \ + }()) +#endif // End of private section with Visual Studio workaround } // namespace @@ -26310,7 +26247,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int // purposes (cutting it down to uint16_t costs performance in some compilers). simdjson_inline uint32_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, + const uint8x16_t bit_mask = simdjson_make_uint8x16_t(0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80); #else const uint8x16_t bit_mask = {0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, @@ -26344,7 +26281,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11, uint8_t v12, uint8_t v13, uint8_t v14, uint8_t v15 - ) : simd8(make_uint8x16_t( + ) : simd8(simdjson_make_uint8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -26435,7 +26372,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x16_t shufmask = vreinterpretq_u8_u64(shufmask64); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x16_t inc = make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x16_t inc = simdjson_make_uint8x16_t(0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x16_t inc = {0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -26465,7 +26402,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int uint8x8_t compactmask2 = vcreate_u8(thintable_epi8[mask2]); // we increment by 0x08 the second half of the mask #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - uint8x8_t inc = make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); + uint8x8_t inc = simdjson_make_uint8x8_t(0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08); #else uint8x8_t inc = {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; #endif @@ -26520,7 +26457,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline simd8( int8_t v0, int8_t v1, int8_t v2, int8_t v3, int8_t v4, int8_t v5, int8_t v6, int8_t v7, int8_t v8, int8_t v9, int8_t v10, int8_t v11, int8_t v12, int8_t v13, int8_t v14, int8_t v15 - ) : simd8(make_int8x16_t( + ) : simd8(simdjson_make_int8x16_t( v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,v12,v13,v14,v15 )) {} @@ -26638,7 +26575,7 @@ simdjson_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x3, int simdjson_inline uint64_t to_bitmask() const { #ifdef SIMDJSON_REGULAR_VISUAL_STUDIO - const uint8x16_t bit_mask = make_uint8x16_t( + const uint8x16_t bit_mask = simdjson_make_uint8x16_t( 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 ); @@ -29768,6 +29705,12 @@ class document { /** * Cast this JSON value to a value when the document is an object or an array. * + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is set to 1 (which is the case when building in Debug mode + * by default), and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * * @returns A value if a JSON array or object cannot be found. * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ @@ -29890,10 +29833,15 @@ class document { */ simdjson_inline operator bool() noexcept(false); /** - * Cast this JSON value to a value. + * Cast this JSON value to a value when the document is an object or an array. * - * @returns A value value. - * @exception if a JSON value cannot be found + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is defined, and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * + * @returns A value value if a JSON array or object cannot be found. + * @exception SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ simdjson_inline operator value() noexcept(false); #endif @@ -31696,7 +31644,17 @@ simdjson_inline simdjson_result document::start_or_resume_object() noexc simdjson_inline simdjson_result document::get_value() noexcept { // Make sure we start any arrays or objects before returning, so that start_root_() // gets called. - iter.assert_at_document_depth(); + + // It is the convention throughout the code that the macro `SIMDJSON_DEVELOPMENT_CHECKS` determines whether + // we check for OUT_OF_ORDER_ITERATION. Proper on::demand code should never trigger this error. +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.at_root()) { return OUT_OF_ORDER_ITERATION; } +#endif + // assert_at_root() serves two purposes: in Debug mode, whether or not + // SIMDJSON_DEVELOPMENT_CHECKS is set or not, it checks that we are at the root of + // the document (this will typically be redundant). In release mode, it generates + // SIMDJSON_ASSUME statements to allow the compiler to make assumptions. + iter.assert_at_root(); switch (*iter.peek()) { case '[': { // The following lines check that the document ends with ]. @@ -39668,6 +39626,12 @@ class document { /** * Cast this JSON value to a value when the document is an object or an array. * + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is set to 1 (which is the case when building in Debug mode + * by default), and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * * @returns A value if a JSON array or object cannot be found. * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ @@ -39790,10 +39754,15 @@ class document { */ simdjson_inline operator bool() noexcept(false); /** - * Cast this JSON value to a value. + * Cast this JSON value to a value when the document is an object or an array. * - * @returns A value value. - * @exception if a JSON value cannot be found + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is defined, and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * + * @returns A value value if a JSON array or object cannot be found. + * @exception SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ simdjson_inline operator value() noexcept(false); #endif @@ -41596,7 +41565,17 @@ simdjson_inline simdjson_result document::start_or_resume_object() noexc simdjson_inline simdjson_result document::get_value() noexcept { // Make sure we start any arrays or objects before returning, so that start_root_() // gets called. - iter.assert_at_document_depth(); + + // It is the convention throughout the code that the macro `SIMDJSON_DEVELOPMENT_CHECKS` determines whether + // we check for OUT_OF_ORDER_ITERATION. Proper on::demand code should never trigger this error. +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.at_root()) { return OUT_OF_ORDER_ITERATION; } +#endif + // assert_at_root() serves two purposes: in Debug mode, whether or not + // SIMDJSON_DEVELOPMENT_CHECKS is set or not, it checks that we are at the root of + // the document (this will typically be redundant). In release mode, it generates + // SIMDJSON_ASSUME statements to allow the compiler to make assumptions. + iter.assert_at_root(); switch (*iter.peek()) { case '[': { // The following lines check that the document ends with ]. @@ -50060,6 +50039,12 @@ class document { /** * Cast this JSON value to a value when the document is an object or an array. * + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is set to 1 (which is the case when building in Debug mode + * by default), and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * * @returns A value if a JSON array or object cannot be found. * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ @@ -50182,10 +50167,15 @@ class document { */ simdjson_inline operator bool() noexcept(false); /** - * Cast this JSON value to a value. + * Cast this JSON value to a value when the document is an object or an array. * - * @returns A value value. - * @exception if a JSON value cannot be found + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is defined, and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * + * @returns A value value if a JSON array or object cannot be found. + * @exception SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ simdjson_inline operator value() noexcept(false); #endif @@ -51988,7 +51978,17 @@ simdjson_inline simdjson_result document::start_or_resume_object() noexc simdjson_inline simdjson_result document::get_value() noexcept { // Make sure we start any arrays or objects before returning, so that start_root_() // gets called. - iter.assert_at_document_depth(); + + // It is the convention throughout the code that the macro `SIMDJSON_DEVELOPMENT_CHECKS` determines whether + // we check for OUT_OF_ORDER_ITERATION. Proper on::demand code should never trigger this error. +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.at_root()) { return OUT_OF_ORDER_ITERATION; } +#endif + // assert_at_root() serves two purposes: in Debug mode, whether or not + // SIMDJSON_DEVELOPMENT_CHECKS is set or not, it checks that we are at the root of + // the document (this will typically be redundant). In release mode, it generates + // SIMDJSON_ASSUME statements to allow the compiler to make assumptions. + iter.assert_at_root(); switch (*iter.peek()) { case '[': { // The following lines check that the document ends with ]. @@ -60451,6 +60451,12 @@ class document { /** * Cast this JSON value to a value when the document is an object or an array. * + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is set to 1 (which is the case when building in Debug mode + * by default), and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * * @returns A value if a JSON array or object cannot be found. * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ @@ -60573,10 +60579,15 @@ class document { */ simdjson_inline operator bool() noexcept(false); /** - * Cast this JSON value to a value. + * Cast this JSON value to a value when the document is an object or an array. * - * @returns A value value. - * @exception if a JSON value cannot be found + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is defined, and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * + * @returns A value value if a JSON array or object cannot be found. + * @exception SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ simdjson_inline operator value() noexcept(false); #endif @@ -62379,7 +62390,17 @@ simdjson_inline simdjson_result document::start_or_resume_object() noexc simdjson_inline simdjson_result document::get_value() noexcept { // Make sure we start any arrays or objects before returning, so that start_root_() // gets called. - iter.assert_at_document_depth(); + + // It is the convention throughout the code that the macro `SIMDJSON_DEVELOPMENT_CHECKS` determines whether + // we check for OUT_OF_ORDER_ITERATION. Proper on::demand code should never trigger this error. +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.at_root()) { return OUT_OF_ORDER_ITERATION; } +#endif + // assert_at_root() serves two purposes: in Debug mode, whether or not + // SIMDJSON_DEVELOPMENT_CHECKS is set or not, it checks that we are at the root of + // the document (this will typically be redundant). In release mode, it generates + // SIMDJSON_ASSUME statements to allow the compiler to make assumptions. + iter.assert_at_root(); switch (*iter.peek()) { case '[': { // The following lines check that the document ends with ]. @@ -70957,6 +70978,12 @@ class document { /** * Cast this JSON value to a value when the document is an object or an array. * + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is set to 1 (which is the case when building in Debug mode + * by default), and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * * @returns A value if a JSON array or object cannot be found. * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ @@ -71079,10 +71106,15 @@ class document { */ simdjson_inline operator bool() noexcept(false); /** - * Cast this JSON value to a value. + * Cast this JSON value to a value when the document is an object or an array. * - * @returns A value value. - * @exception if a JSON value cannot be found + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is defined, and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * + * @returns A value value if a JSON array or object cannot be found. + * @exception SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ simdjson_inline operator value() noexcept(false); #endif @@ -72885,7 +72917,17 @@ simdjson_inline simdjson_result document::start_or_resume_object() noexc simdjson_inline simdjson_result document::get_value() noexcept { // Make sure we start any arrays or objects before returning, so that start_root_() // gets called. - iter.assert_at_document_depth(); + + // It is the convention throughout the code that the macro `SIMDJSON_DEVELOPMENT_CHECKS` determines whether + // we check for OUT_OF_ORDER_ITERATION. Proper on::demand code should never trigger this error. +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.at_root()) { return OUT_OF_ORDER_ITERATION; } +#endif + // assert_at_root() serves two purposes: in Debug mode, whether or not + // SIMDJSON_DEVELOPMENT_CHECKS is set or not, it checks that we are at the root of + // the document (this will typically be redundant). In release mode, it generates + // SIMDJSON_ASSUME statements to allow the compiler to make assumptions. + iter.assert_at_root(); switch (*iter.peek()) { case '[': { // The following lines check that the document ends with ]. @@ -81786,6 +81828,12 @@ class document { /** * Cast this JSON value to a value when the document is an object or an array. * + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is set to 1 (which is the case when building in Debug mode + * by default), and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * * @returns A value if a JSON array or object cannot be found. * @returns SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ @@ -81908,10 +81956,15 @@ class document { */ simdjson_inline operator bool() noexcept(false); /** - * Cast this JSON value to a value. + * Cast this JSON value to a value when the document is an object or an array. * - * @returns A value value. - * @exception if a JSON value cannot be found + * You must not have begun iterating through the object or array. When + * SIMDJSON_DEVELOPMENT_CHECKS is defined, and you have already begun iterating, + * you will get an OUT_OF_ORDER_ITERATION error. If you have begun iterating, you can use + * rewind() to reset the document to its initial state before calling this method. + * + * @returns A value value if a JSON array or object cannot be found. + * @exception SCALAR_DOCUMENT_AS_VALUE error is the document is a scalar (see is_scalar() function). */ simdjson_inline operator value() noexcept(false); #endif @@ -83714,7 +83767,17 @@ simdjson_inline simdjson_result document::start_or_resume_object() noexc simdjson_inline simdjson_result document::get_value() noexcept { // Make sure we start any arrays or objects before returning, so that start_root_() // gets called. - iter.assert_at_document_depth(); + + // It is the convention throughout the code that the macro `SIMDJSON_DEVELOPMENT_CHECKS` determines whether + // we check for OUT_OF_ORDER_ITERATION. Proper on::demand code should never trigger this error. +#if SIMDJSON_DEVELOPMENT_CHECKS + if (!iter.at_root()) { return OUT_OF_ORDER_ITERATION; } +#endif + // assert_at_root() serves two purposes: in Debug mode, whether or not + // SIMDJSON_DEVELOPMENT_CHECKS is set or not, it checks that we are at the root of + // the document (this will typically be redundant). In release mode, it generates + // SIMDJSON_ASSUME statements to allow the compiler to make assumptions. + iter.assert_at_root(); switch (*iter.peek()) { case '[': { // The following lines check that the document ends with ]. diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index e4b5370fdaf6e7..47ecd2aafa0240 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -27,7 +27,7 @@ This a list of all the dependencies: * [npm 9.6.7][] * [openssl 3.0.8][] * [postject 1.0.0-alpha.6][] -* [simdjson 3.6.0][] +* [simdjson 3.6.2][] * [simdutf 4.0.4][] * [undici 5.28.2][] * [uvwasi 0.0.19][] @@ -287,7 +287,7 @@ See [maintaining-openssl][] for more informations. The [postject](https://github.com/nodejs/postject) dependency is used for the [Single Executable strategic initiative](https://github.com/nodejs/single-executable). -### simdjson 3.6.0 +### simdjson 3.6.2 The [simdjson](https://github.com/simdjson/simdjson) dependency is a C++ library for fast JSON parsing. @@ -350,7 +350,7 @@ performance improvements not currently available in standard zlib. [npm 9.6.7]: #npm-967 [openssl 3.0.8]: #openssl-308 [postject 1.0.0-alpha.6]: #postject-100-alpha6 -[simdjson 3.6.0]: #simdutf-360 +[simdjson 3.6.2]: #simdutf-362 [simdutf 4.0.4]: #simdutf-404 [undici 5.28.2]: #undici-5282 [update-openssl-action]: ../../../.github/workflows/update-openssl.yml From c0e5e7487680cd6e65a72c41ef8cc6acf2552e6b Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Wed, 6 Dec 2023 17:55:45 +0900 Subject: [PATCH 29/67] module: document `parentURL` in register options PR-URL: https://github.com/nodejs/node/pull/51039 Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: Jacob Smith Reviewed-By: Geoffrey Booth --- doc/api/module.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/module.md b/doc/api/module.md index 394af95ac00b41..874b26fc60abf7 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -99,6 +99,10 @@ changes: URL, such as `import.meta.url`, you can pass that URL here. **Default:** `'data:'` * `options` {Object} + * `parentURL` {string|URL} If you want to resolve `specifier` relative to a + base URL, such as `import.meta.url`, you can pass that URL here. This + property is ignored if the `parentURL` is supplied as the second argument. + **Default:** `'data:'` * `data` {any} Any arbitrary, cloneable JavaScript value to pass into the [`initialize`][] hook. * `transferList` {Object\[]} [transferrable objects][] to be passed into the From 5f95dca63872e2572f84fc4ebc328803507f266b Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Thu, 30 Nov 2023 23:33:59 -0800 Subject: [PATCH 30/67] node-api: introduce experimental feature flags Add a flag for each experimental feature to indicate its presence. That way, if we compile with `NAPI_EXPERIMENTAL` turned on, we'll be able to distinguish between what `NAPI_EXPERIMENTAL` used to mean on an old version of the headers when compiling against such an old version, and what it means on a new version of Node.js. PR-URL: https://github.com/nodejs/node/pull/50991 Reviewed-By: Michael Dawson Reviewed-By: Vladimir Morozov Reviewed-By: Chengzhong Wu --- doc/contributing/adding-new-napi-api.md | 4 ++++ doc/contributing/releases-node-api.md | 2 ++ src/js_native_api.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/doc/contributing/adding-new-napi-api.md b/doc/contributing/adding-new-napi-api.md index 8d2233bc30f690..e834a395b6206f 100644 --- a/doc/contributing/adding-new-napi-api.md +++ b/doc/contributing/adding-new-napi-api.md @@ -34,6 +34,10 @@ Node-API. * Experimental APIs **must** be documented as such. * Experimental APIs **must** require an explicit compile-time flag (`#define`) to be set to opt-in. + * A feature flag of the form `NODE_API_EXPERIMENTAL_HAS_` **must** + be added with each experimental feature in order to allow code to + distinguish between experimental features as present in one version of + Node.js versus another. * Experimental APIs **must** be considered for backport. * Experimental status exit criteria **must** involve at least the following: diff --git a/doc/contributing/releases-node-api.md b/doc/contributing/releases-node-api.md index f2277b228ec0d6..5f4e6df9a5c3bc 100644 --- a/doc/contributing/releases-node-api.md +++ b/doc/contributing/releases-node-api.md @@ -100,6 +100,8 @@ and update the define version guards with the release version: + #endif // NAPI_VERSION >= 10 ``` +Remove any feature flags of the form `NODE_API_EXPERIMENTAL_HAS_`. + Also, update the Node-API version value of the `napi_get_version` test in `test/js-native-api/test_general/test.js` with the release version `x`: diff --git a/src/js_native_api.h b/src/js_native_api.h index d665052b947552..a3ee3a0e224262 100644 --- a/src/js_native_api.h +++ b/src/js_native_api.h @@ -93,6 +93,7 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf16(napi_env env, size_t length, napi_value* result); #ifdef NAPI_EXPERIMENTAL +#define NODE_API_EXPERIMENTAL_HAS_EXTERNAL_STRINGS NAPI_EXTERN napi_status NAPI_CDECL node_api_create_external_string_latin1(napi_env env, char* str, @@ -518,6 +519,7 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_add_finalizer(napi_env env, #endif // NAPI_VERSION >= 5 #ifdef NAPI_EXPERIMENTAL +#define NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER NAPI_EXTERN napi_status NAPI_CDECL node_api_post_finalizer(napi_env env, From 38fd0ca753639d78dc0760b41c79f1d5882080af Mon Sep 17 00:00:00 2001 From: Chenyu Yang Date: Thu, 7 Dec 2023 04:05:38 +0800 Subject: [PATCH 31/67] benchmark: add undici websocket benchmark Refs: https://github.com/nodejs/performance/issues/114 PR-URL: https://github.com/nodejs/node/pull/50586 Reviewed-By: Luigi Pinca Reviewed-By: Matthew Aitken --- benchmark/websocket/simple.js | 100 +++++++++++++++++++++ test/benchmark/test-benchmark-websocket.js | 9 ++ 2 files changed, 109 insertions(+) create mode 100644 benchmark/websocket/simple.js create mode 100644 test/benchmark/test-benchmark-websocket.js diff --git a/benchmark/websocket/simple.js b/benchmark/websocket/simple.js new file mode 100644 index 00000000000000..1147602a7b1ea7 --- /dev/null +++ b/benchmark/websocket/simple.js @@ -0,0 +1,100 @@ +'use strict'; + +const common = require('../common.js'); +const crypto = require('crypto'); +const http = require('http'); +const { WebSocket } = require('../../deps/undici/undici'); + +const GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; + +const configs = { + size: [64, 16 * 1024, 128 * 1024, 1024 * 1024], + useBinary: ['true', 'false'], + roundtrips: [5000, 1000, 100], +}; + +const bench = common.createBenchmark(main, configs); + +function createFrame(data, opcode) { + let infoLength = 2; + let payloadLength = data.length; + + if (payloadLength >= 65536) { + infoLength += 8; + payloadLength = 127; + } else if (payloadLength > 125) { + infoLength += 2; + payloadLength = 126; + } + + const info = Buffer.alloc(infoLength); + + info[0] = opcode | 0x80; + info[1] = payloadLength; + + if (payloadLength === 126) { + info.writeUInt16BE(data.length, 2); + } else if (payloadLength === 127) { + info[2] = info[3] = 0; + info.writeUIntBE(data.length, 4, 6); + } + + return Buffer.concat([info, data]); +} + +function main(conf) { + const frame = createFrame(Buffer.alloc(conf.size).fill('.'), conf.useBinary === 'true' ? 2 : 1); + const server = http.createServer(); + server.on('upgrade', (req, socket) => { + const key = crypto + .createHash('sha1') + .update(req.headers['sec-websocket-key'] + GUID) + .digest('base64'); + + let bytesReceived = 0; + let roundtrip = 0; + + socket.on('data', function onData(chunk) { + bytesReceived += chunk.length; + + if (bytesReceived === frame.length + 4) { // +4 for the mask. + // Message completely received. + bytesReceived = 0; + + if (++roundtrip === conf.roundtrips) { + socket.removeListener('data', onData); + socket.resume(); + socket.end(); + server.close(); + + bench.end(conf.roundtrips); + } else { + socket.write(frame); + } + } + }); + + socket.write( + [ + 'HTTP/1.1 101 Switching Protocols', + 'Upgrade: websocket', + 'Connection: Upgrade', + `Sec-WebSocket-Accept: ${key}`, + '\r\n', + ].join('\r\n'), + ); + + socket.write(frame); + }); + + server.listen(0, () => { + const ws = new WebSocket(`ws://localhost:${server.address().port}`); + ws.addEventListener('open', () => { + bench.start(); + }); + + ws.addEventListener('message', (event) => { + ws.send(event.data); + }); + }); +} diff --git a/test/benchmark/test-benchmark-websocket.js b/test/benchmark/test-benchmark-websocket.js new file mode 100644 index 00000000000000..d02e46a76b4e9e --- /dev/null +++ b/test/benchmark/test-benchmark-websocket.js @@ -0,0 +1,9 @@ +'use strict'; + +const common = require('../common'); +if (!common.enoughTestMem) + common.skip('Insufficient memory for Websocket benchmark test'); + +const runBenchmark = require('../common/benchmark'); + +runBenchmark('websocket', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); From 735bad36941f4135b092ddd8deecd2fbd9916236 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 7 Dec 2023 05:53:24 +0900 Subject: [PATCH 32/67] build: fix warnings from uv for gn build PR-URL: https://github.com/nodejs/node/pull/51069 Reviewed-By: Jiawen Geng Reviewed-By: Santiago Gimeno Reviewed-By: Luigi Pinca --- deps/uv/unofficial.gni | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni index 64d6bcbc5c13da..0789d2eaccb573 100644 --- a/deps/uv/unofficial.gni +++ b/deps/uv/unofficial.gni @@ -50,6 +50,7 @@ template("uv_gn_build") { "-Wno-shadow", "-Wno-unreachable-code", "-Wno-unreachable-code-return", + "-Wno-unused-but-set-parameter", "-Wno-unused-but-set-variable", "-Wno-unused-function", "-Wno-unused-result", From 5112306064e20908cfe13bd72a76974ed0e51938 Mon Sep 17 00:00:00 2001 From: kylo5aby <109658203+zhenweijin@users.noreply.github.com> Date: Fri, 8 Dec 2023 02:21:19 +0800 Subject: [PATCH 33/67] stream: fix fd is null when calling clearBuffer PR-URL: https://github.com/nodejs/node/pull/50994 Fixes: https://github.com/nodejs/node/issues/50979 Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum Reviewed-By: Raz Luvaton Reviewed-By: Robert Nagy --- lib/internal/streams/writable.js | 3 ++- test/parallel/test-file-write-stream5.js | 28 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-file-write-stream5.js diff --git a/lib/internal/streams/writable.js b/lib/internal/streams/writable.js index e55ddc1796cf6c..0dbf56d7a69ca9 100644 --- a/lib/internal/streams/writable.js +++ b/lib/internal/streams/writable.js @@ -733,7 +733,8 @@ function errorBuffer(state) { // If there's something in the buffer waiting, then process it. function clearBuffer(stream, state) { - if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered)) !== kBuffered) { + if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered | kConstructed)) !== + (kBuffered | kConstructed)) { return; } diff --git a/test/parallel/test-file-write-stream5.js b/test/parallel/test-file-write-stream5.js new file mode 100644 index 00000000000000..cdc8b52eebd48d --- /dev/null +++ b/test/parallel/test-file-write-stream5.js @@ -0,0 +1,28 @@ +'use strict'; + +// Test 'uncork' for WritableStream. +// Refs: https://github.com/nodejs/node/issues/50979 + +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); +const test = require('node:test'); +const tmpdir = require('../common/tmpdir'); + +const filepath = tmpdir.resolve('write_stream.txt'); +tmpdir.refresh(); + +const data = 'data'; + +test('writable stream uncork', () => { + const fileWriteStream = fs.createWriteStream(filepath); + + fileWriteStream.on('finish', common.mustCall(() => { + const writtenData = fs.readFileSync(filepath, 'utf8'); + assert.strictEqual(writtenData, data); + })); + fileWriteStream.cork(); + fileWriteStream.write(data, common.mustCall()); + fileWriteStream.uncork(); + fileWriteStream.end(); +}); From c3c8237089663b8703168163e3d75b9cd293476a Mon Sep 17 00:00:00 2001 From: Jungku Lee Date: Fri, 8 Dec 2023 04:42:45 +0900 Subject: [PATCH 34/67] fs: update params in jsdoc for createReadStream and createWriteStream PR-URL: https://github.com/nodejs/node/pull/51063 Reviewed-By: Luigi Pinca Reviewed-By: Raz Luvaton Reviewed-By: Marco Ippolito Reviewed-By: Deokjin Kim --- lib/fs.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/fs.js b/lib/fs.js index c26979a65e0664..34ad6ef6be835b 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -3092,6 +3092,7 @@ function lazyLoadStreams() { * end?: number; * highWaterMark?: number; * fs?: object | null; + * signal?: AbortSignal | null; * }} [options] * @returns {ReadStream} */ @@ -3112,6 +3113,8 @@ function createReadStream(path, options) { * emitClose?: boolean; * start: number; * fs?: object | null; + * signal?: AbortSignal | null; + * highWaterMark?: number; * flush?: boolean; * }} [options] * @returns {WriteStream} From 539bee4f0a6b4014bec8f845b62fee9cf73d929c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 8 Dec 2023 00:23:41 +0100 Subject: [PATCH 35/67] doc: use length argument in pbkdf2Key The optional `length` argument is supposed to determine the length of the AES-GCM key, so it may be 128, 192, or 256. PR-URL: https://github.com/nodejs/node/pull/51066 Reviewed-By: Marco Ippolito Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca --- doc/api/webcrypto.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 0c5fa8b413b992..07677b8f180de9 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -330,7 +330,7 @@ async function pbkdf2Key(pass, salt, iterations = 1000, length = 256) { iterations, }, keyMaterial, { name: 'AES-GCM', - length: 256, + length, }, true, ['encrypt', 'decrypt']); return key; } From 838179b096c184b32660f82bf7d60e92300d28f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Fri, 8 Dec 2023 22:01:23 +0100 Subject: [PATCH 36/67] doc: correct tracingChannel.traceCallback() tracingChannel.traceCallback() requires a callback otherwise it throws and invalid argument error. As a result arguments are not optional. Correct the documentation to reflect that arguments are not optional. Besides that correct description regarding signaling of errors. Remove an unneeded null check in wrappedCallback() which can't happen because it's validated that callback is of type function. PR-URL: https://github.com/nodejs/node/pull/51068 Fixes: https://github.com/nodejs/node/issues/50996 Reviewed-By: Stephen Belanger Reviewed-By: Luigi Pinca Reviewed-By: Mohammed Keyvanzadeh --- doc/api/diagnostics_channel.md | 18 +++++++++--------- lib/diagnostics_channel.js | 4 +--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/api/diagnostics_channel.md b/doc/api/diagnostics_channel.md index b92ee0b014de02..ba60c7e28d4050 100644 --- a/doc/api/diagnostics_channel.md +++ b/doc/api/diagnostics_channel.md @@ -853,7 +853,7 @@ channels.tracePromise(async () => { }); ``` -#### `tracingChannel.traceCallback(fn[, position[, context[, thisArg[, ...args]]]])` +#### `tracingChannel.traceCallback(fn, position, context, thisArg, ...args)` + +Type: Documentation-only + +Calling `Hash` class directly with `Hash()` or `new Hash()` is +deprecated due to being internals, not intended for public use. +Please use the [`crypto.createHash()`][] method to create Hash instances. + [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 [RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4 @@ -3505,6 +3520,7 @@ release lines. Please use [`dirent.parentPath`][] instead. [`crypto.createCipheriv()`]: crypto.md#cryptocreatecipherivalgorithm-key-iv-options [`crypto.createDecipher()`]: crypto.md#cryptocreatedecipheralgorithm-password-options [`crypto.createDecipheriv()`]: crypto.md#cryptocreatedecipherivalgorithm-key-iv-options +[`crypto.createHash()`]: crypto.md#cryptocreatehashalgorithm-options [`crypto.fips`]: crypto.md#cryptofips [`crypto.pbkdf2()`]: crypto.md#cryptopbkdf2password-salt-iterations-keylen-digest-callback [`crypto.randomBytes()`]: crypto.md#cryptorandombytessize-callback From 297cb6f5c22b10ed5d5e01be9fda43683dad5173 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Mon, 11 Dec 2023 02:41:20 +0200 Subject: [PATCH 48/67] tools: update doc to highlight.js@11.9.0 unified@11.0.4 And unist-util-select@5.1.0. PR-URL: https://github.com/nodejs/node/pull/50459 Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel --- tools/doc/package-lock.json | 611 ++++++++++++++++++++++-------------- tools/doc/package.json | 6 +- 2 files changed, 386 insertions(+), 231 deletions(-) diff --git a/tools/doc/package-lock.json b/tools/doc/package-lock.json index 59e4608d3e1c1c..a7c2088abd3ad5 100644 --- a/tools/doc/package-lock.json +++ b/tools/doc/package-lock.json @@ -11,7 +11,7 @@ "node-doc-generator": "generate.js" }, "devDependencies": { - "highlight.js": "^11.8.0", + "highlight.js": "^11.9.0", "js-yaml": "^4.1.0", "rehype-raw": "^7.0.0", "rehype-stringify": "^10.0.0", @@ -21,8 +21,8 @@ "remark-parse": "^10.0.2", "remark-rehype": "^10.1.0", "to-vfile": "^8.0.0", - "unified": "^11.0.2", - "unist-util-select": "^5.0.0", + "unified": "^11.0.4", + "unist-util-select": "^5.1.0", "unist-util-visit": "^5.0.0" }, "engines": { @@ -30,36 +30,36 @@ } }, "node_modules/@types/debug": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", - "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dev": true, "dependencies": { "@types/ms": "*" } }, "node_modules/@types/hast": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.0.tgz", - "integrity": "sha512-SoytUJRuf68HXYqcXicQIhCrLQjqeYU2anikr4G3p3Iz+OZO5QDQpDj++gv+RenHsnUBwNZ2dumBArF8VLSk2Q==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.3.tgz", + "integrity": "sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==", "dev": true, "dependencies": { "@types/unist": "*" } }, "node_modules/@types/mdast": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.0.tgz", - "integrity": "sha512-YLeG8CujC9adtj/kuDzq1N4tCDYKoZ5l/bnjq8d74+t/3q/tHquJOJKUQXJrLCflOHpKjXgcI/a929gpmLOEng==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { "@types/unist": "*" } }, "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", "dev": true }, "node_modules/@types/parse5": { @@ -69,9 +69,9 @@ "dev": true }, "node_modules/@types/unist": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", - "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, "node_modules/@ungap/structured-clone": { @@ -153,9 +153,9 @@ } }, "node_modules/css-selector-parser": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-2.3.2.tgz", - "integrity": "sha512-JjnG6/pdLJh3iqipq7kteNVtbIczsU2A1cNxb+VAiniSuNmrB/NI3us4rSCfArvlwRXYly+jZhUUfEoInSH9Qg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.0.3.tgz", + "integrity": "sha512-HAcgYSBFKo1jnglINdHeBPIscPOCOh8vCDCaOV5xkwMSlGPEnfdynxBuWkgZMwXltMKgFbDcr4EPmDpSWi34MA==", "dev": true, "funding": [ { @@ -353,18 +353,18 @@ } }, "node_modules/hast-util-sanitize/node_modules/@types/hast": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.5.tgz", - "integrity": "sha512-SvQi0L/lNpThgPoleH53cdjB3y9zpLlVjRbqB3rH8hx1jiRSBGAhyjV3H+URFjNVRqt2EdYNrbZE5IsGlNfpRg==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.8.tgz", + "integrity": "sha512-aMIqAlFd2wTIDZuvLbhUT+TGvMxrNC8ECUIVtH6xxy0sQLs3iu6NO8Kp/VT5je7i5ufnebXzdV1dNDMnvaH6IQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/hast-util-sanitize/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/hast-util-to-html": { @@ -441,9 +441,9 @@ } }, "node_modules/highlight.js": { - "version": "11.8.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.8.0.tgz", - "integrity": "sha512-MedQhoqVdr0U6SSnWPzfiadUcDHfN/Wzq25AkXiQv9oiOO/sG0S7XkvpFIqWBl9Yq1UYyYOOVORs5UW2XlPyzg==", + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz", + "integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==", "dev": true, "engines": { "node": ">=12.0.0" @@ -551,20 +551,33 @@ } }, "node_modules/mdast-util-definitions/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-definitions/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, + "node_modules/mdast-util-definitions/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-definitions/node_modules/unist-util-visit": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", @@ -580,6 +593,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-find-and-replace": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz", @@ -597,20 +624,47 @@ } }, "node_modules/mdast-util-find-and-replace/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-find-and-replace/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, + "node_modules/mdast-util-find-and-replace/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-from-markdown": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", @@ -636,18 +690,18 @@ } }, "node_modules/mdast-util-from-markdown/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-from-markdown/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/mdast-util-from-markdown/node_modules/micromark-util-symbol": { @@ -682,6 +736,19 @@ } ] }, + "node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-frontmatter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-1.0.1.tgz", @@ -698,18 +765,18 @@ } }, "node_modules/mdast-util-frontmatter/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-frontmatter/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/mdast-util-gfm": { @@ -748,18 +815,18 @@ } }, "node_modules/mdast-util-gfm-autolink-literal/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-gfm-autolink-literal/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character": { @@ -830,18 +897,18 @@ } }, "node_modules/mdast-util-gfm-footnote/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-gfm-footnote/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/mdast-util-gfm-strikethrough": { @@ -859,18 +926,18 @@ } }, "node_modules/mdast-util-gfm-strikethrough/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-gfm-strikethrough/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/mdast-util-gfm-table": { @@ -890,18 +957,18 @@ } }, "node_modules/mdast-util-gfm-table/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-gfm-table/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/mdast-util-gfm-task-list-item": { @@ -919,18 +986,18 @@ } }, "node_modules/mdast-util-gfm-task-list-item/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-gfm-task-list-item/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/mdast-util-phrasing": { @@ -948,20 +1015,33 @@ } }, "node_modules/mdast-util-phrasing/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-phrasing/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, + "node_modules/mdast-util-phrasing/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-hast": { "version": "13.0.2", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", @@ -1003,20 +1083,33 @@ } }, "node_modules/mdast-util-to-markdown/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-to-markdown/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, + "node_modules/mdast-util-to-markdown/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-markdown/node_modules/unist-util-visit": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", @@ -1032,6 +1125,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-to-markdown/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", @@ -1046,18 +1153,18 @@ } }, "node_modules/mdast-util-to-string/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/mdast-util-to-string/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/micromark": { @@ -2694,9 +2801,9 @@ } }, "node_modules/property-information": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.3.0.tgz", - "integrity": "sha512-gVNZ74nqhRMiIUYWGQdosYetaKc83x8oT41a0LlV3AAFCAZwCpg4vmGkq8t34+cUhp3cnM4XDiU/7xlgK7HGrg==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.0.tgz", + "integrity": "sha512-9t5qARVofg2xQqKtytzt+lZ4d1Qvj8t5B8fEwXK6qOfgRLgH/b13QlgEyDh033NOS31nXeFbYv7CLUDG1CeifQ==", "dev": true, "funding": { "type": "github", @@ -2750,18 +2857,18 @@ } }, "node_modules/remark-frontmatter/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/remark-frontmatter/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/remark-frontmatter/node_modules/unified": { @@ -2783,6 +2890,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-frontmatter/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-frontmatter/node_modules/vfile": { "version": "5.3.7", "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", @@ -2830,18 +2950,18 @@ } }, "node_modules/remark-gfm/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/remark-gfm/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/remark-gfm/node_modules/unified": { @@ -2863,6 +2983,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-gfm/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-gfm/node_modules/vfile": { "version": "5.3.7", "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", @@ -2911,27 +3044,27 @@ } }, "node_modules/remark-html/node_modules/@types/hast": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.5.tgz", - "integrity": "sha512-SvQi0L/lNpThgPoleH53cdjB3y9zpLlVjRbqB3rH8hx1jiRSBGAhyjV3H+URFjNVRqt2EdYNrbZE5IsGlNfpRg==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.8.tgz", + "integrity": "sha512-aMIqAlFd2wTIDZuvLbhUT+TGvMxrNC8ECUIVtH6xxy0sQLs3iu6NO8Kp/VT5je7i5ufnebXzdV1dNDMnvaH6IQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/remark-html/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/remark-html/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/remark-html/node_modules/hast-util-from-parse5": { @@ -3201,6 +3334,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-html/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-html/node_modules/unist-util-position": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", @@ -3214,6 +3360,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-html/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-html/node_modules/unist-util-visit": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", @@ -3229,6 +3388,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-html/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-html/node_modules/vfile": { "version": "5.3.7", "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", @@ -3289,18 +3462,18 @@ } }, "node_modules/remark-parse/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/remark-parse/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/remark-parse/node_modules/unified": { @@ -3322,6 +3495,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-parse/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-parse/node_modules/vfile": { "version": "5.3.7", "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", @@ -3369,27 +3555,27 @@ } }, "node_modules/remark-rehype/node_modules/@types/hast": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.5.tgz", - "integrity": "sha512-SvQi0L/lNpThgPoleH53cdjB3y9zpLlVjRbqB3rH8hx1jiRSBGAhyjV3H+URFjNVRqt2EdYNrbZE5IsGlNfpRg==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.8.tgz", + "integrity": "sha512-aMIqAlFd2wTIDZuvLbhUT+TGvMxrNC8ECUIVtH6xxy0sQLs3iu6NO8Kp/VT5je7i5ufnebXzdV1dNDMnvaH6IQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/remark-rehype/node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, "dependencies": { "@types/unist": "^2" } }, "node_modules/remark-rehype/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, "node_modules/remark-rehype/node_modules/mdast-util-to-hast": { @@ -3520,6 +3706,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-rehype/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-rehype/node_modules/unist-util-position": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", @@ -3533,6 +3732,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-rehype/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-rehype/node_modules/unist-util-visit": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", @@ -3548,6 +3760,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-rehype/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-rehype/node_modules/vfile": { "version": "5.3.7", "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", @@ -3648,15 +3874,15 @@ } }, "node_modules/unified": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.2.tgz", - "integrity": "sha512-Zta++onvS/dJ6xUvXQOR5q8XJZOkiMCE5wQ8Yv9mLR25pxRS567EX0GO6HZRxxNV/lznwfsvRZ/1pqe9K9QLeQ==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { "@types/unist": "^3.0.0", - "@ungap/structured-clone": "^1.0.0", "bail": "^2.0.0", "devlop": "^1.0.0", + "extend": "^3.0.0", "is-plain-obj": "^4.0.0", "trough": "^2.0.0", "vfile": "^6.0.0" @@ -3677,24 +3903,18 @@ } }, "node_modules/unist-util-is": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", - "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-is/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", - "dev": true - }, "node_modules/unist-util-position": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", @@ -3709,13 +3929,13 @@ } }, "node_modules/unist-util-select": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-5.0.0.tgz", - "integrity": "sha512-xhX135nwV6kdOm3EuzO01aNYBgyAe6aC84j6Hj+RI5DIaV6W5B4BH9U92W3jvU3cw3D2NWx4hTcrusdcGKi8Uw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-5.1.0.tgz", + "integrity": "sha512-4A5mfokSHG/rNQ4g7gSbdEs+H586xyd24sdJqF1IWamqrLHvYb+DH48fzxowyOhOfK7YSqX+XlCojAyuuyyT2A==", "dev": true, "dependencies": { "@types/unist": "^3.0.0", - "css-selector-parser": "^2.0.0", + "css-selector-parser": "^3.0.0", "devlop": "^1.1.0", "nth-check": "^2.0.0", "zwitch": "^2.0.0" @@ -3726,24 +3946,18 @@ } }, "node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-stringify-position/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", - "dev": true - }, "node_modules/unist-util-visit": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", @@ -3760,39 +3974,6 @@ } }, "node_modules/unist-util-visit-parents": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", - "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", - "dev": true, - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-parents/node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", - "dev": true - }, - "node_modules/unist-util-visit/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dev": true, - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit/node_modules/unist-util-visit-parents": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", @@ -3867,32 +4048,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-message/node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", - "dev": true, - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile/node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", - "dev": true, - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/web-namespaces": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", diff --git a/tools/doc/package.json b/tools/doc/package.json index 3d49c92208b7ac..d27ce6ca5102f9 100644 --- a/tools/doc/package.json +++ b/tools/doc/package.json @@ -7,7 +7,7 @@ "node": ">=14.8.0" }, "devDependencies": { - "highlight.js": "^11.8.0", + "highlight.js": "^11.9.0", "js-yaml": "^4.1.0", "rehype-raw": "^7.0.0", "rehype-stringify": "^10.0.0", @@ -17,8 +17,8 @@ "remark-parse": "^10.0.2", "remark-rehype": "^10.1.0", "to-vfile": "^8.0.0", - "unified": "^11.0.2", - "unist-util-select": "^5.0.0", + "unified": "^11.0.4", + "unist-util-select": "^5.1.0", "unist-util-visit": "^5.0.0" }, "bin": { From 3fb7fc909e2612c57838458040a5be4471f3d7b4 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 29 May 2023 10:35:26 -0700 Subject: [PATCH 49/67] quic: further implementation details PR-URL: https://github.com/nodejs/node/pull/48244 Reviewed-By: Yagiz Nizipli Reviewed-By: Stephen Belanger --- src/dataqueue/queue.cc | 34 ++ src/dataqueue/queue.h | 12 + src/quic/application.cc | 11 +- src/quic/bindingdata.cc | 8 +- src/quic/bindingdata.h | 3 +- src/quic/streams.cc | 1029 ++++++++++++++++++++++++++++++++++++++- src/quic/streams.h | 170 ++++++- 7 files changed, 1229 insertions(+), 38 deletions(-) diff --git a/src/dataqueue/queue.cc b/src/dataqueue/queue.cc index 994b82a8751f6e..c3de4eb570beab 100644 --- a/src/dataqueue/queue.cc +++ b/src/dataqueue/queue.cc @@ -162,6 +162,27 @@ class DataQueueImpl final : public DataQueue, "entries", entries_, "std::vector>"); } + void addBackpressureListener(BackpressureListener* listener) override { + if (idempotent_) return; + DCHECK_NOT_NULL(listener); + backpressure_listeners_.insert(listener); + } + + void removeBackpressureListener(BackpressureListener* listener) override { + if (idempotent_) return; + DCHECK_NOT_NULL(listener); + backpressure_listeners_.erase(listener); + } + + void NotifyBackpressure(size_t amount) { + if (idempotent_) return; + for (auto& listener : backpressure_listeners_) listener->EntryRead(amount); + } + + bool HasBackpressureListeners() const noexcept { + return !backpressure_listeners_.empty(); + } + std::shared_ptr get_reader() override; SET_MEMORY_INFO_NAME(DataQueue) SET_SELF_SIZE(DataQueueImpl) @@ -173,6 +194,8 @@ class DataQueueImpl final : public DataQueue, std::optional capped_size_ = std::nullopt; bool locked_to_reader_ = false; + std::unordered_set backpressure_listeners_; + friend class DataQueue; friend class IdempotentDataQueueReader; friend class NonIdempotentDataQueueReader; @@ -433,6 +456,17 @@ class NonIdempotentDataQueueReader final return; } + // If there is a backpressure listener, lets report on how much data + // was actually read. + if (data_queue_->HasBackpressureListeners()) { + // How much did we actually read? + size_t read = 0; + for (uint64_t n = 0; n < count; n++) { + read += vecs[n].len; + } + data_queue_->NotifyBackpressure(read); + } + // Now that we have updated this readers state, we can forward // everything on to the outer next. std::move(next)(status, vecs, count, std::move(done)); diff --git a/src/dataqueue/queue.h b/src/dataqueue/queue.h index 9bf34ffb6572aa..a37bd27549986e 100644 --- a/src/dataqueue/queue.h +++ b/src/dataqueue/queue.h @@ -141,6 +141,14 @@ class DataQueue : public MemoryRetainer { using Done = bob::Done; }; + // A BackpressureListener can be used to receive notifications + // when a non-idempotent DataQueue releases entries as they + // are consumed. + class BackpressureListener { + public: + virtual void EntryRead(size_t amount) = 0; + }; + // A DataQueue::Entry represents a logical chunk of data in the queue. // The entry may or may not represent memory-resident data. It may // or may not be consumable more than once. @@ -285,6 +293,10 @@ class DataQueue : public MemoryRetainer { // been set, maybeCapRemaining() will return std::nullopt. virtual std::optional maybeCapRemaining() const = 0; + // BackpressureListeners only work on non-idempotent DataQueues. + virtual void addBackpressureListener(BackpressureListener* listener) = 0; + virtual void removeBackpressureListener(BackpressureListener* listener) = 0; + static void Initialize(Environment* env, v8::Local target); static void RegisterExternalReferences(ExternalReferenceRegistry* registry); }; diff --git a/src/quic/application.cc b/src/quic/application.cc index b7ba7fcf86b1ca..cafd6a8941c830 100644 --- a/src/quic/application.cc +++ b/src/quic/application.cc @@ -1,3 +1,4 @@ +#include "node_bob.h" #include "uv.h" #if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC @@ -79,7 +80,7 @@ void Session::Application::AcknowledgeStreamData(Stream* stream, void Session::Application::BlockStream(int64_t id) { auto stream = session().FindStream(id); - if (stream) stream->Blocked(); + if (stream) stream->EmitBlocked(); } bool Session::Application::CanAddHeader(size_t current_count, @@ -233,7 +234,7 @@ void Session::Application::SendPendingData() { // and no more outbound data can be sent. CHECK_LE(ndatalen, 0); auto stream = session_->FindStream(stream_data.id); - if (stream) stream->End(); + if (stream) stream->EndWritable(); continue; } case NGTCP2_ERR_WRITE_MORE: { @@ -360,10 +361,8 @@ class DefaultApplication final : public Session::Application { stream_data->data, arraysize(stream_data->data), kMaxVectorCount); - switch (ret) { - case bob::Status::STATUS_EOS: - stream_data->fin = 1; - break; + if (ret == bob::Status::STATUS_EOS) { + stream_data->fin = 1; } } else { stream_data->fin = 1; diff --git a/src/quic/bindingdata.cc b/src/quic/bindingdata.cc index 3e95372ba2fc37..499206356a5862 100644 --- a/src/quic/bindingdata.cc +++ b/src/quic/bindingdata.cc @@ -203,8 +203,12 @@ CallbackScopeBase::CallbackScopeBase(Environment* env) : env(env), context_scope(env->context()), try_catch(env->isolate()) {} CallbackScopeBase::~CallbackScopeBase() { - if (try_catch.HasCaught() && !try_catch.HasTerminated()) { - errors::TriggerUncaughtException(env->isolate(), try_catch); + if (try_catch.HasCaught()) { + if (!try_catch.HasTerminated() && env->can_call_into_js()) { + errors::TriggerUncaughtException(env->isolate(), try_catch); + } else { + try_catch.ReThrow(); + } } } diff --git a/src/quic/bindingdata.h b/src/quic/bindingdata.h index 2b33642b7ad76a..5ab0cc4b3f45a6 100644 --- a/src/quic/bindingdata.h +++ b/src/quic/bindingdata.h @@ -103,7 +103,6 @@ constexpr size_t kMaxVectorCount = 16; V(session_version_negotiation, SessionVersionNegotiation) \ V(session_path_validation, SessionPathValidation) \ V(stream_close, StreamClose) \ - V(stream_error, StreamError) \ V(stream_created, StreamCreated) \ V(stream_reset, StreamReset) \ V(stream_headers, StreamHeaders) \ @@ -304,6 +303,8 @@ struct CallbackScopeBase { ~CallbackScopeBase(); }; +// Maintains a strong reference to BaseObject type ptr to keep it alive during +// a MakeCallback during which it might be destroyed. template struct CallbackScope final : public CallbackScopeBase { BaseObjectPtr ref; diff --git a/src/quic/streams.cc b/src/quic/streams.cc index ae208e0eb0007a..4cca65f56d900e 100644 --- a/src/quic/streams.cc +++ b/src/quic/streams.cc @@ -1,19 +1,680 @@ #if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #include "streams.h" +#include #include #include #include #include +#include #include #include +#include "application.h" +#include "bindingdata.h" +#include "defs.h" #include "session.h" namespace node { + +using v8::Array; +using v8::ArrayBuffer; +using v8::ArrayBufferView; +using v8::BigInt; +using v8::FunctionCallbackInfo; +using v8::FunctionTemplate; +using v8::Integer; +using v8::Just; +using v8::Local; +using v8::Maybe; +using v8::Nothing; +using v8::Object; +using v8::PropertyAttribute; +using v8::SharedArrayBuffer; +using v8::Uint32; +using v8::Value; + namespace quic { -Stream::Stream(BaseObjectPtr session, v8::Local obj) - : AsyncWrap(session->env(), obj, AsyncWrap::PROVIDER_QUIC_STREAM) { - MakeWeak(); +#define STREAM_STATE(V) \ + V(ID, id, int64_t) \ + V(FIN_SENT, fin_sent, uint8_t) \ + V(FIN_RECEIVED, fin_received, uint8_t) \ + V(READ_ENDED, read_ended, uint8_t) \ + V(WRITE_ENDED, write_ended, uint8_t) \ + V(DESTROYED, destroyed, uint8_t) \ + V(PAUSED, paused, uint8_t) \ + V(RESET, reset, uint8_t) \ + V(HAS_READER, has_reader, uint8_t) \ + /* Set when the stream has a block event handler */ \ + V(WANTS_BLOCK, wants_block, uint8_t) \ + /* Set when the stream has a headers event handler */ \ + V(WANTS_HEADERS, wants_headers, uint8_t) \ + /* Set when the stream has a reset event handler */ \ + V(WANTS_RESET, wants_reset, uint8_t) \ + /* Set when the stream has a trailers event handler */ \ + V(WANTS_TRAILERS, wants_trailers, uint8_t) + +#define STREAM_STATS(V) \ + V(CREATED_AT, created_at) \ + V(RECEIVED_AT, received_at) \ + V(ACKED_AT, acked_at) \ + V(CLOSING_AT, closing_at) \ + V(DESTROYED_AT, destroyed_at) \ + V(BYTES_RECEIVED, bytes_received) \ + V(BYTES_SENT, bytes_sent) \ + V(MAX_OFFSET, max_offset) \ + V(MAX_OFFSET_ACK, max_offset_ack) \ + V(MAX_OFFSET_RECV, max_offset_received) \ + V(FINAL_SIZE, final_size) + +#define STREAM_JS_METHODS(V) \ + V(AttachSource, attachSource, false) \ + V(Destroy, destroy, false) \ + V(SendHeaders, sendHeaders, false) \ + V(StopSending, stopSending, false) \ + V(ResetStream, resetStream, false) \ + V(SetPriority, setPriority, false) \ + V(GetPriority, getPriority, true) \ + V(GetReader, getReader, false) + +struct Stream::State { +#define V(_, name, type) type name; + STREAM_STATE(V) +#undef V +}; + +STAT_STRUCT(Stream, STREAM) + +// ============================================================================ + +namespace { +Maybe> GetDataQueueFromSource(Environment* env, + Local value) { + DCHECK_IMPLIES(!value->IsUndefined(), value->IsObject()); + if (value->IsUndefined()) { + return Just(std::shared_ptr()); + } else if (value->IsArrayBuffer()) { + auto buffer = value.As(); + std::vector> entries(1); + entries.push_back(DataQueue::CreateInMemoryEntryFromBackingStore( + buffer->GetBackingStore(), 0, buffer->ByteLength())); + return Just(DataQueue::CreateIdempotent(std::move(entries))); + } else if (value->IsSharedArrayBuffer()) { + auto buffer = value.As(); + std::vector> entries(1); + entries.push_back(DataQueue::CreateInMemoryEntryFromBackingStore( + buffer->GetBackingStore(), 0, buffer->ByteLength())); + return Just(DataQueue::CreateIdempotent(std::move(entries))); + } else if (value->IsArrayBufferView()) { + std::vector> entries(1); + entries.push_back( + DataQueue::CreateInMemoryEntryFromView(value.As())); + return Just(DataQueue::CreateIdempotent(std::move(entries))); + } else if (Blob::HasInstance(env, value)) { + Blob* blob; + ASSIGN_OR_RETURN_UNWRAP( + &blob, value, Nothing>()); + return Just(blob->getDataQueue().slice(0)); + } + // TODO(jasnell): Add streaming sources... + THROW_ERR_INVALID_ARG_TYPE(env, "Invalid data source type"); + return Nothing>(); +} +} // namespace + +struct Stream::Impl { + static void AttachSource(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + + std::shared_ptr dataqueue; + if (GetDataQueueFromSource(env, args[0]).To(&dataqueue)) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + stream->set_outbound(std::move(dataqueue)); + } + } + + static void Destroy(const FunctionCallbackInfo& args) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + if (args.Length() > 1) { + CHECK(args[0]->IsBigInt()); + bool unused = false; + stream->Destroy(QuicError::ForApplication( + args[0].As()->Uint64Value(&unused))); + } else { + stream->Destroy(); + } + } + + static void SendHeaders(const FunctionCallbackInfo& args) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + CHECK(args[0]->IsUint32()); // Kind + CHECK(args[1]->IsArray()); // Headers + CHECK(args[2]->IsUint32()); // Flags + + HeadersKind kind = static_cast(args[0].As()->Value()); + Local headers = args[1].As(); + HeadersFlags flags = + static_cast(args[2].As()->Value()); + + if (stream->is_destroyed()) return args.GetReturnValue().Set(false); + + args.GetReturnValue().Set(stream->session().application().SendHeaders( + *stream, kind, headers, flags)); + } + + // Tells the peer to stop sending data for this stream. This has the effect + // of shutting down the readable side of the stream for this peer. Any data + // that has already been received is still readable. + static void StopSending(const FunctionCallbackInfo& args) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + uint64_t code = NGTCP2_APP_NOERROR; + CHECK_IMPLIES(!args[0]->IsUndefined(), args[0]->IsBigInt()); + if (!args[0]->IsUndefined()) { + bool lossless = false; // not used but still necessary. + code = args[0].As()->Uint64Value(&lossless); + } + + if (stream->is_destroyed()) return; + stream->EndReadable(); + Session::SendPendingDataScope send_scope(&stream->session()); + ngtcp2_conn_shutdown_stream_read(stream->session(), stream->id(), code); + } + + // Sends a reset stream to the peer to tell it we will not be sending any + // more data for this stream. This has the effect of shutting down the + // writable side of the stream for this peer. Any data that is held in the + // outbound queue will be dropped. The stream may still be readable. + static void ResetStream(const FunctionCallbackInfo& args) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + uint64_t code = NGTCP2_APP_NOERROR; + CHECK_IMPLIES(!args[0]->IsUndefined(), args[0]->IsBigInt()); + if (!args[0]->IsUndefined()) { + bool lossless = false; // not used but still necessary. + code = args[0].As()->Uint64Value(&lossless); + } + + if (stream->is_destroyed() || stream->state_->reset == 1) return; + stream->EndWritable(); + // We can release our outbound here now. Since the stream is being reset + // on the ngtcp2 side, we do not need to keep any of the data around + // waiting for acknowledgement that will never come. + stream->outbound_.reset(); + stream->state_->reset = 1; + Session::SendPendingDataScope send_scope(&stream->session()); + ngtcp2_conn_shutdown_stream_write(stream->session(), stream->id(), code); + } + + static void SetPriority(const FunctionCallbackInfo& args) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + CHECK(args[0]->IsUint32()); // Priority + CHECK(args[1]->IsUint32()); // Priority flag + + StreamPriority priority = + static_cast(args[0].As()->Value()); + StreamPriorityFlags flags = + static_cast(args[1].As()->Value()); + + stream->session().application().SetStreamPriority(*stream, priority, flags); + } + + static void GetPriority(const FunctionCallbackInfo& args) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + auto priority = stream->session().application().GetStreamPriority(*stream); + args.GetReturnValue().Set(static_cast(priority)); + } + + static void GetReader(const FunctionCallbackInfo& args) { + Stream* stream; + ASSIGN_OR_RETURN_UNWRAP(&stream, args.Holder()); + BaseObjectPtr reader = stream->get_reader(); + if (reader) return args.GetReturnValue().Set(reader->object()); + THROW_ERR_INVALID_STATE(Environment::GetCurrent(args), + "Unable to get a reader for the stream"); + } +}; + +// ============================================================================ + +class Stream::Outbound final : public MemoryRetainer { + public: + Outbound(Stream* stream, std::shared_ptr queue) + : stream_(stream), + queue_(std::move(queue)), + reader_(queue_->get_reader()) {} + + void Acknowledge(size_t amount) { + size_t remaining = std::min(amount, total_ - uncommitted_); + while (remaining > 0 && head_ != nullptr) { + DCHECK_LE(head_->ack_offset, head_->offset); + // The amount to acknowledge in this chunk is the lesser of the total + // amount remaining to acknowledge or the total remaining unacknowledged + // bytes in the chunk. + size_t amount_to_ack = + std::min(remaining, head_->offset - head_->ack_offset); + // If the amount to ack is zero here, it means our ack offset has caught + // up to our commit offset, which means there's nothing left to + // acknowledge yet. We could treat this as an error but let's just stop + // here. + if (amount_to_ack == 0) break; + + // Adjust our remaining down and our ack_offset up... + remaining -= amount_to_ack; + head_->ack_offset += amount_to_ack; + + // If we've fully acknowledged this chunk, free it and decrement total. + if (head_->ack_offset == head_->buf.len) { + DCHECK_GE(total_, head_->buf.len); + total_ -= head_->buf.len; + // if tail_ == head_ here, it means we've fully acknowledged our current + // buffer. Set tail to nullptr since we're freeing it here. + if (head_.get() == tail_) { + // In this case, commit_head_ should have already been set to nullptr. + // Because we should only have hit this case if the entire buffer + // had been committed. + DCHECK(commit_head_ == nullptr); + tail_ = nullptr; + } + head_ = std::move(head_->next); + DCHECK_IMPLIES(head_ == nullptr, tail_ == nullptr); + } + } + } + + void Commit(size_t amount) { + // Commit amount number of bytes from the current uncommitted + // byte queue. Importantly, this does not remove the bytes + // from the byte queue. + size_t remaining = std::min(uncommitted_, amount); + // There's nothing to commit. + while (remaining > 0 && commit_head_ != nullptr) { + // The amount to commit is the lesser of the total amount remaining to + // commit and the remaining uncommitted bytes in this chunk. + size_t amount_to_commit = std::min( + remaining, + static_cast(commit_head_->buf.len - commit_head_->offset)); + + // The amount to commit here should never be zero because that means we + // should have already advanced the commit head. + DCHECK_NE(amount_to_commit, 0); + uncommitted_ -= amount_to_commit; + remaining -= amount_to_commit; + commit_head_->offset += amount_to_commit; + if (commit_head_->offset == commit_head_->buf.len) { + count_--; + commit_head_ = commit_head_->next.get(); + } + } + } + + void Cap() { + // Calling cap without a value halts the ability to add any + // new data to the queue if it is not idempotent. If it is + // idempotent, it's a non-op. + queue_->cap(); + } + + int Pull(bob::Next next, + int options, + ngtcp2_vec* data, + size_t count, + size_t max_count_hint) { + if (next_pending_) { + std::move(next)(bob::Status::STATUS_BLOCK, nullptr, 0, [](int) {}); + return bob::Status::STATUS_BLOCK; + } + + if (errored_) { + std::move(next)(UV_EBADF, nullptr, 0, [](int) {}); + return UV_EBADF; + } + + // If eos_ is true and there are no uncommitted bytes we'll return eos, + // otherwise, return whatever is in the uncommitted queue. + if (eos_) { + if (uncommitted_ > 0) { + PullUncommitted(std::move(next)); + return bob::Status::STATUS_CONTINUE; + } + std::move(next)(bob::Status::STATUS_EOS, nullptr, 0, [](int) {}); + return bob::Status::STATUS_EOS; + } + + // If there are uncommitted bytes in the queue_, and there are enough to + // fill a full data packet, then pull will just return the current + // uncommitted bytes currently in the queue rather than reading more from + // the queue. + if (uncommitted_ >= kDefaultMaxPacketLength) { + PullUncommitted(std::move(next)); + return bob::Status::STATUS_CONTINUE; + } + + DCHECK(queue_); + DCHECK(reader_); + + // At this point, we know our reader hasn't finished yet, there might be + // uncommitted bytes but we want to go ahead and pull some more. We request + // that the pull is sync but allow for it to be async. + int ret = reader_->Pull( + [this](auto status, auto vecs, auto count, auto done) { + // Always make sure next_pending_ is false when we're done. + auto on_exit = OnScopeLeave([this] { next_pending_ = false; }); + + // The status should never be wait here. + DCHECK_NE(status, bob::Status::STATUS_WAIT); + + if (status < 0) { + // If next_pending_ is true then a pull from the reader ended up + // being asynchronous, our stream is blocking waiting for the data, + // but we have an error! oh no! We need to error the stream. + if (next_pending_) { + stream_->Destroy( + QuicError::ForNgtcp2Error(NGTCP2_INTERNAL_ERROR)); + // We do not need to worry about calling MarkErrored in this case + // since we are immediately destroying the stream which will + // release the outbound buffer anyway. + } + return; + } + + if (status == bob::Status::STATUS_EOS) { + DCHECK_EQ(count, 0); + DCHECK_NULL(vecs); + MarkEnded(); + // If next_pending_ is true then a pull from the reader ended up + // being asynchronous, our stream is blocking waiting for the data. + // Here, there is no more data to read, but we will might have data + // in the uncommitted queue. We'll resume the stream so that the + // session will try to read from it again. + if (next_pending_ && !stream_->is_destroyed()) { + stream_->session().ResumeStream(stream_->id()); + } + return; + } + + if (status == bob::Status::STATUS_BLOCK) { + DCHECK_EQ(count, 0); + DCHECK_NULL(vecs); + // If next_pending_ is true then a pull from the reader ended up + // being asynchronous, our stream is blocking waiting for the data. + // Here, we're still blocking! so there's nothing left for us to do! + return; + } + + DCHECK_EQ(status, bob::Status::STATUS_CONTINUE); + // If the read returns bytes, those will be added to the uncommitted + // bytes in the queue. + Append(vecs, count, std::move(done)); + + // If next_pending_ is true, then a pull from the reader ended up + // being asynchronous, our stream is blocking waiting for the data. + // Now that we have data, let's resume the stream so the session will + // pull from it again. + if (next_pending_ && !stream_->is_destroyed()) { + stream_->session().ResumeStream(stream_->id()); + } + }, + bob::OPTIONS_SYNC, + nullptr, + 0, + kMaxVectorCount); + + // There was an error. We'll report that immediately. We do not have + // to destroy the stream here since that will be taken care of by + // the caller. + if (ret < 0) { + MarkErrored(); + std::move(next)(ret, nullptr, 0, [](int) {}); + // Since we are erroring and won't be able to make use of this DataQueue + // any longer, let's free both it and the reader and put ourselves into + // an errored state. Further attempts to read from the outbound will + // result in a UV_EBADF error. The caller, however, should handle this by + // closing down the stream so that doesn't happen. + return ret; + } + + if (ret == bob::Status::STATUS_EOS) { + // Here, we know we are done with the DataQueue and the Reader, but we + // might not yet have committed or acknowledged all of the queued data. + // We'll release our references to the queue_ and reader_ but everything + // else is untouched. + MarkEnded(); + if (uncommitted_ > 0) { + // If the read returns eos, and there are uncommitted bytes in the + // queue, we'll set eos_ to true and return the current set of + // uncommitted bytes. + PullUncommitted(std::move(next)); + return bob::STATUS_CONTINUE; + } + // If the read returns eos, and there are no uncommitted bytes in the + // queue, we'll return eos with no data. + std::move(next)(bob::Status::STATUS_EOS, nullptr, 0, [](int) {}); + return bob::Status::STATUS_EOS; + } + + if (ret == bob::Status::STATUS_BLOCK) { + // If the read returns blocked, and there are uncommitted bytes in the + // queue, we'll return the current set of uncommitted bytes. + if (uncommitted_ > 0) { + PullUncommitted(std::move(next)); + return bob::Status::STATUS_CONTINUE; + } + // If the read returns blocked, and there are no uncommitted bytes in the + // queue, we'll return blocked. + std::move(next)(bob::Status::STATUS_BLOCK, nullptr, 0, [](int) {}); + return bob::Status::STATUS_BLOCK; + } + + // Reads here are generally expected to be synchronous. If we have a reader + // that insists on providing data asynchronously, then we'll have to block + // until the data is actually available. + if (ret == bob::Status::STATUS_WAIT) { + next_pending_ = true; + std::move(next)(bob::Status::STATUS_BLOCK, nullptr, 0, [](int) {}); + return bob::Status::STATUS_BLOCK; + } + + DCHECK_EQ(ret, bob::Status::STATUS_CONTINUE); + PullUncommitted(std::move(next)); + return bob::Status::STATUS_CONTINUE; + } + + void MemoryInfo(MemoryTracker* tracker) const override { + tracker->TrackField("queue", queue_); + tracker->TrackField("reader", reader_); + tracker->TrackFieldWithSize("buffer", total_); + } + + SET_MEMORY_INFO_NAME(Stream::Outbound) + SET_SELF_SIZE(Outbound) + + private: + struct OnComplete { + bob::Done done; + explicit OnComplete(bob::Done done) : done(std::move(done)) {} + ~OnComplete() { std::move(done)(0); } + }; + + void PullUncommitted(bob::Next next) { + MaybeStackBuffer chunks; + chunks.AllocateSufficientStorage(count_); + auto head = commit_head_; + size_t n = 0; + while (head != nullptr && n < count_) { + // There might only be one byte here but there should never be zero. + DCHECK_LT(head->offset, head->buf.len); + chunks[n].base = head->buf.base + head->offset; + chunks[n].len = head->buf.len - head->offset; + head = head->next.get(); + n++; + } + std::move(next)(bob::Status::STATUS_CONTINUE, chunks.out(), n, [](int) {}); + } + + void MarkErrored() { + errored_ = true; + head_.reset(); + tail_ = nullptr; + commit_head_ = nullptr; + total_ = 0; + count_ = 0; + uncommitted_ = 0; + MarkEnded(); + } + + void MarkEnded() { + eos_ = true; + queue_.reset(); + reader_.reset(); + } + + void Append(const DataQueue::Vec* vectors, size_t count, bob::Done done) { + if (count == 0) return; + // The done callback should only be invoked after we're done with + // all of the vectors passed in this call. To ensure of that, we + // wrap it with a shared pointer that calls done when the final + // instance is dropped. + auto on_complete = std::make_shared(std::move(done)); + for (size_t n = 0; n < count; n++) { + if (vectors[n].len == 0 || vectors[n].base == nullptr) continue; + auto entry = std::make_unique(vectors[n], on_complete); + if (tail_ == nullptr) { + head_ = std::move(entry); + tail_ = head_.get(); + commit_head_ = head_.get(); + } else { + DCHECK_NULL(tail_->next); + tail_->next = std::move(entry); + tail_ = tail_->next.get(); + if (commit_head_ == nullptr) commit_head_ = tail_; + } + count_++; + total_ += vectors[n].len; + uncommitted_ += vectors[n].len; + } + } + + Stream* stream_; + std::shared_ptr queue_; + std::shared_ptr reader_; + + bool errored_ = false; + + // Will be set to true if the reader_ ends up providing a pull result + // asynchronously. + bool next_pending_ = false; + + // Will be set to true once reader_ has returned eos. + bool eos_ = false; + + // The collection of buffers that we have pulled from reader_ and that we + // are holding onto until they are acknowledged. + struct Entry { + size_t offset = 0; + size_t ack_offset = 0; + DataQueue::Vec buf; + std::shared_ptr on_complete; + std::unique_ptr next; + Entry(DataQueue::Vec buf, std::shared_ptr on_complete) + : buf(buf), on_complete(std::move(on_complete)) {} + }; + + std::unique_ptr head_ = nullptr; + Entry* commit_head_ = nullptr; + Entry* tail_ = nullptr; + + // The total number of uncommitted chunks. + size_t count_ = 0; + + // The total number of bytes currently held in the buffer. + size_t total_ = 0; + + // The current byte offset of buffer_ that has been confirmed to have been + // sent. Any offset lower than this represents bytes that we are currently + // waiting to be acknowledged. When we receive acknowledgement, we will + // automatically free held bytes from the buffer. + size_t uncommitted_ = 0; +}; + +// ============================================================================ + +bool Stream::HasInstance(Environment* env, Local value) { + return GetConstructorTemplate(env)->HasInstance(value); +} + +Local Stream::GetConstructorTemplate(Environment* env) { + auto& state = BindingData::Get(env); + auto tmpl = state.stream_constructor_template(); + if (tmpl.IsEmpty()) { + auto isolate = env->isolate(); + tmpl = NewFunctionTemplate(isolate, IllegalConstructor); + tmpl->SetClassName(state.stream_string()); + tmpl->Inherit(AsyncWrap::GetConstructorTemplate(env)); + tmpl->InstanceTemplate()->SetInternalFieldCount( + Stream::kInternalFieldCount); +#define V(name, key, no_side_effect) \ + if (no_side_effect) { \ + SetProtoMethodNoSideEffect(isolate, tmpl, #key, Impl::name); \ + } else { \ + SetProtoMethod(isolate, tmpl, #key, Impl::name); \ + } + + STREAM_JS_METHODS(V) + +#undef V + state.set_stream_constructor_template(tmpl); + } + return tmpl; +} + +void Stream::RegisterExternalReferences(ExternalReferenceRegistry* registry) { +#define V(name, _, __) registry->Register(Impl::name); + STREAM_JS_METHODS(V) +#undef V +} + +void Stream::Initialize(Environment* env, Local target) { + USE(GetConstructorTemplate(env)); + +#define V(name, _) IDX_STATS_STREAM_##name, + enum StreamStatsIdx { STREAM_STATS(V) IDX_STATS_STREAM_COUNT }; +#undef V + +#define V(name, key, __) \ + auto IDX_STATE_STREAM_##name = offsetof(Stream::State, key); + STREAM_STATE(V) +#undef V + +#define V(name, _) NODE_DEFINE_CONSTANT(target, IDX_STATS_STREAM_##name); + STREAM_STATS(V) +#undef V +#define V(name, _, __) NODE_DEFINE_CONSTANT(target, IDX_STATE_STREAM_##name); + STREAM_STATE(V) +#undef V + + constexpr int QUIC_STREAM_HEADERS_KIND_HINTS = + static_cast(HeadersKind::HINTS); + constexpr int QUIC_STREAM_HEADERS_KIND_INITIAL = + static_cast(HeadersKind::INITIAL); + constexpr int QUIC_STREAM_HEADERS_KIND_TRAILING = + static_cast(HeadersKind::TRAILING); + + constexpr int QUIC_STREAM_HEADERS_FLAGS_NONE = + static_cast(HeadersFlags::NONE); + constexpr int QUIC_STREAM_HEADERS_FLAGS_TERMINAL = + static_cast(HeadersFlags::TERMINAL); + + NODE_DEFINE_CONSTANT(target, QUIC_STREAM_HEADERS_KIND_HINTS); + NODE_DEFINE_CONSTANT(target, QUIC_STREAM_HEADERS_KIND_INITIAL); + NODE_DEFINE_CONSTANT(target, QUIC_STREAM_HEADERS_KIND_TRAILING); + + NODE_DEFINE_CONSTANT(target, QUIC_STREAM_HEADERS_FLAGS_NONE); + NODE_DEFINE_CONSTANT(target, QUIC_STREAM_HEADERS_FLAGS_TERMINAL); } Stream* Stream::From(void* stream_user_data) { @@ -21,41 +682,369 @@ Stream* Stream::From(void* stream_user_data) { return static_cast(stream_user_data); } -BaseObjectPtr Stream::Create(Session* session, int64_t id) { - return BaseObjectPtr(); +BaseObjectPtr Stream::Create(Session* session, + int64_t id, + std::shared_ptr source) { + DCHECK_GE(id, 0); + DCHECK_NOT_NULL(session); + Local obj; + if (!GetConstructorTemplate(session->env()) + ->InstanceTemplate() + ->NewInstance(session->env()->context()) + .ToLocal(&obj)) { + return BaseObjectPtr(); + } + + return MakeDetachedBaseObject( + BaseObjectWeakPtr(session), obj, id, std::move(source)); +} + +Stream::Stream(BaseObjectWeakPtr session, + v8::Local object, + int64_t id, + std::shared_ptr source) + : AsyncWrap(session->env(), object, AsyncWrap::PROVIDER_QUIC_STREAM), + stats_(env()->isolate()), + state_(env()->isolate()), + session_(std::move(session)), + origin_(id & 0b01 ? Side::SERVER : Side::CLIENT), + direction_(id & 0b10 ? Direction::UNIDIRECTIONAL + : Direction::BIDIRECTIONAL), + inbound_(DataQueue::Create()) { + MakeWeak(); + state_->id = id; + + // Allows us to be notified when data is actually read from the + // inbound queue so that we can update the stream flow control. + inbound_->addBackpressureListener(this); + + const auto defineProperty = [&](auto name, auto value) { + object + ->DefineOwnProperty( + env()->context(), name, value, PropertyAttribute::ReadOnly) + .Check(); + }; + + defineProperty(env()->state_string(), state_.GetArrayBuffer()); + defineProperty(env()->stats_string(), stats_.GetArrayBuffer()); + + set_outbound(std::move(source)); + + auto params = ngtcp2_conn_get_local_transport_params(this->session()); + STAT_SET(Stats, max_offset, params->initial_max_data); +} + +Stream::~Stream() { + // Make sure that Destroy() was called before Stream is destructed. + DCHECK(is_destroyed()); } int64_t Stream::id() const { - return 0; + return state_->id; } + Side Stream::origin() const { - return Side::CLIENT; + return origin_; } + Direction Stream::direction() const { - return Direction::BIDIRECTIONAL; + return direction_; +} + +Session& Stream::session() const { + return *session_; } bool Stream::is_destroyed() const { - return false; + return state_->destroyed; } + bool Stream::is_eos() const { - return false; + return state_->fin_sent; +} + +bool Stream::is_writable() const { + if (direction() == Direction::UNIDIRECTIONAL) { + switch (origin()) { + case Side::CLIENT: { + if (session_->is_server()) return false; + break; + } + case Side::SERVER: { + if (!session_->is_server()) return false; + break; + } + } + } + return state_->write_ended == 0; +} + +bool Stream::is_readable() const { + if (direction() == Direction::UNIDIRECTIONAL) { + switch (origin()) { + case Side::CLIENT: { + if (!session_->is_server()) return false; + break; + } + case Side::SERVER: { + if (session_->is_server()) return false; + break; + } + } + } + return state_->read_ended == 0; +} + +BaseObjectPtr Stream::get_reader() { + if (!is_readable() || state_->has_reader) + return BaseObjectPtr(); + state_->has_reader = 1; + return Blob::Reader::Create(env(), Blob::Create(env(), inbound_)); +} + +void Stream::set_final_size(uint64_t final_size) { + DCHECK_IMPLIES(state_->fin_received == 1, + final_size <= STAT_GET(Stats, final_size)); + state_->fin_received = 1; + STAT_SET(Stats, final_size, final_size); +} + +void Stream::set_outbound(std::shared_ptr source) { + if (!source || is_destroyed() || !is_writable()) return; + DCHECK_NULL(outbound_); + outbound_ = std::make_unique(this, std::move(source)); + session_->ResumeStream(id()); +} + +void Stream::EntryRead(size_t amount) { + // Tells us that amount bytes were read from inbound_ + // We use this as a signal to extend the flow control + // window to receive more bytes. + if (!is_destroyed() && session_) session_->ExtendStreamOffset(id(), amount); +} + +int Stream::DoPull(bob::Next next, + int options, + ngtcp2_vec* data, + size_t count, + size_t max_count_hint) { + if (is_destroyed() || is_eos()) { + std::move(next)(bob::Status::STATUS_EOS, nullptr, 0, [](int) {}); + return bob::Status::STATUS_EOS; + } + + // If an outbound source has not yet been attached, block until one is + // available. When AttachOutboundSource() is called the stream will be + // resumed. Note that when we say "block" here we don't mean it in the + // traditional "block the thread" sense. Instead, this will inform the + // Session to not try to send any more data from this stream until there + // is a source attached. + if (outbound_ == nullptr) { + std::move(next)(bob::Status::STATUS_BLOCK, nullptr, 0, [](size_t len) {}); + return bob::Status::STATUS_BLOCK; + } + + return outbound_->Pull(std::move(next), options, data, count, max_count_hint); +} + +void Stream::BeginHeaders(HeadersKind kind) { + if (is_destroyed()) return; + headers_length_ = 0; + headers_.clear(); + headers_kind_ = kind; +} + +bool Stream::AddHeader(const Header& header) { + size_t len = header.length(); + if (is_destroyed() || !session_->application().CanAddHeader( + headers_.size(), headers_length_, len)) { + return false; + } + + headers_length_ += len; + + auto& state = BindingData::Get(env()); + + const auto push = [&](auto raw) { + Local value; + if (UNLIKELY(!raw.ToLocal(&value))) return false; + headers_.push_back(value); + return true; + }; + + return push(header.GetName(&state)) && push(header.GetValue(&state)); +} + +void Stream::Acknowledge(size_t datalen) { + if (is_destroyed() || outbound_ == nullptr) return; + + // ngtcp2 guarantees that offset must always be greater than the previously + // received offset. + DCHECK_GE(datalen, STAT_GET(Stats, max_offset_ack)); + STAT_SET(Stats, max_offset_ack, datalen); + + // // Consumes the given number of bytes in the buffer. + outbound_->Acknowledge(datalen); +} + +void Stream::Commit(size_t datalen) { + if (!is_destroyed() && outbound_) outbound_->Commit(datalen); } -void Stream::Acknowledge(size_t datalen) {} -void Stream::Blocked() {} -void Stream::Commit(size_t datalen) {} -void Stream::End() {} -void Stream::Destroy(QuicError error) {} +void Stream::EndWritable() { + if (is_destroyed() || !is_writable()) return; + // If an outbound_ has been attached, we want to mark it as being ended. + // If the outbound_ is wrapping an idempotent DataQueue, then capping + // will be a non-op since we're not going to be writing any more data + // into it anyway. + if (outbound_ != nullptr) outbound_->Cap(); + state_->write_ended = 1; +} + +void Stream::EndReadable(std::optional maybe_final_size) { + if (is_destroyed() || !is_readable()) return; + state_->read_ended = 1; + set_final_size(maybe_final_size.value_or(STAT_GET(Stats, bytes_received))); + inbound_->cap(STAT_GET(Stats, final_size)); +} + +void Stream::Destroy(QuicError error) { + if (is_destroyed()) return; + + // End the writable before marking as destroyed. + EndWritable(); + + // Also end the readable side if it isn't already. + EndReadable(); + + state_->destroyed = 1; + + EmitClose(error); + + // We are going to release our reference to the outbound_ queue here. + outbound_.reset(); + + // We reset the inbound here also. However, it's important to note that + // the JavaScript side could still have a reader on the inbound DataQueue, + // which may keep that data alive a bit longer. + inbound_->removeBackpressureListener(this); + inbound_.reset(); + + // Finally, remove the stream from the session and clear our reference + // to the session. + session_->RemoveStream(id()); +} void Stream::ReceiveData(const uint8_t* data, size_t len, - ReceiveDataFlags flags) {} -void Stream::ReceiveStopSending(QuicError error) {} -void Stream::ReceiveStreamReset(uint64_t final_size, QuicError error) {} + ReceiveDataFlags flags) { + if (is_destroyed()) return; + + // If reading has ended, or there is no data, there's nothing to do but maybe + // end the readable side if this is the last bit of data we've received. + if (state_->read_ended == 1 || len == 0) { + if (flags.fin) EndReadable(); + return; + } + + STAT_INCREMENT_N(Stats, bytes_received, len); + auto backing = ArrayBuffer::NewBackingStore(env()->isolate(), len); + memcpy(backing->Data(), data, len); + inbound_->append(DataQueue::CreateInMemoryEntryFromBackingStore( + std::move(backing), 0, len)); + if (flags.fin) EndReadable(); +} + +void Stream::ReceiveStopSending(QuicError error) { + // Note that this comes from *this* endpoint, not the other side. We handle it + // if we haven't already shutdown our *receiving* side of the stream. + if (is_destroyed() || state_->read_ended) return; + ngtcp2_conn_shutdown_stream_read(session(), id(), error.code()); + EndReadable(); +} + +void Stream::ReceiveStreamReset(uint64_t final_size, QuicError error) { + // Importantly, reset stream only impacts the inbound data flow. It has no + // impact on the outbound data flow. It is essentially a signal that the peer + // has abruptly terminated the writable end of their stream with an error. + // Any data we have received up to this point remains in the queue waiting to + // be read. + EndReadable(final_size); + EmitReset(error); +} + +// ============================================================================ + +void Stream::EmitBlocked() { + // state_->wants_block will be set from the javascript side if the + // stream object has a handler for the blocked event. + if (is_destroyed() || !env()->can_call_into_js() || + state_->wants_block == 0) { + return; + } + CallbackScope cb_scope(this); + MakeCallback(BindingData::Get(env()).stream_blocked_callback(), 0, nullptr); +} + +void Stream::EmitClose(const QuicError& error) { + if (is_destroyed() || !env()->can_call_into_js()) return; + CallbackScope cb_scope(this); + Local err; + if (!error.ToV8Value(env()).ToLocal(&err)) return; -void Stream::Schedule(Stream::Queue* queue) {} -void Stream::Unschedule() {} + MakeCallback(BindingData::Get(env()).stream_close_callback(), 1, &err); +} + +void Stream::EmitHeaders() { + if (is_destroyed() || !env()->can_call_into_js() || + state_->wants_headers == 0) { + return; + } + CallbackScope cb_scope(this); + + Local argv[] = { + Array::New(env()->isolate(), headers_.data(), headers_.size()), + Integer::NewFromUnsigned(env()->isolate(), + static_cast(headers_kind_))}; + + headers_.clear(); + + MakeCallback( + BindingData::Get(env()).stream_headers_callback(), arraysize(argv), argv); +} + +void Stream::EmitReset(const QuicError& error) { + if (is_destroyed() || !env()->can_call_into_js() || + state_->wants_reset == 0) { + return; + } + CallbackScope cb_scope(this); + Local err; + if (!error.ToV8Value(env()).ToLocal(&err)) return; + + MakeCallback(BindingData::Get(env()).stream_reset_callback(), 1, &err); +} + +void Stream::EmitWantTrailers() { + if (is_destroyed() || !env()->can_call_into_js() || + state_->wants_trailers == 0) { + return; + } + CallbackScope cb_scope(this); + MakeCallback(BindingData::Get(env()).stream_trailers_callback(), 0, nullptr); +} + +// ============================================================================ + +void Stream::Schedule(Stream::Queue* queue) { + // If this stream is not already in the queue to send data, add it. + if (!is_destroyed() && outbound_ && stream_queue_.IsEmpty()) + queue->PushBack(this); +} + +void Stream::Unschedule() { + stream_queue_.Remove(); +} } // namespace quic } // namespace node diff --git a/src/quic/streams.h b/src/quic/streams.h index a97efa9acba6f7..fe53d2d9a0e50b 100644 --- a/src/quic/streams.h +++ b/src/quic/streams.h @@ -1,12 +1,18 @@ #pragma once +#include #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC +#include #include #include +#include #include +#include +#include #include +#include #include "bindingdata.h" #include "data.h" @@ -17,27 +23,122 @@ class Session; using Ngtcp2Source = bob::SourceImpl; -// TODO(@jasnell): This is currently a placeholder for the actual definition. -class Stream : public AsyncWrap, public Ngtcp2Source { +// QUIC Stream's are simple data flows that may be: +// +// * Bidirectional (both sides can send) or Unidirectional (one side can send) +// * Server or Client Initiated +// +// The flow direction and origin of the stream are important in determining the +// write and read state (Open or Closed). Specifically: +// +// Bidirectional Stream States: +// +--------+--------------+----------+----------+ +// | ON | Initiated By | Readable | Writable | +// +--------+--------------+----------+----------+ +// | Server | Server | Y | Y | +// +--------+--------------+----------+----------+ +// | Server | Client | Y | Y | +// +--------+--------------+----------+----------+ +// | Client | Server | Y | Y | +// +--------+--------------+----------+----------+ +// | Client | Client | Y | Y | +// +--------+--------------+----------+----------+ +// +// Unidirectional Stream States +// +--------+--------------+----------+----------+ +// | ON | Initiated By | Readable | Writable | +// +--------+--------------+----------+----------+ +// | Server | Server | N | Y | +// +--------+--------------+----------+----------+ +// | Server | Client | Y | N | +// +--------+--------------+----------+----------+ +// | Client | Server | Y | N | +// +--------+--------------+----------+----------+ +// | Client | Client | N | Y | +// +--------+--------------+----------+----------+ +// +// All data sent via the Stream is buffered internally until either receipt is +// acknowledged from the peer or attempts to send are abandoned. The fact that +// data is buffered in memory makes it essential that the flow control for the +// session and the stream are properly handled. For now, we are largely relying +// on ngtcp2's default flow control mechanisms which generally should be doing +// the right thing. +// +// A Stream may be in a fully closed state (No longer readable nor writable) +// state but still have unacknowledged data in it's inbound and outbound +// queues. +// +// A Stream is gracefully closed when (a) both read and write states are closed, +// (b) all queued data has been acknowledged. +// +// The Stream may be forcefully closed immediately using destroy(err). This +// causes all queued outbound data and pending JavaScript writes are abandoned, +// and causes the Stream to be immediately closed at the ngtcp2 level without +// waiting for any outstanding acknowledgements. Keep in mind, however, that the +// peer is not notified that the stream is destroyed and may attempt to continue +// sending data and acknowledgements. +// +// QUIC streams in general do not have headers. Some QUIC applications, however, +// may associate headers with the stream (HTTP/3 for instance). +class Stream : public AsyncWrap, + public Ngtcp2Source, + public DataQueue::BackpressureListener { public: - static Stream* From(void* stream_user_data); + using Header = NgHeaderBase; - static BaseObjectPtr Create(Session* session, int64_t id); + static Stream* From(void* stream_user_data); - Stream(BaseObjectPtr session, v8::Local obj); + static bool HasInstance(Environment* env, v8::Local value); + static v8::Local GetConstructorTemplate( + Environment* env); + static void Initialize(Environment* env, v8::Local target); + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); + + static BaseObjectPtr Create( + Session* session, + int64_t id, + std::shared_ptr source = nullptr); + + // The constructor is only public to be visible by MakeDetachedBaseObject. + // Call Create to create new instances of Stream. + Stream(BaseObjectWeakPtr session, + v8::Local obj, + int64_t id, + std::shared_ptr source); + ~Stream() override; int64_t id() const; Side origin() const; Direction direction() const; + Session& session() const; bool is_destroyed() const; + + // True if we've completely sent all outbound data for this stream. bool is_eos() const; + bool is_readable() const; + bool is_writable() const; + + // Called by the session/application to indicate that the specified number + // of bytes have been acknowledged by the peer. void Acknowledge(size_t datalen); - void Blocked(); void Commit(size_t datalen); - void End(); - void Destroy(QuicError error); + void EndWritable(); + void EndReadable(std::optional maybe_final_size = std::nullopt); + void EntryRead(size_t amount) override; + + // Pulls data from the internal outbound DataQueue configured for this stream. + int DoPull(bob::Next next, + int options, + ngtcp2_vec* data, + size_t count, + size_t max_count_hint) override; + + // Forcefully close the stream immediately. All queued data and pending + // writes are abandoned, and the stream is immediately closed at the ngtcp2 + // level without waiting for any outstanding acknowledgements. + void Destroy(QuicError error = QuicError()); struct ReceiveDataFlags final { // Identifies the final chunk of data that the peer will send for the @@ -53,11 +154,61 @@ class Stream : public AsyncWrap, public Ngtcp2Source { void ReceiveStopSending(QuicError error); void ReceiveStreamReset(uint64_t final_size, QuicError error); + void BeginHeaders(HeadersKind kind); + // Returns false if the header cannot be added. This will typically happen + // if the application does not support headers, a maximimum number of headers + // have already been added, or the maximum total header length is reached. + bool AddHeader(const Header& header); + SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(Stream) SET_SELF_SIZE(Stream) - ListNode stream_queue_; + struct State; + struct Stats; + + // Notifies the JavaScript side that sending data on the stream has been + // blocked because of flow control restriction. + void EmitBlocked(); + + private: + struct Impl; + class Outbound; + + // Gets a reader for the data received for this stream from the peer, + BaseObjectPtr get_reader(); + + void set_final_size(uint64_t amount); + void set_outbound(std::shared_ptr source); + + // JavaScript callouts + + // Notifies the JavaScript side that the stream has been destroyed. + void EmitClose(const QuicError& error); + + // Delivers the set of inbound headers that have been collected. + void EmitHeaders(); + + // Notifies the JavaScript side that the stream has been reset. + void EmitReset(const QuicError& error); + + // Notifies the JavaScript side that the application is ready to receive + // trailing headers. + void EmitWantTrailers(); + + AliasedStruct stats_; + AliasedStruct state_; + BaseObjectWeakPtr session_; + const Side origin_; + const Direction direction_; + std::unique_ptr outbound_; + std::shared_ptr inbound_; + + std::vector> headers_; + HeadersKind headers_kind_ = HeadersKind::INITIAL; + size_t headers_length_ = 0; + + friend struct Impl; public: // The Queue/Schedule/Unschedule here are part of the mechanism used to @@ -69,6 +220,7 @@ class Stream : public AsyncWrap, public Ngtcp2Source { // data to send (such as when it is initially created or is using an async // source that is still waiting for data to be pushed) it will not appear in // the queue. + ListNode stream_queue_; using Queue = ListHead; void Schedule(Queue* queue); From 7f95926f173c2b3785eae47c4f8fb0a2e2ae1dda Mon Sep 17 00:00:00 2001 From: Arsalan Ahmad Date: Mon, 11 Dec 2023 10:41:23 +0200 Subject: [PATCH 50/67] http: handle multi-value content-disposition header Headers in nodejs can be arrays and current workaround for content-disposition header do not take this into account. This change fixes that and makes sure array values are handled properly. PR-URL: https://github.com/nodejs/node/pull/50977 Reviewed-By: Paolo Insogna Reviewed-By: Marco Ippolito Reviewed-By: James M Snell Reviewed-By: Matteo Collina --- lib/_http_outgoing.js | 9 +++++++- .../test-http-server-non-utf8-header.js | 21 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 7303bd88aaa37a..5350c08d4ce75d 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -600,7 +600,14 @@ function processHeader(self, state, key, value, validate) { // https://www.rfc-editor.org/rfc/rfc6266#section-4.3 // Refs: https://github.com/nodejs/node/pull/46528 if (isContentDispositionField(key) && self._contentLength) { - value = Buffer.from(value, 'latin1'); + // The value could be an array here + if (ArrayIsArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = Buffer.from(value[i], 'latin1'); + } + } else { + value = Buffer.from(value, 'latin1'); + } } if (ArrayIsArray(value)) { diff --git a/test/parallel/test-http-server-non-utf8-header.js b/test/parallel/test-http-server-non-utf8-header.js index 331965ae38d0f8..8ce82ac4cada04 100644 --- a/test/parallel/test-http-server-non-utf8-header.js +++ b/test/parallel/test-http-server-non-utf8-header.js @@ -26,6 +26,27 @@ const nonUtf8ToLatin1 = Buffer.from(nonUtf8Header).toString('latin1'); })); } +{ + // Test multi-value header + const server = http.createServer(common.mustCall((req, res) => { + res.writeHead(200, [ + 'content-disposition', + [Buffer.from(nonUtf8Header).toString('binary')], + ]); + res.end('hello'); + })); + + server.listen(0, common.mustCall(() => { + http.get({ port: server.address().port }, (res) => { + assert.strictEqual(res.statusCode, 200); + assert.strictEqual(res.headers['content-disposition'], nonUtf8ToLatin1); + res.resume().on('end', common.mustCall(() => { + server.close(); + })); + }); + })); +} + { const server = http.createServer(common.mustCall((req, res) => { res.writeHead(200, [ From 9b7f79a8bdf2aa3f78e33dce03a58a436eb8f67c Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 4 Dec 2023 17:30:18 +0000 Subject: [PATCH 51/67] src: fix double free reported by coverity Fix double free reported by coverity. ToBufferEndian() in node_i18n.cc was the only caller of Buffer::New() passing in a MaybeStackBuffer. Coverity reported a double free because there were paths in which the src buffer would be deleted by both the destruction of the MaybeStackBuffer and by the Buffer which was done even in failure cases for Buffer::New(). Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/51046 Reviewed-By: James M Snell --- src/node_internals.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/node_internals.h b/src/node_internals.h index 5604f35aeff6b4..c9d6881cb8fbbf 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -192,16 +192,13 @@ static v8::MaybeLocal New(Environment* env, char* src = reinterpret_cast(buf->out()); const size_t len_in_bytes = buf->length() * sizeof(buf->out()[0]); - if (buf->IsAllocated()) + if (buf->IsAllocated()) { ret = New(env, src, len_in_bytes); - else if (!buf->IsInvalidated()) - ret = Copy(env, src, len_in_bytes); - - if (ret.IsEmpty()) - return ret; - - if (buf->IsAllocated()) + // new always takes ownership of src buf->Release(); + } else if (!buf->IsInvalidated()) { + ret = Copy(env, src, len_in_bytes); + } return ret; } From 35e8f26f077d8429273ad4ab0b4b282fbaa4e9ea Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 11 Dec 2023 19:34:47 -0500 Subject: [PATCH 52/67] fs: throw fchownSync error from c++ PR-URL: https://github.com/nodejs/node/pull/51075 Refs: https://github.com/nodejs/performance/issues/106 Reviewed-By: Stephen Belanger Reviewed-By: James M Snell --- lib/fs.js | 4 +--- src/node_file.cc | 12 +++++------- typings/internalBinding/fs.d.ts | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index 34ad6ef6be835b..e398687c04a2b0 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -2051,9 +2051,7 @@ function fchownSync(fd, uid, gid) { validateInteger(uid, 'uid', -1, kMaxUserId); validateInteger(gid, 'gid', -1, kMaxUserId); - const ctx = {}; - binding.fchown(fd, uid, gid, undefined, ctx); - handleErrorFromBinding(ctx); + binding.fchown(fd, uid, gid); } /** diff --git a/src/node_file.cc b/src/node_file.cc index 30fb7b46944b25..bddab3031c55e2 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -2590,17 +2590,15 @@ static void FChown(const FunctionCallbackInfo& args) { CHECK(IsSafeJsInt(args[2])); const uv_gid_t gid = static_cast(args[2].As()->Value()); - FSReqBase* req_wrap_async = GetReqWrap(args, 3); - if (req_wrap_async != nullptr) { // fchown(fd, uid, gid, req) + if (argc > 3) { // fchown(fd, uid, gid, req) + FSReqBase* req_wrap_async = GetReqWrap(args, 3); FS_ASYNC_TRACE_BEGIN0(UV_FS_FCHOWN, req_wrap_async) AsyncCall(env, req_wrap_async, args, "fchown", UTF8, AfterNoArgs, uv_fs_fchown, fd, uid, gid); - } else { // fchown(fd, uid, gid, undefined, ctx) - CHECK_EQ(argc, 5); - FSReqWrapSync req_wrap_sync; + } else { // fchown(fd, uid, gid) + FSReqWrapSync req_wrap_sync("fchown"); FS_SYNC_TRACE_BEGIN(fchown); - SyncCall(env, args[4], &req_wrap_sync, "fchown", - uv_fs_fchown, fd, uid, gid); + SyncCallAndThrowOnError(env, &req_wrap_sync, uv_fs_fchown, fd, uid, gid); FS_SYNC_TRACE_END(fchown); } } diff --git a/typings/internalBinding/fs.d.ts b/typings/internalBinding/fs.d.ts index 71707c0329020a..046eeeb230974b 100644 --- a/typings/internalBinding/fs.d.ts +++ b/typings/internalBinding/fs.d.ts @@ -81,7 +81,7 @@ declare namespace InternalFSBinding { function fchmod(fd: number, mode: number, usePromises: typeof kUsePromises): Promise; function fchown(fd: number, uid: number, gid: number, req: FSReqCallback): void; - function fchown(fd: number, uid: number, gid: number, req: undefined, ctx: FSSyncContext): void; + function fchown(fd: number, uid: number, gid: number): void; function fchown(fd: number, uid: number, gid: number, usePromises: typeof kUsePromises): Promise; function fdatasync(fd: number, req: FSReqCallback): void; From 328a41701c033bfe9ea50396141caff69be52a6b Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Tue, 12 Dec 2023 02:34:55 +0200 Subject: [PATCH 53/67] tools: update lint-md-dependencies to rollup@4.7.0 PR-URL: https://github.com/nodejs/node/pull/51106 Reviewed-By: Luigi Pinca Reviewed-By: Moshe Atlow --- tools/lint-md/package-lock.json | 118 ++++++++++++++++++-------------- tools/lint-md/package.json | 2 +- 2 files changed, 67 insertions(+), 53 deletions(-) diff --git a/tools/lint-md/package-lock.json b/tools/lint-md/package-lock.json index 0a17b1a9bcf40d..bb4b0fdf31b06c 100644 --- a/tools/lint-md/package-lock.json +++ b/tools/lint-md/package-lock.json @@ -18,7 +18,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", - "rollup": "^4.6.1", + "rollup": "^4.7.0", "rollup-plugin-cleanup": "^3.2.1" } }, @@ -101,9 +101,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.6.1.tgz", - "integrity": "sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.7.0.tgz", + "integrity": "sha512-rGku10pL1StFlFvXX5pEv88KdGW6DHUghsxyP/aRYb9eH+74jTGJ3U0S/rtlsQ4yYq1Hcc7AMkoJOb1xu29Fxw==", "cpu": [ "arm" ], @@ -114,9 +114,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.6.1.tgz", - "integrity": "sha512-1TKm25Rn20vr5aTGGZqo6E4mzPicCUD79k17EgTLAsXc1zysyi4xXKACfUbwyANEPAEIxkzwue6JZ+stYzWUTA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.7.0.tgz", + "integrity": "sha512-/EBw0cuJ/KVHiU2qyVYUhogXz7W2vXxBzeE9xtVIMC+RyitlY2vvaoysMUqASpkUtoNIHlnKTu/l7mXOPgnKOA==", "cpu": [ "arm64" ], @@ -127,9 +127,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.6.1.tgz", - "integrity": "sha512-cEXJQY/ZqMACb+nxzDeX9IPLAg7S94xouJJCNVE5BJM8JUEP4HeTF+ti3cmxWeSJo+5D+o8Tc0UAWUkfENdeyw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.7.0.tgz", + "integrity": "sha512-4VXG1bgvClJdbEYYjQ85RkOtwN8sqI3uCxH0HC5w9fKdqzRzgG39K7GAehATGS8jghA7zNoS5CjSKkDEqWmNZg==", "cpu": [ "arm64" ], @@ -140,9 +140,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.6.1.tgz", - "integrity": "sha512-LoSU9Xu56isrkV2jLldcKspJ7sSXmZWkAxg7sW/RfF7GS4F5/v4EiqKSMCFbZtDu2Nc1gxxFdQdKwkKS4rwxNg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.7.0.tgz", + "integrity": "sha512-/ImhO+T/RWJ96hUbxiCn2yWI0/MeQZV/aeukQQfhxiSXuZJfyqtdHPUPrc84jxCfXTxbJLmg4q+GBETeb61aNw==", "cpu": [ "x64" ], @@ -153,9 +153,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.6.1.tgz", - "integrity": "sha512-EfI3hzYAy5vFNDqpXsNxXcgRDcFHUWSx5nnRSCKwXuQlI5J9dD84g2Usw81n3FLBNsGCegKGwwTVsSKK9cooSQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.7.0.tgz", + "integrity": "sha512-zhye8POvTyUXlKbfPBVqoHy3t43gIgffY+7qBFqFxNqVtltQLtWeHNAbrMnXiLIfYmxcoL/feuLDote2tx+Qbg==", "cpu": [ "arm" ], @@ -166,9 +166,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.6.1.tgz", - "integrity": "sha512-9lhc4UZstsegbNLhH0Zu6TqvDfmhGzuCWtcTFXY10VjLLUe4Mr0Ye2L3rrtHaDd/J5+tFMEuo5LTCSCMXWfUKw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.7.0.tgz", + "integrity": "sha512-RAdr3OJnUum6Vs83cQmKjxdTg31zJnLLTkjhcFt0auxM6jw00GD6IPFF42uasYPr/wGC6TRm7FsQiJyk0qIEfg==", "cpu": [ "arm64" ], @@ -179,9 +179,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.6.1.tgz", - "integrity": "sha512-FfoOK1yP5ksX3wwZ4Zk1NgyGHZyuRhf99j64I5oEmirV8EFT7+OhUZEnP+x17lcP/QHJNWGsoJwrz4PJ9fBEXw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.7.0.tgz", + "integrity": "sha512-nhWwYsiJwZGq7SyR3afS3EekEOsEAlrNMpPC4ZDKn5ooYSEjDLe9W/xGvoIV8/F/+HNIY6jY8lIdXjjxfxopXw==", "cpu": [ "arm64" ], @@ -191,10 +191,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.7.0.tgz", + "integrity": "sha512-rlfy5RnQG1aop1BL/gjdH42M2geMUyVQqd52GJVirqYc787A/XVvl3kQ5NG/43KXgOgE9HXgCaEH05kzQ+hLoA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.6.1.tgz", - "integrity": "sha512-DNGZvZDO5YF7jN5fX8ZqmGLjZEXIJRdJEdTFMhiyXqyXubBa0WVLDWSNlQ5JR2PNgDbEV1VQowhVRUh+74D+RA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.7.0.tgz", + "integrity": "sha512-cCkoGlGWfBobdDtiiypxf79q6k3/iRVGu1HVLbD92gWV5WZbmuWJCgRM4x2N6i7ljGn1cGytPn9ZAfS8UwF6vg==", "cpu": [ "x64" ], @@ -205,9 +218,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.6.1.tgz", - "integrity": "sha512-RkJVNVRM+piYy87HrKmhbexCHg3A6Z6MU0W9GHnJwBQNBeyhCJG9KDce4SAMdicQnpURggSvtbGo9xAWOfSvIQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.7.0.tgz", + "integrity": "sha512-R2oBf2p/Arc1m+tWmiWbpHBjEcJnHVnv6bsypu4tcKdrYTpDfl1UT9qTyfkIL1iiii5D4WHxUHCg5X0pzqmxFg==", "cpu": [ "x64" ], @@ -218,9 +231,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.6.1.tgz", - "integrity": "sha512-v2FVT6xfnnmTe3W9bJXl6r5KwJglMK/iRlkKiIFfO6ysKs0rDgz7Cwwf3tjldxQUrHL9INT/1r4VA0n9L/F1vQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.7.0.tgz", + "integrity": "sha512-CPtgaQL1aaPc80m8SCVEoxFGHxKYIt3zQYC3AccL/SqqiWXblo3pgToHuBwR8eCP2Toa+X1WmTR/QKFMykws7g==", "cpu": [ "arm64" ], @@ -231,9 +244,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.6.1.tgz", - "integrity": "sha512-YEeOjxRyEjqcWphH9dyLbzgkF8wZSKAKUkldRY6dgNR5oKs2LZazqGB41cWJ4Iqqcy9/zqYgmzBkRoVz3Q9MLw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.7.0.tgz", + "integrity": "sha512-pmioUlttNh9GXF5x2CzNa7Z8kmRTyhEzzAC+2WOOapjewMbl+3tGuAnxbwc5JyG8Jsz2+hf/QD/n5VjimOZ63g==", "cpu": [ "ia32" ], @@ -244,9 +257,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.6.1.tgz", - "integrity": "sha512-0zfTlFAIhgz8V2G8STq8toAjsYYA6eci1hnXuyOTUFnymrtJwnS6uGKiv3v5UrPZkBlamLvrLV2iiaeqCKzb0A==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.7.0.tgz", + "integrity": "sha512-SeZzC2QhhdBQUm3U0c8+c/P6UlRyBcLL2Xp5KX7z46WXZxzR8RJSIWL9wSUeBTgxog5LTPJuPj0WOT9lvrtP7Q==", "cpu": [ "x64" ], @@ -5778,9 +5791,9 @@ } }, "node_modules/rollup": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.6.1.tgz", - "integrity": "sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.7.0.tgz", + "integrity": "sha512-7Kw0dUP4BWH78zaZCqF1rPyQ8D5DSU6URG45v1dqS/faNsx9WXyess00uTOZxKr7oR/4TOjO1CPudT8L1UsEgw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -5790,18 +5803,19 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.6.1", - "@rollup/rollup-android-arm64": "4.6.1", - "@rollup/rollup-darwin-arm64": "4.6.1", - "@rollup/rollup-darwin-x64": "4.6.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.6.1", - "@rollup/rollup-linux-arm64-gnu": "4.6.1", - "@rollup/rollup-linux-arm64-musl": "4.6.1", - "@rollup/rollup-linux-x64-gnu": "4.6.1", - "@rollup/rollup-linux-x64-musl": "4.6.1", - "@rollup/rollup-win32-arm64-msvc": "4.6.1", - "@rollup/rollup-win32-ia32-msvc": "4.6.1", - "@rollup/rollup-win32-x64-msvc": "4.6.1", + "@rollup/rollup-android-arm-eabi": "4.7.0", + "@rollup/rollup-android-arm64": "4.7.0", + "@rollup/rollup-darwin-arm64": "4.7.0", + "@rollup/rollup-darwin-x64": "4.7.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.7.0", + "@rollup/rollup-linux-arm64-gnu": "4.7.0", + "@rollup/rollup-linux-arm64-musl": "4.7.0", + "@rollup/rollup-linux-riscv64-gnu": "4.7.0", + "@rollup/rollup-linux-x64-gnu": "4.7.0", + "@rollup/rollup-linux-x64-musl": "4.7.0", + "@rollup/rollup-win32-arm64-msvc": "4.7.0", + "@rollup/rollup-win32-ia32-msvc": "4.7.0", + "@rollup/rollup-win32-x64-msvc": "4.7.0", "fsevents": "~2.3.2" } }, diff --git a/tools/lint-md/package.json b/tools/lint-md/package.json index 0292176c3ed45b..61d3d2790aa154 100644 --- a/tools/lint-md/package.json +++ b/tools/lint-md/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", - "rollup": "^4.6.1", + "rollup": "^4.7.0", "rollup-plugin-cleanup": "^3.2.1" } } From 04eaa5cdd7a986bee71f8ab685093218bf3d3f73 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:25:06 +0000 Subject: [PATCH 54/67] doc: run license-builder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51111 Reviewed-By: Marco Ippolito Reviewed-By: Yagiz Nizipli Reviewed-By: Michaël Zasso Reviewed-By: Darshan Sen Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 0dbfa8fb849796..f4395bd0ea1df9 100644 --- a/LICENSE +++ b/LICENSE @@ -1285,9 +1285,9 @@ The externally maintained libraries used by Node.js are: - zlib, located at deps/zlib, is licensed as follows: """ zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.13.1, October xxth, 2022 + version 1.3, August 18th, 2023 - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages From aa2be4bb7658c3f56538bf8068a1bd7ba12dbd3b Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Wed, 13 Dec 2023 14:53:19 +0900 Subject: [PATCH 55/67] module: load source maps in `commonjs` translator PR-URL: https://github.com/nodejs/node/pull/51033 Reviewed-By: Antoine du Hamel Reviewed-By: Geoffrey Booth Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell --- lib/internal/modules/esm/translators.js | 2 ++ test/es-module/test-esm-loader-hooks.mjs | 33 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 949dbab7f6ad6b..47906cff86a225 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -289,6 +289,8 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) { // In case the source was not provided by the `load` step, we need fetch it now. source = stringify(source ?? getSource(new URL(url)).source); + maybeCacheSourceMap(url, source); + const { exportNames, module } = cjsPreparseModuleExports(filename, source); cjsCache.set(url, module); const namesWithDefault = exportNames.has('default') ? diff --git a/test/es-module/test-esm-loader-hooks.mjs b/test/es-module/test-esm-loader-hooks.mjs index c7b8632bae3df8..6f035bccb87f5c 100644 --- a/test/es-module/test-esm-loader-hooks.mjs +++ b/test/es-module/test-esm-loader-hooks.mjs @@ -747,6 +747,39 @@ describe('Loader hooks', { concurrency: true }, () => { assert.strictEqual(signal, null); }); + it('should support source maps in commonjs translator', async () => { + const readFile = async () => {}; + const hook = ` + import { readFile } from 'node:fs/promises'; + export ${ + async function load(url, context, nextLoad) { + const resolved = await nextLoad(url, context); + if (context.format === 'commonjs') { + resolved.source = await readFile(new URL(url)); + } + return resolved; + } +}`; + + const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [ + '--no-warnings', + '--enable-source-maps', + '--import', + `data:text/javascript,${encodeURIComponent(` + import{ register } from "node:module"; + register(${ + JSON.stringify('data:text/javascript,' + encodeURIComponent(hook)) +}); + `)}`, + fixtures.path('source-map/throw-on-require.js'), + ]); + + assert.strictEqual(stdout, ''); + assert.match(stderr, /throw-on-require\.ts:9:9/); + assert.strictEqual(code, 1); + assert.strictEqual(signal, null); + }); + it('should handle mixed of opt-in modules and non-opt-in ones', async () => { const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [ '--no-warnings', From cc949869a3a87397721eb7f20711f5ffaefbd383 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 13 Dec 2023 18:40:54 +0000 Subject: [PATCH 56/67] test: handle relative https redirect Fix `internet/test-inspector-help-page` to handle the relative redirect of `https://nodejs.org/en/docs/inspector` to `/en/docs/guides/debugging-getting-started`. Previously this URL redirected to an absolute URL. PR-URL: https://github.com/nodejs/node/pull/51121 Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli --- test/internet/test-inspector-help-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/internet/test-inspector-help-page.js b/test/internet/test-inspector-help-page.js index d9ae17c5a887b2..5679eae4ebac83 100644 --- a/test/internet/test-inspector-help-page.js +++ b/test/internet/test-inspector-help-page.js @@ -18,7 +18,7 @@ function check(url, cb) { assert(res.statusCode >= 200 && res.statusCode < 400); if (res.statusCode >= 300) - return check(res.headers.location, cb); + return check(new URL(res.headers.location, url), cb); let result = ''; From e178a435093b8c6aac655379fda45ee6bb2a7fa9 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 6 Sep 2023 15:03:35 +0200 Subject: [PATCH 57/67] vm: use v8::DeserializeInternalFieldsCallback explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To avoid ambiguity in the signature. PR-URL: https://github.com/nodejs/node/pull/50984 Reviewed-By: Yagiz Nizipli Reviewed-By: Tobias Nießen Reviewed-By: Daeyeon Jeong Reviewed-By: James M Snell Reviewed-By: Chengzhong Wu --- src/node_contextify.cc | 27 +++++++++++++++------------ test/cctest/test_environment.cc | 9 +++++++-- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 85cdd4b3e74163..23b87657cee1bb 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -208,21 +208,24 @@ MaybeLocal ContextifyContext::CreateV8Context( Local ctx; if (snapshot_data == nullptr) { - ctx = Context::New(isolate, - nullptr, // extensions - object_template, - {}, // global object - {}, // deserialization callback - queue); + ctx = Context::New( + isolate, + nullptr, // extensions + object_template, + {}, // global object + v8::DeserializeInternalFieldsCallback(), // deserialization callback + queue); if (ctx.IsEmpty() || InitializeBaseContextForSnapshot(ctx).IsNothing()) { return MaybeLocal(); } - } else if (!Context::FromSnapshot(isolate, - SnapshotData::kNodeVMContextIndex, - {}, // deserialization callback - nullptr, // extensions - {}, // global object - queue) + } else if (!Context::FromSnapshot( + isolate, + SnapshotData::kNodeVMContextIndex, + v8::DeserializeInternalFieldsCallback(), // deserialization + // callback + nullptr, // extensions + {}, // global object + queue) .ToLocal(&ctx)) { return MaybeLocal(); } diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index 2e747c7be58922..9b812408154287 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -686,8 +686,13 @@ TEST_F(EnvironmentTest, NestedMicrotaskQueue) { std::unique_ptr queue = v8::MicrotaskQueue::New( isolate_, v8::MicrotasksPolicy::kExplicit); - v8::Local context = v8::Context::New( - isolate_, nullptr, {}, {}, {}, queue.get()); + v8::Local context = + v8::Context::New(isolate_, + nullptr, + {}, + {}, + v8::DeserializeInternalFieldsCallback(), + queue.get()); node::InitializeContext(context); v8::Context::Scope context_scope(context); From 2cfee53d7b5016c4c39a96cd5c952d14f50bfa9a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 27 Nov 2023 14:35:25 +0100 Subject: [PATCH 58/67] src: register process_wrap external references PR-URL: https://github.com/nodejs/node/pull/50943 Refs: https://github.com/nodejs/node/issues/50924 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- src/node_external_reference.h | 1 + src/process_wrap.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/node_external_reference.h b/src/node_external_reference.h index f15c97c03d2e9d..e516bf6471d4af 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -110,6 +110,7 @@ class ExternalReferenceRegistry { V(permission) \ V(process_methods) \ V(process_object) \ + V(process_wrap) \ V(report) \ V(task_queue) \ V(tcp_wrap) \ diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 42a746308ba8ac..a9b0cea29cbd15 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -20,6 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "env-inl.h" +#include "node_external_reference.h" #include "permission/permission.h" #include "stream_base-inl.h" #include "stream_wrap.h" @@ -67,6 +68,12 @@ class ProcessWrap : public HandleWrap { SetConstructorFunction(context, target, "Process", constructor); } + static void RegisterExternalReferences(ExternalReferenceRegistry* registry) { + registry->Register(New); + registry->Register(Spawn); + registry->Register(Kill); + } + SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(ProcessWrap) SET_SELF_SIZE(ProcessWrap) @@ -325,3 +332,5 @@ class ProcessWrap : public HandleWrap { } // namespace node NODE_BINDING_CONTEXT_AWARE_INTERNAL(process_wrap, node::ProcessWrap::Initialize) +NODE_BINDING_EXTERNAL_REFERENCE(process_wrap, + node::ProcessWrap::RegisterExternalReferences) From 84e2f51d14a18dd0e1e492b32a1c5749ebd7a493 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 27 Nov 2023 14:35:48 +0100 Subject: [PATCH 59/67] src: register spawn_sync external references PR-URL: https://github.com/nodejs/node/pull/50943 Refs: https://github.com/nodejs/node/issues/50924 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- src/node_external_reference.h | 1 + src/spawn_sync.cc | 7 +++++++ src/spawn_sync.h | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/node_external_reference.h b/src/node_external_reference.h index e516bf6471d4af..09a24aeef1b07f 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -123,6 +123,7 @@ class ExternalReferenceRegistry { V(string_decoder) \ V(stream_wrap) \ V(signal_wrap) \ + V(spawn_sync) \ V(trace_events) \ V(timers) \ V(types) \ diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index b3c0fabafdaad2..3b73dc4a614b9a 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -22,6 +22,7 @@ #include "spawn_sync.h" #include "debug_utils-inl.h" #include "env-inl.h" +#include "node_external_reference.h" #include "node_internals.h" #include "string_bytes.h" #include "util-inl.h" @@ -366,6 +367,10 @@ void SyncProcessRunner::Initialize(Local target, SetMethod(context, target, "spawn", Spawn); } +void SyncProcessRunner::RegisterExternalReferences( + ExternalReferenceRegistry* registry) { + registry->Register(Spawn); +} void SyncProcessRunner::Spawn(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -1107,3 +1112,5 @@ void SyncProcessRunner::KillTimerCloseCallback(uv_handle_t* handle) { NODE_BINDING_CONTEXT_AWARE_INTERNAL(spawn_sync, node::SyncProcessRunner::Initialize) +NODE_BINDING_EXTERNAL_REFERENCE( + spawn_sync, node::SyncProcessRunner::RegisterExternalReferences) diff --git a/src/spawn_sync.h b/src/spawn_sync.h index 81a2f2aaa899ba..d5b74e67d83094 100644 --- a/src/spawn_sync.h +++ b/src/spawn_sync.h @@ -30,8 +30,7 @@ namespace node { - - +class ExternalReferenceRegistry; class SyncProcessOutputBuffer; class SyncProcessStdioPipe; class SyncProcessRunner; @@ -140,6 +139,7 @@ class SyncProcessRunner { }; public: + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); static void Initialize(v8::Local target, v8::Local unused, v8::Local context, From abe90527e41edf4176ecce823a35a1142b8d32af Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 27 Nov 2023 14:36:04 +0100 Subject: [PATCH 60/67] src: register udp_wrap external references PR-URL: https://github.com/nodejs/node/pull/50943 Refs: https://github.com/nodejs/node/issues/50924 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- src/node_external_reference.h | 1 + src/udp_wrap.cc | 39 ++++++++++++++++++++++++++++++++++- src/udp_wrap.h | 3 +++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/node_external_reference.h b/src/node_external_reference.h index 09a24aeef1b07f..b1b6ca31766326 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -115,6 +115,7 @@ class ExternalReferenceRegistry { V(task_queue) \ V(tcp_wrap) \ V(tty_wrap) \ + V(udp_wrap) \ V(url) \ V(util) \ V(pipe_wrap) \ diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 4208a213260e26..d4249d7aac56e0 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -21,10 +21,11 @@ #include "udp_wrap.h" #include "env-inl.h" +#include "handle_wrap.h" #include "node_buffer.h" #include "node_errors.h" +#include "node_external_reference.h" #include "node_sockaddr-inl.h" -#include "handle_wrap.h" #include "req_wrap-inl.h" #include "util-inl.h" @@ -133,6 +134,12 @@ void UDPWrapBase::AddMethods(Environment* env, Local t) { SetProtoMethod(env->isolate(), t, "recvStop", RecvStop); } +void UDPWrapBase::RegisterExternalReferences( + ExternalReferenceRegistry* registry) { + registry->Register(RecvStart); + registry->Register(RecvStop); +} + UDPWrap::UDPWrap(Environment* env, Local object) : HandleWrap(env, object, @@ -229,6 +236,34 @@ void UDPWrap::Initialize(Local target, constants).Check(); } +void UDPWrap::RegisterExternalReferences(ExternalReferenceRegistry* registry) { + UDPWrapBase::RegisterExternalReferences(registry); + registry->Register(New); + registry->Register(GetFD); + + registry->Register(Open); + registry->Register(Bind); + registry->Register(Connect); + registry->Register(Send); + registry->Register(Bind6); + registry->Register(Connect6); + registry->Register(Send6); + registry->Register(Disconnect); + registry->Register(GetSockOrPeerName); + registry->Register(GetSockOrPeerName); + registry->Register(AddMembership); + registry->Register(DropMembership); + registry->Register(AddSourceSpecificMembership); + registry->Register(DropSourceSpecificMembership); + registry->Register(SetMulticastInterface); + registry->Register(SetLibuvInt32); + registry->Register(SetLibuvInt32); + registry->Register(SetLibuvInt32); + registry->Register(SetLibuvInt32); + registry->Register(BufferSize); + registry->Register(GetSendQueueSize); + registry->Register(GetSendQueueCount); +} void UDPWrap::New(const FunctionCallbackInfo& args) { CHECK(args.IsConstructCall()); @@ -807,3 +842,5 @@ void UDPWrap::GetSendQueueCount(const FunctionCallbackInfo& args) { } // namespace node NODE_BINDING_CONTEXT_AWARE_INTERNAL(udp_wrap, node::UDPWrap::Initialize) +NODE_BINDING_EXTERNAL_REFERENCE(udp_wrap, + node::UDPWrap::RegisterExternalReferences) diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 3b8ca7df351a36..c0914dbf3a7f3f 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -32,6 +32,7 @@ namespace node { +class ExternalReferenceRegistry; class UDPWrapBase; // A listener that can be attached to an `UDPWrapBase` object and generally @@ -110,6 +111,7 @@ class UDPWrapBase { static void RecvStart(const v8::FunctionCallbackInfo& args); static void RecvStop(const v8::FunctionCallbackInfo& args); static void AddMethods(Environment* env, v8::Local t); + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); private: UDPListener* listener_ = nullptr; @@ -126,6 +128,7 @@ class UDPWrap final : public HandleWrap, v8::Local unused, v8::Local context, void* priv); + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); static void GetFD(const v8::FunctionCallbackInfo& args); static void New(const v8::FunctionCallbackInfo& args); static void Open(const v8::FunctionCallbackInfo& args); From aee01ff1b42888283308dd4723468575ff3fc0d9 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 27 Nov 2023 15:22:28 +0100 Subject: [PATCH 61/67] test: test syncrhnous methods of child_process in snapshot These currently work in snapshot builder scripts. Asynchronous methods are not supported yet. PR-URL: https://github.com/nodejs/node/pull/50943 Refs: https://github.com/nodejs/node/issues/50924 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- test/fixtures/snapshot/child-process-sync.js | 25 +++++++++ .../test-snapshot-child-process-sync.js | 53 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 test/fixtures/snapshot/child-process-sync.js create mode 100644 test/parallel/test-snapshot-child-process-sync.js diff --git a/test/fixtures/snapshot/child-process-sync.js b/test/fixtures/snapshot/child-process-sync.js new file mode 100644 index 00000000000000..5ffacb05357df6 --- /dev/null +++ b/test/fixtures/snapshot/child-process-sync.js @@ -0,0 +1,25 @@ +'use strict'; + +const { + setDeserializeMainFunction, + isBuildingSnapshot +} = require('v8').startupSnapshot; + +function spawn() { + const { spawnSync, execFileSync, execSync } = require('child_process'); + spawnSync(process.execPath, [ __filename, 'spawnSync' ], { stdio: 'inherit' }); + execSync(`"${process.execPath}" "${__filename}" "execSync"`, { stdio: 'inherit' }); + execFileSync(process.execPath, [ __filename, 'execFileSync' ], { stdio: 'inherit' }); +} + +if (process.argv[2] !== undefined) { + console.log('From child process', process.argv[2]); +} else { + spawn(); +} + +if (isBuildingSnapshot()) { + setDeserializeMainFunction(() => { + spawn(); + }); +} diff --git a/test/parallel/test-snapshot-child-process-sync.js b/test/parallel/test-snapshot-child-process-sync.js new file mode 100644 index 00000000000000..3ec7b2952853ba --- /dev/null +++ b/test/parallel/test-snapshot-child-process-sync.js @@ -0,0 +1,53 @@ +'use strict'; + +// This tests that process.cwd() is accurate when +// restoring state from a snapshot + +require('../common'); +const { spawnSyncAndExitWithoutError } = require('../common/child_process'); +const tmpdir = require('../common/tmpdir'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); + +tmpdir.refresh(); +const blobPath = tmpdir.resolve('snapshot.blob'); +const file = fixtures.path('snapshot', 'child-process-sync.js'); +const expected = [ + 'From child process spawnSync', + 'From child process execSync', + 'From child process execFileSync', +]; + +{ + // Create the snapshot. + spawnSyncAndExitWithoutError(process.execPath, [ + '--snapshot-blob', + blobPath, + '--build-snapshot', + file, + ], { + cwd: tmpdir.path, + }, { + trim: true, + stdout(output) { + assert.deepStrictEqual(output.split('\n'), expected); + return true; + } + }); +} + +{ + spawnSyncAndExitWithoutError(process.execPath, [ + '--snapshot-blob', + blobPath, + file, + ], { + cwd: tmpdir.path, + }, { + trim: true, + stdout(output) { + assert.deepStrictEqual(output.split('\n'), expected); + return true; + } + }); +} From 8da9d969f927971d20eeacbbca7da34d80bc68b5 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 24 Nov 2023 22:38:22 +0100 Subject: [PATCH 62/67] deps: V8: cherry-pick 0fd478bcdabd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [heap-profiler]: expose QueryObjects() to v8::HeapProfiler This allows embedders to use this API for testing memory leaks more reliably. See https://github.com/nodejs/node/pull/50572 for an example about how the API can be used. Change-Id: Ic3d1268e2b331c37e8ec92997b764b9b5486f8c2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5006373 Reviewed-by: Camillo Bruni Reviewed-by: Simon Zünd Commit-Queue: Joyee Cheung Cr-Commit-Position: refs/heads/main@{#91123} Refs: https://github.com/v8/v8/commit/0fd478bcdabd3400d9d74c47c4883c085ef37d18 PR-URL: https://github.com/nodejs/node/pull/50572 Reviewed-By: Geoffrey Booth Reviewed-By: Stephen Belanger --- common.gypi | 2 +- deps/v8/include/v8-profiler.h | 10 ++++ deps/v8/src/api/api.cc | 10 ++++ deps/v8/src/debug/debug-interface.cc | 9 ---- deps/v8/src/debug/debug-interface.h | 10 ---- deps/v8/src/inspector/v8-debugger.cc | 5 +- deps/v8/src/profiler/heap-profiler.cc | 2 +- deps/v8/src/profiler/heap-profiler.h | 5 +- deps/v8/test/cctest/test-heap-profiler.cc | 62 +++++++++++++++++++++++ 9 files changed, 89 insertions(+), 26 deletions(-) diff --git a/common.gypi b/common.gypi index 28522c9fbf83b4..c6b9fa05b44c96 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.17', + 'v8_embedder_string': '-node.18', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 75c9d6a4ae7863..3ec0cd4bb31318 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -921,12 +921,22 @@ class V8_EXPORT EmbedderGraph { virtual ~EmbedderGraph() = default; }; +class QueryObjectPredicate { + public: + virtual ~QueryObjectPredicate() = default; + virtual bool Filter(v8::Local object) = 0; +}; + /** * Interface for controlling heap profiling. Instance of the * profiler can be retrieved using v8::Isolate::GetHeapProfiler. */ class V8_EXPORT HeapProfiler { public: + void QueryObjects(v8::Local context, + QueryObjectPredicate* predicate, + std::vector>* objects); + enum SamplingFlags { kSamplingNoFlags = 0, kSamplingForceGC = 1 << 0, diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index 2708ad9b2e55c7..7807545da57f23 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -10917,6 +10917,16 @@ int HeapProfiler::GetSnapshotCount() { return reinterpret_cast(this)->GetSnapshotsCount(); } +void HeapProfiler::QueryObjects(Local v8_context, + QueryObjectPredicate* predicate, + std::vector>* objects) { + i::Isolate* isolate = reinterpret_cast(v8_context->GetIsolate()); + i::HeapProfiler* profiler = reinterpret_cast(this); + DCHECK_EQ(isolate, profiler->isolate()); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + profiler->QueryObjects(Utils::OpenHandle(*v8_context), predicate, objects); +} + const HeapSnapshot* HeapProfiler::GetHeapSnapshot(int index) { return reinterpret_cast( reinterpret_cast(this)->GetSnapshot(index)); diff --git a/deps/v8/src/debug/debug-interface.cc b/deps/v8/src/debug/debug-interface.cc index fb3b6b69e4be80..51e3633853ba56 100644 --- a/deps/v8/src/debug/debug-interface.cc +++ b/deps/v8/src/debug/debug-interface.cc @@ -1211,15 +1211,6 @@ v8::MaybeLocal EvaluateGlobalForTesting( RETURN_ESCAPED(result); } -void QueryObjects(v8::Local v8_context, - QueryObjectPredicate* predicate, - std::vector>* objects) { - i::Isolate* isolate = reinterpret_cast(v8_context->GetIsolate()); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - isolate->heap_profiler()->QueryObjects(Utils::OpenHandle(*v8_context), - predicate, objects); -} - void GlobalLexicalScopeNames(v8::Local v8_context, std::vector>* names) { i::Handle context = Utils::OpenHandle(*v8_context); diff --git a/deps/v8/src/debug/debug-interface.h b/deps/v8/src/debug/debug-interface.h index 5dfd505fed6f14..eb346b326392a7 100644 --- a/deps/v8/src/debug/debug-interface.h +++ b/deps/v8/src/debug/debug-interface.h @@ -530,16 +530,6 @@ class V8_EXPORT_PRIVATE StackTraceIterator { bool throw_on_side_effect) = 0; }; -class QueryObjectPredicate { - public: - virtual ~QueryObjectPredicate() = default; - virtual bool Filter(v8::Local object) = 0; -}; - -void QueryObjects(v8::Local context, - QueryObjectPredicate* predicate, - std::vector>* objects); - void GlobalLexicalScopeNames(v8::Local context, std::vector>* names); diff --git a/deps/v8/src/inspector/v8-debugger.cc b/deps/v8/src/inspector/v8-debugger.cc index 3d4733b5ba936e..d8a08b422505f7 100644 --- a/deps/v8/src/inspector/v8-debugger.cc +++ b/deps/v8/src/inspector/v8-debugger.cc @@ -8,6 +8,7 @@ #include "include/v8-context.h" #include "include/v8-function.h" #include "include/v8-microtask-queue.h" +#include "include/v8-profiler.h" #include "include/v8-util.h" #include "src/inspector/inspected-context.h" #include "src/inspector/protocol/Protocol.h" @@ -38,7 +39,7 @@ void cleanupExpiredWeakPointers(Map& map) { } } -class MatchPrototypePredicate : public v8::debug::QueryObjectPredicate { +class MatchPrototypePredicate : public v8::QueryObjectPredicate { public: MatchPrototypePredicate(V8InspectorImpl* inspector, v8::Local context, @@ -994,7 +995,7 @@ v8::Local V8Debugger::queryObjects(v8::Local context, v8::Isolate* isolate = context->GetIsolate(); std::vector> v8_objects; MatchPrototypePredicate predicate(m_inspector, context, prototype); - v8::debug::QueryObjects(context, &predicate, &v8_objects); + isolate->GetHeapProfiler()->QueryObjects(context, &predicate, &v8_objects); v8::MicrotasksScope microtasksScope(context, v8::MicrotasksScope::kDoNotRunMicrotasks); diff --git a/deps/v8/src/profiler/heap-profiler.cc b/deps/v8/src/profiler/heap-profiler.cc index a23e6d94d1717e..2a3ed138022d5a 100644 --- a/deps/v8/src/profiler/heap-profiler.cc +++ b/deps/v8/src/profiler/heap-profiler.cc @@ -247,7 +247,7 @@ Heap* HeapProfiler::heap() const { return ids_->heap(); } Isolate* HeapProfiler::isolate() const { return heap()->isolate(); } void HeapProfiler::QueryObjects(Handle context, - debug::QueryObjectPredicate* predicate, + v8::QueryObjectPredicate* predicate, std::vector>* objects) { // We need a stack marker here to allow deterministic passes over the stack. // The garbage collection and the two object heap iterators should scan the diff --git a/deps/v8/src/profiler/heap-profiler.h b/deps/v8/src/profiler/heap-profiler.h index 2756ade8141531..851972a729a806 100644 --- a/deps/v8/src/profiler/heap-profiler.h +++ b/deps/v8/src/profiler/heap-profiler.h @@ -30,7 +30,7 @@ class StringsStorage; // generate consistent IDs for moved objects. class HeapProfilerNativeMoveListener { public: - HeapProfilerNativeMoveListener(HeapProfiler* profiler) + explicit HeapProfilerNativeMoveListener(HeapProfiler* profiler) : profiler_(profiler) {} HeapProfilerNativeMoveListener(const HeapProfilerNativeMoveListener& other) = delete; @@ -116,8 +116,7 @@ class HeapProfiler : public HeapObjectAllocationTracker { Isolate* isolate() const; - void QueryObjects(Handle context, - debug::QueryObjectPredicate* predicate, + void QueryObjects(Handle context, QueryObjectPredicate* predicate, std::vector>* objects); void set_native_move_listener( std::unique_ptr listener) { diff --git a/deps/v8/test/cctest/test-heap-profiler.cc b/deps/v8/test/cctest/test-heap-profiler.cc index 1ca4a4808de2b3..4c685f90c26c54 100644 --- a/deps/v8/test/cctest/test-heap-profiler.cc +++ b/deps/v8/test/cctest/test-heap-profiler.cc @@ -30,6 +30,7 @@ #include #include +#include #include "include/v8-function.h" #include "include/v8-json.h" @@ -4064,6 +4065,67 @@ TEST(SamplingHeapProfilerSampleDuringDeopt) { heap_profiler->StopSamplingHeapProfiler(); } +namespace { +class TestQueryObjectPredicate : public v8::QueryObjectPredicate { + public: + TestQueryObjectPredicate(v8::Local context, + v8::Local symbol) + : context_(context), symbol_(symbol) {} + + bool Filter(v8::Local object) override { + return object->HasOwnProperty(context_, symbol_).FromMaybe(false); + } + + private: + v8::Local context_; + v8::Local symbol_; +}; + +class IncludeAllQueryObjectPredicate : public v8::QueryObjectPredicate { + public: + IncludeAllQueryObjectPredicate() {} + bool Filter(v8::Local object) override { return true; } +}; +} // anonymous namespace + +TEST(QueryObjects) { + LocalContext env; + v8::Isolate* isolate = env->GetIsolate(); + v8::HandleScope scope(isolate); + v8::Local context = env.local(); + + v8::Local sym = + v8::Symbol::New(isolate, v8_str("query_object_test")); + context->Global()->Set(context, v8_str("test_symbol"), sym).Check(); + v8::Local arr = CompileRun(R"( + const arr = []; + for (let i = 0; i < 10; ++i) { + arr.push({[test_symbol]: true}); + } + arr; + )"); + context->Global()->Set(context, v8_str("arr"), arr).Check(); + v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler(); + + { + TestQueryObjectPredicate predicate(context, sym); + std::vector> out; + heap_profiler->QueryObjects(context, &predicate, &out); + + CHECK_EQ(out.size(), 10); + for (size_t i = 0; i < out.size(); ++i) { + CHECK(out[i].Get(isolate)->HasOwnProperty(context, sym).FromMaybe(false)); + } + } + + { + IncludeAllQueryObjectPredicate predicate; + std::vector> out; + heap_profiler->QueryObjects(context, &predicate, &out); + CHECK_GE(out.size(), 10); + } +} + TEST(WeakReference) { v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = CcTest::i_isolate(); From fa25e069fc1aad5bc2167a8c9b06e99d2d0d606d Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 3 Nov 2023 22:53:21 +0000 Subject: [PATCH 63/67] src: implement countObjectsWithPrototype This implements an internal utility for counting objects in the heap with a specified prototype. In addition this adds a checkIfCollectableByCounting() test helper. PR-URL: https://github.com/nodejs/node/pull/50572 Refs: https://github.com/v8/v8/commit/0fd478bcdabd3400d9d74c47c4883c085ef37d18 Reviewed-By: Geoffrey Booth Reviewed-By: Stephen Belanger --- src/heap_utils.cc | 36 ++++++++++++++++++++++++++++++++++++ test/common/gc.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/src/heap_utils.cc b/src/heap_utils.cc index e385955a5d5fce..75f7e7e1bdc1b4 100644 --- a/src/heap_utils.cc +++ b/src/heap_utils.cc @@ -474,6 +474,39 @@ void TriggerHeapSnapshot(const FunctionCallbackInfo& args) { return args.GetReturnValue().Set(filename_v); } +class PrototypeChainHas : public v8::QueryObjectPredicate { + public: + PrototypeChainHas(Local context, Local search) + : context_(context), search_(search) {} + + // What we can do in the filter can be quite limited, but looking up + // the prototype chain is something that the inspector console API + // queryObject() does so it is supported. + bool Filter(Local object) override { + for (Local proto = object->GetPrototype(); proto->IsObject(); + proto = proto.As()->GetPrototype()) { + if (search_ == proto) return true; + } + return false; + } + + private: + Local context_; + Local search_; +}; + +void CountObjectsWithPrototype(const FunctionCallbackInfo& args) { + CHECK_EQ(args.Length(), 1); + CHECK(args[0]->IsObject()); + Local proto = args[0].As(); + Isolate* isolate = args.GetIsolate(); + Local context = isolate->GetCurrentContext(); + PrototypeChainHas prototype_chain_has(context, proto); + std::vector> out; + isolate->GetHeapProfiler()->QueryObjects(context, &prototype_chain_has, &out); + args.GetReturnValue().Set(static_cast(out.size())); +} + void Initialize(Local target, Local unused, Local context, @@ -482,12 +515,15 @@ void Initialize(Local target, SetMethod(context, target, "triggerHeapSnapshot", TriggerHeapSnapshot); SetMethod( context, target, "createHeapSnapshotStream", CreateHeapSnapshotStream); + SetMethod( + context, target, "countObjectsWithPrototype", CountObjectsWithPrototype); } void RegisterExternalReferences(ExternalReferenceRegistry* registry) { registry->Register(BuildEmbedderGraph); registry->Register(TriggerHeapSnapshot); registry->Register(CreateHeapSnapshotStream); + registry->Register(CountObjectsWithPrototype); } } // namespace heap diff --git a/test/common/gc.js b/test/common/gc.js index 9860bb191ee072..4671a5422641ca 100644 --- a/test/common/gc.js +++ b/test/common/gc.js @@ -75,7 +75,54 @@ async function runAndBreathe(fn, repeat, waitTime = 20) { } } +/** + * This requires --expose-internals. + * This function can be used to check if an object factory leaks or not by + * iterating over the heap and count objects with the specified class + * (which is checked by looking up the prototype chain). + * @param {(i: number) => number} fn The factory receiving iteration count + * and returning number of objects created. The return value should be + * precise otherwise false negatives can be produced. + * @param {Function} klass The class whose object is used to count the objects + * @param {number} count Number of iterations that this check should be done + * @param {number} waitTime Optional breathing time for GC. + */ +async function checkIfCollectableByCounting(fn, klass, count, waitTime = 20) { + const { internalBinding } = require('internal/test/binding'); + const { countObjectsWithPrototype } = internalBinding('heap_utils'); + const { prototype, name } = klass; + const initialCount = countObjectsWithPrototype(prototype); + console.log(`Initial count of ${name}: ${initialCount}`); + let totalCreated = 0; + for (let i = 0; i < count; ++i) { + const created = await fn(i); + totalCreated += created; + console.log(`#${i}: created ${created} ${name}, total ${totalCreated}`); + await wait(waitTime); // give GC some breathing room. + const currentCount = countObjectsWithPrototype(prototype); + const collected = totalCreated - (currentCount - initialCount); + console.log(`#${i}: counted ${currentCount} ${name}, collected ${collected}`); + if (collected > 0) { + console.log(`Detected ${collected} collected ${name}, finish early`); + return; + } + } + + await wait(waitTime); // give GC some breathing room. + const currentCount = countObjectsWithPrototype(prototype); + const collected = totalCreated - (currentCount - initialCount); + console.log(`Last count: counted ${currentCount} ${name}, collected ${collected}`); + // Some objects with the prototype can be collected. + if (collected > 0) { + console.log(`Detected ${collected} collected ${name}`); + return; + } + + throw new Error(`${name} cannot be collected`); +} + module.exports = { checkIfCollectable, runAndBreathe, + checkIfCollectableByCounting, }; From ed070755ec4356c86d8dadfb1d9c8eea61efe915 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 3 Nov 2023 22:53:24 +0000 Subject: [PATCH 64/67] test: deflake test-diagnostics-channel-memory-leak PR-URL: https://github.com/nodejs/node/pull/50572 Refs: https://github.com/v8/v8/commit/0fd478bcdabd3400d9d74c47c4883c085ef37d18 Reviewed-By: Geoffrey Booth Reviewed-By: Stephen Belanger --- test/parallel/parallel.status | 3 -- .../test-diagnostics-channel-memory-leak.js | 30 +++++++++---------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 838d465b596f9f..98288c5c1228c2 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -5,9 +5,6 @@ prefix parallel # sample-test : PASS,FLAKY [true] # This section applies to all platforms -# https://github.com/nodejs/node/pull/50327 -# Currently there's no reliable way to test it. -test-diagnostics-channel-memory-leak: SKIP [$system==win32] # https://github.com/nodejs/node/issues/41206 diff --git a/test/parallel/test-diagnostics-channel-memory-leak.js b/test/parallel/test-diagnostics-channel-memory-leak.js index 9e6364d168562f..fe50158070554d 100644 --- a/test/parallel/test-diagnostics-channel-memory-leak.js +++ b/test/parallel/test-diagnostics-channel-memory-leak.js @@ -1,24 +1,22 @@ -// Flags: --expose-gc +// Flags: --expose-internals --max-old-space-size=16 'use strict'; // This test ensures that diagnostic channel references aren't leaked. -require('../common'); -const { ok } = require('assert'); +const common = require('../common'); -const { subscribe, unsubscribe } = require('diagnostics_channel'); +const { subscribe, unsubscribe, Channel } = require('diagnostics_channel'); +const { checkIfCollectableByCounting } = require('../common/gc'); function noop() {} -const heapUsedBefore = process.memoryUsage().heapUsed; - -for (let i = 0; i < 1000; i++) { - subscribe(String(i), noop); - unsubscribe(String(i), noop); -} - -global.gc(); - -const heapUsedAfter = process.memoryUsage().heapUsed; - -ok(heapUsedBefore >= heapUsedAfter); +const outer = 64; +const inner = 256; +checkIfCollectableByCounting((i) => { + for (let j = 0; j < inner; j++) { + const key = String(i * inner + j); + subscribe(key, noop); + unsubscribe(key, noop); + } + return inner; +}, Channel, outer).then(common.mustCall()); From 3ccd5faabbea00b6e77ff2605045be9d7ca90b72 Mon Sep 17 00:00:00 2001 From: Pulkit Gupta Date: Fri, 15 Dec 2023 12:23:08 +0530 Subject: [PATCH 65/67] test_runner: format coverage report for tap reporter PR-URL: https://github.com/nodejs/node/pull/51119 Reviewed-By: Raz Luvaton Reviewed-By: Luigi Pinca Reviewed-By: Moshe Atlow Reviewed-By: Debadree Chatterjee --- lib/internal/test_runner/reporter/tap.js | 2 +- test/parallel/test-runner-coverage.js | 38 +++++++++++++----------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/lib/internal/test_runner/reporter/tap.js b/lib/internal/test_runner/reporter/tap.js index 1f60cfa619886e..e8cf727daede64 100644 --- a/lib/internal/test_runner/reporter/tap.js +++ b/lib/internal/test_runner/reporter/tap.js @@ -58,7 +58,7 @@ async function * tapReporter(source) { yield `${indent(data.nesting)}# ${tapEscape(data.message)}\n`; break; case 'test:coverage': - yield getCoverageReport(indent(data.nesting), data.summary, '# ', ''); + yield getCoverageReport(indent(data.nesting), data.summary, '# ', '', true); break; } } diff --git a/test/parallel/test-runner-coverage.js b/test/parallel/test-runner-coverage.js index 2532f9971c213d..d8181417205b46 100644 --- a/test/parallel/test-runner-coverage.js +++ b/test/parallel/test-runner-coverage.js @@ -22,16 +22,21 @@ function findCoverageFileForPid(pid) { } function getTapCoverageFixtureReport() { + /* eslint-disable max-len */ const report = [ '# start of coverage report', - '# file | line % | branch % | funcs % | uncovered lines', - '# test/fixtures/test-runner/coverage.js | 78.65 | 38.46 | 60.00 | 12, ' + - '13, 16, 17, 18, 19, 20, 21, 22, 27, 39, 43, 44, 61, 62, 66, 67, 71, 72', - '# test/fixtures/test-runner/invalid-tap.js | 100.00 | 100.00 | 100.00 | ', - '# test/fixtures/v8-coverage/throw.js | 71.43 | 50.00 | 100.00 | 5, 6', - '# all files | 78.35 | 43.75 | 60.00 |', + '# -------------------------------------------------------------------------------------------------------------------', + '# file | line % | branch % | funcs % | uncovered lines', + '# -------------------------------------------------------------------------------------------------------------------', + '# test/fixtures/test-runner/coverage.js | 78.65 | 38.46 | 60.00 | 12-13 16-22 27 39 43-44 61-62 66-67 71-72', + '# test/fixtures/test-runner/invalid-tap.js | 100.00 | 100.00 | 100.00 | ', + '# test/fixtures/v8-coverage/throw.js | 71.43 | 50.00 | 100.00 | 5-6', + '# -------------------------------------------------------------------------------------------------------------------', + '# all files | 78.35 | 43.75 | 60.00 |', + '# -------------------------------------------------------------------------------------------------------------------', '# end of coverage report', ].join('\n'); + /* eslint-enable max-len */ if (common.isWindows) { return report.replaceAll('/', '\\'); @@ -88,7 +93,6 @@ test('test tap coverage reporter', skipIfNoInspector, async (t) => { const options = { env: { ...process.env, NODE_V8_COVERAGE: tmpdir.path } }; const result = spawnSync(process.execPath, args, options); const report = getTapCoverageFixtureReport(); - assert(result.stdout.toString().includes(report)); assert.strictEqual(result.stderr.toString(), ''); assert.strictEqual(result.status, 0); @@ -152,16 +156,16 @@ test('single process coverage is the same with --test', skipIfNoInspector, () => test('coverage is combined for multiple processes', skipIfNoInspector, () => { let report = [ '# start of coverage report', - '# file | line % | branch % | funcs % | uncovered lines', - '# common.js | 89.86 | ' + - '62.50 | 100.00 | 8, 13, 14, 18, 34, 35, 53', - '# first.test.js | 83.33 | ' + - '100.00 | 50.00 | 5, 6', - '# second.test.js | 100.00 ' + - '| 100.00 | 100.00 | ', - '# third.test.js | 100.00 | ' + - '100.00 | 100.00 | ', - '# all files | 92.11 | 72.73 | 88.89 |', + '# -------------------------------------------------------------------', + '# file | line % | branch % | funcs % | uncovered lines', + '# -------------------------------------------------------------------', + '# common.js | 89.86 | 62.50 | 100.00 | 8 13-14 18 34-35 53', + '# first.test.js | 83.33 | 100.00 | 50.00 | 5-6', + '# second.test.js | 100.00 | 100.00 | 100.00 | ', + '# third.test.js | 100.00 | 100.00 | 100.00 | ', + '# -------------------------------------------------------------------', + '# all files | 92.11 | 72.73 | 88.89 |', + '# -------------------------------------------------------------------', '# end of coverage report', ].join('\n'); From 71acd367784f49e175e4b6087b09ac02d33350e8 Mon Sep 17 00:00:00 2001 From: Debadree Chatterjee Date: Fri, 15 Dec 2023 13:24:19 +0530 Subject: [PATCH 66/67] stream: implement TransformStream cleanup using "transformer.cancel" Fixes: https://github.com/nodejs/node/issues/49971 PR-URL: https://github.com/nodejs/node/pull/50126 Reviewed-By: Matteo Collina --- lib/internal/webstreams/readablestream.js | 5 +- lib/internal/webstreams/transformstream.js | 116 ++++++++++++++++-- lib/internal/webstreams/writablestream.js | 3 +- test/fixtures/wpt/README.md | 2 +- test/fixtures/wpt/streams/piping/abort.any.js | 2 +- .../piping/close-propagation-backward.any.js | 2 +- .../piping/close-propagation-forward.any.js | 2 +- .../piping/crashtests/cross-piping.html | 12 ++ .../piping/error-propagation-backward.any.js | 2 +- .../piping/error-propagation-forward.any.js | 2 +- .../wpt/streams/piping/flow-control.any.js | 2 +- .../streams/piping/general-addition.any.js | 2 +- .../wpt/streams/piping/general.any.js | 2 +- .../piping/multiple-propagation.any.js | 2 +- .../wpt/streams/piping/pipe-through.any.js | 2 +- .../streams/piping/then-interception.any.js | 2 +- .../streams/piping/throwing-options.any.js | 2 +- .../streams/piping/transform-streams.any.js | 2 +- .../wpt/streams/queuing-strategies.any.js | 2 +- .../bad-buffers-and-views.any.js | 2 +- .../construct-byob-request.any.js | 2 +- .../enqueue-with-detached-buffer.any.js | 2 +- .../readable-byte-streams/general.any.js | 2 +- .../non-transferable-buffers.any.js | 2 +- .../respond-after-enqueue.any.js | 2 +- .../streams/readable-byte-streams/tee.any.js | 2 +- .../readable-streams/async-iterator.any.js | 2 +- .../readable-streams/bad-strategies.any.js | 43 ++++++- .../bad-underlying-sources.any.js | 2 +- .../streams/readable-streams/cancel.any.js | 2 +- .../readable-streams/constructor.any.js | 2 +- .../count-queuing-strategy-integration.any.js | 2 +- .../readable-streams/default-reader.any.js | 2 +- .../floating-point-total-queue-size.any.js | 2 +- .../wpt/streams/readable-streams/from.any.js | 2 +- .../garbage-collection.any.js | 2 +- .../streams/readable-streams/general.any.js | 2 +- .../owning-type-message-port.any.js | 2 +- .../owning-type-video-frame.any.js | 2 +- .../readable-streams/owning-type.any.js | 2 +- .../readable-streams/patched-global.any.js | 2 +- .../reentrant-strategies.any.js | 2 +- .../wpt/streams/readable-streams/tee.any.js | 2 +- .../streams/readable-streams/templated.any.js | 2 +- .../transform-stream-members.any.js | 2 + .../transform-streams/backpressure.any.js | 2 +- .../streams/transform-streams/cancel.any.js | 115 +++++++++++++++++ .../streams/transform-streams/errors.any.js | 45 +++++-- .../streams/transform-streams/flush.any.js | 17 ++- .../streams/transform-streams/general.any.js | 21 +++- .../streams/transform-streams/lipfuzz.any.js | 2 +- .../transform-streams/patched-global.any.js | 2 +- .../transform-streams/properties.any.js | 2 +- .../reentrant-strategies.any.js | 6 +- .../transform-streams/strategies.any.js | 2 +- .../transform-streams/terminate.any.js | 2 +- .../streams/writable-streams/aborting.any.js | 2 +- .../writable-streams/bad-strategies.any.js | 2 +- .../bad-underlying-sinks.any.js | 2 +- .../byte-length-queuing-strategy.any.js | 2 +- .../wpt/streams/writable-streams/close.any.js | 2 +- .../writable-streams/constructor.any.js | 2 +- .../count-queuing-strategy.any.js | 2 +- .../wpt/streams/writable-streams/error.any.js | 2 +- .../floating-point-total-queue-size.any.js | 2 +- .../streams/writable-streams/general.any.js | 2 +- .../writable-streams/properties.any.js | 2 +- .../reentrant-strategy.any.js | 2 +- .../wpt/streams/writable-streams/start.any.js | 2 +- .../wpt/streams/writable-streams/write.any.js | 2 +- test/fixtures/wpt/versions.json | 2 +- test/wpt/status/streams.json | 7 ++ 72 files changed, 418 insertions(+), 94 deletions(-) create mode 100644 test/fixtures/wpt/streams/piping/crashtests/cross-piping.html create mode 100644 test/fixtures/wpt/streams/transform-streams/cancel.any.js diff --git a/lib/internal/webstreams/readablestream.js b/lib/internal/webstreams/readablestream.js index 8e27bae439f8e3..4af209349341d1 100644 --- a/lib/internal/webstreams/readablestream.js +++ b/lib/internal/webstreams/readablestream.js @@ -14,6 +14,7 @@ const { ObjectCreate, ObjectDefineProperties, ObjectSetPrototypeOf, + Promise, PromisePrototypeThen, PromiseResolve, PromiseReject, @@ -2444,7 +2445,7 @@ function setupReadableStreamDefaultController( const startResult = startAlgorithm(); PromisePrototypeThen( - PromiseResolve(startResult), + new Promise((r) => r(startResult)), () => { controller[kState].started = true; assert(!controller[kState].pulling); @@ -3243,7 +3244,7 @@ function setupReadableByteStreamController( const startResult = startAlgorithm(); PromisePrototypeThen( - PromiseResolve(startResult), + new Promise((r) => r(startResult)), () => { controller[kState].started = true; assert(!controller[kState].pulling); diff --git a/lib/internal/webstreams/transformstream.js b/lib/internal/webstreams/transformstream.js index 4d47856a6a12de..3dc85b79a8273e 100644 --- a/lib/internal/webstreams/transformstream.js +++ b/lib/internal/webstreams/transformstream.js @@ -6,7 +6,6 @@ const { ObjectDefineProperties, ObjectSetPrototypeOf, PromisePrototypeThen, - PromiseResolve, SymbolToStringTag, Symbol, } = primordials; @@ -47,6 +46,7 @@ const { nonOpFlush, kType, kState, + nonOpCancel, } = require('internal/webstreams/util'); const { @@ -384,8 +384,7 @@ function initializeTransformStream( return transformStreamDefaultSourcePullAlgorithm(stream); }, cancel(reason) { - transformStreamErrorWritableAndUnblockWrite(stream, reason); - return PromiseResolve(); + return transformStreamDefaultSourceCancelAlgorithm(stream, reason); }, }, { highWaterMark: readableHighWaterMark, @@ -427,6 +426,10 @@ function transformStreamErrorWritableAndUnblockWrite(stream, error) { writableStreamDefaultControllerErrorIfNeeded( writable[kState].controller, error); + transformStreamUnblockWrite(stream); +} + +function transformStreamUnblockWrite(stream) { if (stream[kState].backpressure) transformStreamSetBackpressure(stream, false); } @@ -443,13 +446,15 @@ function setupTransformStreamDefaultController( stream, controller, transformAlgorithm, - flushAlgorithm) { + flushAlgorithm, + cancelAlgorithm) { assert(isTransformStream(stream)); assert(stream[kState].controller === undefined); controller[kState] = { stream, transformAlgorithm, flushAlgorithm, + cancelAlgorithm, }; stream[kState].controller = controller; } @@ -460,21 +465,26 @@ function setupTransformStreamDefaultControllerFromTransformer( const controller = new TransformStreamDefaultController(kSkipThrow); const transform = transformer?.transform || defaultTransformAlgorithm; const flush = transformer?.flush || nonOpFlush; + const cancel = transformer?.cancel || nonOpCancel; const transformAlgorithm = FunctionPrototypeBind(transform, transformer); const flushAlgorithm = FunctionPrototypeBind(flush, transformer); + const cancelAlgorithm = + FunctionPrototypeBind(cancel, transformer); setupTransformStreamDefaultController( stream, controller, transformAlgorithm, - flushAlgorithm); + flushAlgorithm, + cancelAlgorithm); } function transformStreamDefaultControllerClearAlgorithms(controller) { controller[kState].transformAlgorithm = undefined; controller[kState].flushAlgorithm = undefined; + controller[kState].cancelAlgorithm = undefined; } function transformStreamDefaultControllerEnqueue(controller, chunk) { @@ -563,7 +573,40 @@ function transformStreamDefaultSinkWriteAlgorithm(stream, chunk) { } async function transformStreamDefaultSinkAbortAlgorithm(stream, reason) { - transformStreamError(stream, reason); + const { + controller, + readable, + } = stream[kState]; + + if (controller[kState].finishPromise !== undefined) { + return controller[kState].finishPromise; + } + + const { promise, resolve, reject } = createDeferredPromise(); + controller[kState].finishPromise = promise; + const cancelPromise = ensureIsPromise( + controller[kState].cancelAlgorithm, + controller, + reason); + transformStreamDefaultControllerClearAlgorithms(controller); + + PromisePrototypeThen( + cancelPromise, + () => { + if (readable[kState].state === 'errored') + reject(readable[kState].storedError); + else { + readableStreamDefaultControllerError(readable[kState].controller, reason); + resolve(); + } + }, + (error) => { + readableStreamDefaultControllerError(readable[kState].controller, error); + reject(error); + }, + ); + + return controller[kState].finishPromise; } function transformStreamDefaultSinkCloseAlgorithm(stream) { @@ -572,23 +615,32 @@ function transformStreamDefaultSinkCloseAlgorithm(stream) { controller, } = stream[kState]; + if (controller[kState].finishPromise !== undefined) { + return controller[kState].finishPromise; + } + const { promise, resolve, reject } = createDeferredPromise(); + controller[kState].finishPromise = promise; const flushPromise = ensureIsPromise( controller[kState].flushAlgorithm, controller, controller); transformStreamDefaultControllerClearAlgorithms(controller); - return PromisePrototypeThen( + PromisePrototypeThen( flushPromise, () => { if (readable[kState].state === 'errored') - throw readable[kState].storedError; - readableStreamDefaultControllerClose(readable[kState].controller); + reject(readable[kState].storedError); + else { + readableStreamDefaultControllerClose(readable[kState].controller); + resolve(); + } }, (error) => { - transformStreamError(stream, error); - throw readable[kState].storedError; + readableStreamDefaultControllerError(readable[kState].controller, error); + reject(error); }); + return controller[kState].finishPromise; } function transformStreamDefaultSourcePullAlgorithm(stream) { @@ -598,6 +650,48 @@ function transformStreamDefaultSourcePullAlgorithm(stream) { return stream[kState].backpressureChange.promise; } +function transformStreamDefaultSourceCancelAlgorithm(stream, reason) { + const { + controller, + writable, + } = stream[kState]; + + if (controller[kState].finishPromise !== undefined) { + return controller[kState].finishPromise; + } + + const { promise, resolve, reject } = createDeferredPromise(); + controller[kState].finishPromise = promise; + const cancelPromise = ensureIsPromise( + controller[kState].cancelAlgorithm, + controller, + reason); + transformStreamDefaultControllerClearAlgorithms(controller); + + PromisePrototypeThen(cancelPromise, + () => { + if (writable[kState].state === 'errored') + reject(writable[kState].storedError); + else { + writableStreamDefaultControllerErrorIfNeeded( + writable[kState].controller, + reason); + transformStreamUnblockWrite(stream); + resolve(); + } + }, + (error) => { + writableStreamDefaultControllerErrorIfNeeded( + writable[kState].controller, + error); + transformStreamUnblockWrite(stream); + reject(error); + }, + ); + + return controller[kState].finishPromise; +} + module.exports = { TransformStream, TransformStreamDefaultController, diff --git a/lib/internal/webstreams/writablestream.js b/lib/internal/webstreams/writablestream.js index 2115aba36e927b..6dd7bc65566db6 100644 --- a/lib/internal/webstreams/writablestream.js +++ b/lib/internal/webstreams/writablestream.js @@ -7,6 +7,7 @@ const { FunctionPrototypeCall, ObjectDefineProperties, ObjectSetPrototypeOf, + Promise, PromisePrototypeThen, PromiseResolve, PromiseReject, @@ -1295,7 +1296,7 @@ function setupWritableStreamDefaultController( const startResult = startAlgorithm(); PromisePrototypeThen( - PromiseResolve(startResult), + new Promise((r) => r(startResult)), () => { assert(stream[kState].state === 'writable' || stream[kState].state === 'erroring'); diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 26dd520f8f3eed..6d635668f81a1c 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -27,7 +27,7 @@ Last update: - performance-timeline: https://github.com/web-platform-tests/wpt/tree/17ebc3aea0/performance-timeline - resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing - resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources -- streams: https://github.com/web-platform-tests/wpt/tree/517e945bbf/streams +- streams: https://github.com/web-platform-tests/wpt/tree/a8872d92b1/streams - url: https://github.com/web-platform-tests/wpt/tree/c2d7e70b52/url - user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi diff --git a/test/fixtures/wpt/streams/piping/abort.any.js b/test/fixtures/wpt/streams/piping/abort.any.js index 503de9dcaf0893..c9929df91cf688 100644 --- a/test/fixtures/wpt/streams/piping/abort.any.js +++ b/test/fixtures/wpt/streams/piping/abort.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/recording-streams.js // META: script=../resources/test-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/close-propagation-backward.any.js b/test/fixtures/wpt/streams/piping/close-propagation-backward.any.js index 5ea47ab85c0c1f..25bd475ed13e77 100644 --- a/test/fixtures/wpt/streams/piping/close-propagation-backward.any.js +++ b/test/fixtures/wpt/streams/piping/close-propagation-backward.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/close-propagation-forward.any.js b/test/fixtures/wpt/streams/piping/close-propagation-forward.any.js index 71b6e262840090..0ec94f80abf04b 100644 --- a/test/fixtures/wpt/streams/piping/close-propagation-forward.any.js +++ b/test/fixtures/wpt/streams/piping/close-propagation-forward.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/crashtests/cross-piping.html b/test/fixtures/wpt/streams/piping/crashtests/cross-piping.html new file mode 100644 index 00000000000000..712d5ecebef8ff --- /dev/null +++ b/test/fixtures/wpt/streams/piping/crashtests/cross-piping.html @@ -0,0 +1,12 @@ + + diff --git a/test/fixtures/wpt/streams/piping/error-propagation-backward.any.js b/test/fixtures/wpt/streams/piping/error-propagation-backward.any.js index ec74592f86effe..f786469d6c1d40 100644 --- a/test/fixtures/wpt/streams/piping/error-propagation-backward.any.js +++ b/test/fixtures/wpt/streams/piping/error-propagation-backward.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/error-propagation-forward.any.js b/test/fixtures/wpt/streams/piping/error-propagation-forward.any.js index 482da2f8a88e18..e9260f9ea22c41 100644 --- a/test/fixtures/wpt/streams/piping/error-propagation-forward.any.js +++ b/test/fixtures/wpt/streams/piping/error-propagation-forward.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/flow-control.any.js b/test/fixtures/wpt/streams/piping/flow-control.any.js index 09c4420f872adc..e2318da375ab90 100644 --- a/test/fixtures/wpt/streams/piping/flow-control.any.js +++ b/test/fixtures/wpt/streams/piping/flow-control.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-utils.js // META: script=../resources/recording-streams.js diff --git a/test/fixtures/wpt/streams/piping/general-addition.any.js b/test/fixtures/wpt/streams/piping/general-addition.any.js index 2562b7064338ee..cf4aa9bea6a1a4 100644 --- a/test/fixtures/wpt/streams/piping/general-addition.any.js +++ b/test/fixtures/wpt/streams/piping/general-addition.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(async t => { diff --git a/test/fixtures/wpt/streams/piping/general.any.js b/test/fixtures/wpt/streams/piping/general.any.js index bec3480f653944..09e01536325cca 100644 --- a/test/fixtures/wpt/streams/piping/general.any.js +++ b/test/fixtures/wpt/streams/piping/general.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/multiple-propagation.any.js b/test/fixtures/wpt/streams/piping/multiple-propagation.any.js index a78652fc06795e..9be828a23269a5 100644 --- a/test/fixtures/wpt/streams/piping/multiple-propagation.any.js +++ b/test/fixtures/wpt/streams/piping/multiple-propagation.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/pipe-through.any.js b/test/fixtures/wpt/streams/piping/pipe-through.any.js index 26b1cd26a3c82f..339cee19993346 100644 --- a/test/fixtures/wpt/streams/piping/pipe-through.any.js +++ b/test/fixtures/wpt/streams/piping/pipe-through.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/rs-utils.js // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js diff --git a/test/fixtures/wpt/streams/piping/then-interception.any.js b/test/fixtures/wpt/streams/piping/then-interception.any.js index 543f916d940d9a..fc48c368311478 100644 --- a/test/fixtures/wpt/streams/piping/then-interception.any.js +++ b/test/fixtures/wpt/streams/piping/then-interception.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/piping/throwing-options.any.js b/test/fixtures/wpt/streams/piping/throwing-options.any.js index b9f906778f632b..186f8ded1968a4 100644 --- a/test/fixtures/wpt/streams/piping/throwing-options.any.js +++ b/test/fixtures/wpt/streams/piping/throwing-options.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; class ThrowingOptions { diff --git a/test/fixtures/wpt/streams/piping/transform-streams.any.js b/test/fixtures/wpt/streams/piping/transform-streams.any.js index caae9fbad8848a..e079bb637cad0d 100644 --- a/test/fixtures/wpt/streams/piping/transform-streams.any.js +++ b/test/fixtures/wpt/streams/piping/transform-streams.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(() => { diff --git a/test/fixtures/wpt/streams/queuing-strategies.any.js b/test/fixtures/wpt/streams/queuing-strategies.any.js index fa959ebba28338..9efc4570cf2ee2 100644 --- a/test/fixtures/wpt/streams/queuing-strategies.any.js +++ b/test/fixtures/wpt/streams/queuing-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const highWaterMarkConversions = new Map([ diff --git a/test/fixtures/wpt/streams/readable-byte-streams/bad-buffers-and-views.any.js b/test/fixtures/wpt/streams/readable-byte-streams/bad-buffers-and-views.any.js index 3322116b191840..afcc61e6800a28 100644 --- a/test/fixtures/wpt/streams/readable-byte-streams/bad-buffers-and-views.any.js +++ b/test/fixtures/wpt/streams/readable-byte-streams/bad-buffers-and-views.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(() => { diff --git a/test/fixtures/wpt/streams/readable-byte-streams/construct-byob-request.any.js b/test/fixtures/wpt/streams/readable-byte-streams/construct-byob-request.any.js index 8d460a1c81b7bd..a26f949ee29d94 100644 --- a/test/fixtures/wpt/streams/readable-byte-streams/construct-byob-request.any.js +++ b/test/fixtures/wpt/streams/readable-byte-streams/construct-byob-request.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/rs-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js b/test/fixtures/wpt/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js index d2b37f00a9d697..92bd0a26a0ec05 100644 --- a/test/fixtures/wpt/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js +++ b/test/fixtures/wpt/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm promise_test(async t => { const error = new Error('cannot proceed'); diff --git a/test/fixtures/wpt/streams/readable-byte-streams/general.any.js b/test/fixtures/wpt/streams/readable-byte-streams/general.any.js index dd4fdc855786f2..cdce2244c3c84b 100644 --- a/test/fixtures/wpt/streams/readable-byte-streams/general.any.js +++ b/test/fixtures/wpt/streams/readable-byte-streams/general.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/rs-utils.js // META: script=../resources/test-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-byte-streams/non-transferable-buffers.any.js b/test/fixtures/wpt/streams/readable-byte-streams/non-transferable-buffers.any.js index e8ea3c4f966763..47d7b2e653e5ec 100644 --- a/test/fixtures/wpt/streams/readable-byte-streams/non-transferable-buffers.any.js +++ b/test/fixtures/wpt/streams/readable-byte-streams/non-transferable-buffers.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(async t => { diff --git a/test/fixtures/wpt/streams/readable-byte-streams/respond-after-enqueue.any.js b/test/fixtures/wpt/streams/readable-byte-streams/respond-after-enqueue.any.js index b93cec97391e13..e51efa061a6511 100644 --- a/test/fixtures/wpt/streams/readable-byte-streams/respond-after-enqueue.any.js +++ b/test/fixtures/wpt/streams/readable-byte-streams/respond-after-enqueue.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-byte-streams/tee.any.js b/test/fixtures/wpt/streams/readable-byte-streams/tee.any.js index 85844669cd9088..7dd5ba3f3fb013 100644 --- a/test/fixtures/wpt/streams/readable-byte-streams/tee.any.js +++ b/test/fixtures/wpt/streams/readable-byte-streams/tee.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/rs-utils.js // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js diff --git a/test/fixtures/wpt/streams/readable-streams/async-iterator.any.js b/test/fixtures/wpt/streams/readable-streams/async-iterator.any.js index 3ccaca17bc1ac7..4b674bea8430f3 100644 --- a/test/fixtures/wpt/streams/readable-streams/async-iterator.any.js +++ b/test/fixtures/wpt/streams/readable-streams/async-iterator.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/rs-utils.js // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js diff --git a/test/fixtures/wpt/streams/readable-streams/bad-strategies.any.js b/test/fixtures/wpt/streams/readable-streams/bad-strategies.any.js index 521fbffe3ab479..49fa4bdbece5b5 100644 --- a/test/fixtures/wpt/streams/readable-streams/bad-strategies.any.js +++ b/test/fixtures/wpt/streams/readable-streams/bad-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { @@ -149,7 +149,9 @@ promise_test(() => { } ); - promises.push(rs.getReader().closed.catch(e => { + promises.push(rs.getReader().closed.then(() => { + assert_unreached('closed didn\'t throw'); + }, e => { assert_equals(e, theError, 'closed should reject with the error for ' + size); })); } @@ -157,3 +159,40 @@ promise_test(() => { return Promise.all(promises); }, 'Readable stream: invalid strategy.size return value'); + +promise_test(() => { + + const promises = []; + for (const size of [NaN, -Infinity, Infinity, -1]) { + let theError; + const rs = new ReadableStream( + { + pull(c) { + try { + c.enqueue('hi'); + assert_unreached('enqueue didn\'t throw'); + } catch (error) { + assert_equals(error.name, 'RangeError', 'enqueue should throw a RangeError for ' + size); + theError = error; + } + } + }, + { + size() { + return size; + }, + highWaterMark: 5 + } + ); + + promises.push(rs.getReader().closed.then(() => { + assert_unreached('closed didn\'t throw'); + }, e => { + assert_equals(e, theError, 'closed should reject with the error for ' + size); + })); + } + + return Promise.all(promises); + +}, 'Readable stream: invalid strategy.size return value when pulling'); + diff --git a/test/fixtures/wpt/streams/readable-streams/bad-underlying-sources.any.js b/test/fixtures/wpt/streams/readable-streams/bad-underlying-sources.any.js index e9cf4c924930b2..3d77b923d178a0 100644 --- a/test/fixtures/wpt/streams/readable-streams/bad-underlying-sources.any.js +++ b/test/fixtures/wpt/streams/readable-streams/bad-underlying-sources.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/cancel.any.js b/test/fixtures/wpt/streams/readable-streams/cancel.any.js index 800bd994417241..9915c1fb6330c1 100644 --- a/test/fixtures/wpt/streams/readable-streams/cancel.any.js +++ b/test/fixtures/wpt/streams/readable-streams/cancel.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/constructor.any.js b/test/fixtures/wpt/streams/readable-streams/constructor.any.js index 608dc48cfa39d7..0b995f0cb16bde 100644 --- a/test/fixtures/wpt/streams/readable-streams/constructor.any.js +++ b/test/fixtures/wpt/streams/readable-streams/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('error1'); diff --git a/test/fixtures/wpt/streams/readable-streams/count-queuing-strategy-integration.any.js b/test/fixtures/wpt/streams/readable-streams/count-queuing-strategy-integration.any.js index 02ac5bae5c2f8a..a8c1b91d0068e3 100644 --- a/test/fixtures/wpt/streams/readable-streams/count-queuing-strategy-integration.any.js +++ b/test/fixtures/wpt/streams/readable-streams/count-queuing-strategy-integration.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { diff --git a/test/fixtures/wpt/streams/readable-streams/default-reader.any.js b/test/fixtures/wpt/streams/readable-streams/default-reader.any.js index 59d7ab2f74db63..f92862719e47c1 100644 --- a/test/fixtures/wpt/streams/readable-streams/default-reader.any.js +++ b/test/fixtures/wpt/streams/readable-streams/default-reader.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/rs-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/floating-point-total-queue-size.any.js b/test/fixtures/wpt/streams/readable-streams/floating-point-total-queue-size.any.js index 50cca3d951a942..8b88c21d7f0b53 100644 --- a/test/fixtures/wpt/streams/readable-streams/floating-point-total-queue-size.any.js +++ b/test/fixtures/wpt/streams/readable-streams/floating-point-total-queue-size.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Due to the limitations of floating-point precision, the calculation of desiredSize sometimes gives different answers diff --git a/test/fixtures/wpt/streams/readable-streams/from.any.js b/test/fixtures/wpt/streams/readable-streams/from.any.js index 04a03545ad5fe3..58ad4d4add127d 100644 --- a/test/fixtures/wpt/streams/readable-streams/from.any.js +++ b/test/fixtures/wpt/streams/readable-streams/from.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker,jsshell +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/garbage-collection.any.js b/test/fixtures/wpt/streams/readable-streams/garbage-collection.any.js index e578176777adaf..13bd1fb3437877 100644 --- a/test/fixtures/wpt/streams/readable-streams/garbage-collection.any.js +++ b/test/fixtures/wpt/streams/readable-streams/garbage-collection.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=/common/gc.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/general.any.js b/test/fixtures/wpt/streams/readable-streams/general.any.js index 2a32b27943c82f..eee3f62215eeb0 100644 --- a/test/fixtures/wpt/streams/readable-streams/general.any.js +++ b/test/fixtures/wpt/streams/readable-streams/general.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/owning-type-message-port.any.js b/test/fixtures/wpt/streams/readable-streams/owning-type-message-port.any.js index e9961ce042256a..282c1f411485c0 100644 --- a/test/fixtures/wpt/streams/readable-streams/owning-type-message-port.any.js +++ b/test/fixtures/wpt/streams/readable-streams/owning-type-message-port.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/owning-type-video-frame.any.js b/test/fixtures/wpt/streams/readable-streams/owning-type-video-frame.any.js index ec01fda0b3c737..b652f9c5fcb4b6 100644 --- a/test/fixtures/wpt/streams/readable-streams/owning-type-video-frame.any.js +++ b/test/fixtures/wpt/streams/readable-streams/owning-type-video-frame.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/owning-type.any.js b/test/fixtures/wpt/streams/readable-streams/owning-type.any.js index 27a3dda894e4d6..34c2a55d5134a2 100644 --- a/test/fixtures/wpt/streams/readable-streams/owning-type.any.js +++ b/test/fixtures/wpt/streams/readable-streams/owning-type.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/readable-streams/patched-global.any.js b/test/fixtures/wpt/streams/readable-streams/patched-global.any.js index a64a054a97f1f5..c208824c864469 100644 --- a/test/fixtures/wpt/streams/readable-streams/patched-global.any.js +++ b/test/fixtures/wpt/streams/readable-streams/patched-global.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Tests which patch the global environment are kept separate to avoid diff --git a/test/fixtures/wpt/streams/readable-streams/reentrant-strategies.any.js b/test/fixtures/wpt/streams/readable-streams/reentrant-strategies.any.js index b4988bc2433fd5..8ae7b98e8d5eef 100644 --- a/test/fixtures/wpt/streams/readable-streams/reentrant-strategies.any.js +++ b/test/fixtures/wpt/streams/readable-streams/reentrant-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/recording-streams.js // META: script=../resources/rs-utils.js // META: script=../resources/test-utils.js diff --git a/test/fixtures/wpt/streams/readable-streams/tee.any.js b/test/fixtures/wpt/streams/readable-streams/tee.any.js index 00397932f4b6e3..c2c2e482307211 100644 --- a/test/fixtures/wpt/streams/readable-streams/tee.any.js +++ b/test/fixtures/wpt/streams/readable-streams/tee.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/rs-utils.js // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js diff --git a/test/fixtures/wpt/streams/readable-streams/templated.any.js b/test/fixtures/wpt/streams/readable-streams/templated.any.js index ecae3f4d8b129f..dc75b805a10d63 100644 --- a/test/fixtures/wpt/streams/readable-streams/templated.any.js +++ b/test/fixtures/wpt/streams/readable-streams/templated.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-test-templates.js 'use strict'; diff --git a/test/fixtures/wpt/streams/transferable/transform-stream-members.any.js b/test/fixtures/wpt/streams/transferable/transform-stream-members.any.js index fca060b0c05fa3..05914e12ccbe57 100644 --- a/test/fixtures/wpt/streams/transferable/transform-stream-members.any.js +++ b/test/fixtures/wpt/streams/transferable/transform-stream-members.any.js @@ -1,3 +1,5 @@ +// META: global=window,dedicatedworker,shadowrealm + const combinations = [ (t => [t, t.readable])(new TransformStream()), (t => [t.readable, t])(new TransformStream()), diff --git a/test/fixtures/wpt/streams/transform-streams/backpressure.any.js b/test/fixtures/wpt/streams/transform-streams/backpressure.any.js index 6befba41b79542..47a21fb7e71fed 100644 --- a/test/fixtures/wpt/streams/transform-streams/backpressure.any.js +++ b/test/fixtures/wpt/streams/transform-streams/backpressure.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/recording-streams.js // META: script=../resources/test-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/transform-streams/cancel.any.js b/test/fixtures/wpt/streams/transform-streams/cancel.any.js new file mode 100644 index 00000000000000..5c7fc4eae5d55b --- /dev/null +++ b/test/fixtures/wpt/streams/transform-streams/cancel.any.js @@ -0,0 +1,115 @@ +// META: global=window,worker,shadowrealm +// META: script=../resources/test-utils.js +'use strict'; + +const thrownError = new Error('bad things are happening!'); +thrownError.name = 'error1'; + +const originalReason = new Error('original reason'); +originalReason.name = 'error2'; + +promise_test(async t => { + let cancelled = undefined; + const ts = new TransformStream({ + cancel(reason) { + cancelled = reason; + } + }); + const res = await ts.readable.cancel(thrownError); + assert_equals(res, undefined, 'readable.cancel() should return undefined'); + assert_equals(cancelled, thrownError, 'transformer.cancel() should be called with the passed reason'); +}, 'cancelling the readable side should call transformer.cancel()'); + +promise_test(async t => { + const ts = new TransformStream({ + cancel(reason) { + assert_equals(reason, originalReason, 'transformer.cancel() should be called with the passed reason'); + throw thrownError; + } + }); + const writer = ts.writable.getWriter(); + const cancelPromise = ts.readable.cancel(originalReason); + await promise_rejects_exactly(t, thrownError, cancelPromise, 'readable.cancel() should reject with thrownError'); + await promise_rejects_exactly(t, thrownError, writer.closed, 'writer.closed should reject with thrownError'); +}, 'cancelling the readable side should reject if transformer.cancel() throws'); + +promise_test(async t => { + let aborted = undefined; + const ts = new TransformStream({ + cancel(reason) { + aborted = reason; + }, + flush: t.unreached_func('flush should not be called') + }); + const res = await ts.writable.abort(thrownError); + assert_equals(res, undefined, 'writable.abort() should return undefined'); + assert_equals(aborted, thrownError, 'transformer.abort() should be called with the passed reason'); +}, 'aborting the writable side should call transformer.abort()'); + +promise_test(async t => { + const ts = new TransformStream({ + cancel(reason) { + assert_equals(reason, originalReason, 'transformer.cancel() should be called with the passed reason'); + throw thrownError; + }, + flush: t.unreached_func('flush should not be called') + }); + const reader = ts.readable.getReader(); + const abortPromise = ts.writable.abort(originalReason); + await promise_rejects_exactly(t, thrownError, abortPromise, 'writable.abort() should reject with thrownError'); + await promise_rejects_exactly(t, thrownError, reader.closed, 'reader.closed should reject with thrownError'); +}, 'aborting the writable side should reject if transformer.cancel() throws'); + +promise_test(async t => { + const ts = new TransformStream({ + async cancel(reason) { + assert_equals(reason, originalReason, 'transformer.cancel() should be called with the passed reason'); + throw thrownError; + }, + flush: t.unreached_func('flush should not be called') + }); + const cancelPromise = ts.readable.cancel(originalReason); + const closePromise = ts.writable.close(); + await Promise.all([ + promise_rejects_exactly(t, thrownError, cancelPromise, 'cancelPromise should reject with thrownError'), + promise_rejects_exactly(t, thrownError, closePromise, 'closePromise should reject with thrownError'), + ]); +}, 'closing the writable side should reject if a parallel transformer.cancel() throws'); + +promise_test(async t => { + let controller; + const ts = new TransformStream({ + start(c) { + controller = c; + }, + async cancel(reason) { + assert_equals(reason, originalReason, 'transformer.cancel() should be called with the passed reason'); + controller.error(thrownError); + }, + flush: t.unreached_func('flush should not be called') + }); + const cancelPromise = ts.readable.cancel(originalReason); + const closePromise = ts.writable.close(); + await Promise.all([ + promise_rejects_exactly(t, thrownError, cancelPromise, 'cancelPromise should reject with thrownError'), + promise_rejects_exactly(t, thrownError, closePromise, 'closePromise should reject with thrownError'), + ]); +}, 'readable.cancel() and a parallel writable.close() should reject if a transformer.cancel() calls controller.error()'); + +promise_test(async t => { + let controller; + const ts = new TransformStream({ + start(c) { + controller = c; + }, + async cancel(reason) { + assert_equals(reason, originalReason, 'transformer.cancel() should be called with the passed reason'); + controller.error(thrownError); + }, + flush: t.unreached_func('flush should not be called') + }); + const cancelPromise = ts.writable.abort(originalReason); + await promise_rejects_exactly(t, thrownError, cancelPromise, 'cancelPromise should reject with thrownError'); + const closePromise = ts.readable.cancel(1); + await promise_rejects_exactly(t, thrownError, closePromise, 'closePromise should reject with thrownError'); +}, 'writable.abort() and readable.cancel() should reject if a transformer.cancel() calls controller.error()'); diff --git a/test/fixtures/wpt/streams/transform-streams/errors.any.js b/test/fixtures/wpt/streams/transform-streams/errors.any.js index 0cca4c75479d6d..bea060b6590818 100644 --- a/test/fixtures/wpt/streams/transform-streams/errors.any.js +++ b/test/fixtures/wpt/streams/transform-streams/errors.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js 'use strict'; @@ -9,7 +9,8 @@ promise_test(t => { const ts = new TransformStream({ transform() { throw thrownError; - } + }, + cancel: t.unreached_func('cancel should not be called') }); const reader = ts.readable.getReader(); @@ -34,7 +35,8 @@ promise_test(t => { }, flush() { throw thrownError; - } + }, + cancel: t.unreached_func('cancel should not be called') }); const reader = ts.readable.getReader(); @@ -54,13 +56,14 @@ promise_test(t => { ]); }, 'TransformStream errors thrown in flush put the writable and readable in an errored state'); -test(() => { +test(t => { new TransformStream({ start(c) { c.enqueue('a'); c.error(new Error('generic error')); assert_throws_js(TypeError, () => c.enqueue('b'), 'enqueue() should throw'); - } + }, + cancel: t.unreached_func('cancel should not be called') }); }, 'errored TransformStream should not enqueue new chunks'); @@ -72,7 +75,8 @@ promise_test(t => { }); }, transform: t.unreached_func('transform should not be called'), - flush: t.unreached_func('flush should not be called') + flush: t.unreached_func('flush should not be called'), + cancel: t.unreached_func('cancel should not be called') }); const writer = ts.writable.getWriter(); @@ -96,7 +100,8 @@ promise_test(t => { }); }, transform: t.unreached_func('transform should never be called if start() fails'), - flush: t.unreached_func('flush should never be called if start() fails') + flush: t.unreached_func('flush should never be called if start() fails'), + cancel: t.unreached_func('cancel should never be called if start() fails') }); const writer = ts.writable.getWriter(); @@ -202,9 +207,10 @@ promise_test(t => { return Promise.all([ abortPromise, cancelPromise, - promise_rejects_exactly(t, thrownError, writer.closed, 'writer.closed should reject with thrownError')]); -}, 'abort should set the close reason for the writable when it happens before cancel during start, but cancel should ' + - 'still succeed'); + promise_rejects_exactly(t, thrownError, writer.closed, 'writer.closed should reject'), + ]); +}, 'abort should set the close reason for the writable when it happens before cancel during start, and cancel should ' + + 'reject'); promise_test(t => { let resolveTransform; @@ -251,13 +257,26 @@ promise_test(t => { controller = c; } }); - const cancelPromise = ts.readable.cancel(thrownError); - controller.error(ignoredError); + const cancelPromise = ts.readable.cancel(ignoredError); + controller.error(thrownError); return Promise.all([ cancelPromise, promise_rejects_exactly(t, thrownError, ts.writable.getWriter().closed, 'closed should reject with thrownError') ]); -}, 'controller.error() should do nothing after readable.cancel()'); +}, 'controller.error() should close writable immediately after readable.cancel()'); + +promise_test(t => { + let controller; + const ts = new TransformStream({ + start(c) { + controller = c; + } + }); + return ts.readable.cancel(thrownError).then(() => { + controller.error(ignoredError); + return promise_rejects_exactly(t, thrownError, ts.writable.getWriter().closed, 'closed should reject with thrownError'); + }); +}, 'controller.error() should do nothing after readable.cancel() resolves'); promise_test(t => { let controller; diff --git a/test/fixtures/wpt/streams/transform-streams/flush.any.js b/test/fixtures/wpt/streams/transform-streams/flush.any.js index 9287f6f5eb78eb..c95d8ae1186518 100644 --- a/test/fixtures/wpt/streams/transform-streams/flush.any.js +++ b/test/fixtures/wpt/streams/transform-streams/flush.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js 'use strict'; @@ -129,3 +129,18 @@ promise_test(t => { }); return promise_rejects_exactly(t, error1, ts.writable.getWriter().close(), 'close() should reject'); }, 'error() during flush should cause writer.close() to reject'); + +promise_test(async t => { + let flushed = false; + const ts = new TransformStream({ + flush() { + flushed = true; + }, + cancel: t.unreached_func('cancel should not be called') + }); + const closePromise = ts.writable.close(); + await delay(0); + const cancelPromise = ts.readable.cancel(error1); + await Promise.all([closePromise, cancelPromise]); + assert_equals(flushed, true, 'transformer.flush() should be called'); +}, 'closing the writable side should call transformer.flush() and a parallel readable.cancel() should not reject'); diff --git a/test/fixtures/wpt/streams/transform-streams/general.any.js b/test/fixtures/wpt/streams/transform-streams/general.any.js index c95691f7bf49df..a40ef30843ec4d 100644 --- a/test/fixtures/wpt/streams/transform-streams/general.any.js +++ b/test/fixtures/wpt/streams/transform-streams/general.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/rs-utils.js 'use strict'; @@ -388,9 +388,24 @@ promise_test(t => { controller.terminate(); return Promise.all([ cancelPromise, - promise_rejects_exactly(t, cancelReason, ts.writable.getWriter().closed, 'closed should reject with cancelReason') + promise_rejects_js(t, TypeError, ts.writable.getWriter().closed, 'closed should reject with TypeError') ]); -}, 'terminate() should do nothing after readable.cancel()'); +}, 'terminate() should abort writable immediately after readable.cancel()'); + +promise_test(t => { + let controller; + const ts = new TransformStream({ + start(c) { + controller = c; + } + }); + const cancelReason = { name: 'cancelReason' }; + return ts.readable.cancel(cancelReason).then(() => { + controller.terminate(); + return promise_rejects_exactly(t, cancelReason, ts.writable.getWriter().closed, 'closed should reject with TypeError'); + }) +}, 'terminate() should do nothing after readable.cancel() resolves'); + promise_test(() => { let calls = 0; diff --git a/test/fixtures/wpt/streams/transform-streams/lipfuzz.any.js b/test/fixtures/wpt/streams/transform-streams/lipfuzz.any.js index f9f148aaf1c6a4..e334705db44354 100644 --- a/test/fixtures/wpt/streams/transform-streams/lipfuzz.any.js +++ b/test/fixtures/wpt/streams/transform-streams/lipfuzz.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; class LipFuzzTransformer { diff --git a/test/fixtures/wpt/streams/transform-streams/patched-global.any.js b/test/fixtures/wpt/streams/transform-streams/patched-global.any.js index 2d04e3b948b324..cc111eda452f0f 100644 --- a/test/fixtures/wpt/streams/transform-streams/patched-global.any.js +++ b/test/fixtures/wpt/streams/transform-streams/patched-global.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Tests which patch the global environment are kept separate to avoid diff --git a/test/fixtures/wpt/streams/transform-streams/properties.any.js b/test/fixtures/wpt/streams/transform-streams/properties.any.js index 02981b8bc76a5f..dbfd1aa372b907 100644 --- a/test/fixtures/wpt/streams/transform-streams/properties.any.js +++ b/test/fixtures/wpt/streams/transform-streams/properties.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const transformerMethods = { diff --git a/test/fixtures/wpt/streams/transform-streams/reentrant-strategies.any.js b/test/fixtures/wpt/streams/transform-streams/reentrant-strategies.any.js index fc2f91886659f6..a6d459655856a7 100644 --- a/test/fixtures/wpt/streams/transform-streams/reentrant-strategies.any.js +++ b/test/fixtures/wpt/streams/transform-streams/reentrant-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/recording-streams.js // META: script=../resources/rs-utils.js // META: script=../resources/test-utils.js @@ -314,6 +314,10 @@ promise_test(t => { // call to TransformStreamDefaultSink. return delay(0).then(() => { controller.enqueue('a'); + return reader.read(); + }).then(({ value, done }) => { + assert_false(done, 'done should be false'); + assert_equals(value, 'a', 'value should be correct'); return Promise.all([promise_rejects_exactly(t, error1, reader.read(), 'read() should reject'), abortPromise]); }); }, 'writer.abort() inside size() should work'); diff --git a/test/fixtures/wpt/streams/transform-streams/strategies.any.js b/test/fixtures/wpt/streams/transform-streams/strategies.any.js index 94055ad99dc94b..57e113e668ce24 100644 --- a/test/fixtures/wpt/streams/transform-streams/strategies.any.js +++ b/test/fixtures/wpt/streams/transform-streams/strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/recording-streams.js // META: script=../resources/test-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/transform-streams/terminate.any.js b/test/fixtures/wpt/streams/transform-streams/terminate.any.js index 670006366db2af..a959e70fe69339 100644 --- a/test/fixtures/wpt/streams/transform-streams/terminate.any.js +++ b/test/fixtures/wpt/streams/transform-streams/terminate.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/recording-streams.js // META: script=../resources/test-utils.js 'use strict'; diff --git a/test/fixtures/wpt/streams/writable-streams/aborting.any.js b/test/fixtures/wpt/streams/writable-streams/aborting.any.js index e016cd191b876f..9171dbe158f00c 100644 --- a/test/fixtures/wpt/streams/writable-streams/aborting.any.js +++ b/test/fixtures/wpt/streams/writable-streams/aborting.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/writable-streams/bad-strategies.any.js b/test/fixtures/wpt/streams/writable-streams/bad-strategies.any.js index 63fa443065ee41..a1ef0791168f99 100644 --- a/test/fixtures/wpt/streams/writable-streams/bad-strategies.any.js +++ b/test/fixtures/wpt/streams/writable-streams/bad-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('a unique string'); diff --git a/test/fixtures/wpt/streams/writable-streams/bad-underlying-sinks.any.js b/test/fixtures/wpt/streams/writable-streams/bad-underlying-sinks.any.js index d0b3467978ea05..3c434ffe60ccb9 100644 --- a/test/fixtures/wpt/streams/writable-streams/bad-underlying-sinks.any.js +++ b/test/fixtures/wpt/streams/writable-streams/bad-underlying-sinks.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/writable-streams/byte-length-queuing-strategy.any.js b/test/fixtures/wpt/streams/writable-streams/byte-length-queuing-strategy.any.js index ce1962e8917f32..eed86ee7004ea1 100644 --- a/test/fixtures/wpt/streams/writable-streams/byte-length-queuing-strategy.any.js +++ b/test/fixtures/wpt/streams/writable-streams/byte-length-queuing-strategy.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(t => { diff --git a/test/fixtures/wpt/streams/writable-streams/close.any.js b/test/fixtures/wpt/streams/writable-streams/close.any.js index 88855a92efd550..45261e7ca7e01d 100644 --- a/test/fixtures/wpt/streams/writable-streams/close.any.js +++ b/test/fixtures/wpt/streams/writable-streams/close.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/writable-streams/constructor.any.js b/test/fixtures/wpt/streams/writable-streams/constructor.any.js index eaac90e48b8f86..0abc7ef545ea0b 100644 --- a/test/fixtures/wpt/streams/writable-streams/constructor.any.js +++ b/test/fixtures/wpt/streams/writable-streams/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('error1'); diff --git a/test/fixtures/wpt/streams/writable-streams/count-queuing-strategy.any.js b/test/fixtures/wpt/streams/writable-streams/count-queuing-strategy.any.js index 064e16e81506f1..8211757530d323 100644 --- a/test/fixtures/wpt/streams/writable-streams/count-queuing-strategy.any.js +++ b/test/fixtures/wpt/streams/writable-streams/count-queuing-strategy.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { diff --git a/test/fixtures/wpt/streams/writable-streams/error.any.js b/test/fixtures/wpt/streams/writable-streams/error.any.js index faf3fdd9521430..d08c8a54863bb9 100644 --- a/test/fixtures/wpt/streams/writable-streams/error.any.js +++ b/test/fixtures/wpt/streams/writable-streams/error.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('error1'); diff --git a/test/fixtures/wpt/streams/writable-streams/floating-point-total-queue-size.any.js b/test/fixtures/wpt/streams/writable-streams/floating-point-total-queue-size.any.js index bd34cc53a69579..20a14fc19a51e0 100644 --- a/test/fixtures/wpt/streams/writable-streams/floating-point-total-queue-size.any.js +++ b/test/fixtures/wpt/streams/writable-streams/floating-point-total-queue-size.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Due to the limitations of floating-point precision, the calculation of desiredSize sometimes gives different answers diff --git a/test/fixtures/wpt/streams/writable-streams/general.any.js b/test/fixtures/wpt/streams/writable-streams/general.any.js index cede7fd0845b74..48f8eeb89e41ee 100644 --- a/test/fixtures/wpt/streams/writable-streams/general.any.js +++ b/test/fixtures/wpt/streams/writable-streams/general.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { diff --git a/test/fixtures/wpt/streams/writable-streams/properties.any.js b/test/fixtures/wpt/streams/writable-streams/properties.any.js index c95bd7d0c080ba..ae0549f0871b48 100644 --- a/test/fixtures/wpt/streams/writable-streams/properties.any.js +++ b/test/fixtures/wpt/streams/writable-streams/properties.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const sinkMethods = { diff --git a/test/fixtures/wpt/streams/writable-streams/reentrant-strategy.any.js b/test/fixtures/wpt/streams/writable-streams/reentrant-strategy.any.js index eb05cc068043ea..18ce9e84759a11 100644 --- a/test/fixtures/wpt/streams/writable-streams/reentrant-strategy.any.js +++ b/test/fixtures/wpt/streams/writable-streams/reentrant-strategy.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/writable-streams/start.any.js b/test/fixtures/wpt/streams/writable-streams/start.any.js index 82d869430dd700..17972b568ceb24 100644 --- a/test/fixtures/wpt/streams/writable-streams/start.any.js +++ b/test/fixtures/wpt/streams/writable-streams/start.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/streams/writable-streams/write.any.js b/test/fixtures/wpt/streams/writable-streams/write.any.js index f0246f6cad39fd..20a2885bf3512a 100644 --- a/test/fixtures/wpt/streams/writable-streams/write.any.js +++ b/test/fixtures/wpt/streams/writable-streams/write.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js // META: script=../resources/recording-streams.js 'use strict'; diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 8ec93059e8ea69..c9ad58bfce7d86 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -68,7 +68,7 @@ "path": "resources" }, "streams": { - "commit": "517e945bbfaf903f37a35c11700eb96662efbdd3", + "commit": "a8872d92b147fc87200eb0c14fe7a4a9e7cd4f73", "path": "streams" }, "url": { diff --git a/test/wpt/status/streams.json b/test/wpt/status/streams.json index 3b6e0ce6429f9d..8d6a4c6d2fe27b 100644 --- a/test/wpt/status/streams.json +++ b/test/wpt/status/streams.json @@ -59,5 +59,12 @@ }, "readable-streams/read-task-handling.window.js": { "skip": "Browser-specific test" + }, + "transform-streams/cancel.any.js": { + "fail": { + "expected": [ + "readable.cancel() and a parallel writable.close() should reject if a transformer.cancel() calls controller.error()" + ] + } } } From 34ddc71e358e8113393cbe689286bed1fa8096d6 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Fri, 15 Dec 2023 15:48:50 -0300 Subject: [PATCH 67/67] 2023-12-19, Version 21.5.0 (Current) Notable changes: deps: * (SEMVER-MINOR) add simdjson (Yagiz Nizipli) https://github.com/nodejs/node/pull/50322 doc: * deprecate hash constructor (Marco Ippolito) https://github.com/nodejs/node/pull/51077 * deprecate `dirent.path` (Antoine du Hamel) https://github.com/nodejs/node/pull/51020 module: * merge config with `package_json_reader` (Yagiz Nizipli) https://github.com/nodejs/node/pull/50322 src: * move package resolver to c++ (Yagiz Nizipli) https://github.com/nodejs/node/pull/50322 PR-URL: https://github.com/nodejs/node/pull/51166 --- CHANGELOG.md | 3 +- doc/api/deprecations.md | 4 +- doc/api/fs.md | 2 +- doc/changelogs/CHANGELOG_V21.md | 85 +++++++++++++++++++++++++++++++++ src/node_version.h | 6 +-- 5 files changed, 93 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f777ea59bfe239..95d5ad1ebd0e05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,8 @@ release. -21.4.0
+21.5.0
+21.4.0
21.3.0
21.2.0
21.1.0
diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 7028ca429e95a1..be1c4ef344a342 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3457,7 +3457,7 @@ The [`util.types.isWebAssemblyCompiledModule`][] API is deprecated. Please use @@ -3471,7 +3471,7 @@ release lines. Please use [`dirent.parentPath`][] instead. diff --git a/doc/api/fs.md b/doc/api/fs.md index 99070d37a59e45..46987b21bbd41f 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -6633,7 +6633,7 @@ The path to the parent directory of the file this {fs.Dirent} object refers to. added: - v20.1.0 - v18.17.0 -deprecated: REPLACEME +deprecated: v21.5.0 --> > Stability: 0 - Deprecated: Use [`dirent.parentPath`][] instead. diff --git a/doc/changelogs/CHANGELOG_V21.md b/doc/changelogs/CHANGELOG_V21.md index aadf867d4549ee..1f53b574441ebd 100644 --- a/doc/changelogs/CHANGELOG_V21.md +++ b/doc/changelogs/CHANGELOG_V21.md @@ -8,6 +8,7 @@ +21.5.0
21.4.0
21.3.0
21.2.0
@@ -40,6 +41,90 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + + +## 2023-12-19, Version 21.5.0 (Current), @RafaelGSS + +### Notable Changes + +* \[[`0dd53da722`](https://github.com/nodejs/node/commit/0dd53da722)] - **(SEMVER-MINOR)** **deps**: add simdjson (Yagiz Nizipli) [#50322](https://github.com/nodejs/node/pull/50322) +* \[[`9f54987fbc`](https://github.com/nodejs/node/commit/9f54987fbc)] - **module**: merge config with `package_json_reader` (Yagiz Nizipli) [#50322](https://github.com/nodejs/node/pull/50322) +* \[[`45e4f82912`](https://github.com/nodejs/node/commit/45e4f82912)] - **src**: move package resolver to c++ (Yagiz Nizipli) [#50322](https://github.com/nodejs/node/pull/50322) + +#### Deprecations + +* \[[`26ed4ad01f`](https://github.com/nodejs/node/commit/26ed4ad01f)] - **doc**: deprecate hash constructor (Marco Ippolito) [#51077](https://github.com/nodejs/node/pull/51077) +* \[[`58ca66a1a7`](https://github.com/nodejs/node/commit/58ca66a1a7)] - **doc**: deprecate `dirent.path` (Antoine du Hamel) [#51020](https://github.com/nodejs/node/pull/51020) + +### Commits + +* \[[`1bbdbdfbeb`](https://github.com/nodejs/node/commit/1bbdbdfbeb)] - **benchmark**: update iterations in benchmark/perf\_hooks (Lei Shi) [#50869](https://github.com/nodejs/node/pull/50869) +* \[[`087fb0908e`](https://github.com/nodejs/node/commit/087fb0908e)] - **benchmark**: update iterations in benchmark/crypto/aes-gcm-throughput.js (Lei Shi) [#50929](https://github.com/nodejs/node/pull/50929) +* \[[`53b16c71fb`](https://github.com/nodejs/node/commit/53b16c71fb)] - **benchmark**: update iteration and size in benchmark/crypto/randomBytes.js (Lei Shi) [#50868](https://github.com/nodejs/node/pull/50868) +* \[[`38fd0ca753`](https://github.com/nodejs/node/commit/38fd0ca753)] - **benchmark**: add undici websocket benchmark (Chenyu Yang) [#50586](https://github.com/nodejs/node/pull/50586) +* \[[`b148c43244`](https://github.com/nodejs/node/commit/b148c43244)] - **benchmark**: add create-hash benchmark (Joyee Cheung) [#51026](https://github.com/nodejs/node/pull/51026) +* \[[`fdd8c18f96`](https://github.com/nodejs/node/commit/fdd8c18f96)] - **benchmark**: update interations and len in benchmark/util/text-decoder.js (Lei Shi) [#50938](https://github.com/nodejs/node/pull/50938) +* \[[`a9972057ac`](https://github.com/nodejs/node/commit/a9972057ac)] - **benchmark**: update iterations of benchmark/util/type-check.js (Lei Shi) [#50937](https://github.com/nodejs/node/pull/50937) +* \[[`b80bb1329b`](https://github.com/nodejs/node/commit/b80bb1329b)] - **benchmark**: update iterations in benchmark/util/normalize-encoding.js (Lei Shi) [#50934](https://github.com/nodejs/node/pull/50934) +* \[[`dbee03d646`](https://github.com/nodejs/node/commit/dbee03d646)] - **benchmark**: update iterations in benchmark/util/inspect-array.js (Lei Shi) [#50933](https://github.com/nodejs/node/pull/50933) +* \[[`f2d83a3a84`](https://github.com/nodejs/node/commit/f2d83a3a84)] - **benchmark**: update iterations in benchmark/util/format.js (Lei Shi) [#50932](https://github.com/nodejs/node/pull/50932) +* \[[`2581fce553`](https://github.com/nodejs/node/commit/2581fce553)] - **bootstrap**: improve snapshot unsupported builtin warnings (Joyee Cheung) [#50944](https://github.com/nodejs/node/pull/50944) +* \[[`735bad3694`](https://github.com/nodejs/node/commit/735bad3694)] - **build**: fix warnings from uv for gn build (Cheng Zhao) [#51069](https://github.com/nodejs/node/pull/51069) +* \[[`8da9d969f9`](https://github.com/nodejs/node/commit/8da9d969f9)] - **deps**: V8: cherry-pick 0fd478bcdabd (Joyee Cheung) [#50572](https://github.com/nodejs/node/pull/50572) +* \[[`429fbb37c1`](https://github.com/nodejs/node/commit/429fbb37c1)] - **deps**: update simdjson to v3.6.2 (Yagiz Nizipli) [#50986](https://github.com/nodejs/node/pull/50986) +* \[[`9950103253`](https://github.com/nodejs/node/commit/9950103253)] - **deps**: update zlib to 1.3-22124f5 (Node.js GitHub Bot) [#50910](https://github.com/nodejs/node/pull/50910) +* \[[`0b61823e8b`](https://github.com/nodejs/node/commit/0b61823e8b)] - **deps**: update undici to 5.28.2 (Node.js GitHub Bot) [#51024](https://github.com/nodejs/node/pull/51024) +* \[[`95d8a273cc`](https://github.com/nodejs/node/commit/95d8a273cc)] - **deps**: cherry-pick bfbe4e38d7 from libuv upstream (Abdirahim Musse) [#50650](https://github.com/nodejs/node/pull/50650) +* \[[`06038a489e`](https://github.com/nodejs/node/commit/06038a489e)] - **deps**: update libuv to 1.47.0 (Node.js GitHub Bot) [#50650](https://github.com/nodejs/node/pull/50650) +* \[[`0dd53da722`](https://github.com/nodejs/node/commit/0dd53da722)] - **(SEMVER-MINOR)** **deps**: add simdjson (Yagiz Nizipli) [#50322](https://github.com/nodejs/node/pull/50322) +* \[[`04eaa5cdd7`](https://github.com/nodejs/node/commit/04eaa5cdd7)] - **doc**: run license-builder (github-actions\[bot]) [#51111](https://github.com/nodejs/node/pull/51111) +* \[[`26ed4ad01f`](https://github.com/nodejs/node/commit/26ed4ad01f)] - **doc**: deprecate hash constructor (Marco Ippolito) [#51077](https://github.com/nodejs/node/pull/51077) +* \[[`637ffce4c4`](https://github.com/nodejs/node/commit/637ffce4c4)] - **doc**: add note regarding `--experimental-detect-module` (Shubherthi Mitra) [#51089](https://github.com/nodejs/node/pull/51089) +* \[[`838179b096`](https://github.com/nodejs/node/commit/838179b096)] - **doc**: correct tracingChannel.traceCallback() (Gerhard Stöbich) [#51068](https://github.com/nodejs/node/pull/51068) +* \[[`539bee4f0a`](https://github.com/nodejs/node/commit/539bee4f0a)] - **doc**: use length argument in pbkdf2Key (Tobias Nießen) [#51066](https://github.com/nodejs/node/pull/51066) +* \[[`c45a9a3187`](https://github.com/nodejs/node/commit/c45a9a3187)] - **doc**: add deprecation notice to `dirent.path` (Antoine du Hamel) [#51059](https://github.com/nodejs/node/pull/51059) +* \[[`58ca66a1a7`](https://github.com/nodejs/node/commit/58ca66a1a7)] - **doc**: deprecate `dirent.path` (Antoine du Hamel) [#51020](https://github.com/nodejs/node/pull/51020) +* \[[`c2b6edf9ab`](https://github.com/nodejs/node/commit/c2b6edf9ab)] - **esm**: fix hook name in error message (Bruce MacNaughton) [#50466](https://github.com/nodejs/node/pull/50466) +* \[[`35e8f26f07`](https://github.com/nodejs/node/commit/35e8f26f07)] - **fs**: throw fchownSync error from c++ (Yagiz Nizipli) [#51075](https://github.com/nodejs/node/pull/51075) +* \[[`c3c8237089`](https://github.com/nodejs/node/commit/c3c8237089)] - **fs**: update params in jsdoc for createReadStream and createWriteStream (Jungku Lee) [#51063](https://github.com/nodejs/node/pull/51063) +* \[[`3f7f3ce8c9`](https://github.com/nodejs/node/commit/3f7f3ce8c9)] - **fs**: improve error performance of readvSync (IlyasShabi) [#50100](https://github.com/nodejs/node/pull/50100) +* \[[`7f95926f17`](https://github.com/nodejs/node/commit/7f95926f17)] - **http**: handle multi-value content-disposition header (Arsalan Ahmad) [#50977](https://github.com/nodejs/node/pull/50977) +* \[[`7a8a2d5632`](https://github.com/nodejs/node/commit/7a8a2d5632)] - **lib**: don't parse windows drive letters as schemes (华) [#50580](https://github.com/nodejs/node/pull/50580) +* \[[`aa2be4bb76`](https://github.com/nodejs/node/commit/aa2be4bb76)] - **module**: load source maps in `commonjs` translator (Hiroki Osame) [#51033](https://github.com/nodejs/node/pull/51033) +* \[[`c0e5e74876`](https://github.com/nodejs/node/commit/c0e5e74876)] - **module**: document `parentURL` in register options (Hiroki Osame) [#51039](https://github.com/nodejs/node/pull/51039) +* \[[`4eedf5e694`](https://github.com/nodejs/node/commit/4eedf5e694)] - **module**: fix recently introduced coverity warning (Michael Dawson) [#50843](https://github.com/nodejs/node/pull/50843) +* \[[`9f54987fbc`](https://github.com/nodejs/node/commit/9f54987fbc)] - **module**: merge config with `package_json_reader` (Yagiz Nizipli) [#50322](https://github.com/nodejs/node/pull/50322) +* \[[`5f95dca638`](https://github.com/nodejs/node/commit/5f95dca638)] - **node-api**: introduce experimental feature flags (Gabriel Schulhof) [#50991](https://github.com/nodejs/node/pull/50991) +* \[[`3fb7fc909e`](https://github.com/nodejs/node/commit/3fb7fc909e)] - **quic**: further implementation details (James M Snell) [#48244](https://github.com/nodejs/node/pull/48244) +* \[[`fa25e069fc`](https://github.com/nodejs/node/commit/fa25e069fc)] - **src**: implement countObjectsWithPrototype (Joyee Cheung) [#50572](https://github.com/nodejs/node/pull/50572) +* \[[`abe90527e4`](https://github.com/nodejs/node/commit/abe90527e4)] - **src**: register udp\_wrap external references (Joyee Cheung) [#50943](https://github.com/nodejs/node/pull/50943) +* \[[`84e2f51d14`](https://github.com/nodejs/node/commit/84e2f51d14)] - **src**: register spawn\_sync external references (Joyee Cheung) [#50943](https://github.com/nodejs/node/pull/50943) +* \[[`2cfee53d7b`](https://github.com/nodejs/node/commit/2cfee53d7b)] - **src**: register process\_wrap external references (Joyee Cheung) [#50943](https://github.com/nodejs/node/pull/50943) +* \[[`9b7f79a8bd`](https://github.com/nodejs/node/commit/9b7f79a8bd)] - **src**: fix double free reported by coverity (Michael Dawson) [#51046](https://github.com/nodejs/node/pull/51046) +* \[[`fc5503246e`](https://github.com/nodejs/node/commit/fc5503246e)] - **src**: remove unused headers in `node_file.cc` (Jungku Lee) [#50927](https://github.com/nodejs/node/pull/50927) +* \[[`c3abdc58af`](https://github.com/nodejs/node/commit/c3abdc58af)] - **src**: implement --trace-promises (Joyee Cheung) [#50899](https://github.com/nodejs/node/pull/50899) +* \[[`f90fc83e97`](https://github.com/nodejs/node/commit/f90fc83e97)] - **src**: fix dynamically linked zlib version (Richard Lau) [#51007](https://github.com/nodejs/node/pull/51007) +* \[[`9bf144379f`](https://github.com/nodejs/node/commit/9bf144379f)] - **src**: omit bool values of package.json main field (Yagiz Nizipli) [#50965](https://github.com/nodejs/node/pull/50965) +* \[[`45e4f82912`](https://github.com/nodejs/node/commit/45e4f82912)] - **src**: move package resolver to c++ (Yagiz Nizipli) [#50322](https://github.com/nodejs/node/pull/50322) +* \[[`71acd36778`](https://github.com/nodejs/node/commit/71acd36778)] - **stream**: implement TransformStream cleanup using "transformer.cancel" (Debadree Chatterjee) [#50126](https://github.com/nodejs/node/pull/50126) +* \[[`5112306064`](https://github.com/nodejs/node/commit/5112306064)] - **stream**: fix fd is null when calling clearBuffer (kylo5aby) [#50994](https://github.com/nodejs/node/pull/50994) +* \[[`ed070755ec`](https://github.com/nodejs/node/commit/ed070755ec)] - **test**: deflake test-diagnostics-channel-memory-leak (Joyee Cheung) [#50572](https://github.com/nodejs/node/pull/50572) +* \[[`aee01ff1b4`](https://github.com/nodejs/node/commit/aee01ff1b4)] - **test**: test syncrhnous methods of child\_process in snapshot (Joyee Cheung) [#50943](https://github.com/nodejs/node/pull/50943) +* \[[`cc949869a3`](https://github.com/nodejs/node/commit/cc949869a3)] - **test**: handle relative https redirect (Richard Lau) [#51121](https://github.com/nodejs/node/pull/51121) +* \[[`048349ed4c`](https://github.com/nodejs/node/commit/048349ed4c)] - **test**: fix test runner colored output test (Moshe Atlow) [#51064](https://github.com/nodejs/node/pull/51064) +* \[[`7f5291d783`](https://github.com/nodejs/node/commit/7f5291d783)] - **test**: resolve path of embedtest binary correctly (Cheng Zhao) [#50276](https://github.com/nodejs/node/pull/50276) +* \[[`4ddd0daf5f`](https://github.com/nodejs/node/commit/4ddd0daf5f)] - **test**: escape cwd in regexp (Jérémy Lal) [#50980](https://github.com/nodejs/node/pull/50980) +* \[[`3ccd5faabb`](https://github.com/nodejs/node/commit/3ccd5faabb)] - **test\_runner**: format coverage report for tap reporter (Pulkit Gupta) [#51119](https://github.com/nodejs/node/pull/51119) +* \[[`d5c9adf3df`](https://github.com/nodejs/node/commit/d5c9adf3df)] - **test\_runner**: fix infinite loop when files are undefined in test runner (Pulkit Gupta) [#51047](https://github.com/nodejs/node/pull/51047) +* \[[`328a41701c`](https://github.com/nodejs/node/commit/328a41701c)] - **tools**: update lint-md-dependencies to rollup\@4.7.0 (Node.js GitHub Bot) [#51106](https://github.com/nodejs/node/pull/51106) +* \[[`297cb6f5c2`](https://github.com/nodejs/node/commit/297cb6f5c2)] - **tools**: update doc to highlight.js\@11.9.0 unified\@11.0.4 (Node.js GitHub Bot) [#50459](https://github.com/nodejs/node/pull/50459) +* \[[`4705023343`](https://github.com/nodejs/node/commit/4705023343)] - **tools**: fix simdjson updater (Yagiz Nizipli) [#50986](https://github.com/nodejs/node/pull/50986) +* \[[`c9841583db`](https://github.com/nodejs/node/commit/c9841583db)] - **tools**: update eslint to 8.55.0 (Node.js GitHub Bot) [#51025](https://github.com/nodejs/node/pull/51025) +* \[[`2b4671125e`](https://github.com/nodejs/node/commit/2b4671125e)] - **tools**: update lint-md-dependencies to rollup\@4.6.1 (Node.js GitHub Bot) [#51022](https://github.com/nodejs/node/pull/51022) +* \[[`cd891b37f6`](https://github.com/nodejs/node/commit/cd891b37f6)] - **util**: improve performance of function areSimilarFloatArrays (Liu Jia) [#51040](https://github.com/nodejs/node/pull/51040) +* \[[`e178a43509`](https://github.com/nodejs/node/commit/e178a43509)] - **vm**: use v8::DeserializeInternalFieldsCallback explicitly (Joyee Cheung) [#50984](https://github.com/nodejs/node/pull/50984) +* \[[`fd028e146f`](https://github.com/nodejs/node/commit/fd028e146f)] - **win,tools**: upgrade Windows signing to smctl (Stefan Stojanovic) [#50956](https://github.com/nodejs/node/pull/50956) + ## 2023-12-05, Version 21.4.0 (Current), @targos diff --git a/src/node_version.h b/src/node_version.h index 20612f4d3f0b92..4f054175fb232f 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -23,13 +23,13 @@ #define SRC_NODE_VERSION_H_ #define NODE_MAJOR_VERSION 21 -#define NODE_MINOR_VERSION 4 -#define NODE_PATCH_VERSION 1 +#define NODE_MINOR_VERSION 5 +#define NODE_PATCH_VERSION 0 #define NODE_VERSION_IS_LTS 0 #define NODE_VERSION_LTS_CODENAME "" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)